changeset 1816:fb05f99ffcce

Collate site-local variables under "MY_XXX" prefix: MY_PATCH_DIR, MY_ROOT_OVERLAY, MY_CROSS_PATH and MY_CROSS_PREFIX.
author Rob Landley <rob@landley.net>
date Sat, 21 Nov 2015 16:44:39 -0600
parents 191dfad915ba
children 92d542aa6ceb
files build.sh config root-filesystem.sh sources/download_functions.sh sources/functions.sh sources/variables.sh
diffstat 6 files changed, 32 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/build.sh	Wed Nov 18 09:18:44 2015 -0600
+++ b/build.sh	Sat Nov 21 16:44:39 2015 -0600
@@ -112,7 +112,7 @@
 
 # Do we need to build the simple cross compiler?
 
-if [ -z "$CROSS_COMPILER_PATH" ] && not_already simple-cross-compiler
+if [ -z "$MY_CROSS_PATH" ] && not_already simple-cross-compiler
 then
   # If we need to build cross compiler, assume root filesystem is stale.
 
@@ -125,7 +125,7 @@
 # canadian cross.  (It's more powerful than we need here, but if you're going
 # to use the cross compiler in other contexts this is probably what you want.)
 
-if [ -z "$CROSS_COMPILER_PATH" ] && [ ! -z "$CROSS_COMPILER_HOST" ] &&
+if [ -z "$MY_CROSS_PATH" ] && [ ! -z "$CROSS_COMPILER_HOST" ] &&
   not_already cross-compiler
 then
   zap root-filesystem native-compiler system-image
@@ -160,7 +160,7 @@
 
 # Not trying to build nommu native compilers for the moment.
 
-if [ -z "$CROSS_COMPILER_PATH" ] && ! grep -q ELF2FLT sources/targets/"$ARCH" &&
+if [ -z "$MY_CROSS_PATH" ] && ! grep -q ELF2FLT sources/targets/"$ARCH" &&
   not_already native-compiler
 then
   zap system-image
--- a/config	Wed Nov 18 09:18:44 2015 -0600
+++ b/config	Sat Nov 21 16:44:39 2015 -0600
@@ -123,12 +123,6 @@
 
 # export ALLOW_PATCH_FAILURE=1
 
-# If this is set, it's points to a directory containing additional files to
-# copy into the root-filesystem. The path is either absolute or
-# relative to the aboriginal topdir.
-
-# export ROOT_OVERLAY="overlay"
-
 # Build more things in parallel.
 
 # export FORK=1
@@ -148,18 +142,28 @@
 
 # export CFLAGS="-g -pipe"
 
-# If you don't want to build cross compilers, supply path to existing one.
-
-# export CROSS_COMPILER_PATH=/path/to/cross-compiler/bin
-# export CC_PREFIX=thingy-
+# The following paths supplement the build with additional site-specific data.
+# Each path is either absolute or relative to the aboriginal topdir.
 
 # If you have patches you want patch files outside the aboriginal
 # patch directory to be applied, supply the path here. Paths to the
-# patches are built using the pattern
-#   ${EXTERNAL_PATCH_DIR}/${PACKAGE}/*.patch
-# So one or more patches to apply to linux could be in the
+# patches are built using the pattern ${MY_PATCH_DIR}/${PACKAGE}/*.patch
+# so one or more patches to apply to linux could be in the
 # ${EXTERNAL_PATCH_DIR}/linux directory and will be applied in sorted
-# order. The path is either absolute or relative to the aboriginal
-# topdir.
+# order (after the builtin sources/patches/${PACKAGE}-*.patch files).
 
-# export EXTERNAL_PATCH_DIR=/path/to/external/patches
\ No newline at end of file
+# export MY_PATCH_DIR=/path/to/external/patches
+
+# If this is set, it's points to a directory containing additional files to
+# copy into the root-filesystem. (This overwrites existing conflicting files.)
+
+# export MY_ROOT_OVERLAY="overlay"
+
+# If you don't want to build cross compilers, supply path to existing one.
+# Setting these tells build.sh not to build host or native compilers
+# (the native compiler is very sensitive to libgcc build version skew).
+
+# export MY_CROSS_PATH=/path/to/cross-compiler/bin
+# export MY_CROSS_PREFIX=thingy-
+
+
--- a/root-filesystem.sh	Wed Nov 18 09:18:44 2015 -0600
+++ b/root-filesystem.sh	Sat Nov 21 16:44:39 2015 -0600
@@ -39,10 +39,10 @@
 # If user specified different files to put in the root filesystem, add them.
 # (This overwrites existing files.)
 
-if [ ! -z "$ROOT_OVERLAY" ]
+if [ ! -z "$MY_ROOT_OVERLAY" ]
 then
   cd "$TOP"
-  tar -c -C "$ROOT_OVERLAY" . | tar -x -C "$STAGE_DIR" || dienow
+  tar -c -C "$MY_ROOT_OVERLAY" . | tar -x -C "$STAGE_DIR" || dienow
 fi
 
 # Build toybox
--- a/sources/download_functions.sh	Wed Nov 18 09:18:44 2015 -0600
+++ b/sources/download_functions.sh	Sat Nov 21 16:44:39 2015 -0600
@@ -61,9 +61,9 @@
   done
 
   # gather external package patches sorted by filename
-  if [ ! -z "$EXTERNAL_PATCH_DIR" ] && [ -d "${EXTERNAL_PATCH_DIR}/${PACKAGE}" ]
+  if [ ! -z "$MY_PATCH_DIR" ] && [ -d "${MY_PATCH_DIR}/${PACKAGE}" ]
   then
-    for i in "${EXTERNAL_PATCH_DIR}/${PACKAGE}/"*.patch
+    for i in "${MY_PATCH_DIR}/${PACKAGE}/"*.patch
     do
       if [ -f "$i" ]
       then
--- a/sources/functions.sh	Wed Nov 18 09:18:44 2015 -0600
+++ b/sources/functions.sh	Sat Nov 21 16:44:39 2015 -0600
@@ -8,12 +8,13 @@
 {
   local i
 
-  if [ ! -z "$CROSS_COMPILER_PATH" ]
+  if [ ! -z "$MY_CROSS_PATH" ]
   then
+    CC_PREFIX="$MY_CC_PREFIX"
     [ -z "$CC_PREFIX" ] &&
-      echo "CROSS_COMPILER_PATH without CC_PREFIX" >&2 &&
+      echo "MY_CROSS_PATH without MY_CC_PREFIX" >&2 &&
       dienow
-    echo -n "$CROSS_COMPILER_PATH:"
+    echo -n "$MY_CROSS_PATH:"
     return
   fi
 
--- a/sources/variables.sh	Wed Nov 18 09:18:44 2015 -0600
+++ b/sources/variables.sh	Sat Nov 21 16:44:39 2015 -0600
@@ -53,10 +53,7 @@
 export_if_blank HOSTTOOLS="$BUILD/host"
 export_if_blank WRAPDIR="$BUILD/record-commands"
 
-if [ ! -z "$EXTERNAL_PATCH_DIR" ]
-then
-    export EXTERNAL_PATCH_DIR=$(readlink -e "$EXTERNAL_PATCH_DIR")
-fi
+[ ! -z "$MY_PATCH_DIR" ] && export MY_PATCH_DIR="$(readlink -e "$MY_PATCH_DIR")"
 
 # Set a default non-arch