diff host-tools.sh @ 301:309b574a5059

Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a package build breaks its source isn't deleted), and comment host-tools.sh more.
author Rob Landley <rob@landley.net>
date Thu, 21 Feb 2008 04:47:54 -0600
parents d5cda5597722
children a791ca629d9c
line wrap: on
line diff
--- a/host-tools.sh	Sat Feb 16 23:23:11 2008 -0600
+++ b/host-tools.sh	Thu Feb 21 04:47:54 2008 -0600
@@ -14,6 +14,21 @@
 
 mkdir -p "${HOSTTOOLS}" || dienow
 
+# Here are the utilities the build needs that this script doesn't
+# build, but which me must instead use from the host system.
+
+# The first seven are from packages already in mini-native.
+# The last six need to be added to toybox.  (The build breaks if we use
+# the busybox versions.)
+
+for i in ar as nm cc gcc make ld   bzip2 cp find install od sort
+do
+  [ ! -f "${HOSTTOOLS}/$i" ] && (ln -s `which $i` "${HOSTTOOLS}/$i" || dienow)
+done
+
+# Yes this is an old version of busybox.  We're gradually replacing busybox
+# with toybox, one command at a time.
+
 # Build busybox
 if [ -z "$(which busybox)" ]
 then
@@ -29,10 +44,9 @@
   do
     ln -s busybox "${HOSTTOOLS}"/$i || dienow
   done
-  cd .. &&
-  $CLEANUP busybox
+  cd ..
 
-  [ $? -ne 0 ] && dienow
+  cleanup busybox
 fi
 
 # Build toybox
@@ -43,12 +57,15 @@
   make &&
   make instlist &&
   make install_flat PREFIX="${HOSTTOOLS}" &&
-  cd .. &&
-  $CLEANUP toybox
+  cd ..
 
-  [ $? -ne 0 ] && dienow
+  cleanup toybox
 fi
 
+# This is optionally used by mini-native to accelerate native builds when
+# running under qemu.  It's not used to build mini-native, or to build
+# the cross compiler.
+
 # Build distcc
 if [ -z "$(which distcc)" ]
 then
@@ -56,14 +73,13 @@
   ./configure --with-included-popt &&
   make -j "$CPUS" &&
   cp distcc distccd "${HOSTTOOLS}" &&
-  cd .. &&
-  $CLEANUP distcc
+  cd ..
 
-  [ $? -ne 0 ] && dienow
+  cleanup distcc
 fi
 
 # As a temporary measure, build User Mode Linux and use _that_ to package
-# the ext2 image to boot qemu with.
+# the ext2 image to boot qemu with.  (Replace this with toybox gene2fs.)
 
 if [ -z "$(which linux)" ]
 then
@@ -81,21 +97,21 @@
   make ARCH=um allnoconfig KCONFIG_ALLCONFIG=mini.conf &&
   make -j "$CPUS" ARCH=um &&
   cp linux "${HOSTTOOLS}" &&
-  cd .. &&
-  $CLEANUP linux
+  cd ..
 
-  [ $? -ne 0 ] && dienow
+  cleanup linux
 fi
 
+# Everything after here is stuff we _could_ build, but currently don't.
+
 # Build squashfs
 #setupfor squashfs
 #cd squashfs-tools &&
 #make &&
 #cp mksquashfs unsquashfs "${HOSTTOOLS}" &&
-#cd .. &&
-#$CLEANUP squashfs*
+#cd ..
 #
-#[ $? -ne 0 ] && dienow
+#cleanup squashfs
 
 # we can't reliably build qemu because who knows what gcc version the host
 # has?  so until qemu is fixed to build with an arbitrary c compiler,
@@ -113,12 +129,8 @@
 #  ./configure --disable-gcc-check --disable-gfx-check --prefix="${CROSS}" &&
 #  make &&
 #  make install &&
-#  cd .. &&
-#  $CLEANUP qemu-*
-
-for i in ar as nm cc gcc make ld   bzip2 cp find install od sort
-do
-  [ ! -f "${HOSTTOOLS}/$i" ] && (ln -s `which $i` "${HOSTTOOLS}/$i" || dienow)
-done
+#  cd ..
+#
+#  cleanup qemu
 
 echo -e "\e[32mHost tools build complete.\e[0m"