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