Permalink
5ddb832 Feb 16, 2018
2 contributors

Users who have contributed to this file

@ivg @jaybosamiya
executable file 61 lines (50 sloc) 1.24 KB
#!/bin/sh
set -e
rm -f _oasis
case "is$BAP_DEBUG" in
is|isno|isfalse|isdisable|is0)
QUIET="-quiet";
break;;
*)
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"' -- $SETUPS setup.ml.in setup.ml
oasis $QUIET setup
ocamlfind ocamlopt unix.cmxa setup.ml -o setup.exe
rm setup.cmx setup.cmi setup.o
./setup.exe $QUIET -configure "$@"