diff options
-rw-r--r-- | ACKNOWLEDGEMENTS | 10 | ||||
-rw-r--r-- | configure.in | 166 | ||||
-rw-r--r-- | m4/np_curl.m4 | 60 | ||||
-rw-r--r-- | plugins/Makefile.am | 1 |
4 files changed, 154 insertions, 83 deletions
diff --git a/ACKNOWLEDGEMENTS b/ACKNOWLEDGEMENTS index a070a54..7eea869 100644 --- a/ACKNOWLEDGEMENTS +++ b/ACKNOWLEDGEMENTS | |||
@@ -17,5 +17,13 @@ Kompf, Martin 200-2003 Copyright the author | |||
17 | http://cplus.kompf.de/macaddr.html | 17 | http://cplus.kompf.de/macaddr.html |
18 | Using the DLPI support on SysV systems to get the host MAC address in check_dhcp.c | 18 | Using the DLPI support on SysV systems to get the host MAC address in check_dhcp.c |
19 | 19 | ||
20 | 20 | Stenberg, Daniel | |
21 | Copyright (c) 1996 - 2004, Daniel Stenberg, <daniel@haxx.se> | ||
22 | http://curl.haxx.se/ | ||
23 | Use of duplication of macros in m4/np_curl.m4 | ||
24 | |||
25 | Coreutils team | ||
26 | Copyright (C) 91, 1995-2004 Free Software Foundation, Inc. | ||
27 | http://www.gnu.org/software/coreutils/ | ||
28 | Use of macros and lib files in m4/np_coreutils.m4 and lib/ | ||
21 | 29 | ||
diff --git a/configure.in b/configure.in index 0cced59..30e4261 100644 --- a/configure.in +++ b/configure.in | |||
@@ -255,87 +255,6 @@ fi | |||
255 | CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE" | 255 | CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE" |
256 | LIBS="$_SAVEDLIBS" | 256 | LIBS="$_SAVEDLIBS" |
257 | 257 | ||
258 | dnl Check for OpenSSL location | ||
259 | AC_PATH_PROG(OPENSSL,openssl) | ||
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 | ||
275 | AC_ARG_WITH(openssl, | ||
276 | AC_HELP_STRING([--with-openssl=DIR], [sets path to openssl installation]) | ||
277 | AC_HELP_STRING([--without-openssl], [disable openssl]), | ||
278 | OPENSSL=$withval) | ||
279 | |||
280 | if 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" | ||
283 | else | ||
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 | ||
323 | fi | ||
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 | |||
339 | AC_CHECK_HEADERS(unistd.h) | 258 | AC_CHECK_HEADERS(unistd.h) |
340 | 259 | ||
341 | dnl Check for AF_INET6 support - unistd.h required for Darwin | 260 | dnl Check for AF_INET6 support - unistd.h required for Darwin |
@@ -462,6 +381,7 @@ if test x"$enable_emulate_getaddrinfo" != xno ; then | |||
462 | 381 | ||
463 | fi | 382 | fi |
464 | 383 | ||
384 | dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3 | ||
465 | AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) | 385 | AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) |
466 | if test "$FOUNDINCLUDE" = "no"; then | 386 | if 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" |
478 | fi | 398 | fi |
479 | 399 | ||
400 | dnl Check for OpenSSL location | ||
401 | AC_PATH_PROG(OPENSSL,openssl) | ||
402 | if test "$OPENSSL" = "/usr/bin/openssl"; then | ||
403 | OPENSSL=/usr | ||
404 | elif test "$OPENSSL" = "/usr/sbin/openssl"; then | ||
405 | OPENSSL=/usr | ||
406 | elif test "$OPENSSL" = "/opt/bin/openssl"; then | ||
407 | OPENSSL=/opt | ||
408 | elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then | ||
409 | OPENSSL=/opt/openssl | ||
410 | elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then | ||
411 | OPENSSL=/usr/slocal | ||
412 | elif test "$OPENSSL" = "/usr/local/bin/openssl"; then | ||
413 | OPENSSL=/usr/local | ||
414 | elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then | ||
415 | OPENSSL=/usr/local/ssl | ||
416 | fi | ||
417 | AC_ARG_WITH(openssl, | ||
418 | AC_HELP_STRING([--with-openssl=DIR], [sets path to openssl installation]) | ||
419 | AC_HELP_STRING([--without-openssl], [disable openssl]), | ||
420 | OPENSSL=$withval) | ||
421 | |||
422 | if 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" | ||
425 | else | ||
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 | ||
465 | fi | ||
466 | |||
467 | if 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" | ||
473 | elif test "$FOUNDSSL" = "no"; then | ||
474 | AC_MSG_WARN([OpenSSL libs could not be found]) | ||
475 | with_openssl="no" | ||
476 | else | ||
477 | with_openssl="no" | ||
478 | fi | ||
479 | CPPFLAGS="$_SAVEDCPPFLAGS" | ||
480 | |||
480 | dnl | 481 | dnl |
481 | dnl Checks for header files. | 482 | dnl Checks for header files. |
482 | dnl | 483 | dnl |
@@ -1455,8 +1456,9 @@ AC_SUBST(DEPLIBS) | |||
1455 | AM_GNU_GETTEXT([no-libtool], [need-ngettext]) | 1456 | AM_GNU_GETTEXT([no-libtool], [need-ngettext]) |
1456 | AM_GNU_GETTEXT_VERSION(0.11.5) | 1457 | AM_GNU_GETTEXT_VERSION(0.11.5) |
1457 | 1458 | ||
1458 | dnl External libraries | 1459 | dnl External libraries - see ACKNOWLEDGEMENTS |
1459 | np_COREUTILS | 1460 | np_COREUTILS |
1461 | np_CURL | ||
1460 | 1462 | ||
1461 | AC_OUTPUT( | 1463 | AC_OUTPUT( |
1462 | Makefile | 1464 | Makefile |
diff --git a/m4/np_curl.m4 b/m4/np_curl.m4 new file mode 100644 index 0000000..64c3db5 --- /dev/null +++ b/m4/np_curl.m4 | |||
@@ -0,0 +1,60 @@ | |||
1 | dnl These are for the libs and macros from curl | ||
2 | dnl Currently utilising v7.12.3 | ||
3 | |||
4 | dnl We use jm_ for non Autoconf macros. | ||
5 | dnl m4_pattern_forbid([^np_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl | ||
6 | dnl m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl | ||
7 | dnl m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl | ||
8 | |||
9 | dnl These are all m4 things that need to be called | ||
10 | dnl Usually in coreutils' prereq.m4, but this is a subset that we need | ||
11 | AC_DEFUN([np_CURL], | ||
12 | [ | ||
13 | AC_REQUIRE([TYPE_SOCKLEN_T]) | ||
14 | ]) | ||
15 | |||
16 | dnl Check for socklen_t: historically on BSD it is an int, and in | ||
17 | dnl POSIX 1g it is a type of its own, but some platforms use different | ||
18 | dnl types for the argument to getsockopt, getpeername, etc. So we | ||
19 | dnl have to test to find something that will work. | ||
20 | AC_DEFUN([TYPE_SOCKLEN_T], | ||
21 | [ | ||
22 | AC_CHECK_TYPE([socklen_t], ,[ | ||
23 | AC_MSG_CHECKING([for socklen_t equivalent]) | ||
24 | AC_CACHE_VAL([curl_cv_socklen_t_equiv], | ||
25 | [ | ||
26 | # Systems have either "struct sockaddr *" or | ||
27 | # "void *" as the second argument to getpeername | ||
28 | curl_cv_socklen_t_equiv= | ||
29 | for arg2 in "struct sockaddr" void; do | ||
30 | for t in int size_t unsigned long "unsigned long"; do | ||
31 | AC_TRY_COMPILE([ | ||
32 | #ifdef HAVE_SYS_TYPES_H | ||
33 | #include <sys/types.h> | ||
34 | #endif | ||
35 | #ifdef HAVE_SYS_SOCKET_H | ||
36 | #include <sys/socket.h> | ||
37 | #endif | ||
38 | |||
39 | int getpeername (int, $arg2 *, $t *); | ||
40 | ],[ | ||
41 | $t len; | ||
42 | getpeername(0,0,&len); | ||
43 | ],[ | ||
44 | curl_cv_socklen_t_equiv="$t" | ||
45 | break | ||
46 | ]) | ||
47 | done | ||
48 | done | ||
49 | |||
50 | if test "x$curl_cv_socklen_t_equiv" = x; then | ||
51 | AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) | ||
52 | fi | ||
53 | ]) | ||
54 | AC_MSG_RESULT($curl_cv_socklen_t_equiv) | ||
55 | AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, | ||
56 | [type to use in place of socklen_t if not defined])], | ||
57 | [#include <sys/types.h> | ||
58 | #include <sys/socket.h>]) | ||
59 | ]) | ||
60 | |||
diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 7075201..538f905 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am | |||
@@ -53,6 +53,7 @@ check_fping_LDADD = $(NETLIBS) popen.o | |||
53 | check_game_LDADD = $(BASEOBJS) popen.o | 53 | check_game_LDADD = $(BASEOBJS) popen.o |
54 | check_http_LDADD = $(NETLIBS) $(SSLLIBS) | 54 | check_http_LDADD = $(NETLIBS) $(SSLLIBS) |
55 | check_hpjd_LDADD = $(NETLIBS) popen.o | 55 | check_hpjd_LDADD = $(NETLIBS) popen.o |
56 | check_icmp_LDADD = $(NETLIBS) | ||
56 | check_ldap_LDADD = $(NETLIBS) $(LDAPLIBS) | 57 | check_ldap_LDADD = $(NETLIBS) $(LDAPLIBS) |
57 | check_load_LDADD = $(BASEOBJS) popen.o | 58 | check_load_LDADD = $(BASEOBJS) popen.o |
58 | check_mrtg_LDADD = $(BASEOBJS) | 59 | check_mrtg_LDADD = $(BASEOBJS) |