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