# HG changeset patch # User Rob Landley # Date 1250247698 18000 # Node ID d0b74a631587e2d929ef7f64f84a9a39aefd564b # Parent 78b05421aa9d0b25063c11aa567ea6ad2a4ef936 Teach ccwrap.c to use arch-specific WRAPPER_TOPDIR values, to avoid interfering with canadian cross. diff -r 78b05421aa9d -r d0b74a631587 root-filesystem.sh --- a/root-filesystem.sh Thu Aug 13 20:58:15 2009 -0500 +++ b/root-filesystem.sh Fri Aug 14 06:01:38 2009 -0500 @@ -197,7 +197,7 @@ # Tell future packages to link against the libraries in the new root filesystem, # rather than the ones in the cross compiler directory. -export WRAPPER_TOPDIR="$ROOT_TOPDIR" +export ${ARCH}_WRAPPER_TOPDIR="$ROOT_TOPDIR" # Build and install uClibc++ diff -r 78b05421aa9d -r d0b74a631587 sources/toys/ccwrap.c --- a/sources/toys/ccwrap.c Thu Aug 13 20:58:15 2009 -0500 +++ b/sources/toys/ccwrap.c Fri Aug 14 06:01:38 2009 -0500 @@ -157,7 +157,7 @@ else toolprefix++; prefixlen = strlen(toolprefix); - if (!strcmp(toolprefix+prefixlen-3, "gcc")) prefixlen -= 3; + if (prefixlen>=3 && !strcmp(toolprefix+prefixlen-3, "gcc")) prefixlen -= 3; else if (!strcmp(toolprefix+prefixlen-2, "cc")) prefixlen -= 2; else if (!strcmp(toolprefix+prefixlen-2, "ld")) { prefixlen -= 2; @@ -175,6 +175,16 @@ } devprefix = getenv("WRAPPER_TOPDIR"); + if (!devprefix) { + char *temp, *temp2; + xasprintf(&temp, "%.*sWRAPPER_TOPDIR", prefixlen, toolprefix); + temp2 = temp; + while (*temp2) { + if (*temp2 == '-') *temp2='_'; + temp2++; + } + devprefix = getenv(temp); + } if (!devprefix) devprefix = topdir; incstr = getenv("UCLIBC_GCC_INC");