diff options
author | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-03-12 17:11:20 +0000 |
---|---|---|
committer | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-03-12 17:11:20 +0000 |
commit | 48442b777389cfecb95f07b800d69dbac24130f0 (patch) | |
tree | 89503205708962a022c89c26fc0f5159ec3b9f62 | |
parent | 46b0e78076a4c712f9c58b4f7804ba50b5895f46 (diff) | |
download | monitoring-plugins-48442b777389cfecb95f07b800d69dbac24130f0.tar.gz |
Added autogen.sh script that rebuilds using autotools and runs configure
Modified configure.in to include some debug build option info at the end
of the scripts execution. Can be removed by release time.
Modified configure.in to include a --with-ipv6 option
Default build is without IPv6 support now to enable you need to use the
--with-ipv6 command line option to configure.
Modified plugins/utils.* to use USE_IPV6
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@410 f882894a-f735-0410-b71e-b25c423dba1c
-rwxr-xr-x | autogen.sh | 58 | ||||
-rw-r--r-- | configure.in | 51 | ||||
-rw-r--r-- | plugins/utils.c | 12 | ||||
-rw-r--r-- | plugins/utils.h.in | 2 |
4 files changed, 108 insertions, 15 deletions
diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 00000000..0357d93a --- /dev/null +++ b/autogen.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# +# autogen.sh glue for CMU Cyrus IMAP +# $Id$ +# +# Requires: automake, autoconf, dpkg-dev +# set -e + +MAKE=$(which gnumake) +if test ! -x "$MAKE" ; then MAKE=$(which gmake) ; fi +if test ! -x "$MAKE" ; then MAKE=$(which make) ; fi +HAVE_GNU_MAKE=$($MAKE --version|grep -c "Free Software Foundation") + +if test "$HAVE_GNU_MAKE" != "1"; then + echo Could not find GNU make on this system, can not proceed with build. + exit 1 +else + echo Found GNU Make at $MAKE ... good. +fi + +# Refresh GNU autotools toolchain. +for i in config.guess config.sub missing install-sh mkinstalldirs ; do + test -r /usr/share/automake/${i} && { + rm -f ${i} + cp /usr/share/automake/${i} . + } + chmod 755 ${i} +done + +aclocal -I lib +autoheader +automake -c -a +autoconf + +# For the Debian build +test -d debian && { + # Kill executable list first + rm -f debian/executable.files + + # Make sure our executable and removable lists won't be screwed up + debclean && echo Cleaned buildtree just in case... + + # refresh list of executable scripts, to avoid possible breakage if + # upstream tarball does not include the file or if it is mispackaged + # for whatever reason. + echo Generating list of executable files... + rm -f debian/executable.files + find -type f -perm +111 ! -name '.*' -fprint debian/executable.files + + # link these in Debian builds + rm -f config.sub config.guess + ln -s /usr/share/misc/config.sub . + ln -s /usr/share/misc/config.guess . +} + +./configure $* + +exit 0 diff --git a/configure.in b/configure.in index 48e45067..529b7bbc 100644 --- a/configure.in +++ b/configure.in @@ -300,6 +300,29 @@ AC_ARG_WITH(openssl, [sets path to openssl installation]), OPENSSL=$withval,) +AC_ARG_WITH([ipv6], + ACX_HELP_STRING([--with-ipv6], + [enable IPv6 support (default=no)]), + ac_cv_sys_use_ipv6=$withval, + ac_cv_sys_use_ipv6=no) + +dnl Check for AF_INET6 support +AC_CACHE_CHECK([for IPv6 support], ac_cv_sys_use_ipv6, [ + AC_TRY_COMPILE([#include <netinet/in.h>], + [struct sockaddr_in6 sin6; + void *p; + + sin6.sin6_family = AF_INET6; + sin6.sin6_port = 587; + p = &sin6.sin6_addr;], + [ac_cv_sys_use_ipv6=yes], + [ac_cv_sys_use_ipv6=no]) + ]) + +if test x"$ac_cv_sys_use_ipv6" != xno ; then + AC_DEFINE(USE_IPV6,1,[Enable IPv6 support]) +fi + dnl ######################################################################### dnl Check if Posix getaddrinfo() is available. It is also possible to use dnl the version from the lwres library distributed with BIND. @@ -398,21 +421,6 @@ if test x"$enable_emulate_getaddrinfo" != xno ; then fi LIBOBJS="$LIBOBJS gethostbyname.o" - AC_CACHE_CHECK([for IPv6 support], acx_cv_sys_use_ipv6, [ - AC_TRY_COMPILE([ -# include <netinet/in.h> - ], [ - struct sockaddr_in6 sin6; - void *p; - - sin6.sin6_family = AF_INET6; - sin6.sin6_port = 587; - p = &sin6.sin6_addr; - ], [acx_cv_sys_use_ipv6=yes], [acx_cv_sys_use_ipv6=no]) - ]) - if test x"$acx_cv_sys_use_ipv6" != xno ; then - AC_DEFINE(USE_IPV6,1,[Enable IPv6 support]) - fi fi AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) @@ -1047,6 +1055,7 @@ AC_ARG_WITH(ping6_command, [sets syntax for ICMPv6 ping]), ac_cv_ping6_command=$withval,) +if test x"$ac_cv_sys_use_ipv6" != xno ; then AC_MSG_CHECKING(for ICMPv6 ping syntax) ac_cv_ping6_packets_first=no if test -n "$ac_cv_ping6_command" @@ -1196,6 +1205,7 @@ if test "x$ac_cv_ping6_packets_first" != "xno"; then AC_DEFINE(PING6_PACKETS_FIRST,1, [Define if packet count must precede host]) fi +fi AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup) @@ -1453,3 +1463,14 @@ AC_SUBST(DEPLIBS) AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}",[package version]) AC_OUTPUT(Makefile subst lib/Makefile plugins/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl,echo timestamp > plugins/stamp-h1;echo timestamp > plugins/stamp-h2;echo timestamp > plugins/stamp-h3;echo timestamp > plugins/stamp-h4;echo timestamp > plugins/stamp-h5;echo timestamp > plugins/stamp-h6;PATH=.:..:$PATH subst.sh command.cfg) + +ACX_FEATURE([with],[cgiurl],[$cgiurl]) +ACX_FEATURE([with],[nagios-user],[$nagios_usr]) +ACX_FEATURE([with],[nagios-group],[$nagios_grp]) +ACX_FEATURE([with],[trusted-path],[$trusted_path]) +ACX_FEATURE([with],[df-command],[$ac_cv_df_command]) +ACX_FEATURE([with],[ping-command],[$ac_cv_ping_command]) +ACX_FEATURE([with],[ping6-command],[$ac_cv_ping6_command]) +ACX_FEATURE([with],[lwres]) +ACX_FEATURE([with],[ipv6],[$ac_cv_sys_use_ipv6]) +ACX_FEATURE([enable],[emulate-getaddrinfo]) diff --git a/plugins/utils.c b/plugins/utils.c index 0d250677..9ac5596e 100644 --- a/plugins/utils.c +++ b/plugins/utils.c @@ -32,7 +32,9 @@ int is_host (char *); int is_addr (char *); int resolve_host_or_addr (char *, int); int is_inet_addr (char *); +#ifdef USE_IPV6 int is_inet6_addr (char *); +#endif int is_hostname (char *); int is_integer (char *); @@ -181,7 +183,11 @@ is_host (char *address) int is_addr (char *address) { +#ifdef USE_IPV6 if (is_inet_addr (address) || is_inet6_addr (address)) +#else + if (is_inet_addr (address)) +#endif return (TRUE); return (FALSE); @@ -212,11 +218,13 @@ is_inet_addr (char *address) return resolve_host_or_addr (address, AF_INET); } +#ifdef USE_IPV6 int is_inet6_addr (char *address) { return resolve_host_or_addr (address, AF_INET6); } +#endif /* from RFC-1035 * @@ -228,7 +236,11 @@ is_inet6_addr (char *address) int is_hostname (char *s1) { +#ifdef USE_IPV6 return resolve_host_or_addr (s1, AF_UNSPEC); +#else + return resolve_host_or_addr (s1, AF_INET); +#endif } int diff --git a/plugins/utils.h.in b/plugins/utils.h.in index 0d947f42..89ada6f0 100644 --- a/plugins/utils.h.in +++ b/plugins/utils.h.in @@ -30,7 +30,9 @@ int timeout_interval = DEFAULT_SOCKET_TIMEOUT; int is_host (char *); int is_addr (char *); int is_inet_addr (char *); +#ifdef USE_IPV6 int is_inet6_addr (char *); +#endif int is_hostname (char *); int is_integer (char *); |