summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ACKNOWLEDGEMENTS10
-rw-r--r--configure.in166
-rw-r--r--m4/np_curl.m460
-rw-r--r--plugins/Makefile.am1
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
17http://cplus.kompf.de/macaddr.html 17http://cplus.kompf.de/macaddr.html
18Using the DLPI support on SysV systems to get the host MAC address in check_dhcp.c 18Using the DLPI support on SysV systems to get the host MAC address in check_dhcp.c
19 19
20 20Stenberg, Daniel
21Copyright (c) 1996 - 2004, Daniel Stenberg, <daniel@haxx.se>
22http://curl.haxx.se/
23Use of duplication of macros in m4/np_curl.m4
24
25Coreutils team
26Copyright (C) 91, 1995-2004 Free Software Foundation, Inc.
27http://www.gnu.org/software/coreutils/
28Use 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
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
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 @@
1dnl These are for the libs and macros from curl
2dnl Currently utilising v7.12.3
3
4dnl We use jm_ for non Autoconf macros.
5dnl m4_pattern_forbid([^np_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
6dnl m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
7dnl m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
8
9dnl These are all m4 things that need to be called
10dnl Usually in coreutils' prereq.m4, but this is a subset that we need
11AC_DEFUN([np_CURL],
12[
13 AC_REQUIRE([TYPE_SOCKLEN_T])
14])
15
16dnl Check for socklen_t: historically on BSD it is an int, and in
17dnl POSIX 1g it is a type of its own, but some platforms use different
18dnl types for the argument to getsockopt, getpeername, etc. So we
19dnl have to test to find something that will work.
20AC_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
53check_game_LDADD = $(BASEOBJS) popen.o 53check_game_LDADD = $(BASEOBJS) popen.o
54check_http_LDADD = $(NETLIBS) $(SSLLIBS) 54check_http_LDADD = $(NETLIBS) $(SSLLIBS)
55check_hpjd_LDADD = $(NETLIBS) popen.o 55check_hpjd_LDADD = $(NETLIBS) popen.o
56check_icmp_LDADD = $(NETLIBS)
56check_ldap_LDADD = $(NETLIBS) $(LDAPLIBS) 57check_ldap_LDADD = $(NETLIBS) $(LDAPLIBS)
57check_load_LDADD = $(BASEOBJS) popen.o 58check_load_LDADD = $(BASEOBJS) popen.o
58check_mrtg_LDADD = $(BASEOBJS) 59check_mrtg_LDADD = $(BASEOBJS)