aboriginal

changeset 807:d0b74a631587 0.9.7

Teach ccwrap.c to use arch-specific WRAPPER_TOPDIR values, to avoid interfering with canadian cross.
author Rob Landley <rob@landley.net>
date Fri, 14 Aug 2009 06:01:38 -0500
parents 78b05421aa9d
children cce6b8e81581
files root-filesystem.sh sources/toys/ccwrap.c
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/root-filesystem.sh	Thu Aug 13 20:58:15 2009 -0500
     1.2 +++ b/root-filesystem.sh	Fri Aug 14 06:01:38 2009 -0500
     1.3 @@ -197,7 +197,7 @@
     1.4  # Tell future packages to link against the libraries in the new root filesystem,
     1.5  # rather than the ones in the cross compiler directory.
     1.6  
     1.7 -export WRAPPER_TOPDIR="$ROOT_TOPDIR"
     1.8 +export ${ARCH}_WRAPPER_TOPDIR="$ROOT_TOPDIR"
     1.9  
    1.10  # Build and install uClibc++
    1.11  
     2.1 --- a/sources/toys/ccwrap.c	Thu Aug 13 20:58:15 2009 -0500
     2.2 +++ b/sources/toys/ccwrap.c	Fri Aug 14 06:01:38 2009 -0500
     2.3 @@ -157,7 +157,7 @@
     2.4  	else toolprefix++;
     2.5  
     2.6  	prefixlen = strlen(toolprefix);
     2.7 -	if (!strcmp(toolprefix+prefixlen-3, "gcc")) prefixlen -= 3;
     2.8 +	if (prefixlen>=3 && !strcmp(toolprefix+prefixlen-3, "gcc")) prefixlen -= 3;
     2.9  	else if (!strcmp(toolprefix+prefixlen-2, "cc")) prefixlen -= 2;
    2.10  	else if (!strcmp(toolprefix+prefixlen-2, "ld")) {
    2.11  		prefixlen -= 2;
    2.12 @@ -175,6 +175,16 @@
    2.13  	}
    2.14  
    2.15  	devprefix = getenv("WRAPPER_TOPDIR");
    2.16 +	if (!devprefix) {
    2.17 +		char *temp, *temp2;
    2.18 +		xasprintf(&temp, "%.*sWRAPPER_TOPDIR", prefixlen, toolprefix);
    2.19 +		temp2 = temp;
    2.20 +		while (*temp2) {
    2.21 +			if (*temp2 == '-') *temp2='_';
    2.22 +			temp2++;
    2.23 +		}
    2.24 +		devprefix = getenv(temp);
    2.25 +	}
    2.26  	if (!devprefix) devprefix = topdir;
    2.27  
    2.28  	incstr = getenv("UCLIBC_GCC_INC");