this doesn't make the code read any files at runtime; instead the virtual root for unix on win32 is put in a low-level header that's stored in the binaries dir along with the code.
#include <mathematics/chaos.h>
+#include <system_helper.h>
+
namespace algorithms {
/*
#include <mathematics/chaos.h>
#include <structures/static_memory_gremlin.h>
#include <textual/parser_bits.h>
+#include <system_helper.h>
#ifdef __APPLE__
#include <mach-o/dyld.h>
const astring &application_configuration::LOGGING_FOLDER_NAME() { STATIC_STRING("LogPath"); }
-const astring &application_configuration::WINDOZE_VIRTUAL_ROOT_NAME()
-{ STATIC_STRING("VirtualUnixRoot"); }
+//const astring &application_configuration::WINDOZE_VIRTUAL_ROOT_NAME()
+//{ STATIC_STRING("VirtualUnixRoot"); }
const astring &application_configuration::DEFAULT_VIRTUAL_UNIX_ROOT()
{ STATIC_STRING("c:/cygwin"); }
//////////////
-// static storage for virtual unix root, if used.
+// static storage for virtual unix root, if it's used.
+// we don't expect it to change during runtime, right? that would be fubar.
+// so we cache it once we retrieve it.
SAFE_STATIC(astring, static_root_holder, )
-// we don't expect it to change during runtime, right? that would be fubar.
astring application_configuration::get_virtual_unix_root()
{
#ifdef __UNIX__
}
/*
- read the path out of the config file, which should have been set during the
+ use the path in our system helpers header, which should have been set during the
build process if this is really windows.
*/
- astring virtual_root = read_item(WINDOZE_VIRTUAL_ROOT_NAME());
+/// astring virtual_root = read_item(WINDOZE_VIRTUAL_ROOT_NAME());
+ astring virtual_root = FEISTY_MEOW_VIRTUAL_UNIX_ROOT;
if (!virtual_root) {
// if it has no length, we didn't get our setting! we'll limp along with a guess.
- // also don't cache the failure value. maybe it will wake up later!
return DEFAULT_VIRTUAL_UNIX_ROOT();
} else {
static_root_holder() = virtual_root;
static const basis::astring &LOGGING_FOLDER_NAME();
//!< the tag used for finding our logging path in the paths config file.
- static const basis::astring &WINDOZE_VIRTUAL_ROOT_NAME();
+// static const basis::astring &WINDOZE_VIRTUAL_ROOT_NAME();
//!< the tag used for looking up the virtual windows path in the paths config file.
static const basis::astring &DEFAULT_VIRTUAL_UNIX_ROOT();
#include <basis/byte_array.h>
#include <basis/functions.h>
-#include <configuration/application_configuration.h>
-/*
- hmmm: note that we are relying on forward declared code here.
- the canonical ordering for feisty's nucleus has the filesystem code come before
- the configuration code, because the configuratin library uses filesystem features.
- not sure i want to resolve this bizarritude at this time, but it points to the
- need for a virtual interface at lower level than either filesystem or configuration
- libraries, so we can emplace the need for the virtual unix root as a low-level
- dependency to be implemented later.
- */
-
#include <textual/parser_bits.h>
+#include <system_helper.h>
#include <stdio.h>
#include <sys/stat.h>
if (inject_root) LOG(astring("decided to inject root since path is compatible: ") + *this);
}
-LOG(astring("after second phase root injection: ") + *this);
+LOG(astring("after second phase root injection: ") + raw());
if (inject_root) {
// inject the actual path to the unix root in front, if we know it.
// if we don't know it, then a default path that's unlikely to work is idiotically plugged in.
- insert(0, configuration::application_configuration::get_virtual_unix_root());
-LOG(astring("turned cygdrive path string into: ") + *this);
+ insert(0, FEISTY_MEOW_VIRTUAL_UNIX_ROOT);
+///nope configuration::application_configuration::get_virtual_unix_root());
+LOG(astring("turned cygdrive path string into: ") + raw());
}
#endif
[Common]
# default logging path that users can alter if needed.
LogPath=$FEISTY_MEOW_GENERATED_STORE/logs
-# default location of virtual root directory for Unix.
-# replaced at runtime on windoze if cygwin is available.
-#hmmm: support msys too at some point? very worthy as well.
-VirtualUnixRoot=c:/cygwin
--- /dev/null
+#ifndef SYSTEM_HELPER_GROUP
+#define SYSTEM_HELPER_GROUP
+
+//////////////
+// Name : system helper header
+// Author : Chris Koeritz
+// Rights : Copyright (c) 2012-$now By Author
+//////////////
+// This file is free software; you can modify/redistribute it under the terms
+// of the GNU General Public License. [ http://www.gnu.org/licenses/gpl.html ]
+// Feel free to send updates to: [ fred@gruntose.com ]
+//////////////
+
+//! Isolates a few system dependencies for feisty meow runtime environment.
+
+//////////////
+
+/*
+ default location of virtual root directory for Unix.
+ the contents here are replaced at runtime on windoze if cygwin is
+ available.
+*/
+#define FEISTY_MEOW_VIRTUAL_UNIX_ROOT "c:/cygwin"
+
+// hmmm: support msys too at some point? very worthy as well.
+
+//////////////
+
+#endif
+
export STATIC_LIBRARY_DIR = $(TARGETS_STORE)
# "HEADER_SEARCH_PATH" is where the class interface files are to be found.
-# we add the generated store folder for the build version file.
-HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)/versions
+# the generated store folder is added to access the build version file.
+# the binaries are added to access the system_helper.h file.
+HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)/versions $(FEISTY_MEOW_BINARIES)
# "HOOPLE_HEADERS" are locations where the HOOPLE headers can be found.
ifeq "$(HOOPLE_HEADERS)" ""
##############
# creates the directory for our binaries and gives it a reasonable paths configuration.
-function prepare_binaries_dir()
+function prepare_clam_binaries_dir()
{
# we'll store binaries here from the bootstrap process.
if [ ! -d "$CLAM_BINARIES" ]; then
- echo "creating binary dir now in $CLAM_BINARIES"
+ echo "creating clam binary dir now in $CLAM_BINARIES"
mkdir -p "$CLAM_BINARIES"
+ exit_on_error "creating clam binary directory in $CLAM_BINARIES"
fi
if [ ! -f "$CLAM_BINARIES/paths.ini" ]; then
cp "$PRODUCTION_STORE/paths.ini" "$CLAM_BINARIES"
- echo "copied paths.ini to binary dir."
+ exit_on_error "copying paths.ini to $CLAM_BINARIES"
+ echo "copied paths.ini to clam binary dir."
fi
+}
+
+# fix the system helper header up by calling cygpath to determine the cygwin
+# root, if we are on windoze and cygwin.
+function update_system_helper_header()
+{
+ # create our main binaries directory if needed.
+ if [ ! -d "$FEISTY_MEOW_BINARIES" ]; then
+ echo "creating feisty meow binary folder now in $FEISTY_MEOW_BINARIES"
+ mkdir -p "$FEISTY_MEOW_BINARIES"
+ exit_on_error "creating feisty meow binary folder in $FEISTY_MEOW_BINARIES"
+ fi
+
+ # copy up the system helper template version into the binaries directory.
+ if [ ! -f "$FEISTY_MEOW_BINARIES/system_helper.h" ]; then
+ cp "$PRODUCTION_STORE/system_helper_template.h" "$FEISTY_MEOW_BINARIES/system_helper.h"
+ exit_on_error "creating system_helper header in $FEISTY_MEOW_BINARIES"
+ echo "copied system_helper header to feisty meow binary dir."
+ fi
+
# set the cygwin root path if we're on cygwin.
whichable cygpath
if [ $? -eq 0 ]; then
found_root=$(echo $found_root | tr '\\' '/')
echo "processed root is now: '$found_root'"
# edit the entry in place to correct the default path.
- sed -i -e "s%VirtualUnixRoot=.*%VirtualUnixRoot=$found_root%" "$CLAM_BINARIES/paths.ini"
-echo "paths file now has:"
-cat "$CLAM_BINARIES/paths.ini"
+ sed -i \
+ -e "s% *#define FEISTY_MEOW_VIRTUAL_UNIX_ROOT \".*$%#define FEISTY_MEOW_VIRTUAL_UNIX_ROOT \"$found_root\"%" \
+ "$CLAM_BINARIES/paths.ini"
+ exit_on_error "updating system_helper header in $FEISTY_MEOW_BINARIES"
+echo "system helper file now has:"
+cat "$FEISTY_MEOW_BINARIES/system_helper.h"
fi
}
# preconditions for the build process...
# set up our output directories etc.
-prepare_binaries_dir
+prepare_clam_binaries_dir
# set a flag for this process so we can omit certain compilations as necessary.
export BOOT_STRAPPING=true
# NOTE: this depends on the operating system having been chosen above!
if [ "$OPERATING_SYSTEM" = "UNIX" ]; then
function promote {
- prepare_binaries_dir
+ prepare_clam_binaries_dir
if [ ! -f "$INTERMEDIATE_STORE/$1" ]; then
echo "Failed to build the application $1--quitting now."
}
elif [ "$OPERATING_SYSTEM" = "WIN32" ]; then
function promote {
- prepare_binaries_dir
+ prepare_clam_binaries_dir
if [ ! -f "$INTERMEDIATE_STORE/$1.exe" ]; then
echo "Failed to build the application $1.exe--quitting now."
done
fi
+# copy the system helper header.
+update_system_helper_header
+
# rebuild the dependency tool. needed by everything, pretty much, but
# since it's from the xfree project, it doesn't need any of our libraries.
if [ ! -f "$CLAM_BINARIES/makedep$EXE_ENDING" ]; then
if [ -z "$JUST_BOOTSTRAP_APPS" ]; then
echo Cleaning up the temporary files that were built.
bash "$BUILD_SCRIPTS_PATH/whack_build.sh"
-#wrong! we don't want to whack it all. clean
# recreate our useful junk directories...
mkdir -p "$FEISTY_MEOW_GENERATED_STORE"
mkdir -p "$TEMPORARIES_PILE"
mkdir -p "$FEISTY_MEOW_LOGS"
+ # re-copy the system helper header.
+ update_system_helper_header
+
echo Now starting a normal build of the repository source code.
pushd "$FEISTY_MEOW_APEX" &>/dev/null
unset BUILD_DEFAULTS