Import precosat-465r2-2ce82ba-100514
[cl-satwrap.git] / backends / precosat / configure
blobbf255ceeef156b349bc0577c9c73c2d37614a90c
1 #!/bin/sh
3 cpt=no # enforces competition settings if set to yes
5 rm -f makefile
7 if [ ! x"$cpt" = xyes ]
8 then
9 cov=no;dbg=no;log=no;m32=no;opt=no;chk=no;stc=no;sts=no
10 while [ $# -gt 0 ]
12 case $1 in
13 -h)
14 echo "usage: configure [-h|-g|-O|-l|-c|-m32|-static|--check|--stats]"
15 echo "-h print this command line option summary"
16 echo "-g compiling with debugging information"
17 echo "-O heavy optimizations through compiler"
18 echo "-l enable logging"
19 echo "-c enable coverage"
20 echo "-m32 enforce 32 bit binary even on 64 bit machine"
21 echo "-s|-static|--static static compilation"
22 echo "--check enable expensive assertion checking"
23 echo "--stats enable slightly more expensive statistics"
24 exit 0
26 -g) dbg=yes;opt=no;sts=yes;;
27 -O) dbg=no;opt=yes;sts=no;;
28 -l) log=yes;;
29 -c) cov=yes;;
30 -m32) m32=yes;;
31 -s|-static|--static) stc=yes;;
32 --check) chk=yes;;
33 --stats) sts=yes;;
34 *) echo "*** configure: invalid option" 1>&2; exit 1;;
35 esac
36 shift
37 done
38 else
39 cov=no;dbg=no;log=no;m32=yes;opt=yes;chk=no;stc=yes;sts=no
42 [ $cov = yes ] && dbg=yes
43 [ $chk = yes ] && opt=no
44 [ x"$CXX" = x ] && CXX=g++
45 [ $dbg = yes ] && CXXFLAGS="-g"
46 [ $dbg = no ] && CXXFLAGS="-O3"
47 [ $m32 = yes ] && CXXFLAGS="$CXXFLAGS -m32"
48 [ $stc = yes ] && CXXFLAGS="$CXXFLAGS -static"
49 CXXFLAGS="$CXXFLAGS -Wall -Wextra"
50 [ $dbg = no -a $chk = no ] && CXXFLAGS="$CXXFLAGS -DNDEBUG"
51 [ $log = no ] && CXXFLAGS="$CXXFLAGS -DNLOGPRECO"
52 [ $sts = no ] && CXXFLAGS="$CXXFLAGS -DNSTATSPRECO"
53 [ $opt = yes ] && CXXFLAGS="$CXXFLAGS -finline-limit=10000000"
54 [ $opt = yes ] && CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
55 [ $opt = yes ] && CXXFLAGS="$CXXFLAGS -fno-exceptions"
56 [ $cov = yes ] && CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
57 echo "$CXX $CXXFLAGS"
59 sed -e "s,@CXX@,$CXX," -e "s,@CXXFLAGS@,$CXXFLAGS,g" makefile.in > makefile