| @@ -1,193 +1,193 @@ | | | @@ -1,193 +1,193 @@ |
1 | # $NetBSD: Makefile,v 1.19 2015/02/20 19:10:29 pho Exp $ | | 1 | # $NetBSD: Makefile,v 1.20 2015/03/17 21:15:28 tnn 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= 6 | | 7 | PKGREVISION= 6 |
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 |
15 | LICENSE= modified-bsd | | 15 | LICENSE= modified-bsd |
16 | | | 16 | |
17 | # GHC requires GHC to build itself. Formerly we could work around this | | 17 | # GHC requires GHC to build itself. Formerly we could work around this |
18 | # bootstrapping problem by creating a special archive containing C | | 18 | # bootstrapping problem by creating a special archive containing C |
19 | # sources compiled from Haskell sources, but that's no longer | | 19 | # sources compiled from Haskell sources, but that's no longer |
20 | # possible. So we have to prepare stripped-down binaries sufficient to | | 20 | # possible. So we have to prepare stripped-down binaries sufficient to |
21 | # bootstrap compilers for each platforms. If you want to build them | | 21 | # bootstrap compilers for each platforms. If you want to build them |
22 | # yourself, follow an instruction in the ./TODO file. | | 22 | # yourself, follow an instruction in the ./TODO file. |
23 | BROKEN_EXCEPT_ON_PLATFORM+= \ | | 23 | BROKEN_EXCEPT_ON_PLATFORM+= \ |
24 | Darwin-*-powerpc \ | | 24 | Darwin-*-powerpc \ |
25 | FreeBSD-*-i386 \ | | 25 | FreeBSD-*-i386 \ |
26 | Linux-*-x86_64 \ | | 26 | Linux-*-x86_64 \ |
27 | NetBSD-*-i386 \ | | 27 | NetBSD-*-i386 \ |
28 | NetBSD-*-x86_64 \ | | 28 | NetBSD-*-x86_64 \ |
29 | SunOS-5.11-* | | 29 | SunOS-5.11-* |
30 | | | 30 | |
31 | | | 31 | |
32 | # ----------------------------------------------------------------------------- | | 32 | # ----------------------------------------------------------------------------- |
33 | # Distfiles | | 33 | # Distfiles |
34 | # | | 34 | # |
35 | DISTFILES= ${DEFAULT_DISTFILES} | | 35 | DISTFILES= ${DEFAULT_DISTFILES} |
36 | WRKSRC= ${WRKDIR}/${PKGNAME_NOREV} | | 36 | WRKSRC= ${WRKDIR}/${PKGNAME_NOREV} |
37 | | | 37 | |
38 | # We don't want to extract all of the DISTFILEs. | | 38 | # We don't want to extract all of the DISTFILEs. |
39 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} | | 39 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} |
40 | | | 40 | |
41 | | | 41 | |
42 | # ----------------------------------------------------------------------------- | | 42 | # ----------------------------------------------------------------------------- |
43 | # Tools | | 43 | # Tools |
44 | # | | 44 | # |
45 | USE_TOOLS+= autoconf gmake perl:run | | 45 | USE_TOOLS+= autoconf gmake gzip perl:run |
46 | GNU_CONFIGURE= yes | | 46 | GNU_CONFIGURE= yes |
47 | USE_GNU_CONFIGURE_HOST= no | | 47 | USE_GNU_CONFIGURE_HOST= no |
48 | USE_LIBTOOL= yes | | 48 | USE_LIBTOOL= yes |
49 | | | 49 | |
50 | CONFIGURE_ARGS+= \ | | 50 | CONFIGURE_ARGS+= \ |
51 | --with-gcc=${CC:Q} \ | | 51 | --with-gcc=${CC:Q} \ |
52 | --with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_INCDIRS.gmp:Q} \ | | 52 | --with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_INCDIRS.gmp:Q} \ |
53 | --with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_LIBDIRS.gmp:Q} \ | | 53 | --with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_LIBDIRS.gmp:Q} \ |
54 | --with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_INCDIRS.iconv:Q} \ | | 54 | --with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_INCDIRS.iconv:Q} \ |
55 | --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q} | | 55 | --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q} |
56 | | | 56 | |
57 | CONFIGURE_ENV+= \ | | 57 | CONFIGURE_ENV+= \ |
58 | ac_cv_path_fp_prog_ar=${AR:Q} \ | | 58 | ac_cv_path_fp_prog_ar=${AR:Q} \ |
59 | PerlCmd=${PERL5:Q} | | 59 | PerlCmd=${PERL5:Q} |
60 | | | 60 | |
61 | # CFLAGS and LDFLAGS are currently not honored by "./configure". Since | | 61 | # CFLAGS and LDFLAGS are currently not honored by "./configure". Since |
62 | # LDFLAGS contains rpath flags it's very important to force GHC to | | 62 | # LDFLAGS contains rpath flags it's very important to force GHC to |
63 | # honor it. Otherwise neither GHC itself nor executables it produces | | 63 | # honor it. Otherwise neither GHC itself nor executables it produces |
64 | # will have any rpaths so users will have to put "${PREFIX}/lib" into | | 64 | # will have any rpaths so users will have to put "${PREFIX}/lib" into |
65 | # their "/etc/ld-elf.so.conf". See | | 65 | # their "/etc/ld-elf.so.conf". See |
66 | # http://hackage.haskell.org/trac/ghc/ticket/2933 | | 66 | # http://hackage.haskell.org/trac/ghc/ticket/2933 |
67 | .for stage in 0 1 2 | | 67 | .for stage in 0 1 2 |
68 | CONFIGURE_ENV+= \ | | 68 | CONFIGURE_ENV+= \ |
69 | CONF_CC_OPTS_STAGE${stage}=${CFLAGS:Q} \ | | 69 | CONF_CC_OPTS_STAGE${stage}=${CFLAGS:Q} \ |
70 | CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:Q} | | 70 | CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:Q} |
71 | # Note that CONF_LD_LINKER_OPTS_STAGE{0,1,2} are only used for | | 71 | # Note that CONF_LD_LINKER_OPTS_STAGE{0,1,2} are only used for |
72 | # creating static GHCi libraries (HS*.o). Setting them to ${LDFLAGS} | | 72 | # creating static GHCi libraries (HS*.o). Setting them to ${LDFLAGS} |
73 | # does more harm than good because our ${LDFLAGS} contains -Wl,* | | 73 | # does more harm than good because our ${LDFLAGS} contains -Wl,* |
74 | # flags. It's true that ../../mk/wrapper/cmd-sink-ld transforms them | | 74 | # flags. It's true that ../../mk/wrapper/cmd-sink-ld transforms them |
75 | # but those flags will also be baked into the compiler (see | | 75 | # but those flags will also be baked into the compiler (see |
76 | # ${WRKSRC}/compiler/ghc.mk) so they cause problems when used outside | | 76 | # ${WRKSRC}/compiler/ghc.mk) so they cause problems when used outside |
77 | # the buildlink. | | 77 | # the buildlink. |
78 | .endfor | | 78 | .endfor |
79 | | | 79 | |
80 | | | 80 | |
81 | # ----------------------------------------------------------------------------- | | 81 | # ----------------------------------------------------------------------------- |
82 | # Build hooks | | 82 | # Build hooks |
83 | # | | 83 | # |
84 | | | 84 | |
85 | # We patch configure.ac in some directories. | | 85 | # We patch configure.ac in some directories. |
86 | post-patch: | | 86 | post-patch: |
87 | @${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}" | | 87 | @${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}" |
88 | ${RUN} cd ${WRKSRC:Q}/libraries/base && autoconf | | 88 | ${RUN} cd ${WRKSRC:Q}/libraries/base && autoconf |
89 | ${RUN} cd ${WRKSRC:Q}/libraries/integer-gmp && autoconf | | 89 | ${RUN} cd ${WRKSRC:Q}/libraries/integer-gmp && autoconf |
90 | | | 90 | |
91 | | | 91 | |
92 | # Define the target "pre-configure" and non-standard "bootstrap". | | 92 | # Define the target "pre-configure" and non-standard "bootstrap". |
93 | .include "../../lang/ghc7/bootstrap.mk" | | 93 | .include "../../lang/ghc7/bootstrap.mk" |
94 | | | 94 | |
95 | # Our pre-configure phase installs a bindist of bootstrapping compiler | | 95 | # Our pre-configure phase installs a bindist of bootstrapping compiler |
96 | # directly into TOOLS_DIR so that ./configure can find it. | | 96 | # directly into TOOLS_DIR so that ./configure can find it. |
97 | | | 97 | |
98 | | | 98 | |
99 | # Here we generate mk/build.mk dynamically. | | 99 | # Here we generate mk/build.mk dynamically. |
100 | post-configure: | | 100 | post-configure: |
101 | ${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk | | 101 | ${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk |
102 | | | 102 | |
103 | # See https://ghc.haskell.org/trac/ghc/ticket/10096 | | 103 | # See https://ghc.haskell.org/trac/ghc/ticket/10096 |
104 | ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \ | | 104 | ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \ |
105 | --configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.curses:Q} \ | | 105 | --configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.curses:Q} \ |
106 | --configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q}" \ | | 106 | --configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q}" \ |
107 | >> ${WRKSRC:Q}/mk/build.mk | | 107 | >> ${WRKSRC:Q}/mk/build.mk |
108 | | | 108 | |
109 | # The ghc compiler does normally split the generated asm files into small | | 109 | # The ghc compiler does normally split the generated asm files into small |
110 | # parts before sending them to gcc, to enable the linker to eliminate | | 110 | # parts before sending them to gcc, to enable the linker to eliminate |
111 | # unused parts. This does however not play nice with the pkgsrc | | 111 | # unused parts. This does however not play nice with the pkgsrc |
112 | # framework, and the result is that the build takes more than 5 times | | 112 | # framework, and the result is that the build takes more than 5 times |
113 | # as long than when the files are not split. See | | 113 | # as long than when the files are not split. See |
114 | # http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html | | 114 | # http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html |
115 | # for a description of the problem. | | 115 | # for a description of the problem. |
116 | # Disable file splitting until pkgsrc gets improved. | | 116 | # Disable file splitting until pkgsrc gets improved. |
117 | ${RUN} ${ECHO} "SplitObjs = NO" >> ${WRKSRC:Q}/mk/build.mk | | 117 | ${RUN} ${ECHO} "SplitObjs = NO" >> ${WRKSRC:Q}/mk/build.mk |
118 | | | 118 | |
119 | # If there is HsColour in the PATH, GHC's build system tries to use it | | 119 | # If there is HsColour in the PATH, GHC's build system tries to use it |
120 | # without even checking if it really works. That's not what we | | 120 | # without even checking if it really works. That's not what we |
121 | # appreciate. | | 121 | # appreciate. |
122 | ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC:Q}/mk/build.mk | | 122 | ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC:Q}/mk/build.mk |
123 | | | 123 | |
124 | # Don't even think of PDF. | | 124 | # Don't even think of PDF. |
125 | ${RUN} ${ECHO} "BUILD_DOCBOOK_PS = NO" >> ${WRKSRC:Q}/mk/build.mk | | 125 | ${RUN} ${ECHO} "BUILD_DOCBOOK_PS = NO" >> ${WRKSRC:Q}/mk/build.mk |
126 | ${RUN} ${ECHO} "BUILD_DOCBOOK_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk | | 126 | ${RUN} ${ECHO} "BUILD_DOCBOOK_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk |
127 | | | 127 | |
128 | | | 128 | |
129 | # ----------------------------------------------------------------------------- | | 129 | # ----------------------------------------------------------------------------- |
130 | # Installation/removal hooks | | 130 | # Installation/removal hooks |
131 | # | | 131 | # |
132 | | | 132 | |
133 | # Substitutions for INSTALL and DEINSTALL that handles package.cache. | | 133 | # Substitutions for INSTALL and DEINSTALL that handles package.cache. |
134 | FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV} | | 134 | FILES_SUBST+= GHC_VERSION=${PKGVERSION_NOREV} |
135 | | | 135 | |
136 | # We don't want package.cache to be in the PLIST. | | 136 | # We don't want package.cache to be in the PLIST. |
137 | post-install: | | 137 | post-install: |
138 | ${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache | | 138 | ${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${PKGNAME_NOREV}/package.conf.d/package.cache |
139 | | | 139 | |
140 | | | 140 | |
141 | # ----------------------------------------------------------------------------- | | 141 | # ----------------------------------------------------------------------------- |
142 | # PLIST | | 142 | # PLIST |
143 | # | | 143 | # |
144 | # We can't use static PLIST because the package installs some files | | 144 | # We can't use static PLIST because the package installs some files |
145 | # whose names are randomly generated, namely | | 145 | # whose names are randomly generated, namely |
146 | # lib/${PKGNAME}/package.conf.d/*.conf | | 146 | # lib/${PKGNAME}/package.conf.d/*.conf |
147 | # | | 147 | # |
148 | PRINT_PLIST_AWK+= /lib\/${PKGNAME_NOREV}\/package\.conf\.d/ { next; } | | 148 | PRINT_PLIST_AWK+= /lib\/${PKGNAME_NOREV}\/package\.conf\.d/ { next; } |
149 | | | 149 | |
150 | # If we were lucky we could just use "PLIST_TYPE = dynamic", but the | | 150 | # If we were lucky we could just use "PLIST_TYPE = dynamic", but the |
151 | # feature has seemingly bitrotted. | | 151 | # feature has seemingly bitrotted. |
152 | .include "../../mk/bsd.prefs.mk" | | 152 | .include "../../mk/bsd.prefs.mk" |
153 | .if empty(USE_DESTDIR:M[Yy][Ee][Ss]) | | 153 | .if empty(USE_DESTDIR:M[Yy][Ee][Ss]) |
154 | GENERATE_PLIST+= \ | | 154 | GENERATE_PLIST+= \ |
155 | cd ${PREFIX:Q} && \ | | 155 | cd ${PREFIX:Q} && \ |
156 | ${FIND} lib/${PKGNAME_NOREV}/package.conf.d -xdev -newer ${_COOKIE.extract} \! -type d -print | ${SORT} -d; | | 156 | ${FIND} lib/${PKGNAME_NOREV}/package.conf.d -xdev -newer ${_COOKIE.extract} \! -type d -print | ${SORT} -d; |
157 | .else | | 157 | .else |
158 | GENERATE_PLIST+= \ | | 158 | GENERATE_PLIST+= \ |
159 | cd ${DESTDIR:Q}${PREFIX:Q} && \ | | 159 | cd ${DESTDIR:Q}${PREFIX:Q} && \ |
160 | ${FIND} lib/${PKGNAME_NOREV}/package.conf.d -xdev \! -type d -print | ${SORT} -d; | | 160 | ${FIND} lib/${PKGNAME_NOREV}/package.conf.d -xdev \! -type d -print | ${SORT} -d; |
161 | .endif | | 161 | .endif |
162 | | | 162 | |
163 | | | 163 | |
164 | # ----------------------------------------------------------------------------- | | 164 | # ----------------------------------------------------------------------------- |
165 | # Sanity checks | | 165 | # Sanity checks |
166 | # | | 166 | # |
167 | | | 167 | |
168 | # There is an unused script which don't pass the portability test. | | 168 | # There is an unused script which don't pass the portability test. |
169 | CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw | | 169 | CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw |
170 | | | 170 | |
171 | # Dynamic Haskell libraries currently have no rpaths to any dependent | | 171 | # Dynamic Haskell libraries currently have no rpaths to any dependent |
172 | # Haskell libraries so we must skip shlibs check for them. Note that | | 172 | # Haskell libraries so we must skip shlibs check for them. Note that |
173 | # the situation seems to be changed in GHC 7.8.1 so we should | | 173 | # the situation seems to be changed in GHC 7.8.1 so we should |
174 | # readdress this later. See | | 174 | # readdress this later. See |
175 | # https://ghc.haskell.org/trac/ghc/ticket/8266 (slightly off-topic but | | 175 | # https://ghc.haskell.org/trac/ghc/ticket/8266 (slightly off-topic but |
176 | # pho@ found no description for the -fuse-rpath flag.) | | 176 | # pho@ found no description for the -fuse-rpath flag.) |
177 | .if !empty(PKGNAME:Mghc-7.6.*) | | 177 | .if !empty(PKGNAME:Mghc-7.6.*) |
178 | CHECK_SHLIBS_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.* | | 178 | CHECK_SHLIBS_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.* |
179 | .endif | | 179 | .endif |
180 | | | 180 | |
181 | | | 181 | |
182 | # ----------------------------------------------------------------------------- | | 182 | # ----------------------------------------------------------------------------- |
183 | # Dependencies | | 183 | # Dependencies |
184 | # | | 184 | # |
185 | | | 185 | |
186 | BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt | | 186 | BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt |
187 | BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl | | 187 | BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl |
188 | | | 188 | |
189 | .include "../../converters/libiconv/buildlink3.mk" | | 189 | .include "../../converters/libiconv/buildlink3.mk" |
190 | .include "../../devel/gmp/buildlink3.mk" | | 190 | .include "../../devel/gmp/buildlink3.mk" |
191 | .include "../../mk/curses.buildlink3.mk" | | 191 | .include "../../mk/curses.buildlink3.mk" |
192 | .include "../../mk/pthread.buildlink3.mk" | | 192 | .include "../../mk/pthread.buildlink3.mk" |
193 | .include "../../mk/bsd.pkg.mk" | | 193 | .include "../../mk/bsd.pkg.mk" |