changeset 503:e98ed40c55ef

Move include.sh to sources/include.sh. End user doesn't call it directly, shouldn't be at top level.
author Rob Landley <rob@landley.net>
date Sun, 30 Nov 2008 00:59:27 -0600
parents 9a36ec9d02f7
children 131177fc8ec8
files build.sh cross-compiler.sh download.sh host-tools.sh include.sh mini-native.sh package-mini-native.sh run-from-build.sh sources/include.sh
diffstat 9 files changed, 117 insertions(+), 117 deletions(-) [+]
line wrap: on
line diff
--- a/build.sh	Sun Nov 30 00:52:39 2008 -0600
+++ b/build.sh	Sun Nov 30 00:59:27 2008 -0600
@@ -5,7 +5,7 @@
 if [ $# -eq 0 ]
 then
   echo "Usage: $0 ARCH [ARCH...]"
-  ./include.sh
+  sources/include.sh
   exit 1
 fi
 
--- a/cross-compiler.sh	Sun Nov 30 00:52:39 2008 -0600
+++ b/cross-compiler.sh	Sun Nov 30 00:59:27 2008 -0600
@@ -2,7 +2,7 @@
 
 # Get lots of predefined environment variables and shell functions.
 
-source include.sh
+source sources/include.sh
 
 rm -rf "${CROSS}"
 mkdir -p "${CROSS}" || dienow
--- a/download.sh	Sun Nov 30 00:52:39 2008 -0600
+++ b/download.sh	Sun Nov 30 00:59:27 2008 -0600
@@ -3,7 +3,7 @@
 # Use "./download.sh --extract" to extract all tarballs.
 
 NO_ARCH=none
-source include.sh
+source sources/include.sh
 
 [ "$1" == "--extract" ] && EXTRACT_ALL=yes
 
--- a/host-tools.sh	Sun Nov 30 00:52:39 2008 -0600
+++ b/host-tools.sh	Sun Nov 30 00:59:27 2008 -0600
@@ -7,7 +7,7 @@
 set +h
 
 NO_ARCH=1
-source include.sh
+source sources/include.sh
 
 echo -e "$HOST_COLOR"
 echo "=== Building host tools"
--- a/include.sh	Sun Nov 30 00:52:39 2008 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-#!/bin/bash
-
-
-[ -e config ] && source config
-
-source sources/functions.sh
-
-# What host compiler should we use?
-
-[ -z "$CC" ] && CC=gcc
-
-# How many processors should make -j use?
-
-if [ -z "$CPUS" ]
-then
-  export CPUS=$[$(echo /sys/devices/system/cpu/cpu[0-9]* | wc -w)+0]
-  [ "$CPUS" -lt 1 ] && CPUS=1
-fi
-
-umask 022
-unset CFLAGS CXXFLAGS
-
-# This tells gcc to aggressively garbage collect its internal data
-# structures.  Without this, gcc triggers the OOM killer trying to rebuild
-# itself in 128 megs of ram, which is the QEMU default size.  Don't do
-# this on a 64 bit host or gcc will slow to a crawl due to insufficient memory.
-[ "$(uname -m)" != "x86_64" ] &&
-  export CFLAGS="--param ggc-min-expand=0 --param ggc-min-heapsize=12288"
-
-# Find/create directories
-
-TOP=`pwd`
-export SOURCES="${TOP}/sources"
-export SRCDIR="${SOURCES}/packages"
-export FROMSRC=../packages
-export BUILD="${TOP}/build"
-export HOSTTOOLS="${BUILD}/host"
-
-[ -z "$WRAPPY_LOGDIR" ] && WRAPPY_LOGDIR="$BUILD"
-
-# Adjust $PATH
-
-if [ "$PATH" != "$HOSTTOOLS" ]
-then
-  if [ -f "$HOSTTOOLS/busybox" ]
-  then
-    PATH="$HOSTTOOLS"
-  else
-    PATH="${HOSTTOOLS}:$PATH"
-  fi
-fi
-
-STAGE_NAME=`echo $0 | sed 's@.*/\(.*\)\.sh@\1@'`
-export WRAPPY_LOGPATH="$WRAPPY_LOGDIR/cmdlines.${STAGE_NAME}.setupfor"
-if [ -f "$BUILD/wrapdir/wrappy" ]
-then
-  export WRAPPY_REALPATH="$PATH"
-  PATH="$BUILD/wrapdir"
-fi
-
-mkdir -p "${SRCDIR}"
-
-# Tell bash not to cache the $PATH because we modify it.  Without this, bash
-# won't find new executables added after startup.
-set +h
-
-# Get target platform from first command line argument.
-
-if [ -z "$NO_ARCH" ]
-then
-  ARCH_NAME="$1"
-  ARCH="$(echo "$1" | sed 's@.*/@@')"
-  if [ ! -f "${TOP}/sources/targets/${ARCH}/details" ]
-  then
-    echo "Supported architectures: "
-    (cd "${TOP}/sources/targets" && ls)
-    exit 1
-  fi
-
-  # Read the relevant config file.
-
-  CONFIG_DIR="${TOP}/sources/targets/${ARCH}"
-  source "${CONFIG_DIR}/details"
-
-  # Which platform are we building for?
-
-  export WORK="${BUILD}/temp-$ARCH"
-  mkdir -p "${WORK}"
-
-  # Say "unknown" in two different ways so it doesn't assume we're NOT
-  # cross compiling when the host and target are the same processor.  (If host
-  # and target match, the binutils/gcc/make builds won't use the cross compiler
-  # during mini-native.sh, and the host compiler links binaries against the
-  # wrong libc.)
-  [ -z "$CROSS_HOST" ] && export CROSS_HOST=`uname -m`-walrus-linux
-  [ -z "$CROSS_TARGET" ] && export CROSS_TARGET=${ARCH}-unknown-linux
-
-  # Setup directories and add the cross compiler to the start of the path.
-
-  export CROSS="${BUILD}/cross-compiler-$ARCH"
-  export NATIVE="${BUILD}/mini-native-$ARCH"
-  export PATH="${CROSS}/bin:$PATH"
-else
-  ARCH_NAME=host
-  export WORK="${BUILD}/host-temp"
-  mkdir -p "${WORK}"
-fi
-
-[ $? -ne 0 ] && dienow
-
--- a/mini-native.sh	Sun Nov 30 00:52:39 2008 -0600
+++ b/mini-native.sh	Sun Nov 30 00:59:27 2008 -0600
@@ -2,7 +2,7 @@
 
 # Get lots of predefined environment variables and shell functions.
 
-source include.sh
+source sources/include.sh
 
 # Purple.  And why not?
 echo -e "$NATIVE_COLOR"
--- a/package-mini-native.sh	Sun Nov 30 00:52:39 2008 -0600
+++ b/package-mini-native.sh	Sun Nov 30 00:59:27 2008 -0600
@@ -2,7 +2,7 @@
 
 # Create an ext2 root filesystem image from mini-native
 
-source include.sh
+source sources/include.sh
 
 echo -e "$PACKAGE_COLOR"
 echo "=== Packaging system image from mini-native"
--- a/run-from-build.sh	Sun Nov 30 00:52:39 2008 -0600
+++ b/run-from-build.sh	Sun Nov 30 00:59:27 2008 -0600
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 SAVEPATH="$PATH"
-source include.sh
+source sources/include.sh
 PATH="$SAVEPATH"
 
 cd "${BUILD}/system-image-$ARCH" || exit 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/include.sh	Sun Nov 30 00:59:27 2008 -0600
@@ -0,0 +1,110 @@
+#!/bin/bash
+
+
+[ -e config ] && source config
+
+source sources/functions.sh
+
+# What host compiler should we use?
+
+[ -z "$CC" ] && CC=gcc
+
+# How many processors should make -j use?
+
+if [ -z "$CPUS" ]
+then
+  export CPUS=$[$(echo /sys/devices/system/cpu/cpu[0-9]* | wc -w)+0]
+  [ "$CPUS" -lt 1 ] && CPUS=1
+fi
+
+umask 022
+unset CFLAGS CXXFLAGS
+
+# This tells gcc to aggressively garbage collect its internal data
+# structures.  Without this, gcc triggers the OOM killer trying to rebuild
+# itself in 128 megs of ram, which is the QEMU default size.  Don't do
+# this on a 64 bit host or gcc will slow to a crawl due to insufficient memory.
+[ "$(uname -m)" != "x86_64" ] &&
+  export CFLAGS="--param ggc-min-expand=0 --param ggc-min-heapsize=12288"
+
+# Find/create directories
+
+TOP=`pwd`
+export SOURCES="${TOP}/sources"
+export SRCDIR="${SOURCES}/packages"
+export FROMSRC=../packages
+export BUILD="${TOP}/build"
+export HOSTTOOLS="${BUILD}/host"
+
+[ -z "$WRAPPY_LOGDIR" ] && WRAPPY_LOGDIR="$BUILD"
+
+# Adjust $PATH
+
+if [ "$PATH" != "$HOSTTOOLS" ]
+then
+  if [ -f "$HOSTTOOLS/busybox" ]
+  then
+    PATH="$HOSTTOOLS"
+  else
+    PATH="${HOSTTOOLS}:$PATH"
+  fi
+fi
+
+STAGE_NAME=`echo $0 | sed 's@.*/\(.*\)\.sh@\1@'`
+export WRAPPY_LOGPATH="$WRAPPY_LOGDIR/cmdlines.${STAGE_NAME}.setupfor"
+if [ -f "$BUILD/wrapdir/wrappy" ]
+then
+  export WRAPPY_REALPATH="$PATH"
+  PATH="$BUILD/wrapdir"
+fi
+
+mkdir -p "${SRCDIR}"
+
+# Tell bash not to cache the $PATH because we modify it.  Without this, bash
+# won't find new executables added after startup.
+set +h
+
+# Get target platform from first command line argument.
+
+if [ -z "$NO_ARCH" ]
+then
+  ARCH_NAME="$1"
+  ARCH="$(echo "$1" | sed 's@.*/@@')"
+  if [ ! -f "${TOP}/sources/targets/${ARCH}/details" ]
+  then
+    echo "Supported architectures: "
+    (cd "${TOP}/sources/targets" && ls)
+    exit 1
+  fi
+
+  # Read the relevant config file.
+
+  CONFIG_DIR="${TOP}/sources/targets/${ARCH}"
+  source "${CONFIG_DIR}/details"
+
+  # Which platform are we building for?
+
+  export WORK="${BUILD}/temp-$ARCH"
+  mkdir -p "${WORK}"
+
+  # Say "unknown" in two different ways so it doesn't assume we're NOT
+  # cross compiling when the host and target are the same processor.  (If host
+  # and target match, the binutils/gcc/make builds won't use the cross compiler
+  # during mini-native.sh, and the host compiler links binaries against the
+  # wrong libc.)
+  [ -z "$CROSS_HOST" ] && export CROSS_HOST=`uname -m`-walrus-linux
+  [ -z "$CROSS_TARGET" ] && export CROSS_TARGET=${ARCH}-unknown-linux
+
+  # Setup directories and add the cross compiler to the start of the path.
+
+  export CROSS="${BUILD}/cross-compiler-$ARCH"
+  export NATIVE="${BUILD}/mini-native-$ARCH"
+  export PATH="${CROSS}/bin:$PATH"
+else
+  ARCH_NAME=host
+  export WORK="${BUILD}/host-temp"
+  mkdir -p "${WORK}"
+fi
+
+[ $? -ne 0 ] && dienow
+