diff options
author | 2003-01-13 23:20:22 +0000 | |
---|---|---|
committer | 2003-01-13 23:20:22 +0000 | |
commit | 1f5121504ff9d3287df198af8544e5d499d04403 (patch) | |
tree | e7b6fcbb80547fa84973f8c906174afbc08b1c7a /sys-devel/cc-config/files | |
parent | moved to app-emulation (diff) | |
download | historical-1f5121504ff9d3287df198af8544e5d499d04403.tar.gz historical-1f5121504ff9d3287df198af8544e5d499d04403.tar.bz2 historical-1f5121504ff9d3287df198af8544e5d499d04403.zip |
Initial version after moved to cc-config. Adds C wrapper
Diffstat (limited to 'sys-devel/cc-config/files')
-rw-r--r-- | sys-devel/cc-config/files/cc-config-1.2.8 | 19 | ||||
-rw-r--r-- | sys-devel/cc-config/files/digest-cc-config-1.2.8 | 0 | ||||
-rw-r--r-- | sys-devel/cc-config/files/wrapper.c | 17 |
3 files changed, 25 insertions, 11 deletions
diff --git a/sys-devel/cc-config/files/cc-config-1.2.8 b/sys-devel/cc-config/files/cc-config-1.2.8 index 530a0f42097a..bd6610135df3 100644 --- a/sys-devel/cc-config/files/cc-config-1.2.8 +++ b/sys-devel/cc-config/files/cc-config-1.2.8 @@ -2,7 +2,7 @@ # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author: Martin Schlemmer <azarah@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/sys-devel/cc-config/files/cc-config-1.2.8,v 1.1 2003/01/13 15:18:10 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/cc-config/files/cc-config-1.2.8,v 1.2 2003/01/13 23:20:22 azarah Exp $ source /etc/init.d/functions.sh || { @@ -144,15 +144,30 @@ switch_profile() { # Setup /etc/env.d/05gcc ${AWK} '!/^STDCXX_INCDIR=|^LDPATH=/ {print $0}' \ - /etc/env.d/gcc/${CC_COMP} >> /etc/env.d/05gcc + /etc/env.d/gcc/${CC_COMP} > /etc/env.d/05gcc # Add our custom LDPATH echo "LDPATH=\"${MY_LDPATH}\"" >> /etc/env.d/05gcc + + # Make sure we do not recreate /lib/cpp and /usr/bin/cc ... +# echo "DISABLE_GEN_GCC_WRAPPERS=\"yes\"" >> /etc/env.d/05gcc echo "CURRENT=${CC_COMP}" > /etc/env.d/gcc/config source /etc/profile + # These might not be installed, and we want to update the mtime + # for ccache and distcc anyhow ... + ${RM} -f /lib/cpp + ${CP} -f /usr/lib/gcc-config/wrapper /lib/cpp + for x in gcc cpp cc c++ g++ ${CHOST}-gcc ${CHOST}-c++ ${CHOST}-g++ + do + ${RM} -f /usr/bin/${x} + ${CP} -f /usr/lib/gcc-config/wrapper /usr/bin/${x} + ${TOUCH} -m /usr/bin/${x} + done + + ${ENV_UPDATE} &> /dev/null eend 0 diff --git a/sys-devel/cc-config/files/digest-cc-config-1.2.8 b/sys-devel/cc-config/files/digest-cc-config-1.2.8 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sys-devel/cc-config/files/digest-cc-config-1.2.8 diff --git a/sys-devel/cc-config/files/wrapper.c b/sys-devel/cc-config/files/wrapper.c index 09f75443f829..778a9161bc86 100644 --- a/sys-devel/cc-config/files/wrapper.c +++ b/sys-devel/cc-config/files/wrapper.c @@ -1,7 +1,8 @@ /* * Copyright 1999-2003 Gentoo Technologies, Inc. * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-x86/sys-devel/cc-config/files/wrapper.c,v 1.1 2003/01/13 15:18:10 azarah Exp $ + * Author: Martin Schlemmer <azarah@gentoo.org> + * $Header: /var/cvsroot/gentoo-x86/sys-devel/cc-config/files/wrapper.c,v 1.2 2003/01/13 23:20:22 azarah Exp $ */ #define _REENTRANT @@ -48,14 +49,12 @@ int main(int argc, char **argv) { tmpstr = (char *)malloc(strlen(token) + strlen(wrappername) + 2); snprintf(tmpstr, strlen(token) + strlen(wrappername) + 2, "%s/%s", token, wrappername); - + /* Does it exist and is a file? */ ret = stat(tmpstr, &sbuf); - /* It exists, and are not our wrapper ... */ - if ((0 == ret) && (sbuf.st_mode & S_IFREG)) { - - if (0 == strcmp(tmpstr, wrapfullname)) - continue; + /* It exists, and are not our wrapper, and its not in /usr/bin ... */ + if ((0 == ret) && (sbuf.st_mode & S_IFREG) && + (0 != strcmp(tmpstr, wrapfullname)) && (0 == strstr(tmpstr, "/usr/bin"))) { strncpy(wrapperbin, tmpstr, MAXPATHLEN); @@ -80,10 +79,10 @@ int main(int argc, char **argv) { /* It is our wrapper, so get the CC path, and execute the real binary in * there ... */ - inpipe = popen("/usr/sbin/gcc-config --get-bin-path", "r"); + inpipe = popen("/usr/bin/cc-config --get-bin-path", "r"); if (NULL == inpipe) { - fprintf(stderr, "Could not run /usr/sbin/gcc-config!\n"); + fprintf(stderr, "Could not run /usr/bin/cc-config!\n"); exit(1); } |