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/files
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/files')
-rw-r--r--sys-devel/gcc-config/files/fake-ctarget.sh4
-rwxr-xr-xsys-devel/gcc-config/files/gcc-config-1.4.038
2 files changed, 24 insertions, 18 deletions
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"