X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fgenerator%2Fbuild_variables.sh;h=8723e454317350c115e40a1769c9d03a62ae7594;hb=bffe9fba70b7ea1ab1b5d963b811d4637b021ee1;hp=c975fd5b61c4b33717a6578ced8385935dcddcb1;hpb=26159010c33a2c9be695a496f0c6dc540341bee0;p=feisty_meow.git diff --git a/scripts/generator/build_variables.sh b/scripts/generator/build_variables.sh index c975fd5b..8723e454 100644 --- a/scripts/generator/build_variables.sh +++ b/scripts/generator/build_variables.sh @@ -50,34 +50,33 @@ source $FEISTY_MEOW_SCRIPTS/core/functions.sh ############## +# outer check on whether this already was run or not. +if [ -z "$BUILD_VARS_LOADED" ]; then + # perform some calculations to get the right paths from our parameters. if [ ! -z "$PARM_1" ]; then # use the first real parameter since this is probably the 'source' version. export BUILD_SCRIPTS_DIR="$(dirname "$PARM_1")" THIS_TOOL_NAME="$(basename "$PARM_1")" -echo ==sourced version buildscriptsdir is $BUILD_SCRIPTS_DIR else # use the zeroth parameter, since we know nothing more about our name. export BUILD_SCRIPTS_DIR="$(dirname "$PARM_0")" THIS_TOOL_NAME="$(basename "$PARM_0")" -echo ==bashed version buildscriptsdir is $BUILD_SCRIPTS_DIR fi BUILD_SCRIPTS_DIR="$(cd $(echo $BUILD_SCRIPTS_DIR | tr '\\\\' '/' ); \pwd)" -echo "==buildvars buildscriptsdir is $BUILD_SCRIPTS_DIR" # figure out the other paths based on where we found this script. export BUILDING_HIERARCHY="$(echo "$BUILD_SCRIPTS_DIR" | sed -e 's/\(.*\)\/[^\/]*/\1/')" export CLAM_DIR="$(cd $BUILD_SCRIPTS_DIR/../clam ; \pwd)" -echo "==buildvars clamdir is $CLAM_DIR" # synonym to make other builds happy. export BUILDER_DIR="$BUILDING_HIERARCHY" # guess the current platform. -IS_UNIX=$(uname | grep -i linux) -if [ -z "$IS_UNIX" ]; then IS_UNIX=$(uname | grep -i unix); fi -if [ -z "$IS_UNIX" ]; then IS_UNIX=$(uname | grep -i darwin); fi -IS_DOS=$(uname | grep -i ming) -if [ -z "$IS_DOS" ]; then IS_DOS=$(uname | grep -i cygwin); fi +#IS_UNIX=$(uname | grep -i linux) +#if [ -z "$IS_UNIX" ]; then IS_UNIX=$(uname | grep -i unix); fi +#if [ -z "$IS_UNIX" ]; then IS_UNIX=$(uname | grep -i darwin); fi +#IS_DOS=$(uname | grep -i ming) +#if [ -z "$IS_DOS" ]; then IS_DOS=$(uname | grep -i cygwin); fi # set some clam parameters for compilation. if the script can't guess the # right configuration, then you will need to set them in the last 'else' @@ -99,7 +98,6 @@ fi # new BUILD_TOP variable points at the utter top-most level of any files # in the building hierarchy. export BUILD_TOP="$FEISTY_MEOW_DIR" -echo build top is $BUILD_TOP # this variable points at a folder where we store most of the generated products # of the build. these tend to be the things that will be used for packaging into @@ -112,22 +110,17 @@ if [ ! -d "$LOGS_DIR" ]; then mkdir -p "$LOGS_DIR" fi -# hook clam into the compilation system. -function make() -{ - /usr/bin/make -I "$CLAM_DIR" $* -} - ############## # debugging area where we say what we think we know. -#echo scripts: $BUILD_SCRIPTS_DIR -#echo build tools hier: $BUILDING_HIERARCHY -#echo this tool: $THIS_TOOL_NAME -#echo repository: $FEISTY_MEOW_DIR -#echo clam: $CLAM_DIR -#echo makeflags: $MAKEFLAGS +if [ ! -z "$SHELL_DEBUG" ]; then + echo scripts: $BUILD_SCRIPTS_DIR + echo build tools hier: $BUILDING_HIERARCHY + echo this tool: $THIS_TOOL_NAME + echo repository: $FEISTY_MEOW_DIR + echo clam: $CLAM_DIR +fi ############## @@ -157,7 +150,6 @@ fi # now compute some more paths with a bit of "heuristics" for where we can # find the source code. export TOOL_SOURCES="$FEISTY_MEOW_DIR/nucleus/tools" -echo "==tool source is $TOOL_SOURCES" if [ -z "$got_bad" -a ! -d "$TOOL_SOURCES/dependency_tool" -o ! -d "$TOOL_SOURCES/clam_tools" ]; then echo "This script cannot locate the tool source code folder. This is where the" echo "dependency_tool and clam_tools folders are expected to be." @@ -225,5 +217,20 @@ if [ -z "$got_bad" ]; then bash fi + # sentinel that tells us this script was pulled in. + export BUILD_VARS_LOADED=true + fi +fi # outer wrapper for already ran build vars check. + +############## + +# hook clam into the compilation system. +# this always needs to be defined since functions aren't exported. +function make() +{ + /usr/bin/make -I "$CLAM_DIR" $* +} + +