summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2009-07-13 13:23:09 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:29:27 -0600
commit3cdfa2a24cd8279ab5d5204d598f319b175940f2 (patch)
tree9914735d5de9867c38f362481121e70bbf7c9719 /configure
parent2bc56a5316345629e4ff451f0640230bf247f976 (diff)
rvs 0.6.0 -- major restructuring to:
* use a proper build directory, rather than just extracting into / * declare functions in a POSIX/SUS3 compliant way * support systems with out GNU bash, or GNU bash in a place other than /bin/bash
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure59
1 files changed, 59 insertions, 0 deletions
diff --git a/configure b/configure
new file mode 100755
index 0000000..35c7b76
--- /dev/null
+++ b/configure
@@ -0,0 +1,59 @@
+#!/bin/sh
+# rvs configureation script
+#
+# Copyright (C) 2009 Luke Shumaker
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# Originally written by Luke Shumaker <lukeshu@sbcglobal.net>.
+
+while [ $# -gt 0 ]; do case "$1" in
+ --*)
+ var0=`echo "$1" | sed -e 's/^--//' -e 's/=.*$//'`
+ match='false'
+ while read line; do
+ var1=`echo "$line" | cut -f 1 `
+ if [ "$var0" == "$var1" ]; then
+ match='true'
+ break;
+ fi
+ done < Variables
+ if [ "$match" == 'false' ]; then
+ echo "configure: option \`$1' not recognized"
+ exit 255;
+ else
+ val=`echo "$1" | sed -e "s/^--$var0=//"`
+ eval _$var0=$val
+ fi
+ :;;
+ *) echo "configure: option \`$1' not recognized"; exit 255;;
+ esac
+ shift
+done
+
+mkdir -p {out/rvs-core/lib,tmp}
+
+echo '#!/bin/sed -f' > tmp/var.sed
+while read line; do
+ var=`echo "$line" | cut -f 1 `
+ val=$(eval echo `echo "$line" | cut -f 2-`) # load from Variables file
+ val=$(eval echo '${'`echo _$var`-$val'}') # check for option overide
+
+ # evaluate the values, so that we may use env variables as values
+ # escape slashes, as they cause problems for sed
+ var=`echo "$var" | sed 's:/:\\\\/:g'`
+ val=`echo "$val" | sed 's:/:\\\\/:g'`
+
+ echo 's/$$'"${var}"'$\$/'"${val}"'/' >> tmp/var.sed
+ #sed -i.bak 's/$$'"${var}"'$\$/'"${val}"'/' "$files"
+ unset var val
+done < Variables
+
+chmod +x tmp/var.sed
+tmp/var.sed < Makefile.orig > Makefile
+
+n0='# DO NOT edit this file, it has been generated by configure, and will be'
+n1='# overwritten. Instead, edit the file `Makefile.orig'\'
+sed -i -e "10 a$n0" -e "10 a$n1" Makefile