dnl Process this file with autoconf to produce a configure script. dnl $Id: configure.ac 4038 2008-04-05 05:10:04Z rra $ dnl dnl Written by Russ Allbery dnl Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 dnl Board of Trustees, Leland Stanford Jr. University dnl dnl See LICENSE for licensing terms. AC_REVISION([$Revision: 4038 $]) AC_PREREQ([2.61]) AC_INIT([remctl], [2.12], [rra@stanford.edu]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_LIBOBJ_DIR([portable]) AM_INIT_AUTOMAKE([1.10]) AM_MAINTAINER_MODE AC_PROG_CC AM_PROG_CC_C_O AC_PROG_INSTALL AC_PROG_LIBTOOL AC_SEARCH_LIBS([gethostbyname], [nsl]) AC_SEARCH_LIBS([socket], [socket], , [AC_CHECK_LIB([nsl], [socket], [LIBS="-lnsl -lsocket $LIBS"], , [-lsocket])]) RRA_LIB_GSSAPI AC_HEADER_STDBOOL AC_CHECK_HEADERS([sys/bitypes.h sys/filio.h sys/select.h sys/uio.h syslog.h]) AC_CHECK_DECLS([snprintf, vsnprintf]) AC_CHECK_DECLS([inet_aton, inet_ntoa], , , [#include #include #include ]) RRA_C_C99_VAMACROS RRA_C_GNU_VAMACROS AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include #include ]) AC_CHECK_TYPES([long long]) AC_CHECK_TYPE([sig_atomic_t], , [AC_DEFINE([sig_atomic_t], [int], [Define to int if does not define.])], [#include #include ]) AC_CHECK_TYPE([socklen_t], , [AC_DEFINE([socklen_t], [int], [Define to int if does not define.])], [#include #include ]) AC_CHECK_TYPES([struct sockaddr_in6], [AC_DEFINE([HAVE_INET6], [1], [Define to 1 if IPv6 library interfaces are available.])], , [#include #include ]) AC_CHECK_TYPES([struct sockaddr_storage], [AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , , [#include #include ])], , [#include #include ]) RRA_MACRO_IN6_ARE_ADDR_EQUAL RRA_MACRO_SA_LEN RRA_FUNC_INET_NTOA RRA_FUNC_SNPRINTF AC_CHECK_FUNCS([setrlimit setsid]) AC_REPLACE_FUNCS([asprintf daemon getaddrinfo getnameinfo getopt inet_aton \ inet_ntop setenv strlcat strlcpy]) AC_TYPE_SIGNAL dnl Needed to get prototypes for functions like asprintf on Linux. AC_DEFINE([_GNU_SOURCE], [1], [Define to 1 on Linux to get full prototypes.]) dnl If and only if we're on a GNU system, use mapfile to do symbol versioning dnl of the libremctl library. libtool doesn't know how to do this itself. dnl This is supported on Solaris as well but we need to know if we're dnl the GNU linker or the Solaris linker. case "$host" in *-gnu*) VERSION_LDFLAGS='-Wl,--version-script=${srcdir}/client/mapfile' ;; *) VERSION_LDFLAGS="" ;; esac AC_SUBST([VERSION_LDFLAGS]) dnl Set this globally, since we have too many header files that include the dnl GSS-API headers even if the code itself doesn't call GSS-API functions. CPPFLAGS="$CPPFLAGS $GSSAPI_CPPFLAGS" dnl Whether to build the Perl bindings. Put this late so that it shows up dnl near the bottom of the --help output. build_perl= AC_ARG_ENABLE([perl], [AC_HELP_STRING([--enable-perl], [Build Perl libremctl bindings])], [AS_IF([test x"$enableval" = xyes], [build_perl=yes])]) AM_CONDITIONAL([BUILD_PERL], [test x"$build_perl" = xyes]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([tests/client/pod-t], [chmod +x tests/client/pod-t]) AS_IF([test x"$build_perl" = xyes], [AC_CONFIG_FILES([perl/Makefile.PL])]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_COMMANDS([docs], [test -d docs || mkdir docs]) AC_OUTPUT