summaryrefslogtreecommitdiff
path: root/lang/ghc/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lang/ghc/Makefile')
-rw-r--r--lang/ghc/Makefile40
1 files changed, 19 insertions, 21 deletions
diff --git a/lang/ghc/Makefile b/lang/ghc/Makefile
index 88cf3f8c2f3f..604c8605d1a3 100644
--- a/lang/ghc/Makefile
+++ b/lang/ghc/Makefile
@@ -55,12 +55,11 @@ PDFDOCS_BUILD_DEPENDS= xelatex:print/tex-xetex \
${LOCALBASE}/share/fonts/dejavu/DejaVuSans.ttf:x11-fonts/dejavu
PDFDOCS_VARS= hadrian_docs_arg=
-DYNAMIC_CONFIGURE_WITH= system-libffi \
- ffi-includes=${LOCALBASE}/include \
- ffi-libraries=${LOCALBASE}/lib
+DYNAMIC_CONFIGURE_WITH= system-libffi
+DYNAMIC_CONFIGURE_ON= --with-ffi-includes=${LOCALBASE}/include \
+ --with-ffi-libraries=${LOCALBASE}/lib
DYNAMIC_LIB_DEPENDS= libffi.so:devel/libffi
-DYNAMIC_VARS= hadrian_setting_dynamic=True
-DYNAMIC_VARS_OFF= hadrian_setting_dynamic=False
+DYNAMIC_OFF_FLAVOUR?= +no_dynamic_ghc+fully_static
# do not replace this with GMP_CONFIGURE_WITH
# it adds "--without-gmp-*" when the option is OFF, which results in "no" value
@@ -70,8 +69,7 @@ GMP_CONFIGURE_ON= --with-gmp-includes=${LOCALBASE}/include \
GMP_LIB_DEPENDS= libgmp.so:math/gmp
GMP_VARS_OFF= hadrian_gmp_arg=--bignum=native
-PROFILE_VARS= hadrian_setting_profile=True
-PROFILE_VARS_OFF= hadrian_setting_profile=False
+PROFILE_OFF_FLAVOUR= +no_profiled_libs
GHC_VERSION?= 9.8.4
LLVM_VERSION?= 15
@@ -114,18 +112,23 @@ HADRIAN_PLAN= ${MASTERDIR}/files/plan-bootstrap-${BOOT_GHC_VERSION:C/\./_/g}.js
PLIST_SUB+= GMP=
.endif
-LIB_DEPENDS+= libffi.so:devel/libffi
-.undef DYNAMIC_CONFIGURE_WITH
-CONFIGURE_ARGS+= --with-system-libffi --with-ffi-includes=${LOCALBASE}/include --with-ffi-libraries=${LOCALBASE}/lib
-HADRIAN_CMD= ${WRKSRC}/hadrian/bootstrap/_build/bin/hadrian ${HADRIAN_DOCS_ARG} ${HADRIAN_GMP_ARG}
-DO_MAKE_BUILD= ${SETENVI} ${WRK_ENV} ${HADRIAN_CMD} ${_MAKE_JOBS} --flavour=ports
+HADRIAN_FLAVOUR_ARG= --flavour=default
+.if !${PORT_OPTIONS:MDYNAMIC}
+HADRIAN_FLAVOUR_ARG:= ${HADRIAN_FLAVOUR_ARG}${DYNAMIC_OFF_FLAVOUR}
+.endif
+.if !${PORT_OPTIONS:MPROFILE}
+HADRIAN_FLAVOUR_ARG:= ${HADRIAN_FLAVOUR_ARG}${PROFILE_OFF_FLAVOUR}
+.endif
+
+HADRIAN_CMD= ${WRKSRC}/hadrian/bootstrap/_build/bin/hadrian \
+ ${HADRIAN_DOCS_ARG} \
+ ${HADRIAN_GMP_ARG} \
+ ${HADRIAN_FLAVOUR_ARG}
+
+DO_MAKE_BUILD= ${SETENVI} ${WRK_ENV} ${HADRIAN_CMD} ${_MAKE_JOBS}
ALL_TARGET= binary-dist-dir
INSTALL_WRKSRC= ${WRKSRC}/_build/bindist/ghc-${GHC_VERSION}-${CONFIGURE_TARGET}
-.if ! ${PORT_OPTIONS:MDYNAMIC} || !${PORT_OPTIONS:MPROFILE}
-IGNORE= Building with Hadrian requires both DYNAMIC and PROFILE for now
-.endif
-
GHC_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/}
BOOT_DIR= ${WRKDIR}/ghc-${BOOT_GHC_VERSION}-${CONFIGURE_TARGET}
BOOT_INSTALL_DIR= ${WRKDIR}/ghc-boot-install
@@ -147,11 +150,6 @@ CONFIGURE_TARGET= ${ARCH}-unknown-freebsd${"${ARCH:Maarch64}" != "":?:-gnueabihf
CONFIGURE_ARGS+= --host=${CONFIGURE_TARGET}
.endif
-post-patch:
- ${SED} -e 's|%%DYNAMIC%%|${HADRIAN_SETTING_DYNAMIC}|' \
- -e 's|%%PROFILE%%|${HADRIAN_SETTING_PROFILE}|' \
- ${PATCHDIR}/UserSettings.hs > ${WRKSRC}/hadrian/src/UserSettings.hs
-
pre-configure:
# Call the bootstrap script
cd ${WRKSRC} && ${BOOT_SCRIPT}