-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure
executable file
·91 lines (77 loc) · 2.28 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
#!/bin/bash
prefix=/usr/local
debugsym=true
js_of_ocaml=false
z3_solver=true
for arg in "$@"; do
case "$arg" in
--prefix=*)
prefix=$(echo $arg | sed 's/--prefix=//')
;;
--enable-debug)
debugsym=true
;;
--disable-debug)
debugsym=false
;;
--js_of_ocaml)
js_of_ocaml=true
;;
--without-z3-solver)
z3_solver=false
;;
--help)
echo 'usage: ./configure [options]'
echo 'options:'
echo ' --prefix=<path>: installation prefix'
echo ' --js_of_ocaml: Enables js_of_ocaml'
echo ' --enable-debug: include debug symbols'
echo ' --disable-debug: do not include debug symbols'
echo 'all invalid options are silently ignored'
exit 0
;;
esac
done
# checks if z3 solver is available
chmod 755 scripts/check_z3.sh
. scripts/check_z3.sh
echo 'generating makefile ...'
echo "PREFIX = $prefix" >Makefile
if $debugsym; then
echo 'dbg = -g' >>Makefile
fi
cat Makefile.in >>Makefile
if $js_of_ocaml; then
# js_of_ocaml parameters: --disable genprim --debug-info
echo -e "js: version
\tcp src/interface/z3solver_dummy.ml src/interface/z3solver_.ml
\tcp src/interface/mathkernel_call_dummy.ml src/interface/mathkernel_call_.ml
\tcp src/js/helper.ml src/js/helper_.ml
\topam install js_of_ocaml -y
\tdune build --profile release src/rmtld3synth.bc
\tjs_of_ocaml --disable genprim --debug-info +base/runtime.js _build/default/src/rmtld3synth.bc
" >>Makefile
echo -e "(library
(name js)
(public_name rmtld3synth.js)
(libraries sexplib ppx_sexp_conv js_of_ocaml)
(modules Helper_)
(preprocess (pps ppx_sexp_conv))
)
" >src/js/dune
fi
if [ -n "$Z3_VERSION" ] && [ "x$z3_solver" == "xtrue" ]; then
echo "Z3 Version Found: $Z3_VERSION"
if $(vercmp "$Z3_VERSION" "4.7.1" "<="); then
echo -e "\nzsolver:
\tcp src/interface/z3solver.ml src/interface/z3solver_.ml" >>Makefile
else
echo -e "\nzsolver:
\tcp src/interface/z3solver_newAPI.ml src/interface/z3solver_.ml" >>Makefile
fi
else
echo -e "\nzsolver:
\tcp src/interface/z3solver_dummy.ml src/interface/z3solver_.ml" >>Makefile
sed -i 's/z3//' src/interface/dune
fi
echo 'configuration complete, type make to build.'