Minor fixes to get-abc script and configure stuff.
[cvc5.git] / config / build-type
1 #!/bin/sh
2 #
3 # build-type
4 # Morgan Deters <mdeters@cs.nyu.edu> for CVC4
5 #
6 # usage: build-type profile [ overrides... ]
7 #
8 # Returns a build string for the given profile and overrides.
9 # For example, "build-type debug noassertions" returns the canonical
10 # build string for a debug build with assertions turned off.
11 #
12 # The default build directory for CVC4 is then (assuming a standard
13 # debug build):
14 #
15 # builds/`config/config.guess`/`config/build-type debug`
16 #
17 # This script is used both in CVC4's configure script and in the
18 # top-level Makefile when you build another profile than the
19 # "current" build (to see if there already was a build of that type).
20 #
21 # The overrides are as follows:
22 #
23 # staticbinary
24 # optimized
25 # proof
26 # debugsymbols
27 # assertions
28 # tracing
29 # muzzle
30 # coverage
31 # profiling
32 #
33 # Also you can specify "cln" or "gmp". If "gmp", the build dir
34 # contains the string "gmp". (gmp is considered the default.)
35 #
36 # Also for glpk and abc.
37 #
38
39 if [ $# -eq 0 ]; then
40 echo "usage: build-type profile [ overrides... ]" >&2
41 exit
42 fi
43
44 build_type=$1
45 shift
46
47 while [ $# -gt 0 ]; do
48 case "$1" in
49 cln) cln=1 ;;
50 gmp) ;;
51 no*) eval `expr "$1" : 'no\(.*\)'`=0 ;;
52 *) eval $1=1 ;;
53 esac
54 shift
55 done
56
57 build_type_suffix=
58 for arg in cln glpk abc staticbinary optimized proof debugsymbols statistics replay assertions tracing muzzle coverage profiling; do
59 if eval [ -n '"${'$arg'+set}"' ]; then
60 if eval [ '"${'$arg'}"' -eq 0 ]; then
61 build_type_suffix=$build_type_suffix-no$arg
62 else
63 build_type_suffix=$build_type_suffix-$arg
64 fi
65 fi
66 done
67
68 echo $build_type$build_type_suffix