changeset 717:5a3ebc77340c

Teach buildall.sh to canadian cross static cross compilers with --enable-shared and uClibc++ when you set "$CROSS_COMPILERS_EH".
author Rob Landley <rob@landley.net>
date Sun, 19 Apr 2009 03:11:49 -0500
parents ff2cd7c539b2
children f63119db5afa
files buildall.sh
diffstat 1 files changed, 60 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/buildall.sh	Sat Apr 18 03:03:59 2009 -0500
+++ b/buildall.sh	Sun Apr 19 03:11:49 2009 -0500
@@ -5,45 +5,85 @@
 
 . sources/functions.sh || exit 1
 
-# Build one architecture, capturing log output.
+rm -rf build
+
+BASEARCHES="$(cd sources/targets/; ls | grep -v '^hw-')"
+
+# Run command in the background or foreground, depending on $FORK
 
-buildit()
+doforklog()
 {
-  (time ./build.sh $1) 2>&1 | tee out-$1.txt
+  [ -z "$LOG" ] && LOG=/dev/null
+
+  [ ! -z "$FORK" ] &&
+    ( ($*) 2>&1 | tee "$LOG" | grep '^===' &) ||
+      ($*) 2>&1 | tee "$LOG"
 }
 
-# Build in the background or foreground depending on $FORK
-
-buildlog()
-{
-  [ ! -z "$FORK" ] && (buildit $i | grep '^===' &) || buildit $i
-}
-
-# Perform initial setup that doesn't parallelize well.  Download source,
+# Perform initial setup that doesn't parallelize well: Download source,
 # build host tools, extract source.
 
-(./download.sh && ./host-tools.sh && ./download.sh --extract ) 2>&1 | tee out-host.txt
+(./download.sh && ./host-tools.sh && ./download.sh --extract ) 2>&1 |
+  tee out-host.txt
 
 # Create README file (requires build/sources to be extracted)
 
 (do_readme && cat sources/toys/README.footer) | tee build/README
 
-# Build architectures
+# Build all the initial cross compilers
 
-for i in $(cd sources/targets/; ls | grep -v '^hw-')
+# These are dynamically linked on the host, --disable-shared, no uClibc++.
+
+for i in $BASEARCHES
 do
-  buildlog $i
+  LOG=build/cross-dynamic-${i}.txt \
+  SKIP_STAGE_TARBALLS=1 doforklog ./cross-compiler.sh $i
 done
 
-# Wait for architectures to complete
-
 wait4background 0
 
-# Now build hardware targets
+# Should we do the static compilers via canadian cross?
+
+if [ ! -z "$CROSS_COMPILERS_EH" ]
+then
+
+# Build the static cross compilers
+# These are statically linked against uClibc on the host (for portability),
+# built --with-shared, and have uClibc++ installed.
+
+for i in $BASEARCHES
+do
+  LOG=build/cross-static-${i}.txt SKIP_STAGE_TARBALLS=1 \
+    BUILD_STATIC=1 FROM_ARCH=i686 NATIVE_TOOLCHAIN=only \
+    doforklog ./root-filesystem.sh $i 
+done
+
+wait4background 0
+
+
+# Replace the dynamic cross compilers with the static ones, and tar 'em up.
 
-for i in $(cd sources/targets; ls | grep '^hw-')
+rm -rf build/dynamic &&
+mkdir -p build/dynamic &&
+mv build/cross-compiler-* build/dynamic || exit 1
+
+for i in $BASEARCHES
 do
-  buildlog $i
+  mv build/{root-filesystem-$i,cross-compiler-$i} &&
+  mv root-filesystem-$i cross-$i &&
+  doforklog tar czf cross-compiler-$i.tar.bz2 cross-compiler-$i
+done
+
+wait4background 0
+
+fi
+
+# Now build hardware targets using the static cross compilers above.
+# (Smoke test, really.)
+
+for i in $(cd sources/targets; ls)
+do
+  doforklog ./build.sh 2>&1 | tee out-$i.txt
 done
 
 # Wait for hardware targets to complete