Merge branch 'release-2.140.136'
[feisty_meow.git] / scripts / generator / build_variables.sh
index 6e8fa38e93d7367060b3561a09c8d5eac1aab471..bd2afb036d02f508524dc03f8e810ab5968bf344 100644 (file)
@@ -55,6 +55,11 @@ source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
 # outer check on whether this already was run or not.
 if [ -z "$BUILD_VARS_LOADED" ]; then
 
+if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
+  echo recalculating feisty meow build variables.
+  echo
+fi
+
 # 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.
@@ -90,10 +95,67 @@ if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
   echo "[FEISTY_MEOW_APEX is $FEISTY_MEOW_APEX]"
 fi
 
-#if [ "$OPERATING_SYSTEM" == "WIN32" ]; then
-#  # harsh on the paths and make them use backwards slashes.
-#  export SERIOUS_SLASH_TREATMENT=true
-#fi
+# set some extra variables that clam uses.
+
+# CLAM_ON_UNIX or CLAM_ON_DOS might get defined here.
+# we also can set OS_SUBCLASS if we detect darwin.
+if [ $OPERATING_SYSTEM == UNIX ]; then
+  export CLAM_ON_UNIX=$(uname)
+  if [[ $CLAM_ON_UNIX =~ .*[Dd]arwin.* ]]; then
+    # pick the subclass now that we know this is darwin.
+    export CLAM_OS_SUBCLASS=darwin
+  fi
+elif [ $OPERATING_SYSTEM == WIN32 ]; then
+  export CLAM_ON_DOS=$(uname)
+else
+  echo "Unknown operating system--clam will not build well here."
+fi
+
+# CLAM_BASE_CPU is a flag that distinguishes the type of processor, if necessary.
+export CLAM_BASE_CPU="$(uname -m 2>/dev/null || arch 2>/dev/null || echo i686)"
+#ugh, machine gives us an odd answer on macos.  machine 2>/dev/null || 
+
+# "FEISTY_MEOW_CPP_HEADERS" are folders where our C and C++ header files can be found.
+# we'll compute the set of folders as best we can below.
+if [ -d "$FEISTY_MEOW_APEX/nucleus" ]; then
+  # just assumes we're at home and know our header locations under the feisty meow hierarchy.
+  export LOCUS_LIBRARY_HEADERS="$FEISTY_MEOW_APEX/nucleus $FEISTY_MEOW_APEX/octopi $FEISTY_MEOW_APEX/graphiq"
+else
+  export LOCUS_LIBRARY_HEADERS=
+fi 
+export FEISTY_MEOW_CPP_HEADERS=$(find $LOCUS_LIBRARY_HEADERS -mindepth 1 -maxdepth 1 -type d | grep -v "\.settings")
+
+# the root name of the version file.  This is currently irrelevant on
+# non-windoze platforms.
+export CLAM_VERSION_RC_ROOT=$(bash $CLAM_SCRIPTS/cpp/rc_name.sh)
+
+# CLAM_COMPILER is the C/C++ compiler application that builds our code.
+# The variable is mainly used within CLAM itself for determining the proper
+# compiler flags.
+export CLAM_COMPILER
+if [ "$OPERATING_SYSTEM" == UNIX ]; then
+  if [ "$CLAM_OS_SUBCLASS" == darwin ]; then
+    CLAM_COMPILER=GNU_DARWIN
+  else
+    CLAM_COMPILER=GNU_LINUX
+  fi
+elif [ "$OPERATING_SYSTEM" == WIN32 ]; then
+  CLAM_COMPILER=GNU_WINDOWS
+fi
+if [ -z "$CLAM_COMPILER" ]; then
+  # if we get into this case, we have no idea how to set the default compiler.
+  # so... pick a fun default.
+  CLAM_COMPILER=GNU_LINUX
+fi
+
+# "CLAM_COMPILER_ROOT_DIR" is the top-level for the C++ compiler location.
+# it is generally the top of the OS, although some variants may need this
+# modified (e.g., gnu arm linux, but we haven't built on that in a bit).
+export CLAM_COMPILER_ROOT_DIR="/"
+
+# CLAM_COMPILER_VERSION specifies the version of the particular compiler we're using.
+# this is sometimes needed to distinguish how the code is built or where headers/libraries are found.
+export CLAM_COMPILER_VERSION=$(bash $CLAM_SCRIPTS/cpp/get_version.sh $CLAM_COMPILER $CLAM_COMPILER_ROOT_DIR )
 
 # new BUILD_TOP variable points at the utter top-most level of any files
 # in the building hierarchy.
@@ -103,17 +165,6 @@ export BUILD_TOP="$FEISTY_MEOW_APEX"
 # code needed to produce the executables for feisty meow.
 export PRODUCTION_STORE="$BUILD_TOP/production"
 
-## set up the top-level for all build creations and logs and such.
-#export FEISTY_MEOW_GENERATED_STORE="$TMP/generated-feisty_meow"
-#if [ ! -d "$FEISTY_MEOW_GENERATED_STORE" ]; then
-#  mkdir -p "$FEISTY_MEOW_GENERATED_STORE"
-#fi
-## set up our effluent outsourcing valves.
-#export TEMPORARIES_PILE="$FEISTY_MEOW_GENERATED_STORE/temporaries"
-#if [ ! -d "$TEMPORARIES_PILE" ]; then
-#  mkdir -p "$TEMPORARIES_PILE"
-#fi
-
 # this variable points at a folder where we store the generated products of
 # the build, such as the binaries and installer packages.
 export RUNTIME_PATH="$FEISTY_MEOW_GENERATED_STORE/runtime"
@@ -196,8 +247,10 @@ if [ -z "$got_bad" ]; then
   fi
   
   # pick the executable's file ending based on the platform.
-  if [ "$OPERATING_SYSTEM" == "UNIX" ]; then export EXE_ENDING=;
-  elif [ "$OPERATING_SYSTEM" == "WIN32" ]; then export EXE_ENDING=.exe;
+  if [ "$OPERATING_SYSTEM" == "UNIX" ]; then
+    export EXE_ENDING=""
+  elif [ "$OPERATING_SYSTEM" == "WIN32" ]; then
+    export EXE_ENDING=".exe"
   else
     echo "The OPERATING_SYSTEM variable is unset or unknown.  Bailing out."
   fi
@@ -208,7 +261,10 @@ if [ -z "$got_bad" ]; then
   
   # load up the helper variables for visual studio on winders.
   if [ "$OPERATING_SYSTEM" == "WIN32" ]; then
-    source "$BUILD_SCRIPTS_PATH/vis_stu_vars.sh"
+    # moved back to the good path of using gcc, not visual studio.
+#what vars needed?
+#trying just unixy ones, since we're doing cygwin on doze.
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TARGETS_STORE"
   else
     export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TARGETS_STORE"
   fi