aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac208
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
28AH_TOP([#define _GNU_SOURCE 1]) 28AH_TOP([#define _GNU_SOURCE 1])
29 29
30if test `uname -s` == "OS/S390"
31then
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
39fi
40
30# Checks for programs. 41# Checks for programs.
31AC_PROG_AWK 42AC_PROG_AWK
32
33
34AM_PROG_CC_C_O
35
36
37AC_PROG_INSTALL 43AC_PROG_INSTALL
38AC_PROG_LN_S 44AC_PROG_LN_S
39AC_PROG_MAKE_SET 45AC_PROG_MAKE_SET
40AC_CANONICAL_HOST 46AC_CANONICAL_HOST
47AM_PROG_CC_C_O
41AC_PROG_LIBTOOL 48AC_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"
48fi 55fi
49 56
57
50# Check system type 58# Check system type
51case "$host_os" in 59case "$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;;
105esac 117esac
106 118
119
120
121
107CHECK_PTHREAD 122CHECK_PTHREAD
108LIBS="$PTHREAD_LIBS $LIBS" 123LIBS="$PTHREAD_LIBS $LIBS"
109AC_SUBST(PTHREAD_LIBS) 124AC_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)
120SAVE_LIBS=$LIBS 135SAVE_LIBS=$LIBS
121LIBCURL_CHECK_CONFIG(,,curl=1,curl=0) 136LIBCURL_CHECK_CONFIG(,,curl=1,curl=0)
122AM_CONDITIONAL(HAVE_CURL, test x$curl = x1) 137AM_CONDITIONAL(HAVE_CURL, test x$curl == x1)
123LIBS=$SAVE_LIBS 138LIBS=$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"])
144AC_MSG_RESULT($enable_messages) 159AC_MSG_RESULT($enable_messages)
145if test "$enable_messages" = "yes" 160if test "$enable_messages" == "yes"
146then 161then
147 AC_DEFINE([HAVE_MESSAGES],[1],[Include error messages]) 162 AC_DEFINE([HAVE_MESSAGES],[1],[Include error messages])
148fi 163fi
149 164
150# optional: compile TLS client side code [only for test running] ?
151AC_MSG_CHECKING(--enable-client-side argument)
152AC_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"])
157AC_MSG_RESULT($enable_client_side)
158if test "$enable_client_side" = "no"
159then
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"
162else
163 AC_DEFINE([MHD_DEBUG_TLS],[1],[Compile client side code. This will enable running some test cases.])
164 MSG_CLIENT_SIDE="enabled"
165fi
166AM_CONDITIONAL(MHD_DEBUG_TLS, test "$enable_client_side" != "no")
167 165
168# optional: have zzuf, socat? 166# optional: have zzuf, socat?
169AC_CHECK_PROG([HAVE_ZZUF],[zzuf], 1, 0) 167AC_CHECK_PROG([HAVE_ZZUF],[zzuf], 1, 0)
170AC_CHECK_PROG([HAVE_SOCAT],[socat], 1, 0) 168AC_CHECK_PROG([HAVE_SOCAT],[socat], 1, 0)
171
172AM_CONDITIONAL(HAVE_ZZUF, test 0 != $HAVE_ZZUF) 169AM_CONDITIONAL(HAVE_ZZUF, test 0 != $HAVE_ZZUF)
173AM_CONDITIONAL(HAVE_SOCAT, test 0 != $HAVE_SOCAT) 170AM_CONDITIONAL(HAVE_SOCAT, test 0 != $HAVE_SOCAT)
174 171
175# optional: HTTPS support. Included by default 172
173# libgcrypt linkage: required for HTTPS support
174AC_MSG_CHECKING(--with-libgcrypt argument)
175AC_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
213MHD_GCRYPT_VERSION=1:1.2.4
214AC_DEFINE_UNQUOTED([MHD_GCRYPT_VERSION], "$MHD_GCRYPT_VERSION", [gcrypt lib version])
215AC_SUBST(GCRYPT_LIB_PATH)
216AC_SUBST(GCRYPT_LDFLAGS)
217AC_SUBST(GCRYPT_CPPFLAGS)
218
219
220# optional: HTTPS support. Enabled by default
176AC_MSG_CHECKING(--enable-HTTPS argument) 221AC_MSG_CHECKING(--enable-HTTPS argument)
177AC_ARG_ENABLE([HTTPS], 222AC_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"])
182AC_MSG_RESULT($enable_HTTPS) 227if test "$enable_HTTPS" == "yes"
183if test "$enable_HTTPS" = "yes"
184then 228then
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
186else 236else
187 AC_DEFINE([HTTPS_SUPPORT],[0],[disable HTTPS support]) 237 AC_DEFINE([HTTPS_SUPPORT],[0],[disable HTTPS support])
188fi 238fi
189AM_CONDITIONAL(ENABLE_HTTPS, test "$enable_HTTPS" = "yes") 239AC_MSG_RESULT($enable_HTTPS)
240
241AM_CONDITIONAL(ENABLE_HTTPS, test "$enable_HTTPS" == "yes")
242
243# optional: compile TLS client side code [only for test running] ?
244AC_MSG_CHECKING(--enable-client-side argument)
245AC_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"])
250AC_MSG_RESULT($enable_client_side)
251if test "$enable_client_side" == "no"
252then
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"
255else
256 AC_DEFINE([MHD_DEBUG_TLS],[1],[Compile client side code. This will enable running some test cases.])
257 MSG_CLIENT_SIDE="enabled"
258fi
259AM_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
192AC_MSG_CHECKING(--enable-TLS argument) 263AC_MSG_CHECKING(--enable-TLS argument)
@@ -218,51 +289,12 @@ AC_ARG_ENABLE([x509],
218AC_MSG_RESULT($enable_x509) 289AC_MSG_RESULT($enable_x509)
219 290
220 291
221# Libgcrypt linkage : required for HTTPS support
222AC_CHECK_HEADERS(gcrypt.h,gcrypt=true,gcrypt=false)
223AC_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
252MHD_GCRYPT_VERSION=1:1.2.4
253AC_DEFINE_UNQUOTED([MHD_GCRYPT_VERSION], "$MHD_GCRYPT_VERSION", [gcrypt lib version])
254
255AC_SUBST(GCRYPT_LIB_PATH)
256AC_SUBST(GCRYPT_LDFLAGS)
257AC_SUBST(GCRYPT_CPPFLAGS)
258
259# Symbols required by GNU_TLS 292# Symbols required by GNU_TLS
260AC_DEFINE([ENABLE_MINITASN1],[1],[Include minitasn1 support]) 293AC_DEFINE([ENABLE_MINITASN1],[1],[Include minitasn1 support])
261AC_DEFINE([GNULIB_GC_HMAC_SHA1],[1],[GNULIB_GC_HMAC_SHA1]) 294AC_DEFINE([GNULIB_GC_HMAC_SHA1],[1],[GNULIB_GC_HMAC_SHA1])
262AC_DEFINE([GNULIB_GC_RANDOM],[1],[GNULIB_GC_RANDOM]) 295AC_DEFINE([GNULIB_GC_RANDOM],[1],[GNULIB_GC_RANDOM])
263AC_DEFINE([ENABLE_ANON],[1],[Enable anonymous authentication]) 296AC_DEFINE([ENABLE_ANON],[1],[Enable anonymous authentication])
264AC_DEFINE([ENABLE_PKI],[0],[Include PKI support]) 297AC_DEFINE([ENABLE_PKI],[0],[Include PKI support])
265AC_DEFINE([ENABLE_INCLUDED_OPENCDK],[1],[Include ENABLE_INCLUDED_OPENCDK support])
266# gnutls debug support 298# gnutls debug support
267AC_DEFINE([DEBUG],[1],[Include gnutls debug message support]) 299AC_DEFINE([DEBUG],[1],[Include gnutls debug message support])
268AC_DEFINE([C99_MACROS],[1],[Include gnutls debug message support]) 300AC_DEFINE([C99_MACROS],[1],[Include gnutls debug message support])
@@ -280,6 +312,7 @@ AC_SUBST(EXT_LIBS)
280 312
281AC_CONFIG_FILES([ 313AC_CONFIG_FILES([
282Makefile 314Makefile
315contrib/Makefile
283doc/Makefile 316doc/Makefile
284m4/Makefile 317m4/Makefile
285src/Makefile 318src/Makefile
@@ -300,35 +333,38 @@ AM_CONDITIONAL(ENABLE_MINITASN1, [test -n " " ] )
300AM_CONDITIONAL(ENABLE_OPENSSL, [test -n "" ] ) 333AM_CONDITIONAL(ENABLE_OPENSSL, [test -n "" ] )
301AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, [test -n "" ] ) 334AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, [test -n "" ] )
302AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, [test -n "" ] ) 335AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, [test -n "" ] )
303AM_CONDITIONAL(ENABLE_INCLUDED_OPENCDK, [test -n "" ] )
304 336
305# Finally: summary 337# Finally: summary
306if test "$curl" != 1 ; then 338if 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"
308else 340else
309 MSG_CURL="${_libcurl_with}/lib" 341 MSG_CURL="yes"
310fi 342fi
343
311if test "$gcrypt" != true 344if test "$gcrypt" != true
312then 345then
313 MSG_GCRYPT="libgcrypt not found, HTTPS supprot cannot be built" 346 MSG_GCRYPT="no, HTTPS will not be built"
314else 347else
315 MSG_GCRYPT="${with_libgcrypt}/lib" 348 MSG_GCRYPT="yes"
316fi 349fi
317 350
318AC_MSG_NOTICE([Configured to build curl/libcurl: 351AC_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
360if test "$enable_HTTPS" == "yes"
361then
362AC_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])
368fi
369
334 370