summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2004-12-21 22:52:54 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2004-12-21 22:52:54 (GMT)
commit8d91bdc4bc0004ca2c651ed64636245db5475a79 (patch)
treeef63021387011114988508837ea2ee8687d5aeee /configure.in
parent6d8c95247b77e6852877e68a6ebbff7cc64deac6 (diff)
downloadmonitoring-plugins-8d91bdc4bc0004ca2c651ed64636245db5475a79.tar.gz
Revert back to previous openssl checks (the ones from curl kept having
problems with later Redhat versions) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1051 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in202
1 files changed, 67 insertions, 135 deletions
diff --git a/configure.in b/configure.in
index f5d772d..0cced59 100644
--- a/configure.in
+++ b/configure.in
@@ -256,154 +256,86 @@ CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE"
256LIBS="$_SAVEDLIBS" 256LIBS="$_SAVEDLIBS"
257 257
258dnl Check for OpenSSL location 258dnl Check for OpenSSL location
259dnl This whole check is inspired by curl 7.12.2's configure.ac 259AC_PATH_PROG(OPENSSL,openssl)
260OPT_OPENSSL=off 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
261AC_ARG_WITH(openssl, 275AC_ARG_WITH(openssl,
262AC_HELP_STRING([--with-openssl=DIR], [sets path to openssl installation]) 276AC_HELP_STRING([--with-openssl=DIR], [sets path to openssl installation])
263AC_HELP_STRING([--without-openssl], [disable openssl]), 277AC_HELP_STRING([--without-openssl], [disable openssl]),
264OPT_OPENSSL=$withval) 278OPENSSL=$withval)
265 279
266if test X"$OPT_OPENSSL" = "Xno"; then 280if test X"$OPENSSL" = "Xno"; then
267 AC_MSG_WARN([openssl disabled, you will not be able to use ssl options in some plugins]) 281 AC_MSG_WARN([openssl disabled, you will not be able to use ssl options in some plugins])
268 with_openssl=no 282 FOUNDSSL="dontbother"
269else 283else
270 dnl backup the pre-ssl variables 284 dnl Check for OpenSSL header files
271 CLEANLDFLAGS="$LDFLAGS" 285 unset FOUNDINCLUDE
272 CLEANCPPFLAGS="$CPPFLAGS" 286 _SAVEDCPPFLAGS="$CPPFLAGS"
273 CLEANLIBS="$LIBS" 287 if test "$OPENSSL" != "/usr"; then
274 288 CPPFLAGS="$CPPFLAGS -I$OPENSSL/include"
275 case "$OPT_OPENSSL" in
276 yes)
277 dnl --with-openssl (without path) used
278 PKGTEST="yes"
279 ;;
280 off)
281 dnl no --with-openssl given, check default places
282 PKGTEST="yes"
283 ;;
284 *)
285 dnl use the given area
286 PKGTEST="no"
287 OPENSSL=$OPT_OPENSSL
288 LDFLAGS="$LDFLAGS -L$OPENSSL/lib"
289 CPPFLAGS="$CPPFLAGS -I$OPENSSL/include/openssl -I$OPENSSL/include"
290 ;;
291 esac
292
293 dnl Check usual areas for openssl
294 if test "$PKGTEST" = "yes"; then
295 AC_PATH_PROG(OPENSSL,openssl)
296 dnl The /usr checks need to be done so that the right area is include'd
297 if test "$OPENSSL" = "/usr/bin/openssl"; then
298 OPENSSL=/usr
299 elif test "$OPENSSL" = "/usr/sbin/openssl"; then
300 OPENSSL=/usr
301 elif test "$OPENSSL" = "/opt/bin/openssl"; then
302 OPENSSL=/opt
303 elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then
304 OPENSSL=/opt/openssl
305 elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then
306 OPENSSL=/usr/slocal
307 elif test "$OPENSSL" = "/usr/local/bin/openssl"; then
308 OPENSSL=/usr/local
309 elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then
310 OPENSSL=/usr/local/ssl
311 fi
312 fi 289 fi
313 290 AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
314 AC_CHECK_LIB(crypto, CRYPTO_lock,[ 291 SSLINCLUDE="-I$OPENSSL/include"
315 HAVECRYPTO="yes" 292 FOUNDINCLUDE=yes,
316 ],[ 293 FOUNDINCLUDE=no)
317 LDFLAGS="$CLEANLDFLAGS -L$OPENSSL/lib" 294 if test "$FOUNDINCLUDE" = "no"; then
318 CPPFLAGS="$CLEANCPPFLAGS -I$OPENSSL/include/openssl -I$OPENSSL/include" 295 AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
319 AC_CHECK_LIB(crypto, CRYPTO_add_lock,[ 296 SSLINCLUDE="-I$OPENSSL/include"
320 HAVECRYPTO="yes" ], [ 297 FOUNDINCLUDE=yes,
321 LDFLAGS="$CLEANLDFLAGS" 298 FOUNDINCLUDE=no)
322 CPPFLAGS="$CLEANCPPFLAGS" 299 fi
323 LIBS="$CLEANLIBS" 300 AC_SUBST(SSLINCLUDE)
324 ]) 301 if test "$FOUNDINCLUDE" = "no"; then
325 ]) 302 CPPFLAGS="$_SAVEDCPPFLAGS"
326
327 if test "$HAVECRYPTO" = "yes"; then
328 dnl This is only reasonable to do if crypto actually is there: check for
329 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
330
331 dnl This is for Msys/Mingw
332 AC_MSG_CHECKING([for gdi32])
333 my_ac_save_LIBS=$LIBS
334 LIBS="-lgdi32 $LIBS"
335 AC_TRY_LINK([#include <windef.h>
336 #include <wingdi.h>],
337 [GdiFlush();],
338 [ dnl worked!
339 AC_MSG_RESULT([yes])],
340 [ dnl failed, restore LIBS
341 LIBS=$my_ac_save_LIBS
342 AC_MSG_RESULT(no)]
343 )
344
345 AC_CHECK_LIB(crypto, CRYPTO_add_lock)
346 AC_CHECK_LIB(ssl, SSL_connect)
347
348 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
349 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
350 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
351 OLIBS=$LIBS
352 LIBS="$LIBS -lRSAglue -lrsaref"
353 AC_CHECK_LIB(ssl, SSL_connect)
354 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
355 dnl still no SSL_connect
356 AC_MSG_RESULT(no)
357 LIBS=$OLIBS
358 else
359 AC_MSG_RESULT(yes)
360 fi
361 fi
362
363
364 dnl Check for SSLeay headers
365 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
366 openssl/pem.h openssl/ssl.h openssl/err.h,
367 OPENSSL_ENABLED=1)
368
369 if test $ac_cv_header_openssl_x509_h = no; then
370 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
371 OPENSSL_ENABLED=1)
372 fi
373
374 dnl If the ENGINE library seems to be around, check for the OpenSSL engine
375 dnl header, it is kind of "separated" from the main SSL check
376 AC_CHECK_FUNC(ENGINE_init, [ AC_CHECK_HEADERS(openssl/engine.h) ])
377
378 dnl AC_SUBST(OPENSSL_ENABLED)
379
380 dnl these can only exist if openssl exists
381 AC_CHECK_FUNCS( RAND_status \
382 RAND_screen \
383 RAND_egd \
384 CRYPTO_cleanup_all_ex_data )
385
386 fi 303 fi
387 304
388 if test "$OPENSSL_ENABLED" != "1"; then 305 dnl Check for crypto lib
389 if test "$PKGTEST" = "yes"; then 306 _SAVEDLIBS="$LIBS"
390 AC_MSG_WARN([OpenSSL libs could not be found]) 307 AC_CHECK_LIB(crypto,CRYPTO_lock,,,-L$OPENSSL/lib)
391 else 308 if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
392 AC_MSG_WARN([OpenSSL libs and/or directories were not found where specified!]) 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
393 fi 321 fi
394 with_openssl="no"
395 else
396 check_tcp_ssl="check_simap check_spop check_jabber check_nntps"
397 AC_SUBST(check_tcp_ssl)
398 AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
399 with_openssl="yes"
400
401 # Needed for subsequent compiled programs
402 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENSSL/lib$libsuff"
403 export LD_LIBRARY_PATH
404 fi 322 fi
405fi 323fi
406 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
407AC_CHECK_HEADERS(unistd.h) 339AC_CHECK_HEADERS(unistd.h)
408 340
409dnl Check for AF_INET6 support - unistd.h required for Darwin 341dnl Check for AF_INET6 support - unistd.h required for Darwin