From 6f9d344bc3d846afb199bf2c41102d4fb9ab962a Mon Sep 17 00:00:00 2001 From: Gabor Pali Date: Sun, 16 Feb 2014 10:10:59 +0000 Subject: - Fix build with DOCS disabled [1] - Revamp LLVM code generation support [2] - Fix a bug in handling hs- port OPTIONS [3] Reported by: obraun [1], skinnr [2] Submitted by: antoine [3] Obtained from: FreeBSD Haskell --- lang/ghc/Makefile | 11 ++++++++++- lang/ghc/bsd.cabal.mk | 7 +++++-- lang/ghc/bsd.cabal.options.mk | 6 +++--- lang/ghc/pkg-plist | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'lang') diff --git a/lang/ghc/Makefile b/lang/ghc/Makefile index f35555b721c0..74acf1908e22 100644 --- a/lang/ghc/Makefile +++ b/lang/ghc/Makefile @@ -44,13 +44,14 @@ MAKE_ENV= LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 # You can view below. GNU_CONFIGURE= yes -OPTIONS_DEFINE= PROFILE DYNAMIC DOCS +OPTIONS_DEFINE= PROFILE DYNAMIC LLVM DOCS OPTIONS_DEFAULT= PROFILE DYNAMIC DOCS BOOT_DESC= Use installed GHC for bootstrapping BOOTH_DESC= Use installed HsColour for bootstrapping PROFILE_DESC= Add support for performance profiling DYNAMIC_DESC= Add support for dynamic linking +LLVM_DESC= Add support for generating code via LLVM DOCS_DESC= Install HTML documentation LOCALBASE?= /usr/local @@ -131,6 +132,14 @@ CONFIGURE_ARGS+= --with-system-libffi \ --with-ffi-libraries=${LOCALBASE}/lib .endif +.if ${PORT_OPTIONS:MLLVM} +BUILD_DEPENDS+= ${LOCALBASE}/bin/opt32:${PORTSDIR}/devel/llvm32 +RUN_DEPENDS+= ${LOCALBASE}/bin/opt32:${PORTSDIR}/devel/llvm32 + +CONFIGURE_ARGS+= --with-opt=${LOCALBASE}/bin/opt32 \ + --with-llc=${LOCALBASE}/bin/llc32 +.endif + .if empty(PORT_OPTIONS:MBOOT) BOOT_DIR= ${WRKDIR}/ghc-${BOOT_GHC_VERSION}-boot diff --git a/lang/ghc/bsd.cabal.mk b/lang/ghc/bsd.cabal.mk index 49b39b4dfb3b..115b21d20638 100644 --- a/lang/ghc/bsd.cabal.mk +++ b/lang/ghc/bsd.cabal.mk @@ -86,8 +86,11 @@ CONFIGURE_ARGS+= --with-gcc=${CC} --with-ld=${LD} --with-ar=${AR} \ --with-ranlib=${RANLIB} .if ${PORT_OPTIONS:MLLVM} -BUILD_DEPENDS+= llvm>=3.0:${PORTSDIR}/devel/llvm -CONFIGURE_ARGS+= --ghc-option=-fllvm +CONFIGURE_ARGS+= --ghc-option=-fllvm \ + --ghc-option=-pgmlo --ghc-option=${LOCALBASE}/bin/opt32 \ + --ghc-option=-pgmlc --ghc-option=${LOCALBASE}/bin/llc32 + +BUILD_DEPENDS+= ${LOCALBASE}/bin/opt32:${PORTSDIR}/devel/llvm32 .endif .if defined(USE_ALEX) diff --git a/lang/ghc/bsd.cabal.options.mk b/lang/ghc/bsd.cabal.options.mk index 0e339f0f612e..087ae340b477 100644 --- a/lang/ghc/bsd.cabal.options.mk +++ b/lang/ghc/bsd.cabal.options.mk @@ -24,12 +24,12 @@ DYNAMIC_DESC?= Add support for dynamic linking PROFILE_DESC?= Add support for profiling LLVM_DESC?= Use the LLVM backend for code generation -.if !exists(${GHC_CMD}) || (exists(${LOCALBASE}/lib/ghc-${GHC_VERSION}/ghc-${GHC_VERSION}/GHC.dyn_hi) && !defined(IGNORE_DYNAMIC)) +.if (!exists(${GHC_CMD}) || exists(${LOCALBASE}/lib/ghc-${GHC_VERSION}/ghc-${GHC_VERSION}/GHC.dyn_hi)) && !defined(IGNORE_DYNAMIC) OPTIONS_DEFINE+= DYNAMIC OPTIONS_DEFAULT+= DYNAMIC .endif -.if !exists(${GHC_CMD}) || (exists(${LOCALBASE}/lib/ghc-${GHC_VERSION}/ghc-${GHC_VERSION}/GHC.p_hi) && !defined(IGNORE_PROFILE)) +.if (!exists(${GHC_CMD}) || exists(${LOCALBASE}/lib/ghc-${GHC_VERSION}/ghc-${GHC_VERSION}/GHC.p_hi)) && !defined(IGNORE_PROFILE) OPTIONS_DEFINE+= PROFILE .endif @@ -37,7 +37,7 @@ OPTIONS_DEFINE+= PROFILE OPTIONS_DEFINE+= LLVM .endif -.if !exists(${GHC_CMD}) || ((exists(${HADDOCK_CMD}) && exists(${LOCALBASE}/lib/ghc-${GHC_VERSION}/html)) && !defined(NOPORTDOCS)) +.if (!exists(${GHC_CMD}) || (exists(${HADDOCK_CMD}) && exists(${LOCALBASE}/lib/ghc-${GHC_VERSION}/html))) && !defined(NOPORTDOCS) OPTIONS_DEFINE+= DOCS OPTIONS_DEFAULT+= DOCS HADDOCK_AVAILABLE= yes diff --git a/lang/ghc/pkg-plist b/lang/ghc/pkg-plist index ed7e8b3f54be..601fe49d83d6 100644 --- a/lang/ghc/pkg-plist +++ b/lang/ghc/pkg-plist @@ -11,7 +11,7 @@ bin/ghci-%%GHC_VERSION%% bin/ghc-pkg-%%GHC_VERSION%% bin/haddock-ghc-%%GHC_VERSION%% bin/runghc-%%GHC_VERSION%% -man/man1/ghc.1.gz +%%PORTDOCS%%man/man1/ghc.1.gz @exec /bin/ln -sf %D/bin/haddock-ghc-%%GHC_VERSION%% %D/bin/haddock || return true @unexec /bin/rm -f %D/bin/haddock || return true @exec /bin/mkdir -p %D/lib/cabal/ghc-%%GHC_VERSION%% || return true -- cgit v1.2.3