X-Git-Url: https://git.octo.it/?p=liboping.git;a=blobdiff_plain;f=configure.ac;h=6e775e2bb9db9d9871762ec0c52cea262a50c1da;hp=05226e237f3d69d2869c0bfdd1aac12dd1ef49ae;hb=9d202856e82632ad1b9a64ce154a5526e86621eb;hpb=dae22bf08bd44ad7f3f47048a231dd7c2d63bd3f diff --git a/configure.ac b/configure.ac index 05226e2..6e775e2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,31 @@ -AC_INIT(liboping, 0.1.1) -AC_CONFIG_SRCDIR(src/liboping.c) -AC_CONFIG_HEADERS(src/config.h) -AM_INIT_AUTOMAKE(dist-bzip2) -AC_LANG(C) +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.65]) +AC_INIT([liboping],[1.6.2],[ff@octo.it],,[http://github.com/octo/liboping/]) +AC_CONFIG_SRCDIR([src/liboping.c]) +AC_CONFIG_HEADERS([src/config.h]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([dist-bzip2]) +AC_LANG([C]) 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=2 +LIBOPING_REVISION=9 +LIBOPING_AGE=2 +AC_SUBST(LIBOPING_CURRENT) +AC_SUBST(LIBOPING_REVISION) +AC_SUBST(LIBOPING_AGE) + # # Check for programs/utilities # @@ -16,41 +36,39 @@ AC_PROG_LN_S 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) +LT_INIT([dlopen]) + +# pkg-config interface +PKG_INSTALLDIR -# # Checks for header files. -# AC_HEADER_STDC -AC_CHECK_HEADERS(unistd.h) -AC_CHECK_HEADERS(math.h) -AC_CHECK_HEADERS(fcntl.h) -AC_CHECK_HEADERS(sys/types.h) -AC_CHECK_HEADERS(sys/stat.h) AC_HEADER_TIME -AC_CHECK_HEADERS(sys/socket.h) -AC_CHECK_HEADERS(netdb.h) -AC_CHECK_HEADERS(signal.h) +AC_CHECK_HEADERS([math.h signal.h fcntl.h inttypes.h netdb.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h locale.h langinfo.h]) # This sucks, but what can I do..? AC_CHECK_HEADERS(netinet/in_systm.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif ]) AC_CHECK_HEADERS(netinet/in.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -59,6 +77,9 @@ AC_CHECK_HEADERS(netinet/ip.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -70,6 +91,9 @@ AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -84,6 +108,9 @@ AC_CHECK_HEADERS(netinet/ip_var.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -101,6 +128,9 @@ AC_CHECK_HEADERS(netinet/ip6.h, [], [], #if HAVE_SYS_TYPES_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -126,6 +156,14 @@ AC_CHECK_HEADERS(netinet/icmp6.h, [], [], #endif ]) +# Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_TYPE_UID_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT8_T + socket_needs_socket="no" AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, @@ -133,6 +171,16 @@ AC_CHECK_FUNCS(socket, [], 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, @@ -140,4 +188,70 @@ AC_CHECK_FUNCS(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) +with_ncurses="no" +AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses.h, [with_ncurses="yes"], []) +if test "x$with_ncurses" = "xyes" +then + have_ncursesw="no" + have_ncurses="no" + NCURSES_LIB="" + + AC_CHECK_LIB(ncursesw, mvwprintw, [have_ncursesw="yes"], [have_ncursesw="no"]) + AC_CHECK_LIB(ncurses, mvwprintw, [have_ncurses="yes"], [have_ncurses="no"]) + + if test "x$have_ncursesw" = "xyes"; then + NCURSES_LIB="-lncursesw" + else if test "x$have_ncurses" = "xyes"; then + NCURSES_LIB="-lncurses" + else + with_ncurses="no" + fi; fi + AC_SUBST(NCURSES_LIB) +fi +AM_CONDITIONAL(BUILD_WITH_LIBNCURSES, test "x$with_ncurses" = "xyes") + +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) + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_STRERROR_R +AC_CHECK_FUNCS([gettimeofday memset modf select socket sqrt strcasecmp strdup strerror strncasecmp strtoul]) + +AC_CONFIG_FILES([Makefile src/Makefile src/mans/Makefile bindings/Makefile]) +AC_OUTPUT