]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Patch from Khoo Yit Phang.
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Tue, 8 Feb 2011 12:20:23 +0000 (12:20 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Tue, 8 Feb 2011 12:20:23 +0000 (12:20 +0000)
Clean up scripts/configure, and add flags to set CC and -fpic.
- Use POSIX shell parameter expansion when parsing flags, instead of expr.
- Fix the test for $CC/$CXX to work when they contain spaces (e.g., "gcc -m32").
- Export flags in config.info to ensure that the entire build, including recursive Makefiles, consistently use the given flags.
- Don't create the installation directories when configuring; do it when installing.
- Remove minisat configuration flags from scripts/configure, since they are unused.

git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1127 e59a4935-1847-0410-ae03-e826735625c1

scripts/Makefile.common
scripts/Makefile.in
scripts/configure

index f64fc60dc8dac23968f36be531d09b98f89c67bc..f5b0930d35f58e7e1000353e146d2ff0f71dbdc4 100644 (file)
@@ -26,11 +26,6 @@ OPTIMIZE      = -O3  -g            # Maximum optimization
 #2) You need STP to use about half the memory.
 #CFLAGS_M32   = -m32
 
-# If you're compiling a 64-bit version of STP, and you want to use
-# libstp.a in a shared library, you need the -fPIC option.
-#CFLAGS_FPIC = -fPIC
-CFLAGS_FPIC =
-
 CFLAGS_BASE   = $(OPTIMIZE)
 
 
index ea566122c0d5db95bffa0c6764590588f30159a6..1043a681bc1d6ba9794db7738ab56b29b33823c8 100644 (file)
@@ -65,6 +65,9 @@ FORCE:
 
 .PHONY: install
 install: all
+       @mkdir -p $(BIN_DIR)
+       @mkdir -p $(LIB_DIR)
+       @mkdir -p $(INCLUDE_DIR)
        @cp -f $(BINARIES) $(BIN_DIR)
        @cp -f $(LIBRARIES) $(LIB_DIR)
        @cp -f $(HEADERS) $(INCLUDE_DIR)
index f4914b6fc37045f3c3ba2b2517a03235bce77a09..0106dbff9bb28336bc7b17c2360cd723f2daedfc 100755 (executable)
@@ -8,27 +8,22 @@
 # LICENSE: Please view LICENSE file in the home dir of this Program
 #********************************************************************
 
-SAT=minisat
-
 while [ $# -gt 0 ]; do
     case "$1" in
        --with-prefix=*)
-           arg=`expr "x$1" : 'x[^=]*=\(.*\)'`
-           PREFIX=$arg;;
+           PREFIX=${1#*=};;
+       --with-gcc=*)
+           CC=${1#*=};;
        --with-g++=*)
-           arg=`expr "x$1" : 'x[^=]*=\(.*\)'`    
-           CXX=$arg
-           echo "Using g++ instead of gcc";;
-       --with-minisat-core)
-           SAT=minisat;;
-       --with-cryptominisat2)
-           SAT=cryptominisat2;;
+           CXX=${1#*=};;
+       --with-fpic)
+           CFLAGS_FPIC=-fpic;;
        *)
            echo "Usage: $0 [options]"
            echo "   --with-prefix=/prefix/path   Install STP at the specified path"
+           echo "   --with-gcc=/path/to/gcc      Use gcc at the specified path"
            echo "   --with-g++=/path/to/g++      Use g++ at the specified path"
-           echo "   --with-minisat-core          Use core MiniSAT solver (default), runtime option to use simplifying"
-           echo "   --with-cryptominisat2        Use CRYPTOMiniSAT 2.x solver"
+           echo "   --with-pic                   Required to build 64-bit shared libraries."
            echo "$0 failed"
            exit 1;;
     esac
@@ -36,32 +31,23 @@ while [ $# -gt 0 ]; do
     shift
 done
 
-# check for an option --with-prefix=/path/to/prefix and use that as the 
+# check for an option --with-prefix=/path/to/prefix and use that as the
 # prefix, otherwise use /usr/local
 PREFIX=${PREFIX:-/usr/local}
 
-echo "PREFIX=$PREFIX" > scripts/config.info
+echo "export PREFIX=$PREFIX" > scripts/config.info
 echo "Setting prefix to... $PREFIX"
-if [ $CXX ]
-then echo "CXX=$CXX" >> scripts/config.info
-export CXX="$CXX"
-echo "Setting CXX to... $CXX"
-fi
-
-if [ ! -d $PREFIX/include ]
-then mkdir -p $PREFIX/include
+if [ -n "$CC" ]; then
+    echo "export CC=$CC" >> scripts/config.info
+    echo "Setting CC to... $CC"
 fi
-
-if [ ! -d $PREFIX/bin ]
-then mkdir -p $PREFIX/bin
+if [ -n "$CXX" ]; then
+    echo "export CXX=$CXX" >> scripts/config.info
+    echo "Setting CXX to... $CXX"
 fi
-
-if [ ! -d $PREFIX/lib ]
-then mkdir $PREFIX/lib
-fi
-
-if [ ! -d $PREFIX/include/stp ]
-then mkdir $PREFIX/include/stp
+if [ -n "$CFLAGS_FPIC" ]; then
+    echo "export CFLAGS_FPIC=$CFLAGS_FPIC" >> scripts/config.info
+    echo "Setting CFLAGS_FPIC to... $CFLAGS_FPIC"
 fi
 
 echo "STP is configured successfully."