+# 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 &>/dev/null
+ if [ $? -eq 0 ]; then
+ # found cygpath, so run it now to get the dossy path of the root ('/' folder).
+ found_root="$(cygpath -w -m /)"
+ if [ $? -ne 0 ]; then
+ echo "Failure to find virtual Unix root folder with cygpath."
+ exit 1322
+ fi
+#echo "found root as '$found_root'"
+ # translate any backslashes to forward thinking slashes.
+ 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% *#define FEISTY_MEOW_VIRTUAL_UNIX_ROOT \".*$%#define FEISTY_MEOW_VIRTUAL_UNIX_ROOT \"$found_root\"%" \
+ "$FEISTY_MEOW_BINARIES/system_helper.h"
+ 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
+}
+
+function make_code {
+ make $* $BE_NOISY ${BUILD_DEFAULTS[@]}
+ if [ $? != 0 ]; then
+ echo "Failed to make on: $*"
+ exit 2323
+ fi
+}
+
+# removes pcdos eol from any scripts. that assumes that the bootstrap script
+# itself isn't polluted with them.
+function strip_cr {
+ ctrl_m=$'\015'
+ for i in $*; do
+ tempgrep="$(mktemp "$TEMPORARIES_PILE/tempgrep.XXXXXX")"
+ grep -l "$ctrl_m" "$i" >$tempgrep
+ if [ ! -z "$(cat $tempgrep)" ]; then
+ temp="$(mktemp "$TEMPORARIES_PILE/tempsed.XXXXXX")"
+ sed -e "s/$ctrl_m$//" <$i >$temp
+ mv -f $temp $i
+ fi
+ rm "$tempgrep"
+ done
+}
+