summaryrefslogtreecommitdiff
path: root/conf/configure
diff options
Diffstat (limited to 'conf/configure')
-rwxr-xr-xconf/configure61
1 files changed, 61 insertions, 0 deletions
diff --git a/conf/configure b/conf/configure
new file mode 100755
index 00000000..851541fc
--- /dev/null
+++ b/conf/configure
@@ -0,0 +1,61 @@
+#!/bin/sh
+# conf/configure
+# configure for config
+
+#------------- Stuff added to enable --prefix --------------
+if test "x$1" != "x"; then
+ # echo Found input parameter -- $1
+ # Now see if the parameter is --prefix=
+ if test "x${1#--prefix=}" != "x$1"; then
+ # echo "Found --prefix in input args. Setting prefix directory."
+ prefix=${1#--prefix=}
+ else
+ # echo "Found unrecognized parameter in input args."
+ # Just use the default prefix dir.
+ prefix=/usr/local
+ fi
+
+else
+ # echo "No input parameter found."
+ # Just use the default prefix dir
+ prefix=/usr/local
+fi
+
+sed -e "s#/usr/local#$prefix#" ../Makefile.template > Makefile
+#----------------------------------------------------------------
+pkglibdir='${prefix}/lib/gnucap'
+pkglibdir_expanded="${prefix}/lib/gnucap"
+sysconfdir_expanded="${prefix}/etc"
+
+# bug. this is not implemented consistently.
+CXX=${CXX-c++}
+
+fill_template() {
+sed -e "s#@prefix@#$prefix#" \
+ -e "s#@exec_prefix@#$prefix#" \
+ -e "s#@libdir@#$prefix/lib#" \
+ -e "s#@includedir@#$\{prefix\}/include#" \
+ -e "s#@datarootdir@#$\{prefix\}/share/gnucap#" \
+ -e "s#@docdir@#$\{prefix\}/share/doc/gnucap#" \
+ -e "s#@sysconfdir@#$\{prefix\}/etc#" \
+ -e "s#@sysconfdir_expanded@#${sysconfdir_expanded}#" \
+ -e "s#@pkglibdir@#$pkglibdir#" \
+ -e "s#@pkglibdir_expanded@#$pkglibdir_expanded#" \
+ -e "s#@CXXFLAGS@#$CCFLAGS#" \
+ -e "s#@GNUCAP_LIBS@#-lgnucap#" \
+ -e "s#@CXX@#$CXX#" < $1.in > $1
+}
+
+fill_template config.h
+fill_template gnucap-conf
+fill_template gnucap.conf
+
+chmod +x gnucap-conf
+
+echo \# created by $PWD/$0. do not edit >Make2
+echo \#------------------------------------------------------------------------ >>Make2
+echo "PREFIX = " $prefix >>Make2
+echo "CXX = c++" >>Make2
+cat Make1 Make2 ../include/Make3 >Makefile
+
+exit 0