Import PicoSAT-913
[cl-satwrap.git] / backends / picosat / configure
blob06e60473d10aeb959bf9492bf050bf1949ebc709
1 #!/bin/sh
3 satcompetition=yes
5 log=no
6 debug=no
7 optimize=no
8 stats=undefined
9 trace=undefined
10 static=yes
11 thirtytwobit=no
12 static=no
14 while [ $# -gt 0 ]
16 case $1 in
17 -l|--log) debug=yes; log=yes;;
18 -g|--debug) debug=yes; optimize=no;;
19 -s|--stats) stats=yes;;
20 -t|--trace) trace=yes;;
21 --no-stats) stats=no;;
22 --no-trace) trace=no;;
23 -32|--32|-m32) thirtytwobit=yes;;
24 -static|--static) static=yes;;
25 -O) debug=no; optimize=yes;;
26 *) cat <<EOF
27 usage: ./configure [<option> ...]
29 where <option> is one of the following:
31 -g|--debug includ debugging code and symbols
32 -l|--log add low level logging code
33 -s|--stats include and enable more expensive stats counters
34 -t|--trace compile with trace generation support (more memory)
35 --no-stats disable expensive stats
36 --no-trace enable trace generation (less memory)
37 -32|--32|-m32 compile for 32 bit machine even on 64 bit host
38 -static|--static force static compilation
39 -O optimize a lot and disable trace generation
40 EOF
41 exit 1
43 esac
44 shift
45 done
47 echo "version ... `cat VERSION`"
49 if [ $satcompetition = yes ]
50 then
51 debug=no
52 optimize=yes
53 stats=no
54 trace=no
55 thirtytwobit=yes
58 echo "debug ... $debug"
59 echo "optimize ... $optimize"
60 echo "log ... $log"
62 if [ $stats = undefined ]
63 then
64 if [ $optimize = yes ]
65 then
66 stats=no
67 else
68 stats=yes
71 echo "stats ... $stats"
73 if [ $trace = undefined ]
74 then
75 if [ $optimize = yes ]
76 then
77 trace=no
78 else
79 trace=yes
82 echo "trace ... $trace"
84 echo -n "cc ..."
85 [ "X$CC" = X ] && CC=gcc
86 echo " $CC"
88 if [ X"$CFLAGS" = X ]
89 then
90 case X"$CC" in
91 *wine*|*mingw*) CFLAGS="-DNGETRUSAGE -DNALLSIGNALS";;
92 *);;
93 esac
94 [ $log = yes ] && CFLAGS="$CFLAGS -DLOGGING"
95 [ $stats = yes ] && CFLAGS="$CFLAGS -DSTATS"
96 [ $trace = yes ] && CFLAGS="$CFLAGS -DTRACE"
97 [ $static = yes ] && CFLAGS="$CFLAGS -static"
98 case X"$CC" in
99 X*gcc*)
100 CFLAGS="$CFLAGS -Wall -Wextra"
101 [ $thirtytwobit = yes ] && CFLAGS="$CFLAGS -m32"
102 if [ $satcompetition = yes ]
103 then
104 CFLAGS="$CFLAGS -static"
106 if [ $debug = yes ]
107 then
108 CFLAGS="$CFLAGS -g3 -ggdb"
109 else
110 CFLAGS="$CFLAGS -DNDEBUG"
111 if [ $optimize = yes ]
112 then
113 CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -finline-limit=1000000"
114 else
115 CFLAGS="$CFLAGS -O2"
120 if [ $debug = yes ]
121 then
122 CFLAGS="$CFLAGS -g"
123 else
124 CFLAGS="$CFLAGS -O"
127 esac
130 echo "cflags ... $CFLAGS"
132 echo -n "makefile ..."
133 rm -f makefile
134 sed -e "s,@CC@,$CC," -e "s,@CFLAGS@,$CFLAGS," makefile.in > makefile
135 echo " done"