diff --git a/configure.ac b/configure.ac
index 05226e237f3d69d2869c0bfdd1aac12dd1ef49ae..631e72d5293bc432209f0057ad2597309e5479ab 100644 (file)
--- a/configure.ac
+++ b/configure.ac
-AC_INIT(liboping, 0.1.1)
+AC_INIT(liboping, 1.1.0)
AC_CONFIG_SRCDIR(src/liboping.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
AC_PREFIX_DEFAULT("/opt/oping")
+# API version
+LIBOPING_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
+LIBOPING_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
+LIBOPING_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
+AC_SUBST(LIBOPING_MAJOR)
+AC_SUBST(LIBOPING_MINOR)
+AC_SUBST(LIBOPING_PATCH)
+
+# ABI version
+LIBOPING_CURRENT=1
+LIBOPING_REVISION=0
+LIBOPING_AGE=1
+AC_SUBST(LIBOPING_CURRENT)
+AC_SUBST(LIBOPING_REVISION)
+AC_SUBST(LIBOPING_AGE)
+
#
# Check for programs/utilities
#
AC_PROG_MAKE_SET
AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
+if test "x$PERL" = "x"
+then
+ PERL="perl"
+fi
+AC_ARG_VAR(PERL, [Perl interpreter command])
+
#
# configure libtool
#
-AC_LIBLTDL_CONVENIENCE
-AC_SUBST(LTDLINCL)
-AC_SUBST(LIBLTDL)
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
#AC_PROG_RANLIB
-AC_CONFIG_SUBDIRS(libltdl src)
#
# Checks for header files.
[#if HAVE_STDINT_H
# include <stdint.h>
#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
])
AC_CHECK_HEADERS(netinet/in.h, [], [],
[#if HAVE_STDINT_H
# include <stdint.h>
#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#if HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
#endif
[#if HAVE_STDINT_H
# include <stdint.h>
#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#if HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
#endif
[#if HAVE_STDINT_H
# include <stdint.h>
#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#if HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
#endif
[#if HAVE_STDINT_H
# include <stdint.h>
#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#if HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
#endif
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#if HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
#endif
AC_MSG_ERROR(cannot find socket)))
AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
+# Under Solaris, the `xnet' library provides `recvmsg' which complies with the
+# X/Open CAE Specification.
+with_libxnet="no"
+AC_CHECK_LIB(xnet, __xnet_recvmsg, [with_libxnet="yes"],[])
+if test "x$with_libxnet" = "xyes"
+then
+ CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBXNET, test "x$with_libxnet" = "xyes")
+
nanosleep_needs_rt="no"
AC_CHECK_FUNCS(nanosleep, [],
AC_CHECK_LIB(rt, nanosleep,
AC_MSG_ERROR(cannot find nanosleep)))
AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
-AC_OUTPUT(Makefile src/Makefile src/mans/Makefile)
+AC_FUNC_STRERROR_R
+
+AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [Enable extensive debugging output.])],
+[
+ if test "x$enable_debug" = "xyes"
+ then
+ AC_DEFINE(WITH_DEBUG, 1, [Define to 1 if you want to get debugging output.])
+ fi
+], [])
+AM_CONDITIONAL(BUILD_WITH_DEBUG, test "x$enable_debug" = "xyes")
+
+AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ PERL_BINDINGS_OPTIONS="$withval"
+ with_perl_bindings="yes"
+ else
+ PERL_BINDINGS_OPTIONS=""
+ with_perl_bindings="$withval"
+ fi
+],
+[
+ PERL_BINDINGS_OPTIONS=""
+ with_perl_bindings="yes"
+])
+
+if test "x$with_perl_bindings" = "xyes"
+then
+ BINDINGS="perl-bindings"
+else
+ BINDINGS=""
+fi
+
+AC_SUBST(PERL_BINDINGS_OPTIONS)
+
+AC_SUBST(BINDINGS)
+
+AC_OUTPUT(Makefile src/Makefile src/mans/Makefile bindings/Makefile)