comparison configure.ac @ 378:168667cdaa95

Proper configuration and installation
author Adam Chlipala <adamc@hcoop.net>
date Sun, 19 Oct 2008 12:47:10 -0400
parents
children 2f2d5c8dd320
comparison
equal deleted inserted replaced
377:78358e5df273 378:168667cdaa95
1 # configure.in for Ur/Web -*- sh -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # -------------- usual initial stuff -------------
5 # this simply names a file somewhere in the source tree to verify
6 # we're in the right directory
7 AC_INIT(THIS_IS_URWEB)
8
9
10 # sm: require a late-enough autoconf; this is the version number
11 # that's on manju, so I assume it's ok
12 AC_PREREQ(2.50)
13
14 AC_MSG_NOTICE(Configuring Ur/Web)
15
16 # make sure I haven't forgotten to run autoconf
17 if test configure -ot configure.ac; then
18 AC_MSG_ERROR(configure is older than configure.in; you forgot to run autoconf)
19 fi
20
21 # ---------------- generic functions -----------------
22 # debugging diagnostic; set to 'echo' to debug or 'true' for production
23 diagnostic() {
24 #echo "$@"
25 true "$@"
26 }
27
28 if test [-z $BIN]; then
29 BIN=/usr/local/bin
30 fi
31
32 if test [-z $LIB]; then
33 LIB=/usr/local/lib/urweb
34 fi
35
36 if test [-z $INCLUDE]; then
37 INCLUDE=/usr/local/include/urweb
38 fi
39
40 if test [-z $SITELISP]; then
41 SITELISP=/usr/local/share/emacs/site-lisp/urweb-mode
42 fi
43
44
45 do_not_edit="Do not edit this file. It was generated automatically from"
46
47
48 # ----------------- finish up -------------------
49 # names of the variables that get substituted in files; for example,
50 # write @ARCHOS@ somewhere in a written file to get it substituted
51 AC_SUBST(BIN)
52 AC_SUBST(LIB)
53 AC_SUBST(INCLUDE)
54 AC_SUBST(SITELISP)
55 AC_SUBST(do_not_edit)
56
57 # finish the configure script and generate various files; ./configure
58 # will apply variable substitutions to <filename>.in to generate <filename>;
59 # I find it useful to mark generated files as read-only so I don't
60 # accidentally edit them (and then lose my changes when ./configure
61 # runs again); I had originally done the chmod after AC_OUTPUT, but
62 # the problem is then the chmod doesn't run inside ./config.status
63
64 # MY_AC_CONFIG_FILES(filename)
65 # do AC_CONFIG_FILES(filename, chmod a-w filename)
66 define([MY_AC_CONFIG_FILES],
67 [{
68 if test -f [$1].in; then
69 AC_CONFIG_FILES([$1], chmod a-w [$1])
70 else
71 true
72 #echo "skipping [$1] because it's not in this distribution"
73 fi
74 }])
75 define([MY_AC_CONFIG_EXE_FILES],
76 [{
77 if test -f [$1].in; then
78 AC_CONFIG_FILES([$1], [chmod a-w,a+x $1])
79 else
80 true
81 #echo "skipping [$1] because it's not in this distribution"
82 fi
83 }])
84 MY_AC_CONFIG_FILES(Makefile)
85 MY_AC_CONFIG_FILES(src/config.sml)
86
87 AC_OUTPUT()
88
89 # show the user what the variables have been set to
90 cat <<EOF
91
92 Ur/Web configuration:
93 bin directory: BIN $BIN
94 lib directory: LIB $LIB
95 include directory: INCLUDE $INCLUDE
96 site-lisp directory: SITELISP $SITELISP
97 EOF