forked from BinaryAnalysisPlatform/bap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure-omake
executable file
·50 lines (42 loc) · 1.26 KB
/
configure-omake
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
#!/bin/sh
export OPAMCLI=2.0
rm -f _oasis setup.log.om setup.data _oasis_setup.om
mv oasis/benchmarks oasis/benchmarks.backup
mv oasis/piqi-printers oasis/piqi-printers.backup
mv oasis/common oasis/common.backup
cp oasis/common.omake oasis/common
SECTIONS=`ocaml tools/oasis_sections.ml --sections --enable-everything`
SETUPS=`ocaml tools/collect.ml setup.ml $SECTIONS`
AB=`ocaml tools/collect.ml files.ab $SECTIONS`
ocaml tools/cat.ml '"\n# $name\n"' -- $SECTIONS $AB _oasis
ocaml tools/cat.ml '"\n#1 \"$name\"\n"' -- setup.ml.pre.in $SETUPS setup.ml.in setup.ml
cp oasis/common.backup oasis/common
cp oasis/benchmarks.backup oasis/benchmarks
cp oasis/piqi-printers.backup oasis/piqi-printers
sed -i 's/.*Build$.*//' _oasis
sed -i 's/.*CCOpt:.*//' _oasis
sed -i 's/.*CCLib:.*//' _oasis
FST=true
for i in "$@"; do
if $FST; then
set --
FST=false
fi
case $i in
--*=*)
ARG=${i%%=*}
VAL=${i##*=}
set -- "$@" "$ARG" "$VAL"
;;
*)
set -- "$@" "$i"
;;
esac
done
# call setup twice so that it can capture the AB deps
for pass in `seq 2`; do
oasis setup
ocamlfind ocamlopt -package unix -linkpkg setup.ml -o setup.exe
rm setup.cmx setup.cmi setup.o
./setup.exe -configure --prefix $(opam config var prefix) "$@"
done