diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2004-12-21 22:52:54 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2004-12-21 22:52:54 +0000 |
commit | 8d91bdc4bc0004ca2c651ed64636245db5475a79 (patch) | |
tree | ef63021387011114988508837ea2ee8687d5aeee /configure.in | |
parent | 6d8c95247b77e6852877e68a6ebbff7cc64deac6 (diff) | |
download | monitoring-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.in | 202 |
1 files changed, 67 insertions, 135 deletions
diff --git a/configure.in b/configure.in index f5d772d8..0cced597 100644 --- a/configure.in +++ b/configure.in | |||
@@ -256,154 +256,86 @@ CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE" | |||
256 | LIBS="$_SAVEDLIBS" | 256 | LIBS="$_SAVEDLIBS" |
257 | 257 | ||
258 | dnl Check for OpenSSL location | 258 | dnl Check for OpenSSL location |
259 | dnl This whole check is inspired by curl 7.12.2's configure.ac | 259 | AC_PATH_PROG(OPENSSL,openssl) |
260 | OPT_OPENSSL=off | 260 | if test "$OPENSSL" = "/usr/bin/openssl"; then |
261 | OPENSSL=/usr | ||
262 | elif test "$OPENSSL" = "/usr/sbin/openssl"; then | ||
263 | OPENSSL=/usr | ||
264 | elif test "$OPENSSL" = "/opt/bin/openssl"; then | ||
265 | OPENSSL=/opt | ||
266 | elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then | ||
267 | OPENSSL=/opt/openssl | ||
268 | elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then | ||
269 | OPENSSL=/usr/slocal | ||
270 | elif test "$OPENSSL" = "/usr/local/bin/openssl"; then | ||
271 | OPENSSL=/usr/local | ||
272 | elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then | ||
273 | OPENSSL=/usr/local/ssl | ||
274 | fi | ||
261 | AC_ARG_WITH(openssl, | 275 | AC_ARG_WITH(openssl, |
262 | AC_HELP_STRING([--with-openssl=DIR], [sets path to openssl installation]) | 276 | AC_HELP_STRING([--with-openssl=DIR], [sets path to openssl installation]) |
263 | AC_HELP_STRING([--without-openssl], [disable openssl]), | 277 | AC_HELP_STRING([--without-openssl], [disable openssl]), |
264 | OPT_OPENSSL=$withval) | 278 | OPENSSL=$withval) |
265 | 279 | ||
266 | if test X"$OPT_OPENSSL" = "Xno"; then | 280 | if 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" |
269 | else | 283 | else |
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 |
405 | fi | 323 | fi |
406 | 324 | ||
325 | if 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" | ||
331 | elif test "$FOUNDSSL" = "no"; then | ||
332 | AC_MSG_WARN([OpenSSL libs could not be found]) | ||
333 | with_openssl="no" | ||
334 | else | ||
335 | with_openssl="no" | ||
336 | fi | ||
337 | CPPFLAGS="$_SAVEDCPPFLAGS" | ||
338 | |||
407 | AC_CHECK_HEADERS(unistd.h) | 339 | AC_CHECK_HEADERS(unistd.h) |
408 | 340 | ||
409 | dnl Check for AF_INET6 support - unistd.h required for Darwin | 341 | dnl Check for AF_INET6 support - unistd.h required for Darwin |