aboutsummaryrefslogtreecommitdiffstats
path: root/lang/ghc
diff options
context:
space:
mode:
authorpgj <pgj@FreeBSD.org>2013-02-06 06:26:31 +0800
committerpgj <pgj@FreeBSD.org>2013-02-06 06:26:31 +0800
commit89e80c9d9a740b177df836e3e8afcb075ac40dd1 (patch)
tree23d3f49a5183d8fbc5324dad9a1ae399f457b1d7 /lang/ghc
parent624202a6ea91dc9c37f79fc34e43f38fc32fbf13 (diff)
downloadfreebsd-ports-gnome-89e80c9d9a740b177df836e3e8afcb075ac40dd1.tar.gz
freebsd-ports-gnome-89e80c9d9a740b177df836e3e8afcb075ac40dd1.tar.zst
freebsd-ports-gnome-89e80c9d9a740b177df836e3e8afcb075ac40dd1.zip
- Fix breakage in the DYNAMIC-enabled ports triggered by the recent
devel/libffi update - Enable multithreaded build for lang/ghc (i.e. mark MAKE_JOBS_SAFE) Please note that port revision for all the Haskell ports without version changes are bumped. New ports (20): devel/hs-MonadRandom 0.1.8 devel/hs-base64-conduit 0.5.1 devel/hs-bifunctors 3.2 devel/hs-either 3.1 devel/hs-errors 1.3.1 devel/hs-generic-deriving 1.4.0 devel/hs-lens 3.8.5 devel/hs-profunctor-extras 3.3 devel/hs-profunctors 3.2 devel/hs-reflection 1.1.6 devel/hs-timezone-olson 0.1.2 devel/hs-timezone-series 0.1.2 math/hs-comonads-fd 3.0.1 math/hs-groupoids 3.0.1.1 math/hs-nats 0.1 math/hs-semigroupoid-extras 3.0.1 security/hs-cipher-rc4 0.1.2 security/hs-crypto-numbers 0.1.3 security/hs-crypto-pubkey 0.1.2 security/hs-crypto-random-api 0.2.0 Updated ports (107): archivers/hs-zip-archive 0.1.2.1 --> 0.1.3.3 archivers/hs-zlib-bindings 0.1.1.2 --> 0.1.1.3 audio/hs-libmpd 0.8.0.1 --> 0.8.0.2 benchmarks/hs-criterion 0.6.2.0 --> 0.6.2.1 converters/hs-aeson 0.6.0.2_2 --> 0.6.1.0 converters/hs-dataenc 0.14.0.4 --> 0.14.0.5 databases/hs-persistent 1.0.2.2 --> 1.1.4 databases/hs-persistent-sqlite 1.0.1 --> 1.1.2 databases/hs-persistent-template 1.0.0.2 --> 1.1.2.1 devel/hs-BNFC 2.4.2.1_1 --> 2.6.0.3 devel/hs-Boolean 0.1.1 --> 0.1.2 devel/hs-TypeCompose 0.9.7 --> 0.9.9 devel/hs-ansi-terminal 0.5.5_5 --> 0.5.5.1 devel/hs-ansi-wl-pprint 0.6.4_3 --> 0.6.6 devel/hs-basic-prelude 0.3.1.0 --> 0.3.2.0 devel/hs-checkers 0.2.9_2 --> 0.3.1 devel/hs-classy-prelude 0.4.1 --> 0.4.3 devel/hs-classy-prelude-conduit 0.4.1 --> 0.4.3 devel/hs-conduit 0.5.5 --> 0.5.6 devel/hs-configurator 0.2.0.1 --> 0.2.0.2 devel/hs-cpphs 1.15 --> 1.16 devel/hs-edit-distance 0.2.1.1 --> 0.2.1.2 devel/hs-file-embed 0.0.4.6 --> 0.0.4.7 devel/hs-filestore 0.5.0.1 --> 0.6 devel/hs-fsnotify 0.0.4 --> 0.0.6 devel/hs-ghc-paths 0.1.0.8_5 --> 0.1.0.9 devel/hs-git-annex 3.20121211 --> 3.20130124 devel/hs-hashable 1.1.2.5 --> 1.2.0.5 devel/hs-hastache 0.4.2 --> 0.5.0 devel/hs-hlint 1.8.39 --> 1.8.43 devel/hs-hoogle 4.2.14 --> 4.2.15 devel/hs-hspec 1.4.2 --> 1.4.3 devel/hs-largeword 1.0.3 --> 1.0.4 devel/hs-lifted-base 0.2 --> 0.2.0.2 devel/hs-monad-logger 0.2.3 --> 0.2.3.2 devel/hs-optparse-applicative 0.4.2 --> 0.5.2.1 devel/hs-pool-conduit 0.1.0.3 --> 0.1.1 devel/hs-project-template 0.1.0.1 --> 0.1.1 devel/hs-silently 1.2.4 --> 1.2.4.1 devel/hs-smallcheck 0.6.1_2 --> 0.6.2 devel/hs-system-fileio 0.3.10 --> 0.3.11 devel/hs-unix-compat 0.4.0.0 --> 0.4.1.0 devel/hs-unordered-containers 0.2.2.1 --> 0.2.3.0 devel/hs-vault 0.2.0.1 --> 0.2.0.4 devel/hs-void 0.5.8 --> 0.5.11 devel/hs-word8 0.0.2 --> 0.0.3 mail/hs-mime-types 0.1.0.0 --> 0.1.0.2 math/hs-categories 1.0.4 --> 1.0.5 math/hs-comonad 3.0.0.2 --> 3.0.1.1 math/hs-comonad-transformers 3.0 --> 3.0.1 math/hs-distributive 0.2.2_2 --> 0.3 math/hs-pointed 3.0.1 --> 3.0.2 math/hs-semigroupoids 3.0.0.1 --> 3.0.2 math/hs-semigroups 0.8.4.1 --> 0.9 net/hs-network-conduit 0.6.1.1 --> 0.6.2.2 net/hs-simple-sendfile 0.2.8 --> 0.2.10 print/hs-hscolour 1.20.3,1 --> 1.20.3_1,1 security/hs-certificate 1.3.3 --> 1.3.5 security/hs-cipher-aes 0.1.5 --> 0.1.7 security/hs-clientsession 0.8.0.1 --> 0.8.1 security/hs-cprng-aes 0.2.4 --> 0.3.4 security/hs-crypto-conduit 0.4.1 --> 0.4.3 security/hs-cryptocipher 0.3.6 --> 0.4.0 security/hs-cryptohash 0.7.9 --> 0.8.3 security/hs-pem 0.1.1_2 --> 0.1.2 security/hs-skein 0.1.0.10 --> 0.1.0.11 security/hs-tls 1.0.2 --> 1.1.1 security/hs-tls-extra 0.5.0 --> 0.6.1 sysutils/hs-angel 0.3.3 --> 0.3.4 textproc/hs-Diff 0.1.3_3 --> 0.2.0 textproc/hs-attoparsec 0.10.2.0_2 --> 0.10.3.0 textproc/hs-blaze-html 0.5.1.1 --> 0.5.1.3 textproc/hs-blaze-markup 0.5.1.2 --> 0.5.1.4 textproc/hs-case-insensitive 0.4.0.3 --> 0.4.0.4 textproc/hs-citeproc-hs 0.3.6 --> 0.3.7 textproc/hs-double-conversion 0.2.0.5 --> 0.2.0.6 textproc/hs-highlighting-kate 0.5.3.3 --> 0.5.3.5 textproc/hs-hs-bibutils 4.15 --> 4.16 textproc/hs-regex-pcre-builtin 0.94.4.3.8.31 --> 0.94.4.5.8.31 textproc/hs-texmath 0.6.1.1 --> 0.6.1.3 textproc/hs-yaml 0.8.1.1 --> 0.8.2 www/hs-gitit 0.10.0.2 --> 0.10.1.2 www/hs-hamlet 1.1.1.1 --> 1.1.3.1 www/hs-heist 0.8.2 --> 0.11.0 www/hs-hjsmin 0.1.3 --> 0.1.4 www/hs-http-conduit 1.8.4.3 --> 1.8.7 www/hs-http-date 0.0.3 --> 0.0.4 www/hs-http-reverse-proxy 0.1.0.6 --> 0.1.1.1 www/hs-shakespeare-js 1.1.0 --> 1.1.1 www/hs-snap 0.9.2.2 --> 0.11.0 www/hs-wai-app-static 1.3.0.4 --> 1.3.1_1 www/hs-wai-extra 1.3.0.4 --> 1.3.2 www/hs-warp 1.3.5 --> 1.3.7.1 www/hs-xss-sanitize 0.3.2_2 --> 0.3.3 www/hs-yesod 1.1.4.1 --> 1.1.7.2 www/hs-yesod-auth 1.1.2 --> 1.1.3 www/hs-yesod-core 1.1.6.1 --> 1.1.7.1 www/hs-yesod-default 1.1.2 --> 1.1.3 www/hs-yesod-form 1.2.0.1 --> 1.2.0.2 www/hs-yesod-persistent 1.1.0 --> 1.1.0.1 www/hs-yesod-platform 1.1.5 --> 1.1.7.2 www/hs-yesod-static 1.1.1.1 --> 1.1.1.2 www/hs-yesod-test 0.3.1.1 --> 0.3.3 x11-wm/hs-xmonad 0.10_4 --> 0.11 x11-wm/hs-xmonad-contrib 0.10_4 --> 0.11 x11/hs-X11 1.5.0.1_3 --> 1.6.0.2 x11/hs-xmobar 0.14_3 --> 0.16 Obtained from: FreeBSD Haskell
Diffstat (limited to 'lang/ghc')
-rw-r--r--lang/ghc/Makefile14
-rw-r--r--lang/ghc/bsd.cabal.mk4
-rw-r--r--lang/ghc/bsd.hackage.mk20
-rw-r--r--lang/ghc/files/patch-aclocal.m447
-rw-r--r--lang/ghc/files/patch-configure103
-rw-r--r--lang/ghc/files/patch-configure.ac70
-rw-r--r--lang/ghc/files/patch-ghc.mk32
-rw-r--r--lang/ghc/files/patch-mk-config.mk.in15
-rw-r--r--lang/ghc/files/patch-rts-ghc.mk104
-rw-r--r--lang/ghc/files/patch-rts_package.conf.in29
10 files changed, 313 insertions, 125 deletions
diff --git a/lang/ghc/Makefile b/lang/ghc/Makefile
index 6a3c01ede6ea..502c08e9dfaa 100644
--- a/lang/ghc/Makefile
+++ b/lang/ghc/Makefile
@@ -3,6 +3,7 @@
PORTNAME= ghc
PORTVERSION= 7.4.2
+PORTREVISION= 1
CATEGORIES= lang haskell
MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \
${MASTER_SITE_LOCAL:S/$/:boot/}
@@ -26,6 +27,7 @@ CONFLICTS= ghc-6.8.* ghc-6.10.* ghc-6.12.* ghc-7.0.* ghc-7.2.*
USE_BZIP2= yes
LIB_DEPENDS+= gmp.10:${PORTSDIR}/math/gmp
+USE_AUTOTOOLS= autoconf autoheader
USE_PERL5_BUILD= yes
USE_GMAKE= yes
USE_ICONV= yes
@@ -36,6 +38,7 @@ USE_NCURSES= yes
LICENSE= BSD
LICENSE_FILE= ${WRKSRC}/LICENSE
+MAKE_JOBS_SAFE= yes
MAKE_ENV= LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
# The configure process accepts,filters and canonicalises
@@ -66,6 +69,10 @@ OPTIONS_DEFINE+= BOOTH
.include <bsd.port.options.mk>
+.if ${PORT_OPTIONS:MDYNAMIC}
+LIB_DEPENDS+= ffi.6:${PORTSDIR}/devel/libffi
+.endif
+
.if empty(PORT_OPTIONS:MBOOT)
EXTRA_PATCHES= ${PATCHDIR}/nopatch-.._ghc-${BOOT_GHC_VERSION}-boot_rts_package.conf.in
@@ -108,11 +115,18 @@ HACKAGE_SITE?= http://hackage.haskell.org/
HACKAGE_ARCH?= packages/archive/
CONFIGURE_ARGS= --with-gcc=${CC} \
+ --with-ld=${LD} \
--with-gmp-includes=${LOCALBASE}/include \
--with-gmp-libraries=${LOCALBASE}/lib \
--with-iconv-includes=${LOCALBASE}/include \
--with-iconv-libraries=${LOCALBASE}/lib
+.if ${PORT_OPTIONS:MDYNAMIC}
+CONFIGURE_ARGS+= --with-system-libffi \
+ --with-ffi-includes=${LOCALBASE}/include \
+ --with-ffi-libraries=${LOCALBASE}/lib
+.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 55efc4943188..107dda7a3b31 100644
--- a/lang/ghc/bsd.cabal.mk
+++ b/lang/ghc/bsd.cabal.mk
@@ -80,10 +80,6 @@ BUILD_DEPENDS+= ghc>=${GHC_VERSION}:${PORTSDIR}/lang/ghc
USE_BINUTILS= yes
USE_GCC= 4.6+
-.if ${PORT_OPTIONS:MDYNAMIC}
-LIB_DEPENDS+= ffi:${PORTSDIR}/devel/libffi
-.endif
-
CONFIGURE_ARGS+= --with-gcc=${CC} --with-ld=${LD} --with-ar=${AR} \
--with-ranlib=${RANLIB}
diff --git a/lang/ghc/bsd.hackage.mk b/lang/ghc/bsd.hackage.mk
index 4e5a4ab72fee..749258a2e05b 100644
--- a/lang/ghc/bsd.hackage.mk
+++ b/lang/ghc/bsd.hackage.mk
@@ -34,7 +34,9 @@ authenticate_port= www/hs-authenticate
base-unicode-symbols_port= devel/hs-base-unicode-symbols
base16-bytestring_port= devel/hs-base16-bytestring
base64-bytestring_port= devel/hs-base64-bytestring
+base64-conduit_port= devel/hs-base64-conduit
basic-prelude_port= devel/hs-basic-prelude
+bifunctors_port= devel/hs-bifunctors
bio_port= science/hs-bio
bits-atomic_port= devel/hs-bits-atomic
blaze-builder_port= devel/hs-blaze-builder
@@ -61,6 +63,7 @@ certificate_port= security/hs-certificate
cgi_port= www/hs-cgi
checkers_port= devel/hs-checkers
cipher-aes_port= security/hs-cipher-aes
+cipher-rc4_port= security/hs-cipher-rc4
citeproc-hs_port= textproc/hs-citeproc-hs
classy-prelude_port= devel/hs-classy-prelude
classy-prelude-conduit_port= devel/hs-classy-prelude-conduit
@@ -68,6 +71,7 @@ clientsession_port= security/hs-clientsession
cmdargs_port= devel/hs-cmdargs
comonad_port= math/hs-comonad
comonad-transformers_port= math/hs-comonad-transformers
+comonads-fd_port= math/hs-comonads-fd
conduit_port= devel/hs-conduit
ConfigFile_port= devel/hs-ConfigFile
configurator_port= devel/hs-configurator
@@ -81,7 +85,10 @@ criterion_port= benchmarks/hs-criterion
Crypto_port= security/hs-Crypto
crypto-api_port= security/hs-crypto-api
crypto-conduit_port= security/hs-crypto-conduit
+crypto-numbers_port= security/hs-crypto-numbers
+crypto-pubkey_port= security/hs-crypto-pubkey
crypto-pubkey-types_port= security/hs-crypto-pubkey-types
+crypto-random-api_port= security/hs-crypto-random-api
cryptocipher_port= security/hs-cryptocipher
cryptohash_port= security/hs-cryptohash
css-text_port= www/hs-css-text
@@ -105,11 +112,13 @@ distributive_port= math/hs-distributive
dlist_port= devel/hs-dlist
double-conversion_port= textproc/hs-double-conversion
edit-distance_port= devel/hs-edit-distance
+either_port= devel/hs-either
email-validate_port= mail/hs-email-validate
entropy_port= security/hs-entropy
enumerator_port= devel/hs-enumerator
epic_port= lang/hs-epic # executable
erf_port= math/hs-erf
+errors_port= devel/hs-errors
failure_port= devel/hs-failure
fast-logger_port= devel/hs-fast-logger
fastcgi_port= www/hs-fastcgi # lib_depends
@@ -121,6 +130,7 @@ filestore_port= devel/hs-filestore
filesystem-conduit_port= devel/hs-filesystem-conduit
fsnotify_port= devel/hs-fsnotify
gconf_port= devel/hs-gconf
+generic-deriving_port= devel/hs-generic-deriving
ghc-events_port= devel/hs-ghc-events # executable
ghc-mtl_port= devel/hs-ghc-mtl
ghc-paths_port= devel/hs-ghc-paths
@@ -130,6 +140,7 @@ gitit_port= www/hs-gitit # executable
glade_port= devel/hs-glade
glib_port= devel/hs-glib
GLUT_port= x11-toolkits/hs-GLUT
+groupoids_port= math/hs-groupoids
gstreamer_port= multimedia/hs-gstreamer
gtk_port= x11-toolkits/hs-gtk
gtk2hs-buildtools_port= devel/hs-gtk2hs-buildtools # executable
@@ -189,6 +200,7 @@ language-c_port= devel/hs-language-c
language-javascript_port= devel/hs-language-javascript
largeword_port= devel/hs-largeword
lazysmallcheck_port= devel/hs-lazysmallcheck
+lens_port= devel/hs-lens
lhs2tex_port= textproc/hs-lhs2tex
libmpd_port= audio/hs-libmpd
libxml_port= textproc/hs-libxml
@@ -210,11 +222,13 @@ monad-par-extras_port= devel/hs-monad-par-extras
MonadCatchIO-mtl_port= devel/hs-MonadCatchIO-mtl
MonadCatchIO-transformers_port= devel/hs-MonadCatchIO-transformers
monadcryptorandom_port= security/hs-monadcryptorandom
+MonadRandom_port= devel/hs-MonadRandom
mtl_port= devel/hs-mtl
mueval_port= devel/hs-mueval # executable
murmur-hash_port= devel/hs-murmur-hash
mwc-random_port= math/hs-mwc-random
mysql_port= databases/hs-mysql
+nats_port= math/hs-nats
network_port= net/hs-network
network-conduit_port= net/hs-network-conduit
network-info_port= net/hs-network-info
@@ -243,6 +257,8 @@ pool-conduit_port= devel/hs-pool-conduit
porte_port= ports-mgmt/hs-porte # executable
primitive_port= devel/hs-primitive
probability_port= math/hs-probability
+profunctor-extras_port= devel/hs-profunctor-extras
+profunctors_port= devel/hs-profunctors
project-template_port= devel/hs-project-template
PSQueue_port= devel/hs-PSQueue
pureMD5_port= security/hs-pureMD5
@@ -254,6 +270,7 @@ reactive_port= devel/hs-reactive
ReadArgs_port= devel/hs-ReadArgs
readline_port= devel/hs-readline
recaptcha_port= www/hs-recaptcha
+reflection_port= devel/hs-reflection
regex-base_port= textproc/hs-regex-base
regex-compat_port= textproc/hs-regex-compat
regex-pcre-builtin_port= textproc/hs-regex-pcre-builtin
@@ -265,6 +282,7 @@ safe_port= devel/hs-safe
SafeSemaphore_port= devel/hs-SafeSemaphore
scgi_port= www/hs-scgi
sendfile_port= net/hs-sendfile
+semigroupoid-extras_port= math/hs-semigroupoid-extras
semigroupoids_port= math/hs-semigroupoids
semigroups_port= math/hs-semigroups
setenv_port= devel/hs-setenv
@@ -314,6 +332,8 @@ text_port= devel/hs-text
threads_port= devel/hs-threads
threadscope_port= devel/hs-threadscope # executable
time-compat_port= devel/hs-time-compat
+timezone-olson_port= devel/hs-timezone-olson
+timezone-series_port= devel/hs-timezone-series
tls_port= security/hs-tls
tls-extra_port= security/hs-tls-extra
transformers_port= devel/hs-transformers
diff --git a/lang/ghc/files/patch-aclocal.m4 b/lang/ghc/files/patch-aclocal.m4
new file mode 100644
index 000000000000..f288e6b77221
--- /dev/null
+++ b/lang/ghc/files/patch-aclocal.m4
@@ -0,0 +1,47 @@
+--- aclocal.m4.orig 2012-06-06 19:10:25.000000000 +0200
++++ aclocal.m4 2013-02-03 01:28:58.024638318 +0100
+@@ -19,6 +19,8 @@
+ # In bindists, we haven't called AC_CANONICAL_{BUILD,HOST,TARGET}
+ # so this justs uses $bootstrap_target.
+
++ bootstrap_target=`echo "$bootstrap_target" | sed -e 's/-unknown-/-portbld-/g'`
++
+ if test "$build_alias" = ""
+ then
+ if test "$bootstrap_target" != ""
+@@ -157,7 +159,7 @@
+ i386)
+ test -z "[$]2" || eval "[$]2=ArchX86"
+ ;;
+- x86_64)
++ x86_64|amd64)
+ GET_ARM_ISA()
+ test -z "[$]2" || eval "[$]2=ArchX86_64"
+ ;;
+@@ -186,7 +188,7 @@
+
+ checkVendor() {
+ case [$]1 in
+- dec|unknown|hp|apple|next|sun|sgi|ibm)
++ dec|unknown|hp|apple|next|sun|sgi|ibm|portbld)
+ ;;
+ *)
+ echo "Unknown vendor [$]1"
+@@ -1835,7 +1837,7 @@
+ vax)
+ $2="vax"
+ ;;
+- x86_64)
++ x86_64|amd64)
+ $2="x86_64"
+ ;;
+ *)
+@@ -1875,7 +1877,7 @@
+ freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku)
+ $2="$1"
+ ;;
+- freebsd8) # like i686-gentoo-freebsd8
++ freebsd*) # like i686-gentoo-freebsd8
+ $2="freebsd"
+ ;;
+ *)
diff --git a/lang/ghc/files/patch-configure b/lang/ghc/files/patch-configure
deleted file mode 100644
index 3383b16e1a76..000000000000
--- a/lang/ghc/files/patch-configure
+++ /dev/null
@@ -1,103 +0,0 @@
---- configure.orig 2012-06-06 18:11:19.000000000 +0100
-+++ configure 2012-08-25 06:03:00.000000000 +0100
-@@ -3372,8 +3372,8 @@
- vax)
- BuildArch="vax"
- ;;
-- x86_64)
-- BuildArch="x86_64"
-+ x86_64|amd64)
-+ BuildArch="amd64"
- ;;
- *)
- echo "Unknown CPU $build_cpu"
-@@ -3404,7 +3404,7 @@
- freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku)
- BuildOS="$build_os"
- ;;
-- freebsd8) # like i686-gentoo-freebsd8
-+ freebsd*) # like i686-gentoo-freebsd8
- BuildOS="freebsd"
- ;;
- *)
-@@ -3486,8 +3486,8 @@
- vax)
- HostArch="vax"
- ;;
-- x86_64)
-- HostArch="x86_64"
-+ x86_64|amd64)
-+ HostArch="amd64"
- ;;
- *)
- echo "Unknown CPU $host_cpu"
-@@ -3600,8 +3600,8 @@
- vax)
- TargetArch="vax"
- ;;
-- x86_64)
-- TargetArch="x86_64"
-+ x86_64|amd64)
-+ TargetArch="amd64"
- ;;
- *)
- echo "Unknown CPU $target_cpu"
-@@ -3711,6 +3711,8 @@
-
-
-
-+bootstrap_target=`echo "$bootstrap_target" |sed -e 's/-unknown-/-portbld-/g' -e 's/x86_64/amd64/g'`
-+build=`echo "$build" |sed -e 's/\(freebsd\)[[:digit:].]*$/\1/g'`
-
- # Verify that the installed (bootstrap) GHC is capable of generating
- # code for the requested build platform.
-@@ -5772,7 +5774,7 @@
- i386)
- test -z "$2" || eval "$2=ArchX86"
- ;;
-- x86_64)
-+ x86_64|amd64)
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-@@ -5953,7 +5955,7 @@
-
- checkVendor() {
- case $1 in
-- dec|unknown|hp|apple|next|sun|sgi|ibm)
-+ dec|unknown|hp|apple|next|sun|sgi|ibm|portbld)
- ;;
- *)
- echo "Unknown vendor $1"
-@@ -5976,7 +5978,7 @@
- mingw32)
- test -z "$2" || eval "$2=OSMinGW32"
- ;;
-- freebsd)
-+ freebsd*)
- test -z "$2" || eval "$2=OSFreeBSD"
- ;;
- kfreebsdgnu)
-@@ -9990,7 +9992,7 @@
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-lrt $LIBS"
-+LIBS="$LIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
-@@ -10021,12 +10023,7 @@
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
- $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
- if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
-- cat >>confdefs.h <<_ACEOF
--#define HAVE_LIBRT 1
--_ACEOF
--
-- LIBS="-lrt $LIBS"
--
-+ LIBS="$LIBS"
- fi
-
- for ac_func in clock_gettime timer_create timer_settime
diff --git a/lang/ghc/files/patch-configure.ac b/lang/ghc/files/patch-configure.ac
new file mode 100644
index 000000000000..11139a3aa71d
--- /dev/null
+++ b/lang/ghc/files/patch-configure.ac
@@ -0,0 +1,70 @@
+--- configure.ac.orig 2012-06-06 19:10:25.000000000 +0200
++++ configure.ac 2013-02-02 17:31:55.193634655 +0100
+@@ -89,6 +89,59 @@
+ fi
+ WithGhc="$GHC"])
+
++# system libffi
++
++AC_ARG_WITH([system-libffi],
++[AC_HELP_STRING([--with-system-libffi],
++ [Use system provided libffi for RTS [default=no]])
++])
++
++AS_IF([test "x$with_system_libffi" = "xyes"],
++ [UseSystemLibFFI="YES"], [UseSystemLibFFI="NO"]
++)
++
++AC_SUBST(UseSystemLibFFI)
++
++AC_ARG_WITH([ffi-includes],
++[AC_HELP_STRING([--with-ffi-includes=ARG]
++ [Find includes for libffi in ARG [default=system default]])
++],
++[
++ if test "x$UseSystemLibFFI" != "xYES"; then
++ AC_MSG_WARN([--with-ffi-includes will be ignored, --with-system-libffi not set])
++ else
++ FFIIncludeDir="$withval" LIBFFI_CFLAGS="-I $withval"
++ fi
++])
++
++AC_SUBST(FFIIncludeDir)
++
++AC_ARG_WITH([ffi-libraries],
++[AC_HELP_STRING([--with-ffi-libraries=ARG]
++ [Find libffi in ARG [default=system default]])
++],
++[
++ if test "x$UseSystemLibFFI" != "xYES"; then
++ AC_MSG_WARN([--with-ffi-libraries will be ignored, --with-system-libffi not set])
++ else
++ FFILibDir="$withval" LIBFFI_LDFLAGS="-L$withval"
++ fi
++])
++
++AC_SUBST(FFILibDir)
++
++AS_IF([test "$UseSystemLibFFI" = "YES"], [
++ CFLAGS2="$CFLAGS"
++ CFLAGS="$LIBFFI_CFLAGS $CFLAGS"
++ LDFLAGS2="$LDFLAGS"
++ LDFLAGS="$LIBFFI_LDFLAGS $LDFLAGS"
++ AC_CHECK_LIB(ffi, ffi_call,
++ [AC_CHECK_HEADERS([ffi.h], [break], [])
++ AC_DEFINE([HAVE_LIBFFI], [1], [Define to 1 if you have libffi.])],
++ [UseSystemLibFFI="NO"])
++ CFLAGS="$CFLAGS2"
++ LDFLAGS="$LDFLAGS2"
++])
+
+ dnl ** Tell the make system which OS we are using
+ dnl $OSTYPE is set by the operating system to "msys" or "cygwin" or something
+@@ -717,7 +770,6 @@
+ FP_VISIBILITY_HIDDEN
+
+ dnl ** check for librt
+-AC_CHECK_LIB(rt, clock_gettime)
+ AC_CHECK_FUNCS(clock_gettime timer_create timer_settime)
+ FP_CHECK_TIMER_CREATE
+
diff --git a/lang/ghc/files/patch-ghc.mk b/lang/ghc/files/patch-ghc.mk
index 00eeed367856..81f97ee717ea 100644
--- a/lang/ghc/files/patch-ghc.mk
+++ b/lang/ghc/files/patch-ghc.mk
@@ -1,5 +1,5 @@
---- ghc.mk.orig 2012-06-06 18:10:25.000000000 +0100
-+++ ghc.mk 2012-08-25 12:57:51.000000000 +0100
+--- ghc.mk.orig 2012-06-06 19:10:25.000000000 +0200
++++ ghc.mk 2013-01-30 16:24:02.000000000 +0100
@@ -81,6 +81,7 @@
# Catch make if it runs away into an infinite loop
ifeq "$(MAKE_RESTARTS)" ""
@@ -8,3 +8,31 @@
else
$(error Make has restarted itself $(MAKE_RESTARTS) times; is there a makefile bug?)
endif
+@@ -574,12 +575,18 @@
+ $(GHC_GENPRIMOP_DIR)
+ endif
+
++ifeq "$(UseSystemLibFFI)" "YES"
++MAYBE_LIBFFI=
++else
++MAYBE_LIBFFI=libffi
++endif
++
+ BUILD_DIRS += \
+ driver \
+ driver/ghci \
+ driver/ghc \
+ driver/haddock \
+- libffi \
++ $(MAYBE_LIBFFI) \
+ includes \
+ rts
+
+@@ -971,6 +978,7 @@
+ echo "BUILD_DOCBOOK_PDF = $(BUILD_DOCBOOK_PDF)" >> $(BIN_DIST_MK)
+ echo "BUILD_MAN = $(BUILD_MAN)" >> $(BIN_DIST_MK)
+ echo "GHC_CABAL_INPLACE = utils/ghc-cabal/dist-install/build/tmp/ghc-cabal" >> $(BIN_DIST_MK)
++ echo "UseSystemLibFFI = $(UseSystemLibFFI)" >> $(BIN_DIST_MK)
+ cd $(BIN_DIST_PREP_DIR) && autoreconf
+ $(call removeFiles,$(BIN_DIST_PREP_TAR))
+ # h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source
diff --git a/lang/ghc/files/patch-mk-config.mk.in b/lang/ghc/files/patch-mk-config.mk.in
new file mode 100644
index 000000000000..ff8f0071f82f
--- /dev/null
+++ b/lang/ghc/files/patch-mk-config.mk.in
@@ -0,0 +1,15 @@
+--- ./mk/config.mk.in.orig 2012-06-06 19:10:25.000000000 +0200
++++ ./mk/config.mk.in 2013-01-30 16:24:53.000000000 +0100
+@@ -363,6 +363,12 @@
+ PapiLibDir=
+ PapiIncludeDir=
+
++# Configuration for libffi
++UseSystemLibFFI=@UseSystemLibFFI@
++# Flags to go into package.conf for rts
++FFILibDir=@FFILibDir@
++FFIIncludeDir=@FFIIncludeDir@
++
+ ################################################################################
+ #
+ # Paths (see paths.mk)
diff --git a/lang/ghc/files/patch-rts-ghc.mk b/lang/ghc/files/patch-rts-ghc.mk
new file mode 100644
index 000000000000..c03e03dea09a
--- /dev/null
+++ b/lang/ghc/files/patch-rts-ghc.mk
@@ -0,0 +1,104 @@
+--- ./rts/ghc.mk.orig 2012-06-06 19:10:25.000000000 +0200
++++ ./rts/ghc.mk 2013-01-30 16:40:21.000000000 +0100
+@@ -105,8 +105,10 @@
+ endif
+
+ ifneq "$(BINDIST)" "YES"
++ifneq "$(UseSystemLibFFI)" "YES"
+ rts_ffi_objs_stamp = rts/dist/ffi/stamp
+ rts_ffi_objs = rts/dist/ffi/*.o
++
+ $(rts_ffi_objs_stamp): $(libffi_STATIC_LIB) $(TOUCH_DEP) | $$(dir $$@)/.
+ cd rts/dist/ffi && $(AR) x ../../../$(libffi_STATIC_LIB)
+ "$(TOUCH_CMD)" $@
+@@ -119,6 +121,7 @@
+ rts/dist/build/libffi-5.dll: libffi/build/inst/bin/libffi-5.dll
+ cp $< $@
+ endif
++endif
+
+ #-----------------------------------------------------------------------------
+ # Building one way
+@@ -169,6 +172,12 @@
+
+ rts_dist_$1_CC_OPTS += -DRtsWay=\"rts_$1\"
+
++ifneq "$(UseSystemLibFFI)" "YES"
++rts_dist_FFI_SO = rts/dist/build/libffi$(soext)
++else
++rts_dist_FFI_SO =
++endif
++
+ # Making a shared library for the RTS.
+ ifneq "$$(findstring dyn, $1)" ""
+ ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
+@@ -177,10 +186,15 @@
+ "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
+ -no-auto-link-packages -Lrts/dist/build -lffi-5 `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
+ else
+-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext)
++ifneq "$(UseSystemLibFFI)" "YES"
++ LIBFFI_LIBS= -Lrts/dist/build -lffi
++else
++ LIBFFI_LIBS= -L$(FFILibDir)
++endif
++$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend $$(rts_dist_FFI_SO)
+ "$$(RM)" $$(RM_OPTS) $$@
+ "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
+- -no-auto-link-packages -Lrts/dist/build -lffi `cat rts/libs.depend` $$(rts_$1_OBJS) \
++ -no-auto-link-packages $$(LIBFFI_LIBS) `cat rts/libs.depend` $$(rts_$1_OBJS) \
+ $$(rts_$1_DTRACE_OBJS) -o $$@
+ ifeq "$$(darwin_HOST_OS)" "1"
+ # Ensure library's install name is correct before anyone links with it.
+@@ -370,9 +384,14 @@
+ endif
+
+ # ffi.h triggers prototype warnings, so disable them here:
+-rts/Interpreter_CC_OPTS += -Wno-strict-prototypes
+-rts/Adjustor_CC_OPTS += -Wno-strict-prototypes
+-rts/sm/Storage_CC_OPTS += -Wno-strict-prototypes
++ifeq "$(UseSystemLibFFI)" "YES"
++LIBFFI_CFLAGS = $(addprefix -I,$(FFIIncludeDir))
++else
++LIBFFI_CFLAGS =
++endif
++rts/Interpreter_CC_OPTS += -Wno-strict-prototypes $(LIBFFI_CFLAGS)
++rts/Adjustor_CC_OPTS += -Wno-strict-prototypes $(LIBFFI_CFLAGS)
++rts/sm/Storage_CC_OPTS += -Wno-strict-prototypes $(LIBFFI_CFLAGS)
+
+ # inlining warnings happen in Compact
+ rts/sm/Compact_CC_OPTS += -Wno-inline
+@@ -430,6 +449,21 @@
+
+ endif
+
++#-----------------------------------------------------------------------------
++# Use system provided libffi
++
++ifeq "$(UseSystemLibFFI)" "YES"
++
++rts_PACKAGE_CPP_OPTS += -DFFI_INCLUDE_DIR=$(FFIIncludeDir)
++rts_PACKAGE_CPP_OPTS += -DFFI_LIB_DIR=$(FFILibDir)
++
++else # UseSystemLibFFI==YES
++
++rts_PACKAGE_CPP_OPTS += -DFFI_INCLUDE_DIR=""
++rts_PACKAGE_CPP_OPTS += -DFFI_LIB_DIR=""
++
++endif
++
+ # -----------------------------------------------------------------------------
+ # dependencies
+
+@@ -507,7 +541,11 @@
+ INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
+ INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll)
+
++ifneq "$(UseSystemLibFFI)" "YES"
+ install: install_libffi_headers
++else
++install:
++endif
+
+ .PHONY: install_libffi_headers
+ install_libffi_headers :
diff --git a/lang/ghc/files/patch-rts_package.conf.in b/lang/ghc/files/patch-rts_package.conf.in
index e3f4f73239ea..de5040db75e7 100644
--- a/lang/ghc/files/patch-rts_package.conf.in
+++ b/lang/ghc/files/patch-rts_package.conf.in
@@ -1,23 +1,20 @@
-
-$FreeBSD$
-
---- rts/package.conf.in.orig
-+++ rts/package.conf.in
-@@ -31,9 +31,6 @@
- #ifdef HAVE_LIBM
- "m" /* for ldexp() */
- #endif
--#ifdef HAVE_LIBRT
-- , "rt"
--#endif
+--- ./rts/package.conf.in.orig 2012-06-06 19:10:25.000000000 +0200
++++ ./rts/package.conf.in 2013-01-30 19:04:28.000000000 +0100
+@@ -33,6 +33,9 @@
#ifdef HAVE_LIBDL
, "dl"
#endif
-@@ -141,6 +138,7 @@
- , "-u", "base_GHCziConc_runSparks_closure"
- , "-u", "base_GHCziConc_runHandlers_closure"
++#ifdef HAVE_LIBFFI
++ , "ffi"
++#endif
+ #ifdef mingw32_HOST_OS
+ ,"wsock32" /* for the linker */
+ #endif
+@@ -138,6 +141,7 @@
+ , "-u", "base_GHCziConcziSync_runSparks_closure"
+ , "-u", "base_GHCziConcziSignal_runHandlers_closure"
#endif
-+ , "-L%%LOCALBASE%%/lib"
++ , "-L%%LOCALBASE%%/lib"
/* Pick up static libraries in preference over dynamic if in earlier search
* path. This is important to use the static gmp in preference on Mac OS.