comparison configure.ac @ 1132:d4cd54a4ea06

First attempt to switch to Automake, to get shared libraries built in OSX
author Adam Chlipala <adamc@hcoop.net>
date Thu, 28 Jan 2010 09:56:08 -0500
parents f7b25375c0cf
children f6cb1cb2d7a8
comparison
equal deleted inserted replaced
1131:94e83c5533d2 1132:d4cd54a4ea06
1 # configure.in for Ur/Web -*- sh -*- 1 AC_INIT([urweb], [1.0])
2 # Process this file with autoconf to produce a configure script. 2 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
3 3 AC_PROG_CC()
4 # -------------- usual initial stuff ------------- 4 AC_PROG_LIBTOOL()
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 5
28 if test [$prefix = "NONE"]; then 6 if test [$prefix = "NONE"]; then
29 prefix=/usr/local 7 prefix=/usr/local
30 fi 8 fi
31 9
43 21
44 if test [-z $SITELISP]; then 22 if test [-z $SITELISP]; then
45 SITELISP=$prefix/share/emacs/site-lisp/urweb-mode 23 SITELISP=$prefix/share/emacs/site-lisp/urweb-mode
46 fi 24 fi
47 25
48
49 do_not_edit="Do not edit this file. It was generated automatically from"
50
51
52 # ----------------- finish up -------------------
53 # names of the variables that get substituted in files; for example,
54 # write @ARCHOS@ somewhere in a written file to get it substituted
55 AC_SUBST(BIN) 26 AC_SUBST(BIN)
56 AC_SUBST(LIB) 27 AC_SUBST(LIB)
57 AC_SUBST(INCLUDE) 28 AC_SUBST(INCLUDE)
58 AC_SUBST(SITELISP) 29 AC_SUBST(SITELISP)
59 AC_SUBST(GCCARGS) 30 AC_SUBST(GCCARGS)
60 AC_SUBST(do_not_edit)
61 31
62 # finish the configure script and generate various files; ./configure 32 AC_CONFIG_FILES([
63 # will apply variable substitutions to <filename>.in to generate <filename>; 33 Makefile
64 # I find it useful to mark generated files as read-only so I don't 34 src/c/Makefile
65 # accidentally edit them (and then lose my changes when ./configure 35 src/config.sml
66 # runs again); I had originally done the chmod after AC_OUTPUT, but 36 ])
67 # the problem is then the chmod doesn't run inside ./config.status
68
69 # MY_AC_CONFIG_FILES(filename)
70 # do AC_CONFIG_FILES(filename, chmod a-w filename)
71 define([MY_AC_CONFIG_FILES],
72 [{
73 if test -f [$1].in; then
74 AC_CONFIG_FILES([$1], chmod a-w [$1])
75 else
76 true
77 #echo "skipping [$1] because it's not in this distribution"
78 fi
79 }])
80 define([MY_AC_CONFIG_EXE_FILES],
81 [{
82 if test -f [$1].in; then
83 AC_CONFIG_FILES([$1], [chmod a-w,a+x $1])
84 else
85 true
86 #echo "skipping [$1] because it's not in this distribution"
87 fi
88 }])
89 MY_AC_CONFIG_FILES(Makefile)
90 MY_AC_CONFIG_FILES(src/config.sml)
91 37
92 AC_OUTPUT() 38 AC_OUTPUT()
93 39
94 # show the user what the variables have been set to
95 cat <<EOF 40 cat <<EOF
96 41
97 Ur/Web configuration: 42 Ur/Web configuration:
98 bin directory: BIN $BIN 43 bin directory: BIN $BIN
99 lib directory: LIB $LIB 44 lib directory: LIB $LIB