adam@1758
|
1 AC_INIT([urweb], [20120512])
|
adam@1759
|
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@1760
|
6 m4_pattern_allow([AM_PROG_AR])
|
adam@1760
|
7 AM_PROG_AR
|
adam@1760
|
8
|
adamc@1148
|
9 AM_INIT_AUTOMAKE([-Wall -Werror foreign no-define])
|
adamc@1132
|
10 AC_PROG_CC()
|
adamc@1132
|
11 AC_PROG_LIBTOOL()
|
adamc@1141
|
12 AC_CONFIG_MACRO_DIR([m4])
|
ezyang@1739
|
13 AC_CONFIG_HEADERS([include/urweb/config.h])
|
adamc@378
|
14
|
adam@1528
|
15 AX_PTHREAD([echo >/dev/null], [echo "Your C compiler does not support POSIX threads."; exit 1])
|
adam@1528
|
16
|
adam@1369
|
17 AX_CHECK_OPENSSL([echo >/dev/null], [echo "You must install OpenSSL development files."; exit 1])
|
adamc@1165
|
18
|
adamc@1165
|
19 AC_CHECK_PROG(MLTON, mlton, yes, [])
|
adamc@1165
|
20
|
adamc@1165
|
21 if test [-z $MLTON]; then
|
adamc@1165
|
22 echo "You must install MLton."
|
adamc@1165
|
23 exit 1
|
adamc@1165
|
24 fi
|
adamc@1165
|
25
|
adamc@1165
|
26 AC_CHECK_PROG(MLLEX, mllex, yes, [])
|
adamc@1165
|
27
|
adamc@1165
|
28 if test [-z $MLLEX]; then
|
adamc@1165
|
29 echo "You must install MLton (to get mllex)."
|
adamc@1165
|
30 exit 1
|
adamc@1165
|
31 fi
|
adamc@1165
|
32
|
adamc@1165
|
33 AC_CHECK_PROG(MLYACC, mlyacc, yes, [])
|
adamc@1165
|
34
|
adamc@1165
|
35 if test [-z $MLYACC]; then
|
adamc@1165
|
36 echo "You must install MLton (to get mlyacc)."
|
adamc@1165
|
37 exit 1
|
adamc@1165
|
38 fi
|
adamc@1165
|
39
|
adamc@429
|
40 if test [$prefix = "NONE"]; then
|
adamc@429
|
41 prefix=/usr/local
|
adamc@429
|
42 fi
|
adamc@429
|
43
|
adamc@378
|
44 if test [-z $BIN]; then
|
adamc@429
|
45 BIN=$prefix/bin
|
adamc@378
|
46 fi
|
adamc@378
|
47
|
adamc@378
|
48 if test [-z $LIB]; then
|
ezyang@1739
|
49 LIB=$prefix/lib
|
ezyang@1739
|
50 fi
|
ezyang@1739
|
51
|
ezyang@1739
|
52 if test [-z $SRCLIB]; then
|
ezyang@1739
|
53 SRCLIB=$prefix/lib/urweb
|
adamc@378
|
54 fi
|
adamc@378
|
55
|
adamc@378
|
56 if test [-z $INCLUDE]; then
|
adamc@429
|
57 INCLUDE=$prefix/include/urweb
|
adamc@378
|
58 fi
|
adamc@378
|
59
|
adamc@378
|
60 if test [-z $SITELISP]; then
|
adamc@429
|
61 SITELISP=$prefix/share/emacs/site-lisp/urweb-mode
|
adamc@378
|
62 fi
|
adamc@378
|
63
|
adam@1441
|
64 AC_ARG_WITH([emacs],
|
adam@1441
|
65 [AS_HELP_STRING([--without-emacs],
|
adam@1441
|
66 [disable installation of Emacs mode])],
|
adam@1441
|
67 [],
|
adam@1441
|
68 [with_emacs=yes])
|
adam@1441
|
69
|
adam@1441
|
70 AM_CONDITIONAL(USE_EMACS, test "x$with_emacs" = xyes)
|
adam@1441
|
71
|
adam@1464
|
72 if test [-z $PGHEADER]; then
|
adam@1464
|
73 AC_CHECK_HEADERS([postgresql/libpq-fe.h],
|
adam@1464
|
74 [PGHEADER=postgresql/libpq-fe.h])
|
adam@1464
|
75 fi
|
adam@1464
|
76
|
adam@1464
|
77 if test [-z $PGHEADER]; then
|
adam@1464
|
78 PGHEADER=libpq-fe.h
|
adam@1464
|
79 fi
|
adam@1464
|
80
|
adam@1464
|
81 if test [-z $MSHEADER]; then
|
adam@1464
|
82 AC_CHECK_HEADERS([mysql/mysql.h],
|
adam@1464
|
83 [MSHEADER=mysql/mysql.h])
|
adam@1464
|
84 fi
|
adam@1464
|
85
|
adam@1464
|
86 if test [-z $MSHEADER]; then
|
adam@1464
|
87 MSHEADER=mysql.h
|
adam@1464
|
88 fi
|
adam@1464
|
89
|
adam@1464
|
90 if test [-z $SQHEADER]; then
|
adam@1464
|
91 SQHEADER=sqlite3.h
|
adam@1464
|
92 fi
|
adam@1464
|
93
|
adam@1520
|
94 if test [$WORKING_VERSION = "1"]; then
|
adam@1526
|
95 VERSION="$VERSION + `hg identify || (cat .hg_archival.txt | grep 'node\:') || echo ?`"
|
adam@1520
|
96 fi
|
adam@1520
|
97
|
adam@1474
|
98 AC_SUBST(CC)
|
adamc@378
|
99 AC_SUBST(BIN)
|
adamc@378
|
100 AC_SUBST(LIB)
|
ezyang@1739
|
101 AC_SUBST(SRCLIB)
|
adamc@378
|
102 AC_SUBST(INCLUDE)
|
adamc@378
|
103 AC_SUBST(SITELISP)
|
adam@1523
|
104 AC_SUBST(CCARGS)
|
adam@1464
|
105 AC_SUBST(PGHEADER)
|
adam@1464
|
106 AC_SUBST(MSHEADER)
|
adam@1464
|
107 AC_SUBST(SQHEADER)
|
adam@1520
|
108 AC_SUBST(VERSION)
|
adam@1528
|
109 AC_SUBST(PTHREAD_CFLAGS)
|
adam@1528
|
110 AC_SUBST(PTHREAD_LIBS)
|
adamc@378
|
111
|
adamc@1132
|
112 AC_CONFIG_FILES([
|
adamc@1132
|
113 Makefile
|
adamc@1132
|
114 src/c/Makefile
|
adamc@1132
|
115 src/config.sml
|
adamc@1132
|
116 ])
|
adamc@378
|
117
|
adamc@378
|
118 AC_OUTPUT()
|
adamc@378
|
119
|
adamc@378
|
120 cat <<EOF
|
adamc@378
|
121
|
adamc@378
|
122 Ur/Web configuration:
|
adam@1317
|
123 bin directory: BIN $BIN
|
adam@1317
|
124 lib directory: LIB $LIB
|
ezyang@1739
|
125 src lib directory: SRCLIB $SRCLIB
|
adam@1317
|
126 include directory: INCLUDE $INCLUDE
|
adam@1317
|
127 site-lisp directory: SITELISP $SITELISP
|
adam@1474
|
128 C compiler: CC $CC
|
adam@1523
|
129 Extra CC args: CCARGS $CCARGS
|
adam@1464
|
130 Postgres C header: PGHEADER $PGHEADER
|
adam@1464
|
131 MySQL C header: MSHEADER $MSHEADER
|
adam@1464
|
132 SQLite C header: SQHEADER $SQHEADER
|
adam@1661
|
133 OpenSSL: OPENSSL_LIBS $OPENSSL_LIBS
|
adam@1520
|
134
|
adam@1520
|
135 Version: $VERSION
|
adamc@378
|
136 EOF
|