svn commit: r344511 - head/lang/ghc

Gabor Pali pgj at FreeBSD.org
Sun Feb 16 10:11:00 UTC 2014


Author: pgj
Date: Sun Feb 16 10:10:59 2014
New Revision: 344511
URL: http://svnweb.freebsd.org/changeset/ports/344511
QAT: https://qat.redports.org/buildarchive/r344511/

Log:
  - 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 at bitmessage.ch> [2]
  Submitted by:	antoine [3]
  Obtained from:	FreeBSD Haskell

Modified:
  head/lang/ghc/Makefile
  head/lang/ghc/bsd.cabal.mk
  head/lang/ghc/bsd.cabal.options.mk
  head/lang/ghc/pkg-plist

Modified: head/lang/ghc/Makefile
==============================================================================
--- head/lang/ghc/Makefile	Sun Feb 16 09:38:19 2014	(r344510)
+++ head/lang/ghc/Makefile	Sun Feb 16 10:10:59 2014	(r344511)
@@ -44,13 +44,14 @@ MAKE_ENV=	LC_ALL=en_US.UTF-8 LANG=en_US.
 # 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

Modified: head/lang/ghc/bsd.cabal.mk
==============================================================================
--- head/lang/ghc/bsd.cabal.mk	Sun Feb 16 09:38:19 2014	(r344510)
+++ head/lang/ghc/bsd.cabal.mk	Sun Feb 16 10:10:59 2014	(r344511)
@@ -86,8 +86,11 @@ CONFIGURE_ARGS+=	--with-gcc=${CC} --with
 			--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)

Modified: head/lang/ghc/bsd.cabal.options.mk
==============================================================================
--- head/lang/ghc/bsd.cabal.options.mk	Sun Feb 16 09:38:19 2014	(r344510)
+++ head/lang/ghc/bsd.cabal.options.mk	Sun Feb 16 10:10:59 2014	(r344511)
@@ -24,12 +24,12 @@ DYNAMIC_DESC?=	Add support for dynamic l
 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

Modified: head/lang/ghc/pkg-plist
==============================================================================
--- head/lang/ghc/pkg-plist	Sun Feb 16 09:38:19 2014	(r344510)
+++ head/lang/ghc/pkg-plist	Sun Feb 16 10:10:59 2014	(r344511)
@@ -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


More information about the svn-ports-all mailing list