summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Coutts <dcoutts@gentoo.org>2006-05-18 20:42:44 +0000
committerDuncan Coutts <dcoutts@gentoo.org>2006-05-18 20:42:44 +0000
commit6993ffb04d0a40314fd3c0d45e10f4d6d4768534 (patch)
tree6679b06abf653a6c36f2b7287f452fa07e140426 /dev-lang/ghc/ghc-6.4.2.ebuild
parentSecurity mask kurobox-sources; bug #112791. (diff)
downloadgentoo-2-6993ffb04d0a40314fd3c0d45e10f4d6d4768534.tar.gz
gentoo-2-6993ffb04d0a40314fd3c0d45e10f4d6d4768534.tar.bz2
gentoo-2-6993ffb04d0a40314fd3c0d45e10f4d6d4768534.zip
Support gcc-4.x better at the expense of hardened gcc-3.x.
(Portage version: 2.1_pre10-r5)
Diffstat (limited to 'dev-lang/ghc/ghc-6.4.2.ebuild')
-rw-r--r--dev-lang/ghc/ghc-6.4.2.ebuild27
1 files changed, 21 insertions, 6 deletions
diff --git a/dev-lang/ghc/ghc-6.4.2.ebuild b/dev-lang/ghc/ghc-6.4.2.ebuild
index 1f7ef122588e..11409f80f24c 100644
--- a/dev-lang/ghc/ghc-6.4.2.ebuild
+++ b/dev-lang/ghc/ghc-6.4.2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.4.2.ebuild,v 1.4 2006/05/12 15:44:52 dcoutts Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.4.2.ebuild,v 1.5 2006/05/18 20:42:44 dcoutts Exp $
# Brief explanation of the bootstrap logic:
#
@@ -14,7 +14,7 @@
# can be removed once an forall after the first succesful install
# of ghc.
-inherit base eutils flag-o-matic autotools ghc-package check-reqs
+inherit base eutils flag-o-matic toolchain-funcs autotools ghc-package check-reqs
DESCRIPTION="The Glasgow Haskell Compiler"
HOMEPAGE="http://www.haskell.org/ghc/"
@@ -125,20 +125,30 @@ ghc_setup_cflags() {
# hardened-gcc needs to be disabled, because the mangler doesn't accept
# its output.
- append-ghc-cflags compile link $(test-flags-CC -nopie)
- append-ghc-cflags compile $(test-flags-CC -fno-stack-protector)
+ gcc-specs-pie && append-ghc-cflags compile link -nopie
+ gcc-specs-ssp && append-ghc-cflags compile -fno-stack-protector
# We also add -Wa,--noexecstack to get ghc to generate .o files with
# non-exectable stack. This it a hack until ghc does it itself properly.
append-ghc-cflags assemble "-Wa,--noexecstack"
}
+ghc_setup_wrapper() {
+ echo '#!/bin/sh'
+ echo "GHCBIN=\"$(ghc-libdir)/ghc-$1\";"
+ echo "TOPDIROPT=\"-B$(ghc-libdir)\";"
+ echo "GHC_CFLAGS=\"${GHC_CFLAGS}\";"
+ echo '# Mini-driver for GHC'
+ echo 'exec $GHCBIN $TOPDIROPT $GHC_CFLAGS ${1+"$@"}'
+}
+
src_unpack() {
base_src_unpack
ghc_setup_cflags
cd ${S}
epatch "${WORKDIR}/${P}-alut.patch"
+ epatch "${FILESDIR}/${P}-sparc32plus.patch"
# Modify the ghc driver script to use GHC_CFLAGS
echo "SCRIPT_SUBST_VARS += GHC_CFLAGS" >> "${S}/ghc/driver/ghc/Makefile"
@@ -202,15 +212,20 @@ src_compile() {
echo "SplitObjs=NO" >> mk/build.mk
fi
+ GHC_CFLAGS="" ghc_setup_wrapper $(ghc-version) > "${TMP}/ghc.sh"
+ chmod +x "${TMP}/ghc.sh"
+
# We've patched some configure.ac files to fix the OpenAL/ALUT bindings.
# So we need to autoreconf.
eautoreconf
econf \
+ --with-ghc="${TMP}/ghc.sh" \
$(use_enable opengl opengl) \
$(use_enable opengl glut) \
- $(use_enable openal openal) \
- $(use_enable openal alut) \
+ $(use openal && use opengl \
+ && echo --enable-openal --enable-alut \
+ || echo --disable-openal --disable-alut) \
$(use_enable X x11) \
$(use_enable X hgl) \
|| die "econf failed"