18 -g|
--debug) debug
=yes;;
19 -O|
--optimize) debug
=no
;;
21 -s|
--stats) stats
=yes;;
22 -t|
--trace) trace
=yes;;
23 --no-stats) stats
=no
;;
24 --no-trace) trace
=no
;;
25 --no-rcode) rcode
=no
;;
27 -32|
--32|
-m32) thirtytwobit
=yes;;
28 -static|
--static) static
=yes;;
29 -shared|
--shared) shared
=yes;;
31 usage: ./configure.sh [<option> ...]
33 where <option> is one of the following:
35 -g|--debug include debugging code and symbols
36 -O|--optimize optimized compilation (default)
37 -l|--log add low level logging code (default with '-g')
38 -s|--stats more expensive statististcs (default with '-g')
39 -t|--trace trace generation (more memory, default with '-g')
40 --no-stats disable expensive stats
41 --no-trace enable trace generation
42 -32|--32|-m32 compile for 32 bit machine even on 64 bit host
43 -rcode|--no-rcode enable/disable compatibility for used in R exension
44 -static|--static produce static binary
45 -shared|--shared produce shared library
53 echo "version ... `cat VERSION`"
55 if [ $satcompetition = yes ]
65 echo "debug ... $debug"
68 [ $stats = undefined
] && stats
=$debug
69 echo "stats ... $stats"
71 [ $trace = undefined
] && trace
=$debug
72 echo "trace ... $trace"
74 echo "static ... $static"
76 echo "shared ... $shared"
78 [ "X$CC" = X
] && CC
=gcc
83 *wine
*|
*mingw
*) CFLAGS
="-DNGETRUSAGE -DNALLSIGNALS";;
86 [ $log = yes ] && CFLAGS
="$CFLAGS -DLOGGING"
87 [ $stats = yes ] && CFLAGS
="$CFLAGS -DSTATS"
88 [ $trace = yes ] && CFLAGS
="$CFLAGS -DTRACE"
89 [ $static = yes ] && CFLAGS
="$CFLAGS -static"
90 [ $rcode = yes ] && CFLAGS
="$CFLAGS -DRCODE"
93 CFLAGS
="$CFLAGS -Wall -Wextra"
94 [ $thirtytwobit = yes ] && CFLAGS
="$CFLAGS -m32"
97 CFLAGS
="$CFLAGS -g3 -ggdb"
99 CFLAGS
="$CFLAGS -DNDEBUG -O3"
115 for rdoth
in /usr
/share
/R
/include
/R.h
$RINC undefined
117 [ -f $rdoth ] && break
119 if [ $rdoth = undefined
]
121 echo "R.h ... not found (add '-I' manually or 'RHEADER=... ./configure')"
123 RINC
="-I`dirname $rdoth`"
124 CFLAGS
="$CFLAGS $RINC"
125 echo "R.h ... added '$RINC' include directive"
127 TARGETS
="libpicosat.a"
129 TARGETS
="picosat picomcs picomus picogcnf libpicosat.a"
134 TARGETS
="$TARGETS libpicosat.so"
135 CFLAGS
="$CFLAGS -fPIC"
137 echo "targets ... $TARGETS"
141 echo "cflags ... $CFLAGS"
143 printf "makefile ..."
147 -e "s,@CFLAGS@,$CFLAGS," \
148 -e "s,@TARGETS@,$TARGETS," \
149 makefile.
in > makefile