- 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 <skinnr@bitmessage.ch> [2]
Submitted by:	antoine [3]
Obtained from:	FreeBSD Haskell
This commit is contained in:
Gabor Pali 2014-02-16 10:10:59 +00:00
parent 12de8f1cac
commit 6f9d344bc3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=344511
4 changed files with 19 additions and 7 deletions

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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