changeset 47:edaa86240321

Turnerize the build script and teach cross-compile.sh to build qemu when not given --short. Also break out install_utils and comment it out until it gets fixed. (A cross compiler needs an x86 binary of ldd, not an arm binary. It should examine arm files, but _run_ on x86.)
author Rob Landley <rob@landley.net>
date Mon, 18 Dec 2006 15:39:33 -0500
parents eeddef87a747
children 0f77e2472d27
files cross-compiler.sh include.sh
diffstat 2 files changed, 35 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/cross-compiler.sh	Sun Dec 17 18:32:07 2006 -0500
+++ b/cross-compiler.sh	Mon Dec 18 15:39:33 2006 -0500
@@ -6,6 +6,9 @@
 
 mkdir -p "${CROSS}" || dienow
 
+# Orange
+echo -e "\e[33m"
+
 # Build and install binutils
 
 setupfor binutils build-binutils
@@ -77,12 +80,29 @@
 (yes "" | make CROSS="${ARCH}-" oldconfig) > /dev/null &&
 make CROSS="${ARCH}-" KERNEL_HEADERS="${CROSS}/include" \
 	RUNTIME_PREFIX="${CROSS}/" DEVEL_PREFIX="${CROSS}/" \
-	all install_runtime install_dev install_utils &&
+	all install_runtime install_dev &&
+# This needs to be built with the native compiler.  Since uClibc uses $CROSS
+# internally, we have to blank it to avoid confusing them.
+#CROSS= make KERNEL_HEADERS="${CROSS}/include" \
+#	RUNTIME_PREFIX="${CROSS}/" DEVEL_PREFIX="${CROSS}/" install_utils &&
 cd .. &&
 $CLEANUP uClibc*
 
 [ $? -ne 0 ] && dienow
 
+# Skip this part if we're doing a short build.
+
+if [ -z "${BUILD_SHORT}" ]
+then
+
+# Build qemu
+setupfor qemu &&
+./configure --disable-gcc-check --prefix="${CROSS}" &&
+make &&
+make install &&
+cd .. &&
+$CLEANUP qemu-*
+
 # A quick hello world program to test the cross-compiler out.
 
 cat > "$WORK"/hello.c << 'EOF' &&
@@ -104,6 +124,8 @@
 
 [ $? -ne 0 ] && dienow
 
+fi
+
 cat > "${CROSS}"/README << EOF &&
 Cross compiler for $ARCH
 From http://landley.net/code/firmware
@@ -117,7 +139,7 @@
 
 EOF
 
-echo creating cross-compiler-"${ARCH}".tar.bz2 &&
+echo -n creating cross-compiler-"${ARCH}".tar.bz2 &&
 cd "${TOP}"
 { tar cjvCf build cross-compiler-"${ARCH}".tar.bz2 cross-compiler-"${ARCH}" ||
   dienow
@@ -125,4 +147,4 @@
 
 [ $? -ne 0 ] && dienow
 
-echo Cross compiler toolchain build complete.
+echo -e "\e[32mCross compiler toolchain build complete.\e[0m"
--- a/include.sh	Sun Dec 17 18:32:07 2006 -0500
+++ b/include.sh	Mon Dec 18 15:39:33 2006 -0500
@@ -69,7 +69,7 @@
 
 function dienow()
 {
-  echo "Exiting due to errors"
+  echo -e "\e[31mExiting due to errors\e[0m"
   exit 1
 }
 
@@ -119,7 +119,7 @@
   then
     cd "$1"* || dienow
   else
-    mkdir "$2"
+    mkdir -p "$2" &&
     cd "$2" || dienow
   fi
 
@@ -160,6 +160,14 @@
 # For bash: check the $PATH for new executables added after startup.
 set +h
 
+# Are we doing a short build?
+
+if [ "$1" == "--short" ]
+then
+  export BUILD_SHORT=1
+  shift
+fi
+
 # Get target platform from first command line argument.
 
 if [ -z "$NO_ARCH" ]