diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 208 |
1 files changed, 122 insertions, 86 deletions
diff --git a/configure.ac b/configure.ac index 33473834..344a95f4 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -27,17 +27,24 @@ AM_CONFIG_HEADER([MHD_config.h]) | |||
27 | 27 | ||
28 | AH_TOP([#define _GNU_SOURCE 1]) | 28 | AH_TOP([#define _GNU_SOURCE 1]) |
29 | 29 | ||
30 | if test `uname -s` == "OS/S390" | ||
31 | then | ||
32 | # configure binaries for z/OS | ||
33 | CC=`pwd`"/contrib/xcc" | ||
34 | chmod +x $CC || true | ||
35 | CPP="c89 -E" | ||
36 | CXXCPP="c++ -E -+" | ||
37 | # _CCC_CCMODE=1 | ||
38 | # _C89_CCMODE=1 | ||
39 | fi | ||
40 | |||
30 | # Checks for programs. | 41 | # Checks for programs. |
31 | AC_PROG_AWK | 42 | AC_PROG_AWK |
32 | |||
33 | |||
34 | AM_PROG_CC_C_O | ||
35 | |||
36 | |||
37 | AC_PROG_INSTALL | 43 | AC_PROG_INSTALL |
38 | AC_PROG_LN_S | 44 | AC_PROG_LN_S |
39 | AC_PROG_MAKE_SET | 45 | AC_PROG_MAKE_SET |
40 | AC_CANONICAL_HOST | 46 | AC_CANONICAL_HOST |
47 | AM_PROG_CC_C_O | ||
41 | AC_PROG_LIBTOOL | 48 | AC_PROG_LIBTOOL |
42 | 49 | ||
43 | # set GCC options | 50 | # set GCC options |
@@ -47,6 +54,7 @@ then | |||
47 | CFLAGS="-fno-strict-aliasing $CFLAGS" | 54 | CFLAGS="-fno-strict-aliasing $CFLAGS" |
48 | fi | 55 | fi |
49 | 56 | ||
57 | |||
50 | # Check system type | 58 | # Check system type |
51 | case "$host_os" in | 59 | case "$host_os" in |
52 | *darwin* | *rhapsody* | *macosx*) | 60 | *darwin* | *rhapsody* | *macosx*) |
@@ -97,6 +105,10 @@ netbsd*) | |||
97 | LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32 -lplibc" | 105 | LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32 -lplibc" |
98 | AM_CONDITIONAL(HAVE_GNU_LD, true) | 106 | AM_CONDITIONAL(HAVE_GNU_LD, true) |
99 | ;; | 107 | ;; |
108 | *openedition*) | ||
109 | AC_DEFINE_UNQUOTED(OS390,1,[This is a OS/390 system]) | ||
110 | AM_CONDITIONAL(HAVE_GNU_LD, false) | ||
111 | ;; | ||
100 | *) | 112 | *) |
101 | AC_MSG_RESULT(Unrecognised OS $host_os) | 113 | AC_MSG_RESULT(Unrecognised OS $host_os) |
102 | AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) | 114 | AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) |
@@ -104,6 +116,9 @@ netbsd*) | |||
104 | ;; | 116 | ;; |
105 | esac | 117 | esac |
106 | 118 | ||
119 | |||
120 | |||
121 | |||
107 | CHECK_PTHREAD | 122 | CHECK_PTHREAD |
108 | LIBS="$PTHREAD_LIBS $LIBS" | 123 | LIBS="$PTHREAD_LIBS $LIBS" |
109 | AC_SUBST(PTHREAD_LIBS) | 124 | AC_SUBST(PTHREAD_LIBS) |
@@ -119,7 +134,7 @@ AC_CHECK_HEADERS([sys/select.h sys/types.h sys/time.h sys/msg.h netdb.h netinet/ | |||
119 | # libcurl (required for testing) | 134 | # libcurl (required for testing) |
120 | SAVE_LIBS=$LIBS | 135 | SAVE_LIBS=$LIBS |
121 | LIBCURL_CHECK_CONFIG(,,curl=1,curl=0) | 136 | LIBCURL_CHECK_CONFIG(,,curl=1,curl=0) |
122 | AM_CONDITIONAL(HAVE_CURL, test x$curl = x1) | 137 | AM_CONDITIONAL(HAVE_CURL, test x$curl == x1) |
123 | LIBS=$SAVE_LIBS | 138 | LIBS=$SAVE_LIBS |
124 | 139 | ||
125 | # Lib cURL & cURL - OpenSSL versions | 140 | # Lib cURL & cURL - OpenSSL versions |
@@ -142,51 +157,107 @@ AC_ARG_ENABLE(messages, | |||
142 | [enable_messages=$enableval], | 157 | [enable_messages=$enableval], |
143 | [enable_messages="no"]) | 158 | [enable_messages="no"]) |
144 | AC_MSG_RESULT($enable_messages) | 159 | AC_MSG_RESULT($enable_messages) |
145 | if test "$enable_messages" = "yes" | 160 | if test "$enable_messages" == "yes" |
146 | then | 161 | then |
147 | AC_DEFINE([HAVE_MESSAGES],[1],[Include error messages]) | 162 | AC_DEFINE([HAVE_MESSAGES],[1],[Include error messages]) |
148 | fi | 163 | fi |
149 | 164 | ||
150 | # optional: compile TLS client side code [only for test running] ? | ||
151 | AC_MSG_CHECKING(--enable-client-side argument) | ||
152 | AC_ARG_ENABLE(client-side, | ||
153 | [AS_HELP_STRING([--enable-client-side], | ||
154 | [Compile client side code])], | ||
155 | [enable_client_side=$enableval], | ||
156 | [enable_client_side="no"]) | ||
157 | AC_MSG_RESULT($enable_client_side) | ||
158 | if test "$enable_client_side" = "no" | ||
159 | then | ||
160 | AC_DEFINE([MHD_DEBUG_TLS],[0],[Compile client side code. This will enable running some test cases.]) | ||
161 | MSG_CLIENT_SIDE="disabled. running some test cases won't be possible" | ||
162 | else | ||
163 | AC_DEFINE([MHD_DEBUG_TLS],[1],[Compile client side code. This will enable running some test cases.]) | ||
164 | MSG_CLIENT_SIDE="enabled" | ||
165 | fi | ||
166 | AM_CONDITIONAL(MHD_DEBUG_TLS, test "$enable_client_side" != "no") | ||
167 | 165 | ||
168 | # optional: have zzuf, socat? | 166 | # optional: have zzuf, socat? |
169 | AC_CHECK_PROG([HAVE_ZZUF],[zzuf], 1, 0) | 167 | AC_CHECK_PROG([HAVE_ZZUF],[zzuf], 1, 0) |
170 | AC_CHECK_PROG([HAVE_SOCAT],[socat], 1, 0) | 168 | AC_CHECK_PROG([HAVE_SOCAT],[socat], 1, 0) |
171 | |||
172 | AM_CONDITIONAL(HAVE_ZZUF, test 0 != $HAVE_ZZUF) | 169 | AM_CONDITIONAL(HAVE_ZZUF, test 0 != $HAVE_ZZUF) |
173 | AM_CONDITIONAL(HAVE_SOCAT, test 0 != $HAVE_SOCAT) | 170 | AM_CONDITIONAL(HAVE_SOCAT, test 0 != $HAVE_SOCAT) |
174 | 171 | ||
175 | # optional: HTTPS support. Included by default | 172 | |
173 | # libgcrypt linkage: required for HTTPS support | ||
174 | AC_MSG_CHECKING(--with-libgcrypt argument) | ||
175 | AC_ARG_WITH(libgcrypt, | ||
176 | [AS_HELP_STRING([--with-libgcrypt=PFX], | ||
177 | [Base of libgcrypt installation])], | ||
178 | [AC_MSG_RESULT("$with_libgcrypt") | ||
179 | case $with_libgcrypt in | ||
180 | no) | ||
181 | gcrypt=false | ||
182 | ;; | ||
183 | yes) | ||
184 | AC_CHECK_HEADERS([gcrypt.h], | ||
185 | AC_CHECK_LIB(gcrypt,gcry_prime_generate, | ||
186 | gcrypt=true, | ||
187 | gcrypt=false)) | ||
188 | ;; | ||
189 | *) | ||
190 | LDFLAGS="-L${with_libgcrypt}lib $LDFLAGS" | ||
191 | CPPFLAGS="-I${with_libgcrypt}/include $CPPFLAGS" | ||
192 | AC_CHECK_HEADERS(gcrypt.h, | ||
193 | # check for 'gcry_prime_generate' in gcrypt.la | ||
194 | AC_CHECK_LIB(gcrypt,gcry_prime_generate, | ||
195 | GCRYPT_LIB_PATH="${with_libgcrypt}/lib" | ||
196 | GCRYPT_LDFLAGS="-L${with_libgcrypt}/lib" | ||
197 | GCRYPT_CPPFLAGS="-I${with_libgcrypt}/include" | ||
198 | gcrypt=true, | ||
199 | gcrypt=false)) | ||
200 | LDFLAGS=$SAVE_LDFLAGS | ||
201 | CPPFLAGS=$SAVE_CPPFLAGS | ||
202 | ;; | ||
203 | esac | ||
204 | ], | ||
205 | [AC_MSG_RESULT([not specified]) | ||
206 | AC_CHECK_HEADERS([gcrypt.h], | ||
207 | AC_CHECK_LIB(gcrypt,gcry_prime_generate, | ||
208 | gcrypt=true, | ||
209 | gcrypt=false)) | ||
210 | ]) | ||
211 | |||
212 | # define the minimal version of libgcrypt required | ||
213 | MHD_GCRYPT_VERSION=1:1.2.4 | ||
214 | AC_DEFINE_UNQUOTED([MHD_GCRYPT_VERSION], "$MHD_GCRYPT_VERSION", [gcrypt lib version]) | ||
215 | AC_SUBST(GCRYPT_LIB_PATH) | ||
216 | AC_SUBST(GCRYPT_LDFLAGS) | ||
217 | AC_SUBST(GCRYPT_CPPFLAGS) | ||
218 | |||
219 | |||
220 | # optional: HTTPS support. Enabled by default | ||
176 | AC_MSG_CHECKING(--enable-HTTPS argument) | 221 | AC_MSG_CHECKING(--enable-HTTPS argument) |
177 | AC_ARG_ENABLE([HTTPS], | 222 | AC_ARG_ENABLE([HTTPS], |
178 | [AS_HELP_STRING([--enable-HTTPS], | 223 | [AS_HELP_STRING([--enable-HTTPS], |
179 | [enable HTTPS support (default is yes)])], | 224 | [enable HTTPS support (default is yes)])], |
180 | [enable_HTTPS=$enableval], | 225 | [enable_HTTPS=$enableval], |
181 | [enable_HTTPS="yes"]) | 226 | [enable_HTTPS="yes"]) |
182 | AC_MSG_RESULT($enable_HTTPS) | 227 | if test "$enable_HTTPS" == "yes" |
183 | if test "$enable_HTTPS" = "yes" | ||
184 | then | 228 | then |
185 | AC_DEFINE([HTTPS_SUPPORT],[1],[include HTTPS support]) | 229 | if test "$gcrypt" == "true" |
230 | then | ||
231 | AC_DEFINE([HTTPS_SUPPORT],[1],[include HTTPS support]) | ||
232 | else | ||
233 | AC_DEFINE([HTTPS_SUPPORT],[0],[no libgcrypt]) | ||
234 | enable_HTTPS="no (lacking libgcrypt)" | ||
235 | fi | ||
186 | else | 236 | else |
187 | AC_DEFINE([HTTPS_SUPPORT],[0],[disable HTTPS support]) | 237 | AC_DEFINE([HTTPS_SUPPORT],[0],[disable HTTPS support]) |
188 | fi | 238 | fi |
189 | AM_CONDITIONAL(ENABLE_HTTPS, test "$enable_HTTPS" = "yes") | 239 | AC_MSG_RESULT($enable_HTTPS) |
240 | |||
241 | AM_CONDITIONAL(ENABLE_HTTPS, test "$enable_HTTPS" == "yes") | ||
242 | |||
243 | # optional: compile TLS client side code [only for test running] ? | ||
244 | AC_MSG_CHECKING(--enable-client-side argument) | ||
245 | AC_ARG_ENABLE(client-side, | ||
246 | [AS_HELP_STRING([--enable-client-side], | ||
247 | [Compile client side code])], | ||
248 | [enable_client_side=$enableval], | ||
249 | [enable_client_side="no"]) | ||
250 | AC_MSG_RESULT($enable_client_side) | ||
251 | if test "$enable_client_side" == "no" | ||
252 | then | ||
253 | AC_DEFINE([MHD_DEBUG_TLS],[0],[Compile client side code. This will enable running some test cases.]) | ||
254 | MSG_CLIENT_SIDE="disabled. running some test cases won't be possible" | ||
255 | else | ||
256 | AC_DEFINE([MHD_DEBUG_TLS],[1],[Compile client side code. This will enable running some test cases.]) | ||
257 | MSG_CLIENT_SIDE="enabled" | ||
258 | fi | ||
259 | AM_CONDITIONAL(MHD_DEBUG_TLS, test "$enable_client_side" != "no") | ||
260 | |||
190 | 261 | ||
191 | # optional: TLS support. Included by default | 262 | # optional: TLS support. Included by default |
192 | AC_MSG_CHECKING(--enable-TLS argument) | 263 | AC_MSG_CHECKING(--enable-TLS argument) |
@@ -218,51 +289,12 @@ AC_ARG_ENABLE([x509], | |||
218 | AC_MSG_RESULT($enable_x509) | 289 | AC_MSG_RESULT($enable_x509) |
219 | 290 | ||
220 | 291 | ||
221 | # Libgcrypt linkage : required for HTTPS support | ||
222 | AC_CHECK_HEADERS(gcrypt.h,gcrypt=true,gcrypt=false) | ||
223 | AC_ARG_WITH(libgcrypt, | ||
224 | [AS_HELP_STRING([--with-libgcrypt=PFX], | ||
225 | [Base of libgcrypt installation])], | ||
226 | [AC_MSG_RESULT("$with_libgcrypt") | ||
227 | case $with_libgcrypt in | ||
228 | no) | ||
229 | gcrypt=false | ||
230 | ;; | ||
231 | yes) | ||
232 | ;; | ||
233 | *) | ||
234 | LDFLAGS="-L$with_libgcrypt/lib $LDFLAGS" | ||
235 | CPPFLAGS="-I$with_libgcrypt/include $CPPFLAGS" | ||
236 | AC_CHECK_HEADERS(gcrypt.h, | ||
237 | # check for 'gcry_prime_generate' in gcrypt.la | ||
238 | AC_CHECK_LIB(gcrypt,gcry_prime_generate, | ||
239 | GCRYPT_LIB_PATH="$with_libgcrypt/lib" | ||
240 | GCRYPT_LDFLAGS="-L$with_libgcrypt/lib" | ||
241 | GCRYPT_CPPFLAGS="-I$with_libgcrypt/include" | ||
242 | gcrypt=true, | ||
243 | gcrypt=false)) | ||
244 | LDFLAGS=$SAVE_LDFLAGS | ||
245 | CPPFLAGS=$SAVE_CPPFLAGS | ||
246 | ;; | ||
247 | esac | ||
248 | ], | ||
249 | [AC_MSG_RESULT([--with_libgcrypt not specified])]) | ||
250 | |||
251 | # define the minimal version of libgcrypt required | ||
252 | MHD_GCRYPT_VERSION=1:1.2.4 | ||
253 | AC_DEFINE_UNQUOTED([MHD_GCRYPT_VERSION], "$MHD_GCRYPT_VERSION", [gcrypt lib version]) | ||
254 | |||
255 | AC_SUBST(GCRYPT_LIB_PATH) | ||
256 | AC_SUBST(GCRYPT_LDFLAGS) | ||
257 | AC_SUBST(GCRYPT_CPPFLAGS) | ||
258 | |||
259 | # Symbols required by GNU_TLS | 292 | # Symbols required by GNU_TLS |
260 | AC_DEFINE([ENABLE_MINITASN1],[1],[Include minitasn1 support]) | 293 | AC_DEFINE([ENABLE_MINITASN1],[1],[Include minitasn1 support]) |
261 | AC_DEFINE([GNULIB_GC_HMAC_SHA1],[1],[GNULIB_GC_HMAC_SHA1]) | 294 | AC_DEFINE([GNULIB_GC_HMAC_SHA1],[1],[GNULIB_GC_HMAC_SHA1]) |
262 | AC_DEFINE([GNULIB_GC_RANDOM],[1],[GNULIB_GC_RANDOM]) | 295 | AC_DEFINE([GNULIB_GC_RANDOM],[1],[GNULIB_GC_RANDOM]) |
263 | AC_DEFINE([ENABLE_ANON],[1],[Enable anonymous authentication]) | 296 | AC_DEFINE([ENABLE_ANON],[1],[Enable anonymous authentication]) |
264 | AC_DEFINE([ENABLE_PKI],[0],[Include PKI support]) | 297 | AC_DEFINE([ENABLE_PKI],[0],[Include PKI support]) |
265 | AC_DEFINE([ENABLE_INCLUDED_OPENCDK],[1],[Include ENABLE_INCLUDED_OPENCDK support]) | ||
266 | # gnutls debug support | 298 | # gnutls debug support |
267 | AC_DEFINE([DEBUG],[1],[Include gnutls debug message support]) | 299 | AC_DEFINE([DEBUG],[1],[Include gnutls debug message support]) |
268 | AC_DEFINE([C99_MACROS],[1],[Include gnutls debug message support]) | 300 | AC_DEFINE([C99_MACROS],[1],[Include gnutls debug message support]) |
@@ -280,6 +312,7 @@ AC_SUBST(EXT_LIBS) | |||
280 | 312 | ||
281 | AC_CONFIG_FILES([ | 313 | AC_CONFIG_FILES([ |
282 | Makefile | 314 | Makefile |
315 | contrib/Makefile | ||
283 | doc/Makefile | 316 | doc/Makefile |
284 | m4/Makefile | 317 | m4/Makefile |
285 | src/Makefile | 318 | src/Makefile |
@@ -300,35 +333,38 @@ AM_CONDITIONAL(ENABLE_MINITASN1, [test -n " " ] ) | |||
300 | AM_CONDITIONAL(ENABLE_OPENSSL, [test -n "" ] ) | 333 | AM_CONDITIONAL(ENABLE_OPENSSL, [test -n "" ] ) |
301 | AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, [test -n "" ] ) | 334 | AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, [test -n "" ] ) |
302 | AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, [test -n "" ] ) | 335 | AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, [test -n "" ] ) |
303 | AM_CONDITIONAL(ENABLE_INCLUDED_OPENCDK, [test -n "" ] ) | ||
304 | 336 | ||
305 | # Finally: summary | 337 | # Finally: summary |
306 | if test "$curl" != 1 ; then | 338 | if test "$curl" != 1 ; then |
307 | MSG_CURL="libcurl not found, building test won't be possible" | 339 | MSG_CURL="no, many unit tests will not run" |
308 | else | 340 | else |
309 | MSG_CURL="${_libcurl_with}/lib" | 341 | MSG_CURL="yes" |
310 | fi | 342 | fi |
343 | |||
311 | if test "$gcrypt" != true | 344 | if test "$gcrypt" != true |
312 | then | 345 | then |
313 | MSG_GCRYPT="libgcrypt not found, HTTPS supprot cannot be built" | 346 | MSG_GCRYPT="no, HTTPS will not be built" |
314 | else | 347 | else |
315 | MSG_GCRYPT="${with_libgcrypt}/lib" | 348 | MSG_GCRYPT="yes" |
316 | fi | 349 | fi |
317 | 350 | ||
318 | AC_MSG_NOTICE([Configured to build curl/libcurl: | 351 | AC_MSG_NOTICE([Configuration Summary: |
319 | Configuration Summery: | 352 | Operating System: ${host_os} |
320 | 353 | Target directory: ${prefix} | |
321 | os: ${host_os} | 354 | Messages: ${enable_messages} |
322 | target dir: ${prefix} | 355 | libgcrypt: ${MSG_GCRYPT} |
323 | messages: ${enable_messages} | 356 | libcurl (testing): ${MSG_CURL} |
324 | HTTPS support: ${enable_HTTPS} | 357 | HTTPS support: ${enable_HTTPS} |
358 | ]) | ||
359 | |||
360 | if test "$enable_HTTPS" == "yes" | ||
361 | then | ||
362 | AC_MSG_NOTICE([HTTPS subsystem configuration: | ||
325 | TLS support: ${enable_TLS} | 363 | TLS support: ${enable_TLS} |
326 | SSLv3 support: ${enable_SSL} | 364 | SSLv3 support: ${enable_SSL} |
327 | x509 support: ${enable_x509} | 365 | x509 support: ${enable_x509} |
328 | libgcrypt: ${MSG_GCRYPT} | 366 | Client code dep.: ${MSG_CLIENT_SIDE} |
329 | |||
330 | # Testing | ||
331 | libcurl: ${MSG_CURL} | ||
332 | client code dep.: ${MSG_CLIENT_SIDE} | ||
333 | ]) | 367 | ]) |
368 | fi | ||
369 | |||
334 | 370 | ||