|
1 # -*- Autoconf -*- |
|
2 # Process this file with autoconf to produce a configure script. |
|
3 |
|
4 AC_PREREQ(2.59) |
|
5 AC_INIT(src/mod_auth_form) |
|
6 AC_CONFIG_AUX_DIR(autom4) |
|
7 AC_CONFIG_SRCDIR([src/mod_auth_form.c]) |
|
8 AM_INIT_AUTOMAKE(mod_auth_form, 2.05) |
|
9 |
|
10 # Set some argument variables. |
|
11 AC_ARG_VAR(APACHE2_PREFIX, [Base path containing the Apache2 installation]) |
|
12 AC_ARG_VAR(APR0_PREFIX, [Base path containing the Apache2 Portable Runtime Library, series 0, installation]) |
|
13 AC_ARG_VAR(APR1_PREFIX, [Base path containing the Apache2 Portable Runtime Library, series 1, installation]) |
|
14 AC_ARG_VAR(MYSQL_PREFIX, [Base path containing the MySQL installation]) |
|
15 AC_ARG_VAR(APACHE2_INCLUDE, [Path to the Apache2 header file directory]) |
|
16 AC_ARG_VAR(APR0_INCLUDE, [Path to the Apache2 Portable Runtime Library, series 0, header file directory]) |
|
17 AC_ARG_VAR(APR1_INCLUDE, [Path to the Apache2 Portable Runtime Library, series 1, header file directory]) |
|
18 AC_ARG_VAR(MYSQL_INCLUDE, [Path to the MySQL header directory]) |
|
19 AC_ARG_VAR(MYSQLCLIENT_LIBPATH, [Path to the directory containing the MySQL client library]) |
|
20 if test -z "$APACHE2_PREFIX"; then |
|
21 APACHE2_PREFIX=/usr |
|
22 fi |
|
23 if test -z "$APR0_PREFIX"; then |
|
24 APR0_PREFIX=$APACHE2_PREFIX |
|
25 fi |
|
26 if test -z "$APR1_PREFIX"; then |
|
27 APR1_PREFIX=$APACHE2_PREFIX |
|
28 fi |
|
29 if test -z "$MYSQL_PREFIX"; then |
|
30 MYSQL_PREFIX=/usr |
|
31 fi |
|
32 if test -z "$APACHE2_INCLUDE"; then |
|
33 APACHE2_INCLUDE=$APACHE2_PREFIX/include |
|
34 fi |
|
35 if test -z "$APR0_INCLUDE"; then |
|
36 APR0_INCLUDE=$APR0_PREFIX/include |
|
37 fi |
|
38 if test -z "$APR1_INCLUDE"; then |
|
39 APR1_INCLUDE=$APR1_PREFIX/include |
|
40 fi |
|
41 if test -z "$MYSQL_INCLUDE"; then |
|
42 MYSQL_INCLUDE=$MYSQL_PREFIX/include |
|
43 fi |
|
44 if test -z "$MYSQLCLIENT_LIBPATH"; then |
|
45 MYSQLCLIENT_LIBPATH=$MYSQL_PREFIX/lib |
|
46 MYSQLCLIENT_LIBFLAGS=-L$MYSQLCLIENT_LIBPATH |
|
47 fi |
|
48 AC_ARG_ENABLE(debug, |
|
49 [ --enable-debug turn on debug messages], |
|
50 [debug=yes]) |
|
51 if test "$debug" = "yes"; then |
|
52 AC_DEFINE(MAF_DEBUG, "1") |
|
53 fi |
|
54 AC_SUBST(APACHE2_INCLUDE) |
|
55 AC_SUBST(APR_INCLUDE) |
|
56 AC_SUBST(MYSQL_PREFIX) |
|
57 AC_SUBST(MYSQL_INCLUDE) |
|
58 AC_SUBST(MYSQLCLIENT_LIBFLAGS) |
|
59 AC_SUBST(MYSQLCLIENT_LIB) |
|
60 |
|
61 # Checks for programs. |
|
62 AC_PROG_CXX |
|
63 AC_PROG_CC |
|
64 AC_PROG_CPP |
|
65 AC_PROG_INSTALL |
|
66 AC_PROG_LN_S |
|
67 AC_PROG_MAKE_SET |
|
68 AM_PROG_LIBTOOL |
|
69 AC_PATH_PROG(APXS, apxs2, "no") |
|
70 if test "$APXS" = "no"; then |
|
71 if test -e $APACHE2_PREFIX/bin/apxs2; then |
|
72 APXS=$APACHE2_PREFIX/bin/apxs2 |
|
73 AC_MSG_RESULT([Apache2 'apxs2' found.]) |
|
74 else |
|
75 AC_MSG_RESULT([Apache2 'apxs2' cannot be found. Checking for |
|
76 Apache2 'apxs'.]) |
|
77 fi |
|
78 fi |
|
79 if test "$APXS" = "no"; then |
|
80 AC_PATH_PROG(APXS, apxs, "no") |
|
81 if test "$APXS" = "no"; then |
|
82 if test -e $APACHE2_PREFIX/bin/apxs; then |
|
83 APXS=$APACHE2_PREFIX/bin/apxs |
|
84 AC_MSG_RESULT([Apache2 'apxs' found.]) |
|
85 else |
|
86 AC_MSG_WARN([Apache2 'apxs' cannot be found. Check |
|
87 your binary paths and/or correct APACHE2_PREFIX. This is |
|
88 needed to build the .so file for installation.]) |
|
89 fi |
|
90 fi |
|
91 fi |
|
92 |
|
93 # Checks for libraries. |
|
94 if test -e $MYSQLCLIENT_LIBPATH/mysql; then |
|
95 MYSQLCLIENT_LIBFLAGS="$MYSQLCLIENT_LIBFLAGS -L$MYSQLCLIENT_LIBPATH/mysql" |
|
96 fi |
|
97 LDFLAGS="$LDFLAGS $MYSQLCLIENT_LIBFLAGS" |
|
98 |
|
99 AC_CHECK_LIB(z, compress,, AC_MSG_WARN([ |
|
100 ZLib could not be found. This may result in an unstable |
|
101 module.])) |
|
102 AC_CHECK_LIB(pthread, pthread_key_create, pthread="yes", pthread="no") |
|
103 if test "$pthread" = "yes"; then |
|
104 MYSQLCLIENT_LIBFLAGS="$MYSQLCLIENT_LIBFLAGS -lpthread" |
|
105 LDFLAGS="$LDFLAGS -lpthread" |
|
106 MYSQLCLIENT_LIB=mysqlclient_r |
|
107 AC_CHECK_LIB(mysqlclient_r, mysql_init, threadsafe_mysql="yes", threadsafe_mysql="no") |
|
108 fi |
|
109 if test "$threadsafe_mysql" != "yes"; then |
|
110 MYSQLCLIENT_LIB=mysqlclient |
|
111 AC_MSG_WARN([ |
|
112 Cannot link with thread-safe MySQL client library (libmysqlclient_r)]) |
|
113 AC_CHECK_LIB($MYSQLCLIENT_LIB, mysql_init,, AC_MSG_ERROR([ |
|
114 The MySQL client library could not be found. Please check the |
|
115 MySQL installation and correct MYSQL_PREFIX.])) |
|
116 fi |
|
117 AC_CHECK_LIB($MYSQLCLIENT_LIB, mysql_ssl_set, AC_DEFINE(MAF_MYSQL_SSL, "1"), AC_MSG_WARN([ |
|
118 The MySQL client library does not support SSL. Disabling |
|
119 SSL support for MySQL.])) |
|
120 |
|
121 # Check for key header files (manually) |
|
122 if test ! -e $APACHE2_INCLUDE/httpd.h; then |
|
123 APACHE2_INCLUDE=$APACHE2_PREFIX/include/apache2 |
|
124 if test ! -e $APACHE2_INCLUDE/httpd.h; then |
|
125 AC_MSG_ERROR([ |
|
126 The Apache2 header files could not be found. |
|
127 Please correct APACHE2_PREFIX or APACHE2_INCLUDE.]) |
|
128 fi |
|
129 fi |
|
130 if test ! -e $APR1_INCLUDE/apr_hooks.h; then |
|
131 APR1_INCLUDE=$APR1_PREFIX/include/apr-1 |
|
132 if test ! -e $APR1_INCLUDE/apr_hooks.h; then |
|
133 AC_MSG_WARN([ |
|
134 The Apache2 Portable Runtime Library, series 1, header files could not be found. |
|
135 Please correct APR1_PREFIX or APR1_INCLUDE if APR-1.x is installed.]) |
|
136 if test ! -e $APR0_INCLUDE/apr_hooks.h; then |
|
137 APR0_INCLUDE=$APR0_PREFIX/include/apr-0 |
|
138 if test ! -e $APR0_INCLUDE/apr_hooks.h; then |
|
139 AC_MSG_WARN([ |
|
140 The Apache2 Portable Runtime Library, series 0, header files could not be found. |
|
141 Please correct APR0_PREFIX or APR0_INCLUDE if APR-0.x is installed.]) |
|
142 AC_MSG_ERROR([ |
|
143 The Apache2 Portable Runtime Library header files could not be found. |
|
144 Please check your APR installation.]) |
|
145 fi |
|
146 fi |
|
147 fi |
|
148 fi |
|
149 if test -e $APR1_INCLUDE/apr_hooks.h;then |
|
150 APR_INCLUDE=$APR1_INCLUDE |
|
151 elif test -e $APR0_INCLUDE/apr_hooks.h;then |
|
152 APR_INCLUDE=$APR0_INCLUDE |
|
153 fi |
|
154 if test ! -e $MYSQL_INCLUDE/mysql.h; then |
|
155 MYSQL_INCLUDE=$MYSQL_PREFIX/include/mysql |
|
156 if test ! -e $MYSQL_INCLUDE/mysql.h; then |
|
157 AC_MSG_ERROR([ |
|
158 The MySQL header files could not be found. Please |
|
159 correct MYSQL_PREFIX or MYSQL_INCLUDE.]) |
|
160 fi |
|
161 fi |
|
162 |
|
163 # Checks for typedefs, structures, and compiler characteristics. |
|
164 AC_C_CONST |
|
165 |
|
166 # Checks for library functions. |
|
167 AC_CHECK_FUNCS([strchr strrchr strstr strtol],, AC_MSG_ERROR([Missing a standard string function.])) |
|
168 |
|
169 # Finally, output the results |
|
170 AC_CONFIG_FILES([Makefile |
|
171 src/Makefile]) |
|
172 #AC_CONFIG_COMMANDS([time-stamp], [$DATE > stamp-h.in]) |
|
173 AC_OUTPUT |