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
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')
-rw-r--r--dev-lang/ghc/ChangeLog14
-rw-r--r--dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch12
-rw-r--r--dev-lang/ghc/ghc-6.4.1-r3.ebuild61
-rw-r--r--dev-lang/ghc/ghc-6.4.2.ebuild27
4 files changed, 88 insertions, 26 deletions
diff --git a/dev-lang/ghc/ChangeLog b/dev-lang/ghc/ChangeLog
index 84f252a5bfbe..8a68528a4bfc 100644
--- a/dev-lang/ghc/ChangeLog
+++ b/dev-lang/ghc/ChangeLog
@@ -1,6 +1,18 @@
# ChangeLog for dev-lang/ghc
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.101 2006/05/12 15:44:52 dcoutts Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.102 2006/05/18 20:42:44 dcoutts Exp $
+
+ 18 May 2006; Duncan Coutts <dcoutts@gentoo.org>
+ +files/ghc-6.4.2-sparc32plus.patch, ghc-6.4.1-r3.ebuild, ghc-6.4.2.ebuild:
+ Support gcc-4.x better at the expense of hardened gcc-3.x.
+ Switching between gcc-3.x and gcc-4.x will now just work. Switching between
+ vanilla and hardened gcc will now require re-emerging rather than just
+ working. It should also enable anyone who has broken their ghc installation
+ by upgrading to gcc-4.x to get things working again by re-emerging ghc-6.4.2,
+ ghc-6.4.1-r3 or ghc-bin-6.4.1-r1.
+ Only build OpenAL/ALUT bindings if the OpenGL bindings will also be built
+ (since one depends on the other).
+ Fix GHCi on sparc when using the V8+ ABI (eg CFLAGS="-march=ultrasparc").
12 May 2006; Duncan Coutts <dcoutts@gentoo.org>
+files/ghc-6.4.2-alut.patch, ghc-6.4.2.ebuild:
diff --git a/dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch b/dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch
new file mode 100644
index 000000000000..709f3db52b1d
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch
@@ -0,0 +1,12 @@
+--- ghc-6.4.2/ghc/rts/Linker.c 2006-01-04 15:24:10.000000000 +0000
++++ ghc-6.4.2.new/ghc/rts/Linker.c 2006-05-15 21:06:45.000000000 +0100
+@@ -2695,6 +2695,9 @@
+ IF_DEBUG(linker,debugBelch( "Architecture is " ));
+ switch (ehdr->e_machine) {
+ case EM_386: IF_DEBUG(linker,debugBelch( "x86" )); break;
++#ifdef EM_SPARC32PLUS
++ case EM_SPARC32PLUS:
++#endif
+ case EM_SPARC: IF_DEBUG(linker,debugBelch( "sparc" )); break;
+ #ifdef EM_IA_64
+ case EM_IA_64: IF_DEBUG(linker,debugBelch( "ia64" )); break;
diff --git a/dev-lang/ghc/ghc-6.4.1-r3.ebuild b/dev-lang/ghc/ghc-6.4.1-r3.ebuild
index f698a49a125c..2e67a4041cb5 100644
--- a/dev-lang/ghc/ghc-6.4.1-r3.ebuild
+++ b/dev-lang/ghc/ghc-6.4.1-r3.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.1-r3.ebuild,v 1.6 2006/05/03 23:05:28 dcoutts Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.4.1-r3.ebuild,v 1.7 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/"
@@ -43,8 +43,9 @@ RDEPEND="
>=dev-libs/gmp-4.1
>=sys-libs/readline-4.2
X? ( || ( x11-libs/libX11 virtual/x11 ) )
- opengl? ( virtual/opengl virtual/glu virtual/glut )
- openal? ( media-libs/openal )"
+ opengl? ( virtual/opengl
+ virtual/glu virtual/glut
+ openal? ( media-libs/openal ) )"
# ghc cannot usually be bootstrapped using later versions ...
DEPEND="${RDEPEND}
@@ -57,18 +58,24 @@ DEPEND="${RDEPEND}
PDEPEND=">=dev-haskell/cabal-1.1.3"
-# Portage's resolution of virtuals fails on virtual/ghc in some Portage releases,
-# the following function causes the build to fail with an informative error message
-# in such a case.
-# pkg_setup() {
-# if ! has_version virtual/ghc; then
-# eerror "This ebuild needs a version of GHC to bootstrap from."
-# eerror "Please emerge dev-lang/ghc-bin to get a binary version."
-# eerror "You can either use the binary version directly or emerge"
-# eerror "dev-lang/ghc afterwards."
-# die "virtual/ghc version required to build"
-# fi
-# }
+pkg_setup() {
+ if use openal && ! use opengl; then
+ ewarn "The OpenAL bindings require the OpenGL bindings, however"
+ ewarn "USE=\"-opengl\" so the OpenAL bindings will not be built."
+ ewarn "To build the OpenAL bindings emerge with USE=\"openal opengl\""
+ fi
+
+ # Portage's resolution of virtuals fails on virtual/ghc in some Portage
+ # releases, the following function causes the build to fail with an
+ # informative error message in such a case.
+ #if ! has_version virtual/ghc; then
+ # eerror "This ebuild needs a version of GHC to bootstrap from."
+ # eerror "Please emerge dev-lang/ghc-bin to get a binary version."
+ # eerror "You can either use the binary version directly or emerge"
+ # eerror "dev-lang/ghc afterwards."
+ # die "virtual/ghc version required to build"
+ #fi
+}
append-ghc-cflags() {
local flag compile assemble link
@@ -116,14 +123,23 @@ 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
@@ -132,6 +148,7 @@ src_unpack() {
epatch "${FILESDIR}/${PN}-6.4.1-configure.patch"
epatch "${FILESDIR}/${PN}-6.4.1-openal.patch"
epatch "${FILESDIR}/${PN}-6.4.1-gcc41.patch"
+ epatch "${FILESDIR}/${PN}-6.4.2-sparc32plus.patch"
# Modify the ghc driver script to use GHC_CFLAGS
echo "SCRIPT_SUBST_VARS += GHC_CFLAGS" >> "${S}/ghc/driver/ghc/Makefile"
@@ -192,14 +209,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 do allow us to enable/disable the
# X11 and HGL packages, 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 openal && use opengl \
+ && echo --enable-openal \
+ || echo --disable-openal) \
$(use_enable X x11) \
$(use_enable X hgl) \
|| die "econf failed"
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"