summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in166
1 files changed, 84 insertions, 82 deletions
diff --git a/configure.in b/configure.in
index 0cced59..30e4261 100644
--- a/configure.in
+++ b/configure.in
@@ -255,87 +255,6 @@ fi
255CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE" 255CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE"
256LIBS="$_SAVEDLIBS" 256LIBS="$_SAVEDLIBS"
257 257
258dnl Check for OpenSSL location
259AC_PATH_PROG(OPENSSL,openssl)
260if test "$OPENSSL" = "/usr/bin/openssl"; then
261 OPENSSL=/usr
262elif test "$OPENSSL" = "/usr/sbin/openssl"; then
263 OPENSSL=/usr
264elif test "$OPENSSL" = "/opt/bin/openssl"; then
265 OPENSSL=/opt
266elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then
267 OPENSSL=/opt/openssl
268elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then
269 OPENSSL=/usr/slocal
270elif test "$OPENSSL" = "/usr/local/bin/openssl"; then
271 OPENSSL=/usr/local
272elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then
273 OPENSSL=/usr/local/ssl
274fi
275AC_ARG_WITH(openssl,
276AC_HELP_STRING([--with-openssl=DIR], [sets path to openssl installation])
277AC_HELP_STRING([--without-openssl], [disable openssl]),
278OPENSSL=$withval)
279
280if test X"$OPENSSL" = "Xno"; then
281 AC_MSG_WARN([openssl disabled, you will not be able to use ssl options in some plugins])
282 FOUNDSSL="dontbother"
283else
284 dnl Check for OpenSSL header files
285 unset FOUNDINCLUDE
286 _SAVEDCPPFLAGS="$CPPFLAGS"
287 if test "$OPENSSL" != "/usr"; then
288 CPPFLAGS="$CPPFLAGS -I$OPENSSL/include"
289 fi
290 AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
291 SSLINCLUDE="-I$OPENSSL/include"
292 FOUNDINCLUDE=yes,
293 FOUNDINCLUDE=no)
294 if test "$FOUNDINCLUDE" = "no"; then
295 AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
296 SSLINCLUDE="-I$OPENSSL/include"
297 FOUNDINCLUDE=yes,
298 FOUNDINCLUDE=no)
299 fi
300 AC_SUBST(SSLINCLUDE)
301 if test "$FOUNDINCLUDE" = "no"; then
302 CPPFLAGS="$_SAVEDCPPFLAGS"
303 fi
304
305 dnl Check for crypto lib
306 _SAVEDLIBS="$LIBS"
307 AC_CHECK_LIB(crypto,CRYPTO_lock,,,-L$OPENSSL/lib)
308 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
309 dnl Check for SSL lib
310 AC_CHECK_LIB(ssl,main,LDFLAGS="$LDFLAGS -L$OPENSSL/lib" SSLLIBS="-lssl -lcrypto",AC_CHECK_LIB(ssl,main,LDFLAGS="$LDFLAGS -L$OPENSSL/lib" SSLLIBS="-lssl -lcrypto"),-L$OPENSSL/lib -lcrypto)
311 fi
312 LIBS="$_SAVEDLIBS"
313
314 FOUNDSSL="no"
315 dnl test headers and libs to decide whether check_http should use SSL
316 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
317 if test "$ac_cv_lib_ssl_main" = "yes"; then
318 if test "$FOUNDINCLUDE" = "yes"; then
319 FOUNDSSL="yes"
320 fi
321 fi
322 fi
323fi
324
325if test "$FOUNDSSL" = "yes"; then
326 check_tcp_ssl="check_simap check_spop check_jabber check_nntps"
327 AC_SUBST(check_tcp_ssl)
328 AC_SUBST(SSLLIBS)
329 AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
330 with_openssl="yes"
331elif test "$FOUNDSSL" = "no"; then
332 AC_MSG_WARN([OpenSSL libs could not be found])
333 with_openssl="no"
334else
335 with_openssl="no"
336fi
337CPPFLAGS="$_SAVEDCPPFLAGS"
338
339AC_CHECK_HEADERS(unistd.h) 258AC_CHECK_HEADERS(unistd.h)
340 259
341dnl Check for AF_INET6 support - unistd.h required for Darwin 260dnl Check for AF_INET6 support - unistd.h required for Darwin
@@ -462,6 +381,7 @@ if test x"$enable_emulate_getaddrinfo" != xno ; then
462 381
463fi 382fi
464 383
384dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
465AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) 385AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
466if test "$FOUNDINCLUDE" = "no"; then 386if test "$FOUNDINCLUDE" = "no"; then
467 _SAVEDCPPFLAGS="$CPPFLAGS" 387 _SAVEDCPPFLAGS="$CPPFLAGS"
@@ -477,6 +397,87 @@ if test "$FOUNDINCLUDE" = "no"; then
477 CPPFLAGS="$_SAVEDCPPFLAGS" 397 CPPFLAGS="$_SAVEDCPPFLAGS"
478fi 398fi
479 399
400dnl Check for OpenSSL location
401AC_PATH_PROG(OPENSSL,openssl)
402if test "$OPENSSL" = "/usr/bin/openssl"; then
403 OPENSSL=/usr
404elif test "$OPENSSL" = "/usr/sbin/openssl"; then
405 OPENSSL=/usr
406elif test "$OPENSSL" = "/opt/bin/openssl"; then
407 OPENSSL=/opt
408elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then
409 OPENSSL=/opt/openssl
410elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then
411 OPENSSL=/usr/slocal
412elif test "$OPENSSL" = "/usr/local/bin/openssl"; then
413 OPENSSL=/usr/local
414elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then
415 OPENSSL=/usr/local/ssl
416fi
417AC_ARG_WITH(openssl,
418AC_HELP_STRING([--with-openssl=DIR], [sets path to openssl installation])
419AC_HELP_STRING([--without-openssl], [disable openssl]),
420OPENSSL=$withval)
421
422if test X"$OPENSSL" = "Xno"; then
423 AC_MSG_WARN([openssl disabled, you will not be able to use ssl options in some plugins])
424 FOUNDSSL="dontbother"
425else
426 dnl Check for OpenSSL header files
427 unset FOUNDINCLUDE
428 _SAVEDCPPFLAGS="$CPPFLAGS"
429 if test "$OPENSSL" != "/usr"; then
430 CPPFLAGS="$CPPFLAGS -I$OPENSSL/include"
431 fi
432 AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
433 SSLINCLUDE="-I$OPENSSL/include"
434 FOUNDINCLUDE=yes,
435 FOUNDINCLUDE=no)
436 if test "$FOUNDINCLUDE" = "no"; then
437 AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
438 SSLINCLUDE="-I$OPENSSL/include"
439 FOUNDINCLUDE=yes,
440 FOUNDINCLUDE=no)
441 fi
442 AC_SUBST(SSLINCLUDE)
443 if test "$FOUNDINCLUDE" = "no"; then
444 CPPFLAGS="$_SAVEDCPPFLAGS"
445 fi
446
447 dnl Check for crypto lib
448 _SAVEDLIBS="$LIBS"
449 AC_CHECK_LIB(crypto,CRYPTO_lock,,,-L$OPENSSL/lib)
450 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
451 dnl Check for SSL lib
452 AC_CHECK_LIB(ssl,main,LDFLAGS="$LDFLAGS -L$OPENSSL/lib" SSLLIBS="-lssl -lcrypto",AC_CHECK_LIB(ssl,main,LDFLAGS="$LDFLAGS -L$OPENSSL/lib" SSLLIBS="-lssl -lcrypto"),-L$OPENSSL/lib -lcrypto)
453 fi
454 LIBS="$_SAVEDLIBS"
455
456 FOUNDSSL="no"
457 dnl test headers and libs to decide whether check_http should use SSL
458 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
459 if test "$ac_cv_lib_ssl_main" = "yes"; then
460 if test "$FOUNDINCLUDE" = "yes"; then
461 FOUNDSSL="yes"
462 fi
463 fi
464 fi
465fi
466
467if test "$FOUNDSSL" = "yes"; then
468 check_tcp_ssl="check_simap check_spop check_jabber check_nntps"
469 AC_SUBST(check_tcp_ssl)
470 AC_SUBST(SSLLIBS)
471 AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
472 with_openssl="yes"
473elif test "$FOUNDSSL" = "no"; then
474 AC_MSG_WARN([OpenSSL libs could not be found])
475 with_openssl="no"
476else
477 with_openssl="no"
478fi
479CPPFLAGS="$_SAVEDCPPFLAGS"
480
480dnl 481dnl
481dnl Checks for header files. 482dnl Checks for header files.
482dnl 483dnl
@@ -1455,8 +1456,9 @@ AC_SUBST(DEPLIBS)
1455AM_GNU_GETTEXT([no-libtool], [need-ngettext]) 1456AM_GNU_GETTEXT([no-libtool], [need-ngettext])
1456AM_GNU_GETTEXT_VERSION(0.11.5) 1457AM_GNU_GETTEXT_VERSION(0.11.5)
1457 1458
1458dnl External libraries 1459dnl External libraries - see ACKNOWLEDGEMENTS
1459np_COREUTILS 1460np_COREUTILS
1461np_CURL
1460 1462
1461AC_OUTPUT( 1463AC_OUTPUT(
1462 Makefile 1464 Makefile