Changeset View
Changeset View
Standalone View
Standalone View
lang/ghc/bsd.ghc.mk
# $FreeBSD$ | # $FreeBSD$ | ||||
# | # | ||||
# bsd.ghc.mk -- Common code for various versions of GHC ports. | # bsd.ghc.mk -- Common code for various versions of GHC ports. | ||||
# | # | ||||
# Maintained by: haskell@FreeBSD.org | # Maintained by: haskell@FreeBSD.org | ||||
# | # | ||||
ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 | |||||
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} | ||||
LIB_DEPENDS+= libgmp.so:math/gmp | |||||
USES= autoreconf gmake iconv:translit localbase:ldflags ncurses perl5 tar:xz | USES= autoreconf gmake iconv:translit localbase:ldflags ncurses perl5 tar:xz | ||||
USE_LOCALE= en_US.UTF-8 | USE_LOCALE= en_US.UTF-8 | ||||
USE_PERL5= build | USE_PERL5= build | ||||
NO_CCACHE= ccache: error: Failed to create directory /nonexistent/.ccache/tmp: Permission denied | NO_CCACHE= ccache: error: Failed to create directory /nonexistent/.ccache/tmp: Permission denied | ||||
# The configure process accepts,filters and canonicalises | # The configure process accepts,filters and canonicalises | ||||
# the CONFIGURE_TARGET variable. You can read the files | # the CONFIGURE_TARGET variable. You can read the files | ||||
# ${WRKSRC}/configure and ${WRKSRC}/config.sub. | # ${WRKSRC}/configure and ${WRKSRC}/config.sub. | ||||
# This is better fixed in files/build.mk.in | # This is better fixed in files/build.mk.in | ||||
GNU_CONFIGURE= yes | GNU_CONFIGURE= yes | ||||
CONFIGURE_ARGS= --with-gmp-includes=${LOCALBASE}/include \ | CONFIGURE_ARGS= --with-iconv-includes=${LOCALBASE}/include \ | ||||
--with-gmp-libraries=${LOCALBASE}/lib \ | |||||
--with-iconv-includes=${LOCALBASE}/include \ | |||||
--with-iconv-libraries=${LOCALBASE}/lib | --with-iconv-libraries=${LOCALBASE}/lib | ||||
# Turn off for a while, see PR 228727 | |||||
CONFIGURE_ARGS+= --enable-dtrace=0 | |||||
SUB_FILES= build.mk \ | SUB_FILES= build.mk | ||||
build.boot.mk | |||||
SUB_LIST= GHC_VERSION=${GHC_VERSION} \ | SUB_LIST= GHC_VERSION=${GHC_VERSION} \ | ||||
NCURSESINC="${NCURSESBASE}/include" NCURSESLIB="${NCURSESLIB}" \ | NCURSESINC="${NCURSESBASE}/include" NCURSESLIB="${NCURSESLIB}" \ | ||||
CFLAGS="${CFLAGS}" | CFLAGS="${CFLAGS}" | ||||
OPTIONS_GROUP= BOOTSTRAP | OPTIONS_GROUP= BOOTSTRAP | ||||
BOOTSTRAP_DESC= Bootsrap using installed ghc | BOOTSTRAP_DESC= Bootsrap using installed ghc | ||||
OPTIONS_GROUP_BOOTSTRAP=BOOT | OPTIONS_GROUP_BOOTSTRAP=BOOT | ||||
OPTIONS_DEFINE= DYNAMIC PROFILE DOCS | OPTIONS_DEFINE= DYNAMIC GMP PROFILE DOCS | ||||
OPTIONS_SUB= yes | OPTIONS_SUB= yes | ||||
OPTIONS_DEFAULT= PROFILE DYNAMIC | OPTIONS_DEFAULT= DYNAMIC PROFILE GMP | ||||
mikael: This issue is fixed with 8.4.3 on aarch64 and armv6/7 | |||||
# ghci segfaults on arm when dynamic linking is used | |||||
OPTIONS_EXCLUDE_armv6= DYNAMIC | |||||
OPTIONS_EXCLUDE_armv7= DYNAMIC | |||||
OPTIONS_EXCLUDE_aarch64= DYNAMIC | |||||
BOOT_DESC= Use installed GHC for bootstrapping | BOOT_DESC= Use installed GHC for bootstrapping | ||||
PROFILE_DESC= Add support for performance profiling | |||||
DYNAMIC_DESC= Add support for dynamic linking | |||||
DOCS_DESC= Install HTML documentation | DOCS_DESC= Install HTML documentation | ||||
DYNAMIC_DESC= Add support for dynamic linking | |||||
GMP_DESC= Use GNU Multi-precision Library for big integers support | |||||
PROFILE_DESC= Add support for performance profiling | |||||
DYNAMIC_CONFIGURE_ARGS= --with-system-libffi \ | DOCS_BUILD_DEPENDS+= sphinx-build:textproc/py-sphinx | ||||
--with-ffi-includes=${LOCALBASE}/include \ | |||||
--with-ffi-libraries=${LOCALBASE}/lib | DYNAMIC_CONFIGURE_WITH= system-libffi \ | ||||
ffi-includes=${LOCALBASE}/include \ | |||||
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 | ||||
GMP_CONFIGURE_WITH= gmp-includes=${LOCALBASE}/include \ | |||||
gmp-libraries=${LOCALBASE}/lib | |||||
GMP_LIB_DEPENDS= libgmp.so:math/gmp | |||||
# Append substitutions for build.mk | # Append substitutions for build.mk | ||||
BOOT_SUB_LIST= HSC2HS=${LOCALBASE}/bin/hsc2hs | BOOT_SUB_LIST= HSC2HS=${LOCALBASE}/bin/hsc2hs | ||||
BOOT_SUB_LIST_OFF= HSC2HS=${BOOT_HSC2HS} | BOOT_SUB_LIST_OFF= HSC2HS=${BOOT_HSC2HS} | ||||
DOCS_BUILD_DEPENDS+= sphinx-build:textproc/py-sphinx | DOCS_SUB_LIST= WITH_DOCS="YES" | ||||
DOCS_SUB_LIST_OFF= WITH_DOCS="NO" | |||||
DYNAMIC_SUB_LIST= WITH_DYNAMIC="YES" | DYNAMIC_SUB_LIST= WITH_DYNAMIC="YES" | ||||
DYNAMIC_SUB_LIST_OFF= WITH_DYNAMIC="NO" | DYNAMIC_SUB_LIST_OFF= WITH_DYNAMIC="NO" | ||||
GMP_SUB_LIST= INTEGER_LIBRARY="integer-gmp" | |||||
GMP_SUB_LIST_OFF= INTEGER_LIBRARY="integer-simple" | |||||
PROFILE_SUB_LIST= WITH_PROFILE="YES" | PROFILE_SUB_LIST= WITH_PROFILE="YES" | ||||
PROFILE_SUB_LIST_OFF= WITH_PROFILE="NO" | PROFILE_SUB_LIST_OFF= WITH_PROFILE="NO" | ||||
DOCS_SUB_LIST= WITH_DOCS="YES" | |||||
DOCS_SUB_LIST_OFF= WITH_DOCS="NO" | |||||
LOCALBASE?= /usr/local | LOCALBASE?= /usr/local | ||||
GHC_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/} | |||||
.include <bsd.port.options.mk> | .include <bsd.port.options.mk> | ||||
.if empty(PORT_OPTIONS:MBOOT) | .if empty(PORT_OPTIONS:MBOOT) | ||||
. if ${ARCH} == armv6 || ${ARCH} == armv7 | |||||
BOOT_GHC_VERSION= 8.4.2 | BOOT_GHC_VERSION= 8.4.2 | ||||
. else | |||||
BOOT_GHC_VERSION= 8.4.3 | |||||
. endif | |||||
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 | .if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 | ||||
# CONFIGURE_TARGET must to be the same as the llvm triple | # CONFIGURE_TARGET must to be the same as the llvm triple | ||||
CONFIGURE_TARGET= ${ARCH}-unknown-freebsd${"${ARCH:Maarch64}" != "":?:-gnueabihf} | CONFIGURE_TARGET= ${ARCH}-unknown-freebsd${"${ARCH:Maarch64}" != "":?:-gnueabihf} | ||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-aclocal.m4 | EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-aclocal.m4 | ||||
BUILD_DEPENDS+= ld.gold:devel/binutils \ | BUILD_DEPENDS+= ld.gold:devel/binutils \ | ||||
llc${LLVM_VERSION}:devel/llvm${LLVM_VERSION} | llc${LLVM_VERSION}:devel/llvm${LLVM_VERSION} | ||||
RUN_DEPENDS+= ld.gold:devel/binutils \ | RUN_DEPENDS+= ld.gold:devel/binutils \ | ||||
llc${LLVM_VERSION}:devel/llvm${LLVM_VERSION} | llc${LLVM_VERSION}:devel/llvm${LLVM_VERSION} | ||||
USE_GCC= yes | USE_GCC= yes | ||||
. if ${OSVERSION} < 1200064 | . if ${OSVERSION} < 1200064 | ||||
IGNORE= lang/ghc on ARM requires at least __FreeBSD_version 1200064 | IGNORE= lang/ghc on ARM requires at least __FreeBSD_version 1200064 | ||||
. endif | . endif | ||||
. ifdef QEMU_EMULATING | . ifdef QEMU_EMULATING | ||||
IGNORE= qemu-user-static isn't able to build lang/ghc, but it builds fine on a real hardware | IGNORE= qemu-user-static isn't able to build lang/ghc, but it builds fine on a real hardware | ||||
. endif | . endif | ||||
.endif | .endif | ||||
# Turn off for a while, see PR 228727 | |||||
CONFIGURE_ARGS+= --enable-dtrace=0 | |||||
.if ${OSVERSION} < 1200000 | |||||
USE_GCC= yes | |||||
.else | |||||
. if !exists(/usr/bin/ld.bfd) | |||||
USE_BINUTILS= yes | |||||
. endif | |||||
LD= ld.bfd | |||||
.endif | |||||
CONFIGURE_ENV+= CC=${CC} LD=${LD} | CONFIGURE_ENV+= CC=${CC} LD=${LD} | ||||
DOCSDIR= ${PREFIX}/share/doc/${DISTNAME} | DOCSDIR= ${PREFIX}/share/doc/${DISTNAME} | ||||
GHC_LIBDIR= ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION} | GHC_LIBDIR= ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION} | ||||
GHC_LIBDIR_REL= lib/ghc-${GHC_VERSION} | GHC_LIBDIR_REL= lib/ghc-${GHC_VERSION} | ||||
PLIST_SUB+= GHC_VERSION=${GHC_VERSION} GHC_LIBDIR=${GHC_LIBDIR_REL} | PLIST_SUB+= GHC_VERSION=${GHC_VERSION} GHC_LIBDIR=${GHC_LIBDIR_REL} | ||||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | |||||
.endif | .endif | ||||
(for f in ${_EXECUTABLES} $$(${FIND} ${GHC_LIBDIR} -name '*.so*'); do \ | (for f in ${_EXECUTABLES} $$(${FIND} ${GHC_LIBDIR} -name '*.so*'); do \ | ||||
${STRIP_CMD} $$f; done) | ${STRIP_CMD} $$f; done) | ||||
# Create a bootstrap compiler tar ball: run this in an interactive poudriere jail | # Create a bootstrap compiler tar ball: run this in an interactive poudriere jail | ||||
.PHONY: create-bootstrap | .PHONY: create-bootstrap | ||||
create-bootstrap: | create-bootstrap: | ||||
cd ${WRKSRC} \ | cd ${WRKSRC} \ | ||||
&& ${ECHO} "BIN_DIST_NAME=ghc-${GHC_VERSION}-boot" >> mk/build.mk \ | |||||
&& ${ECHO} "BIN_DIST_TAR=ghc-${GHC_VERSION}-boot.tar" >> mk/build.mk \ | |||||
&& gmake binary-dist TAR_COMP=xz \ | && gmake binary-dist TAR_COMP=xz \ | ||||
&& mv ${WRKSRC}/ghc-${GHC_VERSION}-${ARCH}-portbld-freebsd.tar.xz /tmp/ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz | && ${MV} ${WRKSRC}/ghc-${GHC_VERSION}-boot-${GHC_ARCH}-portbld-freebsd.tar.xz /tmp/ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz | ||||
Not Done Inline ActionsCan we use ${WRKSRC}/ghc-${GHC_VERSION}-${CONFIGURE_TARGET:S/${OSREL}//}.tar.xz instead? I used the llvm triple and not the 'portbld' thing on arm :/ mikael: Can we use ${WRKSRC}/ghc-${GHC_VERSION}-${CONFIGURE_TARGET:S/${OSREL}//}.tar.xz instead? I used… | |||||
Done Inline Actions
What does that mean? You didn't use the port to build the bootstrap? arrowd: > I used the llvm triple
What does that mean? You didn't use the port to build the bootstrap? | |||||
&& sha256 ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz | |||||
&& stat -f %z ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz | cd /tmp \ | ||||
&& sha256 ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz \ | |||||
&& ${ECHO} -n "SIZE (ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz) = " \ | |||||
&& ${STAT} -f %z ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz |
This issue is fixed with 8.4.3 on aarch64 and armv6/7