forked from camlp4/camlp4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·55 lines (45 loc) · 1.04 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
#! /bin/sh
# Try to turn internationalization off
unset LANG
unset LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
set -e
for i in "$@"; do
case $i in
--bindir=*)
BINDIR=${i##*=}
;;
--libdir=*)
LIBDIR=${i##*=}
;;
--pkgdir=*)
PKGDIR=${i##*=}
;;
*)
echo "usage: ./configure [--bindir=<dir>] [--libdir=<dir>] [--pkgdir=<dir>]" 1>&2
exit 2
;;
esac
done
# OCaml is already installed, this means we should have everything we
# need. Just dump its configuration.
ocamlc -config | sed 's/: /="/;s/$/"/' > config.sh
ocamlc -config | sed 's/^/let /;s/: / = "/;s/$/"/' > myocamlbuild_config.ml
# Add a few things to config.sh
. ./config.sh
if [ "$os_type" = Win32 ]; then
ext_exe=".exe"
else
ext_exe=""
fi
OCAMLC="`which ocamlc`"
LIBDIR="${LIBDIR:-$standard_library}"
BINDIR="${BINDIR:-`dirname $OCAMLC`}"
PKGDIR="${PKGDIR:-$standard_library}"
cat >> config.sh <<EOF
A="$ext_lib"
O="$ext_obj"
EXE="$ext_exe"
LIBDIR="$LIBDIR"
BINDIR="$BINDIR"
PKGDIR="$PKGDIR"
EOF