blob: 25196f7602ed019af3d86db924bb41da0c0f3aad (
plain)
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
92
93
94
95
96
97
98
99
100
101
102
103
|
# configure.in for Ur/Web -*- sh -*-
# Process this file with autoconf to produce a configure script.
# -------------- usual initial stuff -------------
# this simply names a file somewhere in the source tree to verify
# we're in the right directory
AC_INIT(THIS_IS_URWEB)
# sm: require a late-enough autoconf; this is the version number
# that's on manju, so I assume it's ok
AC_PREREQ(2.50)
AC_MSG_NOTICE(Configuring Ur/Web)
# make sure I haven't forgotten to run autoconf
if test configure -ot configure.ac; then
AC_MSG_ERROR(configure is older than configure.in; you forgot to run autoconf)
fi
# ---------------- generic functions -----------------
# debugging diagnostic; set to 'echo' to debug or 'true' for production
diagnostic() {
#echo "$@"
true "$@"
}
if test [$prefix = "NONE"]; then
prefix=/usr/local
fi
if test [-z $BIN]; then
BIN=$prefix/bin
fi
if test [-z $LIB]; then
LIB=$prefix/lib/urweb
fi
if test [-z $INCLUDE]; then
INCLUDE=$prefix/include/urweb
fi
if test [-z $SITELISP]; then
SITELISP=$prefix/share/emacs/site-lisp/urweb-mode
fi
do_not_edit="Do not edit this file. It was generated automatically from"
# ----------------- finish up -------------------
# names of the variables that get substituted in files; for example,
# write @ARCHOS@ somewhere in a written file to get it substituted
AC_SUBST(BIN)
AC_SUBST(LIB)
AC_SUBST(INCLUDE)
AC_SUBST(SITELISP)
AC_SUBST(GCCARGS)
AC_SUBST(do_not_edit)
# finish the configure script and generate various files; ./configure
# will apply variable substitutions to <filename>.in to generate <filename>;
# I find it useful to mark generated files as read-only so I don't
# accidentally edit them (and then lose my changes when ./configure
# runs again); I had originally done the chmod after AC_OUTPUT, but
# the problem is then the chmod doesn't run inside ./config.status
# MY_AC_CONFIG_FILES(filename)
# do AC_CONFIG_FILES(filename, chmod a-w filename)
define([MY_AC_CONFIG_FILES],
[{
if test -f [$1].in; then
AC_CONFIG_FILES([$1], chmod a-w [$1])
else
true
#echo "skipping [$1] because it's not in this distribution"
fi
}])
define([MY_AC_CONFIG_EXE_FILES],
[{
if test -f [$1].in; then
AC_CONFIG_FILES([$1], [chmod a-w,a+x $1])
else
true
#echo "skipping [$1] because it's not in this distribution"
fi
}])
MY_AC_CONFIG_FILES(Makefile)
MY_AC_CONFIG_FILES(src/config.sml)
AC_OUTPUT()
# show the user what the variables have been set to
cat <<EOF
Ur/Web configuration:
bin directory: BIN $BIN
lib directory: LIB $LIB
include directory: INCLUDE $INCLUDE
site-lisp directory: SITELISP $SITELISP
Extra GCC args: GCCARGS $GCCARGS
EOF
|