diff cross-compiler.sh @ 400:f60b1189c0ea

Teach build to use recent uClibc snapshot when USE_UNSTABLE=uClibc
author Rob Landley <rob@landley.net>
date Sun, 28 Sep 2008 12:18:40 -0500
parents f6802733e627
children e64eb9ff27b9
line wrap: on
line diff
--- a/cross-compiler.sh	Sun Sep 28 05:45:13 2008 -0500
+++ b/cross-compiler.sh	Sun Sep 28 12:18:40 2008 -0500
@@ -89,36 +89,21 @@
 # Build and install uClibc
 
 setupfor uClibc
-
-if [ -e /usr/include ]
+if unstable uClibc
 then
-  # Build $ARCH-readelf and $ARCH-ldd
-
-  # "make utils" in uClibc is broken for cross compiling.  Either it creates a
-  # target binary (which you can't run on the host), or it tries to link the
-  # host binary against the target library, and use the target compiler flags
-  # (neither of which is going to produce a working host binary).  The solution
-  # is to bypass the broken build entirely, and do it by hand.
-  make CROSS= allnoconfig &&
-  make CROSS= headers KERNEL_HEADERS=/usr/include &&
-  $CC $STATIC_FLAGS -Os -s -I include utils/readelf.c \
-      -o "${CROSS}/bin/${ARCH}-readelf" &&
-  $CC $STATIC_FLAGS -Os -s -I ldso/include utils/ldd.c \
-      -o "${CROSS}/bin/${ARCH}-ldd" &&
-  make CROSS= distclean
-
-  [ $? -ne 0 ] && dienow
+  CONFIGFILE=miniconfig-alt-uClibc
+  BUILDIT="install -j $CPUS"
+else
+  CONFIGFILE=miniconfig-uClibc
+  BUILDIT="all install_runtime install_dev"
 fi
 
-# Build and install the uClibc libraries.
-
-make CROSS= allnoconfig KCONFIG_ALLCONFIG="${CONFIG_DIR}"/miniconfig-uClibc &&
-# Can't use -j here, build is unstable.
+make CROSS= KCONFIG_ALLCONFIG="${CONFIG_DIR}"/$CONFIGFILE allnoconfig &&
 make CROSS="${ARCH}-" KERNEL_HEADERS="${CROSS}/include" PREFIX="${CROSS}/" \
-	RUNTIME_PREFIX=/ DEVEL_PREFIX=/ all install_runtime install_dev &&
+     RUNTIME_PREFIX=/ DEVEL_PREFIX=/ $BUILDIT &&
 cd ..
+cleanup uClibc
 
-cleanup uClibc
 
 cat > "${CROSS}"/README << EOF &&
 Cross compiler for $ARCH