forked from BinaryAnalysisPlatform/bap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·59 lines (49 loc) · 1.26 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
#!/bin/sh
set -e
rm -f _oasis
case "is$BAP_DEBUG" in
is|isno|isfalse|isdisable|is0)
QUIET="-quiet";;
*)
QUIET=""
esac
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
SECTIONS=`ocaml tools/oasis_sections.ml --sections "$@"`
TAGS=`ocaml tools/collect.ml tags $SECTIONS`
PLUGINS=`ocaml tools/collect.ml ocamlbuild.ml $SECTIONS`
SETUPS=`ocaml tools/collect.ml setup.ml $SECTIONS`
AB=`ocaml tools/collect.ml files.ab $SECTIONS`
# Correct for "--disable" type of arguments
if ! $FST; then
ARGS=`ocaml tools/oasis_sections.ml --args "$@"`
set --
while read -r arg; do
set -- "$@" "$arg"
done <<EOF
$ARGS
EOF
fi
ocaml tools/cat.ml '"\n# $name\n"' -- $SECTIONS $AB _oasis
ocaml tools/cat.ml '"\n# $name\n"' -- $TAGS _tags.in _tags
ocaml tools/cat.ml '"\n#1 \"$name\"\n"' -- $PLUGINS myocamlbuild.ml.in myocamlbuild.ml
ocaml tools/cat.ml '"\n#1 \"$name\"\n"' -- setup.ml.pre.in $SETUPS setup.ml.in setup.ml
oasis $QUIET setup
ocamlfind ocamlopt -package unix -linkpkg setup.ml -o setup.exe
rm setup.cmx setup.cmi setup.o
./setup.exe $QUIET -configure "$@"