Fix build failure that occurs when pkgsrc devel/ncurses is being used * Formerly we were passing "--with-curses-includes=${BUILDLINK_PREFIX.curses}/include" to "${WRKSRC}/libraries/terminfo/configure". This is problematic because pkgsrc devel/ncurses installs headers into ${PREFIX}/include/ncurses, not ${PREFIX}/include, while ghc-cabal expects "ncurses.h" and "term.h" in ${PREFIX}/include (because we said so) and then it emits an error. The fix is to use ${BUILDLINK_INCDIRS.curses} instead of "include". Note that this requires my recent changes to ../../mk/curses.buildlink3.mk (r1.21) * The "bootstrap" target now uses buildlink wrapper not to pick up random libraries which happened to be in "${PREFIX}/lib". Bootstrap binary kits should be linked with a predictable set of libraries. * The "bootstrap" target now automatically runs through the wrapper phase. You no longer have to run "${MAKE} patch" manually.diff -r1.12 -r1.13 pkgsrc/lang/ghc7/Makefile
(pho)
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile,v 1.12 2014/08/03 08:14:38 obache Exp $ | 1 | # $NetBSD: Makefile,v 1.13 2015/02/03 02:32:05 pho Exp $ | |
2 | # ----------------------------------------------------------------------------- | 2 | # ----------------------------------------------------------------------------- | |
3 | # Package metadata | 3 | # Package metadata | |
4 | # | 4 | # | |
5 | DISTNAME= ghc-7.6.3-src | 5 | DISTNAME= ghc-7.6.3-src | |
6 | PKGNAME= ${DISTNAME:S/-src$//} | 6 | PKGNAME= ${DISTNAME:S/-src$//} | |
7 | PKGREVISION= 4 | 7 | PKGREVISION= 4 | |
8 | CATEGORIES= lang | 8 | CATEGORIES= lang | |
9 | MASTER_SITES= http://www.haskell.org/ghc/dist/${PKGVERSION_NOREV}/ | 9 | MASTER_SITES= http://www.haskell.org/ghc/dist/${PKGVERSION_NOREV}/ | |
10 | EXTRACT_SUFX= .tar.bz2 | 10 | EXTRACT_SUFX= .tar.bz2 | |
11 | 11 | |||
12 | MAINTAINER= pho@cielonegro.org | 12 | MAINTAINER= pho@cielonegro.org | |
13 | HOMEPAGE= http://www.haskell.org/ghc/ | 13 | HOMEPAGE= http://www.haskell.org/ghc/ | |
14 | COMMENT= Compiler for the functional language Haskell | 14 | COMMENT= Compiler for the functional language Haskell | |
@@ -50,30 +50,30 @@ WRKSRC= ${WRKDIR}/${PKGNAME_NOREV} | @@ -50,30 +50,30 @@ WRKSRC= ${WRKDIR}/${PKGNAME_NOREV} | |||
50 | # We don't want to extract all of the DISTFILEs. | 50 | # We don't want to extract all of the DISTFILEs. | |
51 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} | 51 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} | |
52 | 52 | |||
53 | 53 | |||
54 | # ----------------------------------------------------------------------------- | 54 | # ----------------------------------------------------------------------------- | |
55 | # Tools | 55 | # Tools | |
56 | # | 56 | # | |
57 | USE_TOOLS+= autoconf gmake perl:run | 57 | USE_TOOLS+= autoconf gmake perl:run | |
58 | GNU_CONFIGURE= yes | 58 | GNU_CONFIGURE= yes | |
59 | USE_GNU_CONFIGURE_HOST= no | 59 | USE_GNU_CONFIGURE_HOST= no | |
60 | 60 | |||
61 | CONFIGURE_ARGS+= \ | 61 | CONFIGURE_ARGS+= \ | |
62 | --with-gcc=${CC:Q} \ | 62 | --with-gcc=${CC:Q} \ | |
63 | --with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/include \ | 63 | --with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_INCDIRS.gmp:Q} \ | |
64 | --with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/lib \ | 64 | --with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_LIBDIRS.gmp:Q} \ | |
65 | --with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/include \ | 65 | --with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_INCDIRS.iconv:Q} \ | |
66 | --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/lib | 66 | --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q} | |
67 | 67 | |||
68 | CONFIGURE_ENV+= \ | 68 | CONFIGURE_ENV+= \ | |
69 | CONF_CC_OPTS_STAGE0=${CFLAGS:Q} \ | 69 | CONF_CC_OPTS_STAGE0=${CFLAGS:Q} \ | |
70 | CONF_GCC_LINKER_OPTS_STAGE0=${LDFLAGS:Q} \ | 70 | CONF_GCC_LINKER_OPTS_STAGE0=${LDFLAGS:Q} \ | |
71 | CONF_LD_LINKER_OPTS_STAGE0=${LDFLAGS:Q} \ | 71 | CONF_LD_LINKER_OPTS_STAGE0=${LDFLAGS:Q} \ | |
72 | CONF_CC_OPTS_STAGE1=${CFLAGS:Q} \ | 72 | CONF_CC_OPTS_STAGE1=${CFLAGS:Q} \ | |
73 | CONF_GCC_LINKER_OPTS_STAGE1=${LDFLAGS:Q} \ | 73 | CONF_GCC_LINKER_OPTS_STAGE1=${LDFLAGS:Q} \ | |
74 | CONF_LD_LINKER_OPTS_STAGE1=${LDFLAGS:Q} \ | 74 | CONF_LD_LINKER_OPTS_STAGE1=${LDFLAGS:Q} \ | |
75 | CONF_CC_OPTS_STAGE2=${CFLAGS:Q} \ | 75 | CONF_CC_OPTS_STAGE2=${CFLAGS:Q} \ | |
76 | CONF_GCC_LINKER_OPTS_STAGE2=${LDFLAGS:Q} \ | 76 | CONF_GCC_LINKER_OPTS_STAGE2=${LDFLAGS:Q} \ | |
77 | CONF_LD_LINKER_OPTS_STAGE2=${LDFLAGS:Q} \ | 77 | CONF_LD_LINKER_OPTS_STAGE2=${LDFLAGS:Q} \ | |
78 | ac_cv_path_fp_prog_ar=${AR:Q} \ | 78 | ac_cv_path_fp_prog_ar=${AR:Q} \ | |
79 | PerlCmd=${PERL5:Q} | 79 | PerlCmd=${PERL5:Q} | |
@@ -97,41 +97,42 @@ SITES.${i}?= ${MASTER_SITE_LOCAL} | @@ -97,41 +97,42 @@ SITES.${i}?= ${MASTER_SITE_LOCAL} | |||
97 | .endfor | 97 | .endfor | |
98 | 98 | |||
99 | # Our pre-configure phase installs a bindist of bootstrapping compiler | 99 | # Our pre-configure phase installs a bindist of bootstrapping compiler | |
100 | # directly into TOOLS_DIR so that ./configure can find it. | 100 | # directly into TOOLS_DIR so that ./configure can find it. | |
101 | 101 | |||
102 | post-configure: | 102 | post-configure: | |
103 | # Here we generate mk/build.mk dynamically. | 103 | # Here we generate mk/build.mk dynamically. | |
104 | ${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk | 104 | ${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk | |
105 | 105 | |||
106 | # We need to tell the libraries/terminfo/configure that our ncurses is | 106 | # We need to tell the libraries/terminfo/configure that our ncurses is | |
107 | # in a non-standard path. Without that, the resulting GHC tries to | 107 | # in a non-standard path. Without that, the resulting GHC tries to | |
108 | # link programs by executing ld(1) without passing it -L${PREFIX:Q}/lib. | 108 | # link programs by executing ld(1) without passing it -L${PREFIX:Q}/lib. | |
109 | ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \ | 109 | ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \ | |
110 | --configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/include \ | 110 | --configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.curses:Q} \ | |
111 | --configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/lib" >> ${WRKSRC:Q}/mk/build.mk | 111 | --configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q}" \ | |
112 | >> ${WRKSRC:Q}/mk/build.mk | |||
112 | 113 | |||
113 | # The ghc compiler does normally split the generated asm files into small | 114 | # The ghc compiler does normally split the generated asm files into small | |
114 | # parts before sending them to gcc, to enable the linker to eliminate | 115 | # parts before sending them to gcc, to enable the linker to eliminate | |
115 | # unused parts. This does however not play nice with the pkgsrc | 116 | # unused parts. This does however not play nice with the pkgsrc | |
116 | # framework, and the result is that the build takes more than 5 times | 117 | # framework, and the result is that the build takes more than 5 times | |
117 | # as long than when the files are not split. See | 118 | # as long than when the files are not split. See | |
118 | # http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html | 119 | # http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html | |
119 | # for a description of the problem. | 120 | # for a description of the problem. | |
120 | # Disable file splitting until pkgsrc gets improved. | 121 | # Disable file splitting until pkgsrc gets improved. | |
121 | ${RUN} ${ECHO} "SplitObjs = NO" >> ${WRKSRC:Q}/mk/build.mk | 122 | ${RUN} ${ECHO} "SplitObjs = NO" >> ${WRKSRC:Q}/mk/build.mk | |
122 | 123 | |||
123 | # If there is HsColour is in the PATH, GHC's build system tries to use | 124 | # If there is HsColour in the PATH, GHC's build system tries to use it | |
124 | # it without even checking if it really works. That's not what we | 125 | # without even checking if it really works. That's not what we | |
125 | # appreciate. | 126 | # appreciate. | |
126 | ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC:Q}/mk/build.mk | 127 | ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC:Q}/mk/build.mk | |
127 | 128 | |||
128 | # Don't even think of PDF. | 129 | # Don't even think of PDF. | |
129 | ${RUN} ${ECHO} "BUILD_DOCBOOK_PS = NO" >> ${WRKSRC:Q}/mk/build.mk | 130 | ${RUN} ${ECHO} "BUILD_DOCBOOK_PS = NO" >> ${WRKSRC:Q}/mk/build.mk | |
130 | ${RUN} ${ECHO} "BUILD_DOCBOOK_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk | 131 | ${RUN} ${ECHO} "BUILD_DOCBOOK_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk | |
131 | 132 | |||
132 | 133 | |||
133 | # ----------------------------------------------------------------------------- | 134 | # ----------------------------------------------------------------------------- | |
134 | # Installation/removal hooks | 135 | # Installation/removal hooks | |
135 | # | 136 | # | |
136 | 137 | |||
137 | # Substitutions for INSTALL and DEINSTALL that handles package.cache. | 138 | # Substitutions for INSTALL and DEINSTALL that handles package.cache. |
@@ -16,15 +16,15 @@ wip/ghc TODO | @@ -16,15 +16,15 @@ wip/ghc TODO | |||
16 | * Let ``./configure`` check for broken binutils and provide a better | 16 | * Let ``./configure`` check for broken binutils and provide a better | |
17 | fix for ``patch-rts_StgCRun.c``. | 17 | fix for ``patch-rts_StgCRun.c``. | |
18 | * Build more bootstrapping compilers to support more platforms. | 18 | * Build more bootstrapping compilers to support more platforms. | |
19 | 19 | |||
20 | 20 | |||
21 | How to build a bootstrapping compiler | 21 | How to build a bootstrapping compiler | |
22 | ------------------------------------- | 22 | ------------------------------------- | |
23 | 23 | |||
24 | You need a working compiler to build one. If you think there are no | 24 | You need a working compiler to build one. If you think there are no | |
25 | bindists for your platform, you may need to cross-build a compiler | 25 | bindists for your platform, you may need to cross-build a compiler | |
26 | yourself: `Cross-compiling GHC | 26 | yourself: `Cross-compiling GHC | |
27 | <http://hackage.haskell.org/trac/ghc/wiki/Building/CrossCompiling>`_ | 27 | <http://hackage.haskell.org/trac/ghc/wiki/Building/CrossCompiling>`_ | |
28 | 28 | |||
29 | Assuming you have a working ghc in your PATH, just run ``bmake patch | 29 | Assuming you have a working ghc in your PATH, just run ``bmake clean | |
30 | && bmake bootstrap`` and see if you are lucky enough. | 30 | && bmake bootstrap`` and see if you are lucky enough. |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: bootstrap.mk,v 1.11 2014/09/26 07:00:50 obache Exp $ | 1 | # $NetBSD: bootstrap.mk,v 1.12 2015/02/03 02:32:05 pho Exp $ | |
2 | # ----------------------------------------------------------------------------- | 2 | # ----------------------------------------------------------------------------- | |
3 | # Select a bindist of bootstrapping compiler based on a per-platform | 3 | # Select a bindist of bootstrapping compiler based on a per-platform | |
4 | # basis. | 4 | # basis. | |
5 | # | 5 | # | |
6 | # BOOT_ARCHIVE | 6 | # BOOT_ARCHIVE | |
7 | # This variable is set to the name of compressed archive file of a | 7 | # This variable is set to the name of compressed archive file of a | |
8 | # bootstrapping compiler for the current platform. | 8 | # bootstrapping compiler for the current platform. | |
9 | # | 9 | # | |
10 | # BOOT_TARBALL | 10 | # BOOT_TARBALL | |
11 | # Similar to BOOT_ARCHIVE, but "*.tar" not "*.tar.xz". | 11 | # Similar to BOOT_ARCHIVE, but "*.tar" not "*.tar.xz". | |
12 | # | 12 | # | |
13 | .include "../../mk/bsd.prefs.mk" | 13 | .include "../../mk/bsd.prefs.mk" | |
14 | .if ${MACHINE_ARCH} == "i386" && ${OPSYS} == "FreeBSD" | 14 | .if ${MACHINE_ARCH} == "i386" && ${OPSYS} == "FreeBSD" | |
@@ -38,27 +38,26 @@ BOOT_ARCHIVE:= ${PKGNAME}-boot-x86_64-u | @@ -38,27 +38,26 @@ BOOT_ARCHIVE:= ${PKGNAME}-boot-x86_64-u | |||
38 | 38 | |||
39 | .else | 39 | .else | |
40 | PKG_FAIL_REASON+= "internal error: unsupported platform" | 40 | PKG_FAIL_REASON+= "internal error: unsupported platform" | |
41 | .endif | 41 | .endif | |
42 | 42 | |||
43 | # current bootstrap binary kit for SmartOS is built with ncurses5 | 43 | # current bootstrap binary kit for SmartOS is built with ncurses5 | |
44 | .if !empty(MACHINE_PLATFORM:MSunOS-5.11-*) && !empty(OS_VARIANT:U:MSmartOS) | 44 | .if !empty(MACHINE_PLATFORM:MSunOS-5.11-*) && !empty(OS_VARIANT:U:MSmartOS) | |
45 | BUILD_DEPENDS+= ncurses>=5.0:../../devel/ncurses | 45 | BUILD_DEPENDS+= ncurses>=5.0:../../devel/ncurses | |
46 | .endif | 46 | .endif | |
47 | 47 | |||
48 | BOOT_TARBALL= ${BOOT_ARCHIVE:C/\.xz$//} | 48 | BOOT_TARBALL= ${BOOT_ARCHIVE:C/\.xz$//} | |
49 | 49 | |||
50 | 50 | |||
51 | ||||
52 | # ----------------------------------------------------------------------------- | 51 | # ----------------------------------------------------------------------------- | |
53 | # The "pre-configure" hook | 52 | # The "pre-configure" hook | |
54 | # | 53 | # | |
55 | # Install a bootstrapping compiler directly into TOOLS_DIR so that | 54 | # Install a bootstrapping compiler directly into TOOLS_DIR so that | |
56 | # ./configure can find it. | 55 | # ./configure can find it. | |
57 | # | 56 | # | |
58 | USE_TOOLS+= gmake xzcat xz | 57 | USE_TOOLS+= gmake xzcat xz | |
59 | 58 | |||
60 | pre-configure: | 59 | pre-configure: | |
61 | @${TEST} -f ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE} || \ | 60 | @${TEST} -f ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE} || \ | |
62 | ${FAIL_MSG} "Put your trusted bootstrap archive as ${DISTDIR}/${DIST_SUBDIR}/${BOOT_ARCHIVE}" | 61 | ${FAIL_MSG} "Put your trusted bootstrap archive as ${DISTDIR}/${DIST_SUBDIR}/${BOOT_ARCHIVE}" | |
63 | @${PHASE_MSG} "Extracting bootstrapping compiler for ${PKGNAME}" | 62 | @${PHASE_MSG} "Extracting bootstrapping compiler for ${PKGNAME}" | |
64 | ${RUN} ${MKDIR} ${WRKDIR:Q}/build-extract | 63 | ${RUN} ${MKDIR} ${WRKDIR:Q}/build-extract | |
@@ -71,75 +70,96 @@ pre-configure: | @@ -71,75 +70,96 @@ pre-configure: | |||
71 | --prefix=${TOOLS_DIR:Q} && \ | 70 | --prefix=${TOOLS_DIR:Q} && \ | |
72 | ${MAKE_PROGRAM} install | 71 | ${MAKE_PROGRAM} install | |
73 | 72 | |||
74 | 73 | |||
75 | # ----------------------------------------------------------------------------- | 74 | # ----------------------------------------------------------------------------- | |
76 | # An unusual target "bootstrap" | 75 | # An unusual target "bootstrap" | |
77 | # | 76 | # | |
78 | # Build a bootstrapping compiler using an already installed GHC. This | 77 | # Build a bootstrapping compiler using an already installed GHC. This | |
79 | # can certainly impossible if you don't have one. It's absolutely | 78 | # can certainly impossible if you don't have one. It's absolutely | |
80 | # important to build it with the fewest possible run-time | 79 | # important to build it with the fewest possible run-time | |
81 | # dependencies, otherwise the resulting binary can easily get | 80 | # dependencies, otherwise the resulting binary can easily get | |
82 | # unusable. | 81 | # unusable. | |
83 | # | 82 | # | |
84 | .PHONY: bootstrap | |||
85 | 83 | |||
86 | #BUILDLINK_PASSTHRU_DIRS= ${PREFIX}/lib/${PKGNAME_NOREV} | 84 | # Compiler wrappers must not remove -I/-L flags for this directory | |
85 | # tree, otherwise the GHC we are going to use for building our | |||
86 | # bootstraping kit will not work at all. Ideally it should be added to | |||
87 | # BUILDLINK_PASSTHRU_DIRS only .if make(bootstrap), but then running | |||
88 | # "${MAKE} wrapper" before "${MAKE} bootstrap" will result in a | |||
89 | # cryptic error which we can't easily catch. | |||
90 | BOOTSTRAP_GHC_LIBDIR_CMD= ghc --print-libdir | |||
91 | .if !defined(BOOTSTRAP_GHC_LIBDIR) | |||
92 | BOOTSTRAP_GHC_LIBDIR!= ${BOOTSTRAP_GHC_LIBDIR_CMD} 2>/dev/null || ${ECHO} | |||
93 | .endif | |||
94 | MAKEVARS+= BOOTSTRAP_GHC_LIBDIR | |||
95 | BUILDLINK_PASSTHRU_DIRS+= ${BOOTSTRAP_GHC_LIBDIR} | |||
87 | 96 | |||
97 | # Default values for BUILDLINK_INCDIRS.<pkg> are only generated in the | |||
98 | # barrier. See ../../mk/buildlink3/bsd.buildlink3.mk and | |||
99 | # ../../mk/bsd.pkg.barrier.mk | |||
100 | .PHONY: bootstrap | |||
101 | .if make(bootstrap) | |||
102 | _BARRIER_CMDLINE_TARGETS+= bootstrap | |||
103 | .endif | |||
104 | .if !defined(_PKGSRC_BARRIER) | |||
105 | bootstrap: barrier | |||
106 | .else | |||
88 | bootstrap: pre-bootstrap .WAIT ${WRKDIR}/${BOOT_ARCHIVE} | 107 | bootstrap: pre-bootstrap .WAIT ${WRKDIR}/${BOOT_ARCHIVE} | |
89 | @${PHASE_MSG} "Done creating" ${WRKDIR}/${BOOT_ARCHIVE} | 108 | @${PHASE_MSG} "Done creating" ${WRKDIR}/${BOOT_ARCHIVE} | |
90 | 109 | .endif | ||
91 | 110 | |||
92 | .PHONY: pre-bootstrap | 111 | .PHONY: pre-bootstrap | |
93 | pre-bootstrap: | 112 | pre-bootstrap: wrapper | |
94 | @${TEST} \! -f ${_COOKIE.configure} || \ | 113 | .if empty(BOOTSTRAP_GHC_LIBDIR) | |
95 | (${ERROR_MSG} "You have already configured the package in a way\ | 114 | @if ${BOOTSTRAP_GHC_LIBDIR_CMD} 2>/dev/null 1>&2; then \ | |
115 | ${ERROR_MSG} "Running \"${BOOTSTRAP_GHC_LIBDIR_CMD}\" has failed during wrapper phase."; \ | |||
116 | ${FAIL_MSG} "Plase run \"${MAKE} clean\" and try again."; \ | |||
117 | else \ | |||
118 | ${ERROR_MSG} "Failed to run \"${BOOTSTRAP_GHC_LIBDIR_CMD}\":"; \ | |||
119 | ${BOOTSTRAP_GHC_LIBDIR_CMD}; \ | |||
120 | ${ERROR_MSG} "You don't seem to have a working GHC in your PATH."; \ | |||
121 | ${FAIL_MSG} "Please install one and then run \"${MAKE} clean bootstrap\"."; \ | |||
122 | fi | |||
123 | .endif | |||
124 | @if ${TEST} -f ${_COOKIE.configure}; then \ | |||
125 | ${ERROR_MSG} "You have already configured the package in a way\ | |||
96 | that building bootstrapping compiler is impossible."; \ | 126 | that building bootstrapping compiler is impossible."; \ | |
97 | ${FAIL_MSG} "Please run \"${MAKE} clean patch\" first."); | 127 | ${FAIL_MSG} "Please run \"${MAKE} clean\" first."; \ | |
98 | @${TEST} -f ${_COOKIE.patch} || \ | 128 | fi | |
99 | ${FAIL_MSG} "Please run \"${MAKE} patch\" first." | |||
100 | @${DO_NADA} | |||
101 | ||||
102 | 129 | |||
103 | ${WRKDIR}/lndir: | 130 | ${WRKDIR}/lndir: | |
104 | @${PHASE_MSG} "Building lndir(1) to duplicate the source tree." | 131 | @${PHASE_MSG} "Building lndir(1) to duplicate the source tree." | |
105 | cd ${WRKSRC:Q}/utils/lndir && \ | 132 | cd ${WRKSRC:Q}/utils/lndir && \ | |
106 | ${PKG_CC:Q} lndir.c -o ${.TARGET} | 133 | ${PKG_CC:Q} lndir.c -o ${.TARGET} | |
107 | 134 | |||
108 | ${WRKDIR}/stamp-lndir-boot: ${WRKDIR}/lndir | 135 | ${WRKDIR}/stamp-lndir-boot: ${WRKDIR}/lndir | |
109 | @${PHASE_MSG} "Duplicating the source tree for bootstrapping ${PKGNAME_NOREV}" | 136 | @${PHASE_MSG} "Duplicating the source tree for bootstrapping ${PKGNAME_NOREV}" | |
110 | ${MKDIR} ${WRKDIR:Q}/build-boot | 137 | ${MKDIR} ${WRKDIR:Q}/build-boot | |
111 | cd ${WRKDIR:Q}/build-boot && \ | 138 | cd ${WRKDIR:Q}/build-boot && \ | |
112 | ${WRKDIR}/lndir -silent ../${PKGNAME_NOREV:Q} | 139 | ${WRKDIR}/lndir -silent ../${PKGNAME_NOREV:Q} | |
113 | ${TOUCH} ${.TARGET} | 140 | ${TOUCH} ${.TARGET} | |
114 | 141 | |||
115 | ${WRKDIR}/stamp-configure-boot: ${WRKDIR}/stamp-lndir-boot | 142 | ${WRKDIR}/stamp-configure-boot: ${WRKDIR}/stamp-lndir-boot | |
116 | @${PHASE_MSG} "Configuring bootstrapping compiler ${PKGNAME_NOREV}" | 143 | @${PHASE_MSG} "Configuring bootstrapping compiler ${PKGNAME_NOREV}" | |
117 | ${MKDIR} ${WRKDIR:Q}/build-boot | 144 | ${MKDIR} ${WRKDIR:Q}/build-boot | |
118 | cd ${WRKDIR:Q}/build-boot && \ | 145 | cd ${WRKDIR:Q}/build-boot && \ | |
119 | ${PKGSRC_SETENV} PATH=${PATH} \ | 146 | ${PKGSRC_SETENV} ${CONFIGURE_ENV} ${SH} ./configure ${CONFIGURE_ARGS} && \ | |
120 | CONF_CC_OPTS_STAGE0=${CFLAGS:Q} \ | 147 | ${CP} -f ${FILESDIR:Q}/bootstrap.build.mk mk/build.mk && \ | |
121 | CONF_GCC_LINKER_OPTS_STAGE0="-L${PREFIX}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib" \ | 148 | ${ECHO} >> mk/build.mk && \ | |
122 | CONF_LD_LINKER_OPTS_STAGE0="-L${PREFIX}/lib ${LINKER_RPATH_FLAG}${PREFIX}/lib" \ | 149 | ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \ | |
123 | CONF_CC_OPTS_STAGE1=${CFLAGS:Q} \ | 150 | --configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.curses:Q} \ | |
124 | CONF_GCC_LINKER_OPTS_STAGE1="-L${PREFIX}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib" \ | 151 | --configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q}" \ | |
125 | CONF_LD_LINKER_OPTS_STAGE1="-L${PREFIX}/lib ${LINKER_RPATH_FLAG}${PREFIX}/lib" \ | 152 | >> mk/build.mk | |
126 | CONF_CC_OPTS_STAGE2=${CFLAGS:Q} \ | |||
127 | CONF_GCC_LINKER_OPTS_STAGE2="-L${PREFIX}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib" \ | |||
128 | CONF_LD_LINKER_OPTS_STAGE2="-L${PREFIX}/lib ${LINKER_RPATH_FLAG}${PREFIX}/lib" \ | |||
129 | ${SH} ./configure && \ | |||
130 | ${SED} -e "s,@CURSES_INCDIR@,${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.ncurses:Uinclude},g" \ | |||
131 | -e "s,@CURSES_LIBDIR@,${BUILDLINK_PREFIX.curses:Q}/lib,g" \ | |||
132 | ${FILESDIR:Q}/bootstrap.build.mk > mk/build.mk | |||
133 | ${TOUCH} ${.TARGET} | 153 | ${TOUCH} ${.TARGET} | |
134 | 154 | |||
135 | ${WRKDIR}/stamp-build-boot: ${WRKDIR}/stamp-configure-boot | 155 | ${WRKDIR}/stamp-build-boot: ${WRKDIR}/stamp-configure-boot | |
136 | @${PHASE_MSG} "Building bootstrapping compiler ${PKGNAME_NOREV}" | 156 | @${PHASE_MSG} "Building bootstrapping compiler ${PKGNAME_NOREV}" | |
137 | ${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD} | 157 | ${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD} | |
138 | ${TOUCH} ${.TARGET} | 158 | ${TOUCH} ${.TARGET} | |
139 | 159 | |||
140 | ${WRKDIR}/${BOOT_TARBALL}: ${WRKDIR}/stamp-build-boot | 160 | ${WRKDIR}/${BOOT_TARBALL}: ${WRKDIR}/stamp-build-boot | |
141 | @${PHASE_MSG} "Creating binary distribution of bootstrapping ${PKGNAME_NOREV}" | 161 | @${PHASE_MSG} "Creating binary distribution of bootstrapping ${PKGNAME_NOREV}" | |
142 | ${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD} binary-dist | 162 | ${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD} binary-dist | |
143 | ${MV} -f ${WRKDIR:Q}/build-boot/${BOOT_TARBALL} ${.TARGET} | 163 | ${MV} -f ${WRKDIR:Q}/build-boot/${BOOT_TARBALL} ${.TARGET} | |
144 | 164 | |||
145 | # This can take up half an hour. Memory usage is also very high, about 680 MiB. | 165 | # This can take up half an hour. Memory usage is also very high, about 680 MiB. |
@@ -19,17 +19,13 @@ SplitObjs = NO | @@ -19,17 +19,13 @@ SplitObjs = NO | |||
19 | GhcLibWays = v | 19 | GhcLibWays = v | |
20 | GhcRTSWays = | 20 | GhcRTSWays = | |
21 | 21 | |||
22 | # I'm not sure disabling GHCi significantly reduces the bindist size, | 22 | # I'm not sure disabling GHCi significantly reduces the bindist size, | |
23 | # but we don't need it anyway. | 23 | # but we don't need it anyway. | |
24 | GhcWithInterpreter = NO | 24 | GhcWithInterpreter = NO | |
25 | 25 | |||
26 | # We don't want in-place GMP to be statically linked as it increases | 26 | # We don't want in-place GMP to be statically linked as it increases | |
27 | # the bindist size. Dynamic linkage is even worse. | 27 | # the bindist size. Dynamic linkage is even worse. | |
28 | INTEGER_LIBRARY = integer-simple | 28 | INTEGER_LIBRARY = integer-simple | |
29 | 29 | |||
30 | # We'd like to distinguish bootstrapping bindists from normal ones. | 30 | # We'd like to distinguish bootstrapping bindists from normal ones. | |
31 | BIN_DIST_NAME = ghc-$(ProjectVersion)-boot | 31 | BIN_DIST_NAME = ghc-$(ProjectVersion)-boot | |
32 | ||||
33 | libraries/terminfo_CONFIGURE_OPTS += \ | |||
34 | --configure-option=--with-curses-includes=@CURSES_INCDIR@ \ | |||
35 | --configure-option=--with-curses-libraries=@CURSES_LIBDIR@ |