-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure
executable file
·92 lines (86 loc) · 2.46 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
cpt=no # enforces competition settings if set to yes
memdbg=no
picosat=no
rm -f makefile
if [ ! x"$cpt" = xyes ]
then
cov=no;dbg=no;log=no;chk=no;stc=no;sts=no;m32=no
while [ $# -gt 0 ]
do
case $1 in
-h)
echo "usage: configure [-h|-g|-O|-l|-c|-m32|-static|--check|--stats]"
echo "-h print this command line option summary"
echo "-g compiling with debugging information"
echo "-l enable logging"
echo "-c enable coverage"
echo "-m32 enforce 32 bit binary even on 64 bit machine"
echo "-s|-static|--static static compilation"
echo "--check enable expensive assertion checking"
echo "--stats enable slightly more expensive statistics"
echo "--mem-debug print (de)allocations for memory debugging"
echo "--competition enforce competition settings"
exit 0
;;
-g) dbg=yes;sts=yes;;
-O) dbg=no;sts=no;;
-l) log=yes;;
-c) cov=yes;;
-m32) m32=yes;;
-s|-static|--static) stc=yes;;
--check) chk=yes;;
--stats) sts=yes;;
--mem-debug) memdbg=yes;;
--picosat) picosat=yes;;
--competition) cpt=yes;;
*) echo "*** configure: invalid option" 1>&2; exit 1;;
esac
shift
done
else
cov=no;dbg=no;log=no;m32=yes;chk=no;stc=yes;sts=no
fi
LIBS=""
DEPS=""
[ $cov = yes ] && dbg=yes
[ x"$CXX" = x ] && CXX=g++
[ $dbg = yes ] && CXXFLAGS="-g"
[ $dbg = no ] && CXXFLAGS="-O3"
[ $m32 = yes ] && CXXFLAGS="$CXXFLAGS -m32"
[ $stc = yes ] && CXXFLAGS="$CXXFLAGS -static"
CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-unused-but-set-variable -Wno-unused-function"
[ $dbg = no -a $chk = no ] && CXXFLAGS="$CXXFLAGS -DNDEBUG"
[ $log = no ] && CXXFLAGS="$CXXFLAGS -DNLOGPRECO"
[ $sts = no ] && CXXFLAGS="$CXXFLAGS -DNSTATSPRECO"
[ $memdbg = yes ] && CXXFLAGS="$CXXFLAGS -DMEMDBGPRECO"
if [ $picosat = yes ]
then
LIBS="-L../picosat -lpicosat"
DEPS="../picosat/libpicosat.a"
CXXFLAGS="$CXXFLAGS -DCHECKWITHPICOSAT"
fi
if [ $cpt = yes ]
then
CXXFLAGS="$CXXFLAGS -march=core2"
TARGETS="feedback"
CXX=/usr/bin/g++
for CNF in /data/cnf/sc2009/applications/simon-s03-fifo8-300.cnf \
/data/cnf/cmu/longmult12.dimacs \
log/prime65537.in \
none
do
[ -f $CNF ] && break;
done
else
TARGETS="targets"
fi
echo "$CXX $CXXFLAGS"
sed \
-e "s,@CXX@,$CXX," \
-e "s,@CXXFLAGS@,$CXXFLAGS,g" \
-e "s,@LIBS@,$LIBS,g" \
-e "s,@TARGETS@,$TARGETS,g" \
-e "s,@DEPS@,$DEPS,g" \
-e "s,@CNF@,$CNF,g" \
makefile.in > makefile