annotate configure.ac @ 1838:6ec243437d12

Autogenerate some files
author Adam Chlipala <adam@chlipala.net>
date Wed, 12 Dec 2012 16:42:15 -0500
parents 7cf34f8b7b93
children 1239ba1a1671
rev   line source
adam@1826 1 AC_INIT([urweb], [20120925])
adam@1827 2 WORKING_VERSION=1
adamc@1149 3 AC_USE_SYSTEM_EXTENSIONS
adam@1760 4
adam@1760 5 # automake 1.12 requires this, but automake 1.11 doesn't recognize it
adam@1762 6 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
adam@1760 7
adamc@1148 8 AM_INIT_AUTOMAKE([-Wall -Werror foreign no-define])
adamc@1132 9 AC_PROG_CC()
adamc@1132 10 AC_PROG_LIBTOOL()
adamc@1141 11 AC_CONFIG_MACRO_DIR([m4])
ezyang@1739 12 AC_CONFIG_HEADERS([include/urweb/config.h])
adamc@378 13
adam@1528 14 AX_PTHREAD([echo >/dev/null], [echo "Your C compiler does not support POSIX threads."; exit 1])
adam@1528 15
adam@1369 16 AX_CHECK_OPENSSL([echo >/dev/null], [echo "You must install OpenSSL development files."; exit 1])
adamc@1165 17
adamc@1165 18 AC_CHECK_PROG(MLTON, mlton, yes, [])
adamc@1165 19
adamc@1165 20 if test [-z $MLTON]; then
adamc@1165 21 echo "You must install MLton."
adamc@1165 22 exit 1
adamc@1165 23 fi
adamc@1165 24
adamc@1165 25 AC_CHECK_PROG(MLLEX, mllex, yes, [])
adamc@1165 26
adamc@1165 27 if test [-z $MLLEX]; then
adamc@1165 28 echo "You must install MLton (to get mllex)."
adamc@1165 29 exit 1
adamc@1165 30 fi
adamc@1165 31
adamc@1165 32 AC_CHECK_PROG(MLYACC, mlyacc, yes, [])
adamc@1165 33
adamc@1165 34 if test [-z $MLYACC]; then
adamc@1165 35 echo "You must install MLton (to get mlyacc)."
adamc@1165 36 exit 1
adamc@1165 37 fi
adamc@1165 38
adamc@429 39 if test [$prefix = "NONE"]; then
adamc@429 40 prefix=/usr/local
adamc@429 41 fi
adamc@429 42
adamc@378 43 if test [-z $BIN]; then
adamc@429 44 BIN=$prefix/bin
adamc@378 45 fi
adamc@378 46
adamc@378 47 if test [-z $LIB]; then
ezyang@1739 48 LIB=$prefix/lib
ezyang@1739 49 fi
ezyang@1739 50
ezyang@1739 51 if test [-z $SRCLIB]; then
ezyang@1739 52 SRCLIB=$prefix/lib/urweb
adamc@378 53 fi
adamc@378 54
adamc@378 55 if test [-z $INCLUDE]; then
adamc@429 56 INCLUDE=$prefix/include/urweb
adamc@378 57 fi
adamc@378 58
adamc@378 59 if test [-z $SITELISP]; then
adamc@429 60 SITELISP=$prefix/share/emacs/site-lisp/urweb-mode
adamc@378 61 fi
adamc@378 62
adam@1441 63 AC_ARG_WITH([emacs],
adam@1441 64 [AS_HELP_STRING([--without-emacs],
adam@1441 65 [disable installation of Emacs mode])],
adam@1441 66 [],
adam@1441 67 [with_emacs=yes])
adam@1441 68
adam@1441 69 AM_CONDITIONAL(USE_EMACS, test "x$with_emacs" = xyes)
adam@1441 70
adam@1464 71 if test [-z $PGHEADER]; then
adam@1464 72 AC_CHECK_HEADERS([postgresql/libpq-fe.h],
adam@1464 73 [PGHEADER=postgresql/libpq-fe.h])
adam@1464 74 fi
adam@1464 75
adam@1464 76 if test [-z $PGHEADER]; then
adam@1464 77 PGHEADER=libpq-fe.h
adam@1464 78 fi
adam@1464 79
adam@1464 80 if test [-z $MSHEADER]; then
adam@1464 81 AC_CHECK_HEADERS([mysql/mysql.h],
adam@1464 82 [MSHEADER=mysql/mysql.h])
adam@1464 83 fi
adam@1464 84
adam@1464 85 if test [-z $MSHEADER]; then
adam@1464 86 MSHEADER=mysql.h
adam@1464 87 fi
adam@1464 88
adam@1464 89 if test [-z $SQHEADER]; then
adam@1464 90 SQHEADER=sqlite3.h
adam@1464 91 fi
adam@1464 92
adam@1520 93 if test [$WORKING_VERSION = "1"]; then
adam@1526 94 VERSION="$VERSION + `hg identify || (cat .hg_archival.txt | grep 'node\:') || echo ?`"
adam@1520 95 fi
adam@1520 96
mad@1825 97 # Clang does not like being passed -pthread, since it's implicit on OS X.
mad@1825 98 # So let's get rid of that! Here's to hoping it doesn't break Clang
mad@1825 99 # on other platforms.
mad@1825 100 AC_MSG_CHECKING([if compiling with clang])
mad@1825 101 AC_COMPILE_IFELSE(
mad@1825 102 [AC_LANG_PROGRAM([], [[
mad@1825 103 #ifndef __clang__
mad@1825 104 not clang
mad@1825 105 #endif
mad@1825 106 ]])],
mad@1825 107 [CLANG=yes], [CLANG=no])
mad@1825 108 AC_MSG_RESULT([$CLANG])
mad@1825 109
mad@1825 110 if test [$CLANG = "yes"]; then
mad@1825 111 PTHREAD_CFLAGS=""
mad@1825 112 PTHREAD_LIBS=""
mad@1825 113 fi
mad@1825 114
adam@1474 115 AC_SUBST(CC)
adamc@378 116 AC_SUBST(BIN)
adamc@378 117 AC_SUBST(LIB)
ezyang@1739 118 AC_SUBST(SRCLIB)
adamc@378 119 AC_SUBST(INCLUDE)
adamc@378 120 AC_SUBST(SITELISP)
adam@1523 121 AC_SUBST(CCARGS)
jgross@1837 122 AC_SUBST(MLTONARGS)
adam@1464 123 AC_SUBST(PGHEADER)
adam@1464 124 AC_SUBST(MSHEADER)
adam@1464 125 AC_SUBST(SQHEADER)
adam@1520 126 AC_SUBST(VERSION)
adam@1528 127 AC_SUBST(PTHREAD_CFLAGS)
adam@1528 128 AC_SUBST(PTHREAD_LIBS)
adamc@378 129
adamc@1132 130 AC_CONFIG_FILES([
adamc@1132 131 Makefile
adamc@1132 132 src/c/Makefile
adamc@1132 133 src/config.sml
adamc@1132 134 ])
adamc@378 135
adamc@378 136 AC_OUTPUT()
adamc@378 137
adamc@378 138 cat <<EOF
adamc@378 139
adamc@378 140 Ur/Web configuration:
adam@1317 141 bin directory: BIN $BIN
adam@1317 142 lib directory: LIB $LIB
ezyang@1739 143 src lib directory: SRCLIB $SRCLIB
adam@1317 144 include directory: INCLUDE $INCLUDE
adam@1317 145 site-lisp directory: SITELISP $SITELISP
adam@1474 146 C compiler: CC $CC
adam@1523 147 Extra CC args: CCARGS $CCARGS
jgross@1837 148 Extra MLTON args: MLTONARGS $MLTONARGS
adam@1464 149 Postgres C header: PGHEADER $PGHEADER
adam@1464 150 MySQL C header: MSHEADER $MSHEADER
adam@1464 151 SQLite C header: SQHEADER $SQHEADER
adam@1661 152 OpenSSL: OPENSSL_LIBS $OPENSSL_LIBS
mad@1825 153 pthreads: PTHREAD_CFLAGS $PTHREAD_CFLAGS
mad@1825 154 PTHREAD_LIBS $PTHREAD_LIBS
adam@1520 155
adam@1520 156 Version: $VERSION
adamc@378 157 EOF