summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2009-07-13 16:07:25 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:11 -0600
commit1a65ae278e81946ec3a8af43b1f6f18c26e1161a (patch)
treeb08ab355f44ca036ff4e9743966454d5df1a1e09 /configure
parent1f75a1dff61a33dea973ebeea64a3bd8bccb715a (diff)
rvs-0.6.1 -- make it possible to compile from another directory
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure9
1 files changed, 6 insertions, 3 deletions
diff --git a/configure b/configure
index 35c7b76..256a15b 100755
--- a/configure
+++ b/configure
@@ -9,6 +9,8 @@
#
# Originally written by Luke Shumaker <lukeshu@sbcglobal.net>.
+sourcedir=`dirname "$0"`
+
while [ $# -gt 0 ]; do case "$1" in
--*)
var0=`echo "$1" | sed -e 's/^--//' -e 's/=.*$//'`
@@ -49,11 +51,12 @@ while read line; do
echo 's/$$'"${var}"'$\$/'"${val}"'/' >> tmp/var.sed
#sed -i.bak 's/$$'"${var}"'$\$/'"${val}"'/' "$files"
unset var val
-done < Variables
+done < "$sourcedir/Variables"
chmod +x tmp/var.sed
-tmp/var.sed < Makefile.orig > Makefile
+tmp/var.sed < "$sourcedir/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
+sourcedir=`echo "$sourcedir" | sed 's:/:\\\\/:g'`
+sed -i -e "10 a$n0" -e "10 a$n1" -e "s/@@sourcedir@@/$sourcedir/" Makefile