Changeset View
Standalone View
lang/ghc/Makefile
Show All 9 Lines | |||||
DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source | DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source | ||||
MAINTAINER= haskell@FreeBSD.org | MAINTAINER= haskell@FreeBSD.org | ||||
COMMENT= Compiler for the functional language Haskell | COMMENT= Compiler for the functional language Haskell | ||||
LICENSE= BSD3CLAUSE | LICENSE= BSD3CLAUSE | ||||
LICENSE_FILE= ${WRKSRC}/LICENSE | LICENSE_FILE= ${WRKSRC}/LICENSE | ||||
ONLY_FOR_ARCHS= i386 amd64 | ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 | ||||
GHC_VERSION= 8.4.3 | GHC_VERSION= 8.4.3 | ||||
HSCOLOUR_VERSION= 1.24.4 | HSCOLOUR_VERSION= 1.24.4 | ||||
DATADIR= ${PREFIX}/share/ghc-${GHC_VERSION} | DATADIR= ${PREFIX}/share/ghc-${GHC_VERSION} | ||||
EXAMPLESDIR= ${PREFIX}/share/examples/ghc-${GHC_VERSION} | EXAMPLESDIR= ${PREFIX}/share/examples/ghc-${GHC_VERSION} | ||||
CONFLICTS= ghc-7.4.* ghc-7.6.* ghc-7.8.* ghc-7.10.* ghc-8.0.* | CONFLICTS= ghc-7.4.* ghc-7.6.* ghc-7.8.* ghc-7.10.* ghc-8.0.* | ||||
Show All 27 Lines | |||||
OPTIONS_GROUP_BOOTSTRAP=BOOT BOOTH | OPTIONS_GROUP_BOOTSTRAP=BOOT BOOTH | ||||
OPTIONS_DEFINE= DYNAMIC PROFILE DOCS | OPTIONS_DEFINE= DYNAMIC PROFILE DOCS | ||||
OPTIONS_SUB= yes | OPTIONS_SUB= yes | ||||
OPTIONS_DEFAULT= PROFILE DYNAMIC | OPTIONS_DEFAULT= PROFILE DYNAMIC | ||||
BOOT_DESC= Use installed GHC for bootstrapping | BOOT_DESC= Use installed GHC for bootstrapping | ||||
BOOTH_DESC= Use installed HsColour for bootstrapping | BOOTH_DESC= Use installed HsColour for bootstrapping | ||||
PROFILE_DESC= Add support for performance profiling | PROFILE_DESC= Add support for performance profiling | ||||
tcberner: ^missing tab aber = | |||||
DYNAMIC_DESC= Add support for dynamic linking | DYNAMIC_DESC= Add support for dynamic linking | ||||
DOCS_DESC= Install HTML documentation | DOCS_DESC= Install HTML documentation | ||||
DYNAMIC_CONFIGURE_ARGS= --with-system-libffi \ | DYNAMIC_CONFIGURE_ARGS= --with-system-libffi \ | ||||
--with-ffi-includes=${LOCALBASE}/include \ | --with-ffi-includes=${LOCALBASE}/include \ | ||||
--with-ffi-libraries=${LOCALBASE}/lib | --with-ffi-libraries=${LOCALBASE}/lib | ||||
# The version number is needed as lang/gcc installs a different version | # The version number is needed as lang/gcc installs a different version | ||||
DYNAMIC_LIB_DEPENDS= libffi.so.6:devel/libffi | DYNAMIC_LIB_DEPENDS= libffi.so.6:devel/libffi | ||||
Show All 17 Lines | |||||
.include <bsd.port.options.mk> | .include <bsd.port.options.mk> | ||||
.if empty(PORT_OPTIONS:MBOOT) | .if empty(PORT_OPTIONS:MBOOT) | ||||
BOOT_GHC_VERSION= 8.4.2 | BOOT_GHC_VERSION= 8.4.2 | ||||
DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${EXTRACT_SUFX}:boot | DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${EXTRACT_SUFX}:boot | ||||
.endif # MBOOT | .endif # MBOOT | ||||
.if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 | |||||
Not Done Inline Actions^ could you indent the nested ifs - that makes it a tiny bit more readable. .if ... . if ... . endif .endif tcberner: ^ could you indent the nested ifs - that makes it a tiny bit more readable.
```
.if ...
. if . | |||||
# CONFIGURE_TARGET must to be the same as the llvm triple | |||||
CONFIGURE_TARGET= ${ARCH}-unknown-freebsd${"${ARCH:Maarch64}" != "":?:-gnueabihf} | |||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-aclocal.m4 | |||||
BUILD_DEPENDS+= ${LOCALBASE}/bin/ld.gold:devel/binutils \ | |||||
Not Done Inline Actions${LOCALBASE}/bin/ part shouldn't be needed, just like for opt50. arrowd: `${LOCALBASE}/bin/` part shouldn't be needed, just like for `opt50`. | |||||
llc50:devel/llvm50 | |||||
RUN_DEPENDS+= ${LOCALBASE}/bin/ld.gold:devel/binutils \ | |||||
llc50:devel/llvm50 | |||||
USE_GCC= yes | |||||
CONFIGURE_ENV+= OPT=opt50 LLC=llc50 | |||||
.if ${OSVERSION} < 1200064 | |||||
IGNORE= lang/ghc requires at least __FreeBSD_version 1200064 | |||||
Not Done Inline Actionsmaybe add "for this architecture"? emaste: maybe add "for this architecture"? | |||||
Not Done Inline ActionsIt's already in the 'if ${ARCH}' block, do you think it's needed? mikael: It's already in the 'if ${ARCH}' block, do you think it's needed? | |||||
Not Done Inline ActionsFor someone reading the Makefile no; I just assumed someone might see arm64 build log output without noticing that it wasn't amd64. But I suspect it's rather unlikely. emaste: For someone reading the Makefile no; I just assumed someone might see arm64 build log output… | |||||
.endif | |||||
.ifdef QEMU_EMULATING | |||||
IGNORE= qemu-user-static is too buggy to build lang/ghc, it builds fine on a real hardware | |||||
matUnsubmitted Not Done Inline ActionsThis message gives your opinion and a bad one about qemu. Please make it more neutral. mat: This message gives your opinion and a bad one about qemu. Please make it more neutral. | |||||
mikaelAuthorUnsubmitted Not Done Inline ActionsIt's not my opinion it's the sad reality. mikael: It's not my opinion it's the sad reality. | |||||
matUnsubmitted Not Done Inline ActionsIt does not change the fact that this message is insulting for people who work on qemu. mat: It does not change the fact that this message is insulting for people who work on qemu. | |||||
mikaelAuthorUnsubmitted Not Done Inline ActionsI work on qemu-user-static and I don't find this message insulting. Feel free to propose something else if you don't like it. mikael: I work on qemu-user-static and I don't find this message insulting. Feel free to propose… | |||||
.endif | |||||
.endif | |||||
# Turn off for a while, see PR 228727 | # Turn off for a while, see PR 228727 | ||||
CONFIGURE_ARGS+= --enable-dtrace=0 | CONFIGURE_ARGS+= --enable-dtrace=0 | ||||
.if ${OSVERSION} < 1200000 | .if ${OSVERSION} < 1200000 | ||||
USE_GCC= yes | USE_GCC= yes | ||||
.else | .else | ||||
LD= ld.bfd | LD= ld.bfd | ||||
.endif | .endif | ||||
CONFIGURE_ENV+= CC=${CC} LD=${LD} | CONFIGURE_ENV+= CC=${CC} LD=${LD} | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
MAKE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} | MAKE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} | ||||
CONFIGURE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} | CONFIGURE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} | ||||
. endif # MBOOTH | . endif # MBOOTH | ||||
.endif # MDOCS | .endif # MDOCS | ||||
post-extract: | post-extract: | ||||
.if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200031 | .if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200031 && \ | ||||
${ARCH} != aarch64 && ${ARCH} != armv6 && ${ARCH} != armv7 | |||||
Not Done Inline ActionsWhy exclude ARM arches here? IIRC, This fiddling is done for ino64 change, which affects all arches. arrowd: Why exclude ARM arches here? IIRC, This fiddling is done for ino64 change, which affects all… | |||||
Not Done Inline ActionsMy bootstraps binaries are based on FreeBSD 12, they already contains the ino64 change and don't need the 'wrap' hack. It's only needed when the bootstrap compiler is pre ino64 (FreeBSD 10.3 for example). mikael: My bootstraps binaries are based on FreeBSD 12, they already contains the ino64 change and… | |||||
Done Inline Actionsadd a comment saying so. mat: add a comment saying so. | |||||
@${REINPLACE_CMD} -e 's|@SettingsCCompilerLinkFlags@|& -Wl,--wrap=readdir_r,--wrap=stat,--wrap=lstat,--wrap=fstat,--wrap=mknod|' ${BOOT_DIR}/settings.in | @${REINPLACE_CMD} -e 's|@SettingsCCompilerLinkFlags@|& -Wl,--wrap=readdir_r,--wrap=stat,--wrap=lstat,--wrap=fstat,--wrap=mknod|' ${BOOT_DIR}/settings.in | ||||
.endif | .endif | ||||
# %%PORTDOCS%%%%DOCSDIR%%/html/libraries/doc-index-V.html | # %%PORTDOCS%%%%DOCSDIR%%/html/libraries/doc-index-V.html | ||||
post-install-script: | post-install-script: | ||||
${FIND} -ds ${GHC_LIBDIR} -type f -print | ${SED} -E \ | ${FIND} -ds ${GHC_LIBDIR} -type f -print | ${SED} -E \ | ||||
-e 's,^${STAGEDIR}${PREFIX}/?,,' \ | -e 's,^${STAGEDIR}${PREFIX}/?,,' \ | ||||
-e '/^${GHC_LIBDIR:C/\//\\\//g}\/package.conf.d\/package\.cache/s|^|@comment |g' \ | -e '/^${GHC_LIBDIR:C/\//\\\//g}\/package.conf.d\/package\.cache/s|^|@comment |g' \ | ||||
Show All 16 Lines | .if ${PORT_OPTIONS:MDOCS} | ||||
${ECHO} '@postexec ${SH} -c "cd %D/${DOCSDIR_REL}/html/libraries && ./gen_contents_index"' >> ${TMPPLIST} | ${ECHO} '@postexec ${SH} -c "cd %D/${DOCSDIR_REL}/html/libraries && ./gen_contents_index"' >> ${TMPPLIST} | ||||
.endif | .endif | ||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} -e 's|%%CC%%|${CC}|; \ | @${REINPLACE_CMD} -e 's|%%CC%%|${CC}|; \ | ||||
s|%%AR%%|${AR}|; \ | s|%%AR%%|${AR}|; \ | ||||
s|%%LD%%|${LD}|' \ | s|%%LD%%|${LD}|' \ | ||||
${WRKSRC}/libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs | ${WRKSRC}/libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs | ||||
# we must use binutils:ld on arm | |||||
.if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 | |||||
@${REINPLACE_CMD} -e 's|LD_NO_GOLD=ld|LD_NO_GOLD=${PREFIX}/bin/ld|' \ | |||||
Not Done Inline ActionsThe code here seems to be contradicting with the comment. You are replacing LOCALBASE with ${PREFIX} instead of setting linker. Can you explain this block? arrowd: The code here seems to be contradicting with the comment. You are replacing `LOCALBASE` with… | |||||
Not Done Inline ActionsI want to replace LD_NO_GOLD=ld with LD_NO_GOLD=/usr/local/bin/ld. mikael: I want to replace LD_NO_GOLD=ld with LD_NO_GOLD=/usr/local/bin/ld.
I can do @${REINPLACE_CMD}… | |||||
Not Done Inline ActionsWhat's LD_NO_GOLD? The linker to be used is set via env var LD. See line 120 of this Makefile. arrowd: What's `LD_NO_GOLD`? The linker to be used is set via env var `LD`. See line 120 of this… | |||||
Not Done Inline ActionsLD_NO_GOLD is just used to speed up some linking phase (ld.gold is slower than 'ld' and 'ld' can be used in some parts of the build without breaking ghc-stage2). Also, our base ld is too old and doesn't work (don't have the error log) so binutils:ld must be used. mikael: LD_NO_GOLD is just used to speed up some linking phase (ld.gold is slower than 'ld' and 'ld'… | |||||
Not Done Inline ActionsIf LD_NO_GOLD just speeds the build up, we can move it out of .if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7? arrowd: If `LD_NO_GOLD` just speeds the build up, we can move it out of `.if ${ARCH} == aarch64 ||… | |||||
Not Done Inline ActionsIt'll add an extra build dependency for amd64/i386: binutils and I'm not sure it's worth it on those arches. mikael: It'll add an extra build dependency for amd64/i386: binutils and I'm not sure it's worth it on… | |||||
Not Done Inline ActionsI don't quite get it. If we already aren't using gold, then setting LD_NO_GOLD should be a no-op, no? arrowd: I don't quite get it. If we already aren't using `gold`, then setting `LD_NO_GOLD` should be a… | |||||
Not Done Inline ActionsMy comment about LD_NO_GOLD is completely wrong, I have mixed up something in my head.... From rules/build-package-way.mk: mikael: My comment about LD_NO_GOLD is completely wrong, I have mixed up something in my head....
From… | |||||
matUnsubmitted Done Inline ActionsThis is probably wrong, it should be using LOCALBASE and not PREFIX. mat: This is probably wrong, it should be using LOCALBASE and not PREFIX. | |||||
${WRKSRC}/aclocal.m4 | |||||
.endif | |||||
.if empty(PORT_OPTIONS:MBOOT) | .if empty(PORT_OPTIONS:MBOOT) | ||||
@${REINPLACE_CMD} -e '/^mandir/d' ${BOOT_DIR}/mk/build.mk | @${REINPLACE_CMD} -e '/^mandir/d' ${BOOT_DIR}/mk/build.mk | ||||
@${REINPLACE_CMD} -e '/^infodir/d' ${BOOT_DIR}/mk/build.mk | @${REINPLACE_CMD} -e '/^infodir/d' ${BOOT_DIR}/mk/build.mk | ||||
@${REINPLACE_CMD} -e '/^docdir/d' ${BOOT_DIR}/mk/build.mk | @${REINPLACE_CMD} -e '/^docdir/d' ${BOOT_DIR}/mk/build.mk | ||||
@${REINPLACE_CMD} -e '/^htmldir/d' ${BOOT_DIR}/mk/build.mk | @${REINPLACE_CMD} -e '/^htmldir/d' ${BOOT_DIR}/mk/build.mk | ||||
.endif | .endif | ||||
pre-configure: apply-slist | pre-configure: apply-slist | ||||
# Copy the subbed build.mk to the proper position | # Copy the subbed build.mk to the proper position | ||||
${CP} ${WRKDIR}/build.mk ${WRKSRC}/mk/build.mk | ${CP} ${WRKDIR}/build.mk ${WRKSRC}/mk/build.mk | ||||
@${MKDIR} ${TMPDIR} | @${MKDIR} ${TMPDIR} | ||||
.if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && \ | .if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && \ | ||||
${OSVERSION} >= 1200031 | ${OSVERSION} >= 1200031 && \ | ||||
${ARCH} != aarch64 && ${ARCH} != armv6 && ${ARCH} != armv7 | |||||
Not Done Inline ActionsThis also relates to ino64. Doesn't it work for ARM? arrowd: This also relates to ino64. Doesn't it work for ARM? | |||||
Not Done Inline ActionsI can build the 'wrap' stuff but it's not needed for arm since the bootstraps binaries is post ino64. mikael: I can build the 'wrap' stuff but it's not needed for arm since the bootstraps binaries is post… | |||||
Not Done Inline ActionsIt can stay, I just making sure there is no hidden problem somewhere. arrowd: It can stay, I just making sure there is no hidden problem somewhere. | |||||
${CC} ${CFLAGS} -c -o ${BOOT_DIR}/wrap.o ${PATCHDIR}/wrap.c | ${CC} ${CFLAGS} -c -o ${BOOT_DIR}/wrap.o ${PATCHDIR}/wrap.c | ||||
for x in ${BOOT_DIR}/rts/dist/build/libCffi*.a; do \ | for x in ${BOOT_DIR}/rts/dist/build/libCffi*.a; do \ | ||||
${AR} q $$x ${BOOT_DIR}/wrap.o; ${RANLIB} $$x; \ | ${AR} q $$x ${BOOT_DIR}/wrap.o; ${RANLIB} $$x; \ | ||||
done | done | ||||
rm ${BOOT_DIR}/wrap.o | rm ${BOOT_DIR}/wrap.o | ||||
.endif # Do not merge, prev condition need to grow OSVER check. | .endif # Do not merge, prev condition need to grow OSVER check. | ||||
.if empty(PORT_OPTIONS:MBOOT) | .if empty(PORT_OPTIONS:MBOOT) | ||||
@(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${CONFIGURE_ARGS_BOOT}) | @(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${CONFIGURE_ARGS_BOOT}) | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |
^missing tab aber =