diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2003-04-12 21:21:03 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2003-04-12 21:21:03 +0000 |
commit | e04dd5e73391bed211a3b28df7bb4446eca30d9d (patch) | |
tree | 23028c3feb691812b25e52d7533924429013c605 /sys-devel | |
parent | update wrapper for cross compile, bug #18933 (diff) | |
download | gentoo-2-e04dd5e73391bed211a3b28df7bb4446eca30d9d.tar.gz gentoo-2-e04dd5e73391bed211a3b28df7bb4446eca30d9d.tar.bz2 gentoo-2-e04dd5e73391bed211a3b28df7bb4446eca30d9d.zip |
update wrapper for cross compile, bug #18933
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/gcc-config/ChangeLog | 6 | ||||
-rw-r--r-- | sys-devel/gcc-config/Manifest | 4 | ||||
-rw-r--r-- | sys-devel/gcc-config/files/wrapper-1.4.1.c | 51 |
3 files changed, 25 insertions, 36 deletions
diff --git a/sys-devel/gcc-config/ChangeLog b/sys-devel/gcc-config/ChangeLog index 81b8e8003f50..fc32f6401341 100644 --- a/sys-devel/gcc-config/ChangeLog +++ b/sys-devel/gcc-config/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-devel/gcc-config # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.34 2003/04/12 18:44:22 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.35 2003/04/12 21:19:26 azarah Exp $ + + 12 Apr 2003; Martin Schlemmer <azarah@gentoo.org> files/wrapper-1.4.1.c : + Update wrapper as I suggested in bug #18933 to be able to handle cross + compiler frontends ... *gcc-config-1.3.3 (12 Apr 2003) diff --git a/sys-devel/gcc-config/Manifest b/sys-devel/gcc-config/Manifest index c2aebd77888d..2837b8965756 100644 --- a/sys-devel/gcc-config/Manifest +++ b/sys-devel/gcc-config/Manifest @@ -1,4 +1,4 @@ -MD5 552949dc701c87a89f6429de605415d2 ChangeLog 6938 +MD5 196d9cc45c45320c2fae5bfc4054fe75 ChangeLog 7113 MD5 0933e6187cc0f10fa79b8504e7a3bd0e gcc-config-1.3.0.ebuild 2110 MD5 db9be5ce1763eccd6aa5fea794198624 gcc-config-1.3.3.ebuild 2227 MD5 237a7e0aff8c90471ebe138056a1bf39 gcc-config-1.2.7.ebuild 1151 @@ -10,7 +10,7 @@ MD5 9b87bd79f5c7f42b0a93e944c79a89b2 files/gcc-config-1.3.0 7131 MD5 a4fe6c2cc89bb24276a53da0fb4def9e files/wrapper.c 3527 MD5 98ae7460e20ff7907863052a863ab8ff files/gcc-config-1.3.1 8106 MD5 40100df067977032972172e4eb5cab05 files/gcc-config-1.2.7 8674 -MD5 8a9ad455b4cf3cd03f70b2e7ad5329eb files/wrapper-1.4.1.c 7293 +MD5 98e773e0836193330f1f5e142b6070bf files/wrapper-1.4.1.c 7293 MD5 ee11abc1908b09d4ef5613f365202047 files/digest-gcc-config-1.3.0 192 MD5 44cb03b926702bd77bb7bbe84499348e files/gcc-config-1.4 11992 MD5 dbc7a76dc0e32a1b8734a44c00aa9abe files/digest-gcc-config-1.3.1 585 diff --git a/sys-devel/gcc-config/files/wrapper-1.4.1.c b/sys-devel/gcc-config/files/wrapper-1.4.1.c index 83a1311827e1..6ef05a4a5261 100644 --- a/sys-devel/gcc-config/files/wrapper-1.4.1.c +++ b/sys-devel/gcc-config/files/wrapper-1.4.1.c @@ -2,7 +2,7 @@ * Copyright 1999-2003 Gentoo Technologies, Inc. * Distributed under the terms of the GNU General Public License v2 * Author: Martin Schlemmer <azarah@gentoo.org> - * $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/wrapper-1.4.1.c,v 1.1 2003/04/12 18:44:22 azarah Exp $ + * $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/wrapper-1.4.1.c,v 1.2 2003/04/12 21:19:26 azarah Exp $ */ #define _REENTRANT @@ -20,10 +20,13 @@ #include <stdarg.h> #include <errno.h> -//#define DEBUG - #define GCC_CONFIG "/usr/bin/gcc-config" -#define ENVD_FILE "/etc/env.d/05gcc" + +#ifndef CC_PROFILE +# define ENVD_FILE "/etc/env.d/05gcc" +#else +# define ENVD_FILE "/etc/env.d/gcc/" CC_PROFILE +#endif struct wrapper_data { char name[MAXPATHLEN + 1]; @@ -144,16 +147,10 @@ static int find_target_in_envd(struct wrapper_data *data) if ((NULL != token) && (strlen(token) > 0)) { str = token; -#ifdef DEBUG - printf("* token = %s\n", token); -#endif /* A bash variable may be unquoted, quoted with " or * quoted with ', so extract the value without those .. */ token = strsep(&str, "\n\"\'"); -#ifdef DEBUG - printf("* token = %s\n", token); -#endif while (NULL != token) { @@ -164,9 +161,6 @@ static int find_target_in_envd(struct wrapper_data *data) } token = strsep(&str, "\n\"\'"); -#ifdef DEBUG - printf("* token = %s\n", token); -#endif } } @@ -184,35 +178,30 @@ static void find_wrapper_target(struct wrapper_data *data) FILE *inpipe = NULL; char *str = data->tmp; -#ifdef DEBUG - printf("* calling find_target_in_path\n"); -#endif +#ifndef CC_PROFILE if (find_target_in_path(data)) return; - -#ifdef DEBUG - printf("* calling find_target_in_envd\n"); #endif + if (find_target_in_envd(data)) return; - -#ifdef DEBUG - printf("* calling find_wrapper_target\n"); -#endif - + /* Only our wrapper is in PATH, so get the CC path using gcc-config and execute the real binary in there... */ +#ifndef CC_PROFILE inpipe = popen(GCC_CONFIG " --get-bin-path", "r"); - if (NULL == inpipe) { - +#else + inpipe = popen(GCC_CONFIG " --get-bin-path " CC_PROFILE, "r"); +#endif + if (NULL == inpipe) wrapper_exit( - "Could not open pipe for GCC_CONFIG: %s\n", + "Could not open pipe for gcc-config: %s\n", wrapper_strerror(errno, data)); - } if (0 == fgets(str, MAXPATHLEN, inpipe)) - wrapper_exit("Could not get compiler binary path: %s\n", + wrapper_exit( + "Could not get compiler binary path: %s\n", wrapper_strerror(errno, data)); strncpy(data->bin, str, sizeof(data->bin) - 1); @@ -312,10 +301,6 @@ int main(int argc, char **argv) * headers, etc (bug #8132). */ argv[0] = data->bin; -#ifdef DEBUG - printf("exec %s\n", data->bin); -#endif - /* Ok, do it ... */ if (execv(data->bin, argv) < 0) wrapper_exit("Could not run/locate \"%s\"\n", data->name); |