-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·88 lines (66 loc) · 1.95 KB
/
Copy pathconfigure
File metadata and controls
executable file
·88 lines (66 loc) · 1.95 KB
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
#! /bin/bash
###########################################################################
## ##
## OCamlPP ##
## ##
## Benoit Vaugon ##
## ##
## This file is distributed under the terms of the CeCILL license. ##
## See file LICENSE-en. ##
## ##
###########################################################################
function error () {
echo "$@" 1>&2
exit 1
}
function usage () {
echo "$@" 1>&2
error "Usage: $0 [ -prefix <dir> ] [ -bindir <dir> ] [ -mandir <dir> ]"
}
function check_command () {
which "$1" > /dev/null
if [ $? -ne 0 ]; then
error "Error: \"$1\" not installed"
fi
}
###
check_command "ocamlbuild"
check_command "mkdir"
check_command "pwd"
check_command "cp"
check_command "rm"
###
mkdir -p bin etc
###
OCAMLBUILD=$(which ocamlbuild)
VERSION=$(cat VERSION)
PWD=$(pwd)
###
BINDIR=/usr/local/bin
MANDIR=/usr/local/man
while [ $# -ne 0 ]; do
case "$1" in
-bindir) BINDIR="$2"; shift ;;
-mandir) MANDIR="$2"; shift ;;
-prefix)
BINDIR="$2"/bin
MANDIR="$2"/man
shift;;
*)
usage "Don't know what to do with \"$1\""
esac
shift
done
###
echo "\
VERSION = $VERSION
OCAMLBUILD = $OCAMLBUILD -cflags -w,Ae,-warn-error,A,-safe-string,-strict-formats,-strict-sequence -lflags -w,Ae,-warn-error,A,-safe-string,-strict-formats,-strict-sequence -no-links -classic-display
BINDIR = $BINDIR
MAN1DIR = $MANDIR/man1
" > etc/Makefile.conf
###
echo "\
let version = \"$VERSION\";;
" > etc/config.ml
###
echo "** OCamlPP configuration completed successfully **"