summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <eradicator@gentoo.org>2005-03-04 12:22:21 +0000
committerJeremy Huddleston <eradicator@gentoo.org>2005-03-04 12:22:21 +0000
commit1a9c99fa7e6688b9bc9fee59d03b9f3a75b6880c (patch)
tree40e9819e326870f4453467dde2a0ba5c4c3993b4 /sys-devel/gcc-config
parentstable on amd64 and x86 (diff)
downloadgentoo-2-1a9c99fa7e6688b9bc9fee59d03b9f3a75b6880c.tar.gz
gentoo-2-1a9c99fa7e6688b9bc9fee59d03b9f3a75b6880c.tar.bz2
gentoo-2-1a9c99fa7e6688b9bc9fee59d03b9f3a75b6880c.zip
Cleaned up 1.4.0 a bit. Got rid of the stupid fake-ctarget.sh stuff and added smarter logic for that into the gcc-config script. Still in package.mask as it hits a sandbox bug.
(Portage version: 2.0.51.18)
Diffstat (limited to 'sys-devel/gcc-config')
-rw-r--r--sys-devel/gcc-config/ChangeLog8
-rw-r--r--sys-devel/gcc-config/files/fake-ctarget.sh4
-rwxr-xr-xsys-devel/gcc-config/files/gcc-config-1.4.038
-rw-r--r--sys-devel/gcc-config/gcc-config-1.4.0.ebuild13
4 files changed, 37 insertions, 26 deletions
diff --git a/sys-devel/gcc-config/ChangeLog b/sys-devel/gcc-config/ChangeLog
index e0a6976c0dd5..9baf21de0f35 100644
--- a/sys-devel/gcc-config/ChangeLog
+++ b/sys-devel/gcc-config/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-devel/gcc-config
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.81 2005/02/19 10:04:01 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.82 2005/03/04 12:22:21 eradicator Exp $
+
+ 04 Mar 2005; Jeremy Huddleston <eradicator@gentoo.org>
+ -files/fake-ctarget.sh, files/gcc-config-1.4.0, gcc-config-1.4.0.ebuild:
+ Cleaned up 1.4.0 a bit. Got rid of the stupid fake-ctarget.sh stuff and
+ added smarter logic for that into the gcc-config script. Still in
+ package.mask as it hits a sandbox bug.
*gcc-config-1.4.0 (19 Feb 2005)
diff --git a/sys-devel/gcc-config/files/fake-ctarget.sh b/sys-devel/gcc-config/files/fake-ctarget.sh
deleted file mode 100644
index 624156951540..000000000000
--- a/sys-devel/gcc-config/files/fake-ctarget.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-export ABI="custom"
-export CFLAGS_custom="@@CFLAGS@@"
-@@EXEC@@ "${@}"
diff --git a/sys-devel/gcc-config/files/gcc-config-1.4.0 b/sys-devel/gcc-config/files/gcc-config-1.4.0
index 06fdce677641..400573b19b1c 100755
--- a/sys-devel/gcc-config/files/gcc-config-1.4.0
+++ b/sys-devel/gcc-config/files/gcc-config-1.4.0
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.4.0,v 1.2 2005/02/20 01:16:29 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.4.0,v 1.3 2005/03/04 12:22:21 eradicator Exp $
# Author: Martin Schlemmer <azarah@gentoo.org>
trap ":" INT QUIT TSTP
@@ -92,6 +92,21 @@ is_cross_compiler() {
[[ ${CC_COMP/${REAL_CHOST}} = ${CC_COMP} ]]
}
+create_script_wrapper() {
+ cat > ${1} <<EOF
+#!/bin/bash
+
+if [[ -z \${ABI} ]]; then
+ export ABI="custom"
+ export CFLAGS_custom="${3}"
+fi
+
+${2} "\${@}"
+EOF
+
+ chmod 755 ${1}
+}
+
switch_profile() {
local MY_LDPATH=
local GCC_PROFILES=
@@ -211,7 +226,7 @@ switch_profile() {
local ref=${ROOT}/${GCC_BIN_PATH}/${x}
[[ ${x} = "cc" ]] && ref=${ROOT}/${GCC_BIN_PATH}/gcc
if [[ -x ${ref} ]] ; then
- ${CP} -f "${LIBEXECDIR}/wrapper" \
+ ${CP} -f "${WRAPPER}" \
"${ROOT}/usr/bin/${x}"
touch -r "${ref}" "${ROOT}/usr/bin/${x}"
@@ -219,7 +234,7 @@ switch_profile() {
# This should probably get folded back into the wrapper ...
if [[ ${x:${#x}-3} = "gcc" ]] || [[ ${x:${#x}-3} = "g++" ]] ; then
for bits in ${GCCBITS} ; do
- cp -f "${LIBEXECDIR}/wrapper" \
+ cp -f "${WRAPPER}" \
"${ROOT}/usr/bin/${x}${bits}"
done
fi
@@ -236,7 +251,7 @@ switch_profile() {
[[ -f ${ROOT}/usr/bin/${CTARGET}-${x}64 ]] && \
rm -f ${ROOT}/usr/bin/${CTARGET}-${x}64
- ${CP} -f ${LIBEXECDIR}/wrapper \
+ ${CP} -f ${WRAPPER} \
${ROOT}/usr/bin/${CTARGET}-${x}
${CHMOD} 755 ${ROOT}/usr/bin/${CTARGET}-${x}
touch -r ${ref} ${ROOT}/usr/bin/${CTARGET}-${x}
@@ -245,19 +260,13 @@ switch_profile() {
for cctarget in ${CTARGET_ALIASES}; do
local var="CFLAGS_"${cctarget//-/_}
if [[ ! -f ${GCC_ENV_D}/config-${cctarget} ]]; then
- sed -e "s:@@EXEC@@:${CTARGET}-${x}:g" \
- -e "s:@@CFLAGS@@:${!var}:g" \
- ${LIBEXECDIR}/fake-ctarget.sh > ${ROOT}/usr/bin/${cctarget}-${x}
- ${CHMOD} 755 ${ROOT}/usr/bin/${cctarget}-${x}
+ create_script_wrapper ${ROOT}/usr/bin/${cctarget}-${x} ${CTARGET}-${x} "${!var}"
touch -r ${ref} ${ROOT}/usr/bin/${cctarget}-${x}
fi
done
if ! is_cross_compiler && [[ -n "${CFLAGS_default}" ]]; then
- sed -e "s:@@EXEC@@:${CTARGET}-${x}:g" \
- -e "s:@@CFLAGS@@:${CFLAGS_default}:g" \
- ${LIBEXECDIR}/fake-ctarget.sh > ${ROOT}/usr/bin/${x}
- ${CHMOD} 755 ${ROOT}/usr/bin/${x}
+ create_script_wrapper ${ROOT}/usr/bin/${x} ${CTARGET}-${x} "${CFLAGS_default}"
touch -r ${ref} ${ROOT}/usr/bin/${x}
fi
fi
@@ -266,7 +275,7 @@ switch_profile() {
# Only install cpp if switching to a native one
if ! is_cross_compiler ; then
${RM} -f "${ROOT}/lib/cpp"
- ${CP} -f "${LIBEXECDIR}/wrapper" "${ROOT}/lib/cpp"
+ ${CP} -f "${WRAPPER}" "${ROOT}/lib/cpp"
fi
# We need to make sure that libgcc_s.so makes it into /lib.
@@ -419,7 +428,8 @@ CHECK_CHOST="no"
CC_COMP=
[[ -z ${ROOT} ]] && ROOT="/"
[[ ${ROOT:-1} != "/" ]] && ROOT="${ROOT}/"
-LIBEXECDIR="${ROOT}usr/lib/misc/gcc-config"
+LIBEXECDIR="${ROOT}usr/lib/misc"
+WRAPPER="${LIBEXECDIR}/gcc-config-wrapper"
ENV_D="${ROOT}etc/env.d"
GCC_ENV_D="${ENV_D}/gcc"
diff --git a/sys-devel/gcc-config/gcc-config-1.4.0.ebuild b/sys-devel/gcc-config/gcc-config-1.4.0.ebuild
index dc646327cdbe..b5598c870e2e 100644
--- a/sys-devel/gcc-config/gcc-config-1.4.0.ebuild
+++ b/sys-devel/gcc-config/gcc-config-1.4.0.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.4.0.ebuild,v 1.1 2005/02/19 10:04:01 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.4.0.ebuild,v 1.2 2005/03/04 12:22:21 eradicator Exp $
inherit toolchain-funcs
@@ -13,8 +13,8 @@ SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="-*"
-#KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+#KEYWORDS="-*"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
#KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sh sparc x86"
IUSE=""
@@ -24,7 +24,7 @@ DEPEND="virtual/libc
S=${WORKDIR}
src_compile() {
- $(tc-getCC) -O2 -Wall -o wrapper \
+ $(tc-getCC) -O2 -Wall -o gcc-config-wrapper \
${FILESDIR}/wrapper-${W_VER}.c || die "compile wrapper"
}
@@ -32,9 +32,8 @@ src_install() {
newbin ${FILESDIR}/${PN}-${PV} ${PN} || die "install gcc-config"
dosed "s:PORTAGE-VERSION:${PVR}:" /usr/bin/${PN}
- exeinto /usr/lib/misc/gcc-config
- doexe wrapper || die "install wrapper"
- doexe ${FILESDIR}/fake-ctarget.sh || die "install wrapper"
+ exeinto /usr/lib/misc
+ doexe gcc-config-wrapper || die "install wrapper"
}
pkg_postinst() {