annotate configure.ac @ 946:2412cb10c97c

Filters displaying properly
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Sep 2009 16:27:24 -0400
parents f7b25375c0cf
children d4cd54a4ea06
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@429 28 if test [$prefix = "NONE"]; then
adamc@429 29 prefix=/usr/local
adamc@429 30 fi
adamc@429 31
adamc@378 32 if test [-z $BIN]; then
adamc@429 33 BIN=$prefix/bin
adamc@378 34 fi
adamc@378 35
adamc@378 36 if test [-z $LIB]; then
adamc@429 37 LIB=$prefix/lib/urweb
adamc@378 38 fi
adamc@378 39
adamc@378 40 if test [-z $INCLUDE]; then
adamc@429 41 INCLUDE=$prefix/include/urweb
adamc@378 42 fi
adamc@378 43
adamc@378 44 if test [-z $SITELISP]; then
adamc@429 45 SITELISP=$prefix/share/emacs/site-lisp/urweb-mode
adamc@378 46 fi
adamc@378 47
adamc@378 48
adamc@378 49 do_not_edit="Do not edit this file. It was generated automatically from"
adamc@378 50
adamc@378 51
adamc@378 52 # ----------------- finish up -------------------
adamc@378 53 # names of the variables that get substituted in files; for example,
adamc@378 54 # write @ARCHOS@ somewhere in a written file to get it substituted
adamc@378 55 AC_SUBST(BIN)
adamc@378 56 AC_SUBST(LIB)
adamc@378 57 AC_SUBST(INCLUDE)
adamc@378 58 AC_SUBST(SITELISP)
adamc@435 59 AC_SUBST(GCCARGS)
adamc@378 60 AC_SUBST(do_not_edit)
adamc@378 61
adamc@378 62 # finish the configure script and generate various files; ./configure
adamc@378 63 # will apply variable substitutions to <filename>.in to generate <filename>;
adamc@378 64 # I find it useful to mark generated files as read-only so I don't
adamc@378 65 # accidentally edit them (and then lose my changes when ./configure
adamc@378 66 # runs again); I had originally done the chmod after AC_OUTPUT, but
adamc@378 67 # the problem is then the chmod doesn't run inside ./config.status
adamc@378 68
adamc@378 69 # MY_AC_CONFIG_FILES(filename)
adamc@378 70 # do AC_CONFIG_FILES(filename, chmod a-w filename)
adamc@378 71 define([MY_AC_CONFIG_FILES],
adamc@378 72 [{
adamc@378 73 if test -f [$1].in; then
adamc@378 74 AC_CONFIG_FILES([$1], chmod a-w [$1])
adamc@378 75 else
adamc@378 76 true
adamc@378 77 #echo "skipping [$1] because it's not in this distribution"
adamc@378 78 fi
adamc@378 79 }])
adamc@378 80 define([MY_AC_CONFIG_EXE_FILES],
adamc@378 81 [{
adamc@378 82 if test -f [$1].in; then
adamc@378 83 AC_CONFIG_FILES([$1], [chmod a-w,a+x $1])
adamc@378 84 else
adamc@378 85 true
adamc@378 86 #echo "skipping [$1] because it's not in this distribution"
adamc@378 87 fi
adamc@378 88 }])
adamc@378 89 MY_AC_CONFIG_FILES(Makefile)
adamc@378 90 MY_AC_CONFIG_FILES(src/config.sml)
adamc@378 91
adamc@378 92 AC_OUTPUT()
adamc@378 93
adamc@378 94 # show the user what the variables have been set to
adamc@378 95 cat <<EOF
adamc@378 96
adamc@378 97 Ur/Web configuration:
adamc@378 98 bin directory: BIN $BIN
adamc@378 99 lib directory: LIB $LIB
adamc@378 100 include directory: INCLUDE $INCLUDE
adamc@378 101 site-lisp directory: SITELISP $SITELISP
adamc@435 102 Extra GCC args: GCCARGS $GCCARGS
adamc@378 103 EOF