-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure
executable file
·76 lines (69 loc) · 1.84 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
# simple configuration script
# @author UENO Katsuhiro
# @author YAMATODANI Kiyoshi
projname=smlformat
prefix=/usr/local
exec_prefix='$(prefix)'
compiler=smlsharp
mllex=smllex
mlyacc=smlyacc
for opt in "$@"
do
optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
case "$opt" in
--prefix=*) prefix="$optarg" ;;
--exec_prefix=*) exec_prefix="$optarg" ;;
--with-smlsharp) compiler="$optarg" ;;
--with-mllex) mllex="$optarg" ;;
--with-mlyacc) mlyacc="$optarg" ;;
--help)
echo "Usage: $0 OPTIONS..."
echo
echo "Options:"
echo "--help print this message."
echo "--prefix=DIR install files to DIR [default=$prefix]"
echo "--exec-prefix=DIR isntall executables to DIR [default=$prefix]"
echo "--with-smlsharp use SML# [default=smlsharp]"
echo "--with-mllex use MLLex [default=smllex]"
echo "--with-mlyacc use MLYacc [default=smlyacc]"
;;
*)
echo "$0: error: unrecognized option: $opt" 1>&2
echo "Try \`$0 --help' for more information." 1>&2
exit 1
;;
esac
done
echo "SML compiler for building $projname... $compiler"
cat > commonrule <<EOF
# This file is automatically generated by configure script.
prefix = $prefix
exec_prefix = $exec_prefix
bindir = \$(exec_prefix)/bin
libdir = \$(prefix)/lib
libdir_$projname = \$(libdir)/$projname
heapdir = \$(libdir_$projname)/heap
MLYACC = $mlyacc
MLLEX = $mllex
SMLDOC = smldoc
INSTALL = install
INSTALL_PROGRAM = \$(INSTALL)
INSTALL_DATA = \$(INSTALL)
SML_COMPILER = $compiler
SMLSHARP_HEAPSIZE = 512M:2G
MAKESML = SMLSHARP_HEAPSIZE=\$(SMLSHARP_HEAPSIZE) \$(SML_COMPILER)
# commonrule ends here.
EOF
for i in \
Makefile
do
echo "creating $i"
sed "
s|@srcdir_$projname@|.|
s|@builddir@|.|
s|@top_srcdir@|.|
s|@top_builddir@|.|
" "$i.in" > "$i"
done
# configure ends here.