3 cpt
=no
# enforces competition settings if set to yes
7 if [ ! x
"$cpt" = xyes
]
9 cov
=no
;dbg
=no
;log
=no
;m32
=no
;opt
=no
;chk
=no
;stc
=no
;sts
=no
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"
26 -g) dbg
=yes;opt
=no
;sts
=yes;;
27 -O) dbg
=no
;opt
=yes;sts
=no
;;
31 -s|
-static|
--static) stc
=yes;;
34 *) echo "*** configure: invalid option" 1>&2; exit 1;;
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"
59 sed -e "s,@CXX@,$CXX," -e "s,@CXXFLAGS@,$CXXFLAGS,g" makefile.
in > makefile