summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2003-01-13 23:20:22 +0000
committerMartin Schlemmer <azarah@gentoo.org>2003-01-13 23:20:22 +0000
commitb1028a51313a0e7bb0a42e79e7098bad21fe13ec (patch)
tree63a788da37aa3751981ec1b3ef2033e74834830a /sys-devel/cc-config
parentmoved to app-emulation (diff)
downloadgentoo-2-b1028a51313a0e7bb0a42e79e7098bad21fe13ec.tar.gz
gentoo-2-b1028a51313a0e7bb0a42e79e7098bad21fe13ec.tar.bz2
gentoo-2-b1028a51313a0e7bb0a42e79e7098bad21fe13ec.zip
Initial version after moved to cc-config. Adds C wrapper
Diffstat (limited to 'sys-devel/cc-config')
-rw-r--r--sys-devel/cc-config/ChangeLog92
-rw-r--r--sys-devel/cc-config/cc-config-1.2.8.ebuild73
-rw-r--r--sys-devel/cc-config/files/cc-config-1.2.819
-rw-r--r--sys-devel/cc-config/files/digest-cc-config-1.2.80
-rw-r--r--sys-devel/cc-config/files/wrapper.c17
5 files changed, 190 insertions, 11 deletions
diff --git a/sys-devel/cc-config/ChangeLog b/sys-devel/cc-config/ChangeLog
new file mode 100644
index 000000000000..60288f2bb7c6
--- /dev/null
+++ b/sys-devel/cc-config/ChangeLog
@@ -0,0 +1,92 @@
+# ChangeLog for sys-devel/cc-config
+# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/cc-config/ChangeLog,v 1.1 2003/01/13 23:20:22 azarah Exp $
+
+*cc-config-1.2.8 (13 Jan 2003)
+
+ 13 Jan 2003; Martin Schlemmer <azarah@gentoo.org> cc-config-1.2.8 :
+
+ Move to cc-config. Add C wrapper to call the real binaries.
+
+ 02 Jan 2003; Martin Schlemmer <azarah@gentoo.org> gcc-config-1.2.7 :
+
+ Update usage screen to be more compact. Also should be more consistant
+ with other unix tools. Bug #13005.
+
+*gcc-config-1.2.7 (25 Dec 2002)
+
+ 06 Jan 2003; Jan Seidel <tuxus@gentoo.org> gcc-config-1.2.7.ebuild :
+ Added mips to keywords.
+
+ 25 Dec 2002; Martin Schlemmer <azarah@gentoo.org> gcc-config-1.2.7.ebuild :
+
+ Add colorgcc support, partly a fix for bug #12689.
+
+*gcc-config-1.2.6 (23 Dec 2002)
+
+ 24 Dec 2002; Martin Schlemmer <azarah@gentoo.org> gcc-config-1.2.6.ebuild :
+
+ In some cases we have an old /usr/bin/cpp binary that was not unmerged from
+ non multi arch/version scheme gcc's. If so, backup it, and replace with a
+ wrapper script.
+
+*gcc-config-1.2.5 (23 Dec 2002)
+
+ 23 Dec 2002; Martin Schlemmer <azarah@gentoo.org> gcc-config-1.2.5.ebuild :
+
+ Add --print-environ switch. Add /usr/bin/cpp wrapper. Fix the wrapper
+ to setup PATH if it cannot find cpp, or if 'which cpp' give /usr/bin/cpp.
+
+ 17 Dec 2002; Martin Schlemmer <azarah@gentoo.org> gcc-config-1.2.4 :
+
+ Do not add a LDPATH if the directory do not exist.
+
+*gcc-config-1.2.4 (16 Dec 2002)
+
+ 16 Dec 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ More fixes for wrappers.
+
+*gcc-config-1.2.3 (16 Dec 2002)
+
+ 16 Dec 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ Regenerate /lib/cpp and /usr/bin/cc if they do not exist, or
+ are symlinks .. Run gcc-config in pkg_postinst().
+
+*gcc-config-1.2.2 (16 Dec 2002)
+
+ 16 Dec 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ Update to handle wrappers used for /lib/cpp and /usr/bin/cc in
+ new gcc ebuilds.
+
+ 06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords
+
+*gcc-config-1.2.1 (27 Nov 2002)
+
+ 27 Nov 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ Update to only biatch about not being root if the user
+ tries to change the system profile, thanks rphillips!
+
+*gcc-config-1.2 (10 Nov 2002)
+
+ 10 Nov 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ Include all LDPATH's for this CHOST in /etc/ld.so.conf.
+ Add --use-portage-chost option so that it will only change
+ gcc profile if CHOST is same as that of make.conf.
+
+*gcc-config-1.1 (10 Nov 2002)
+
+ 10 Nov 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ New version with lots of options, and help.
+
+*gcc-config-1.0 (28 Oct 2002)
+
+ 28 Oct 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ Initial version.
+
diff --git a/sys-devel/cc-config/cc-config-1.2.8.ebuild b/sys-devel/cc-config/cc-config-1.2.8.ebuild
new file mode 100644
index 000000000000..7b3659968fe1
--- /dev/null
+++ b/sys-devel/cc-config/cc-config-1.2.8.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/cc-config/cc-config-1.2.8.ebuild,v 1.1 2003/01/13 23:20:22 azarah Exp $
+
+DISABLE_GEN_GCC_WRAPPERS="yes"
+
+S="${WORKDIR}/${P}"
+DESCRIPTION="Utility to change the gcc compiler being used."
+SRC_URI=""
+HOMEPAGE="http://www.gentoo.org/"
+
+KEYWORDS="x86 ppc sparc alpha mips"
+SLOT="0"
+LICENSE="GPL-2"
+
+DEPEND="virtual/glibc"
+
+
+src_install() {
+
+ einfo "Compiling wrapper..."
+ gcc -O2 -Wall -o ${WORKDIR}/wrapper ${FILESDIR}/wrapper.c
+
+ exeinto /usr/lib/gcc-config
+ doexe ${WORKDIR}/wrapper
+
+ # Only setup this if we have a proper gcc version installed, else
+ # we will nuke the non cc-config versions ...
+ if /usr/bin/cc-config --get-current-profile &> /dev/null || \
+ /usr/sbin/gcc-config --get-current-profile &> /dev/null
+ then
+ einfo "Creating wrappers for compiler tools..."
+ exeinto /lib
+ newexe ${WORKDIR}/wrapper cpp
+
+ exeinto /usr/bin
+ for x in gcc cpp cc c++ g++ ${CHOST}-gcc ${CHOST}-c++ ${CHOST}-g++
+ do
+ newexe ${WORKDIR}/wrapper ${x}
+ done
+ fi
+
+ einfo "Adding compat symlinks..."
+ into /usr
+ dodir /usr/sbin
+ newbin ${FILESDIR}/${PN}-${PV} ${PN}
+ dosym ../bin/${PN} /usr/sbin/${PN}
+ dosym ../bin/${PN} /usr/sbin/gcc-config
+}
+
+pkg_postinst() {
+
+ # Do we have a valid multi ver setup ?
+ if ${ROOT}/usr/bin/cc-config --get-current-profile &> /dev/null
+ then
+ # We not longer use the /usr/include/g++-v3 hacks, as
+ # it is not needed ...
+ if [ -L ${ROOT}/usr/include/g++ ]
+ then
+ rm -f ${ROOT}/usr/include/g++
+ fi
+ if [ -L ${ROOT}/usr/include/g++-v3 ]
+ then
+ rm -f ${ROOT}/usr/include/g++-v3
+ fi
+
+ if [ ${ROOT} = "/" ]
+ then
+ /usr/bin/cc-config $(/usr/bin/cc-config --get-current-profile)
+ fi
+ fi
+}
+
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);
}