-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure
executable file
·91 lines (83 loc) · 2.33 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/sh
# simple configuration script
# @author UENO Katsuhiro
# @author YAMATODANI Kiyoshi
projname=smldoc
depends='mllex/smllex mlyacc/smlyacc'
prefix=/usr/local
exec_prefix='$(prefix)'
compiler=mlton
for opt in "$@"
do
optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
case "$opt" in
--prefix=*) prefix="$optarg" ;;
--exec_prefix=*) exec_prefix="$optarg" ;;
--with-smlnj) compiler=smlnj ;;
--with-mlton) compiler=mlton ;;
--with-smlsharp) compiler=smlsharp ;;
--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-smlnj use SML/NJ [default=no]"
echo "--with-mlton use MLton [default=yes]"
echo "--with-smlsharp use SML# [default=no]"
;;
*)
echo "$0: error: unrecognized option: $opt" 1>&2
echo "Try \`$0 --help' for more information." 1>&2
exit 1
;;
esac
done
for i in $depends; do
module=`dirname $i`
if [ -f "../$i" ]; then result=yes; else result=no; fi
echo "checking for dependency on $module... $result"
if [ "x$result" = "xno" ]; then
echo "** Build \`$module' by the following command before building this module:"
echo " cd ../$module && ./configure && make"
exit 1
fi
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
SHELL = /bin/sh
MLYACC = \$(srcdir)/../mlyacc/smlyacc
MLLEX = \$(srcdir)/../mllex/smllex
SMLDOC = \$(srcdir)/../smldoc/smldoc
INSTALL = install
INSTALL_PROGRAM = \$(INSTALL)
INSTALL_DATA = \$(INSTALL)
SML_COMPILER = $compiler
MAKESML = \
COMPILER='\$(SML_COMPILER)' \
INSTALL='\$(INSTALL)' \
BINDIR='\$(DESTDIR)\$(bindir)' \
HEAPDIR='\$(DESTDIR)\$(heapdir)' \
\$(SHELL) \$(srcdir)/../SMLSharp/makesml
# 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.