changeset 1210:a36e985f6198

Untangle static vs cross for ccwrap section.
author Rob Landley <rob@landley.net>
date Mon, 16 Aug 2010 21:05:18 -0500
parents 42bcb67165b4
children e0c2ba5cc233
files sources/sections/ccwrap.sh
diffstat 1 files changed, 3 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/sources/sections/ccwrap.sh	Mon Aug 16 21:03:59 2010 -0500
+++ b/sources/sections/ccwrap.sh	Mon Aug 16 21:05:18 2010 -0500
@@ -1,63 +1,9 @@
-# build and install gcc wrapper script.
+# build and install gcc wrapper
 
 # Which compiler do we build the wrapper with, and should it be static?
 
-if [ -z "$HOST_ARCH" ] || [ "$BUILD_STATIC" == none ]
-then
-  TEMP="$CC"
-  STATIC_FLAGS=
-else
-  TEMP="${HOST_ARCH}-cc"
-  STATIC_FLAGS=--static
-fi
-
-# Copy compiler binaries (if not already present)
-
-if false
-then
-  # Populate the wrapper directories (unfinished)
-
-  # The purpose of this is to wrap an existing cross compiler by populating
-  # a directory of symlinks in the layout ccwrap expects.  This requires
-  # querying the existing compiler to find 1) system header dirs,
-  # 2) compiler header dirs, 3) system library dirs, 4) compiler library dirs,
-  # 5) binary search path for cpp and ld and such.
-
-  mkdir -p "$STAGE_DIR"/{tools,include,lib,cc/{include,lib}} &&
-
-  # Setup bin directory
-
-  mkdir -p "$STAGE_DIR/bin" || dienow
-  path_search "$PATH" "${TOOLCHAIN_PREFIX}*" \
-    'cp "$DIR/$FILE" "$STAGE_DIR/bin/$FILE"' | dotprogress
-
-  mv "$STAGE_DIR/"{bin/"${TOOLCHAIN_PREFIX}"cc,tools/bin/cc} ||
-  mv "$STAGE_DIR/"{bin/"${TOOLCHAIN_PREFIX}"gcc,tools/bin/cc} || dienow
-  ln -sf "${TOOLCHAIN_PREFIX}cc" "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}gcc" || dienow
-
-  # populate include
-
-  SYSINC_PATH="$(echo '#include <stdio.h>' | "$ARCH-cc" -E - | \
-    sed -n 's@.*"\(.*\)/stdio\.h".*@\1@p;T;q')"
-
-  # populate lib
-
-    # Need both /lib and /usr/lib.  What if libc.so linker script points to
-    # other directory?  --print-search-dirs, perhaps?
-
-  # populate cc/include
-
-  # This is the trick uClibc build uses.
-
-  CCINC_PATH="$(gcc --print-file-name=include)"
-
-  # populate cc/lib
-
-  CCLIB_PATH="$(gcc --print-file-name=crtbegin.o | sed 's@crtbegin.o$@@')"
-  # or maybe --print-search-dirs "libraries"?
-
-  # Populate tools
-fi
+[ "$BUILD_STATIC" == none ] && STATIC_FLAGS= || STATIC_FLAGS=--static
+[ -z "$HOST_ARCH" ] && TEMP="$CC" || TEMP="${HOST_ARCH}-cc"
 
 # Build wrapper binary