AC_INIT([ABAC], [0.1.0], [mikeryan@ISI.EDU]) AC_CONFIG_SRCDIR([libabac/abac_role.c]) AM_INIT_AUTOMAKE([foreign subdir-objects]) LT_INIT AC_CONFIG_MACRO_DIR([m4]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_LIBTOOL # Explicitly hunt up perl AC_CHECK_PROGS(PERL, perl) # for python AM_PATH_PYTHON SWIG_ENABLE_CXX SWIG_PYTHON AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], [build with debug symbols])], [CFLAGS+="-g "],[]) # Checks for libraries. AC_ARG_WITH([strongswan], [AS_HELP_STRING([--with-strongswan=PATH], [location of strongswan-4.4.0 source tree])], [LIBSTRONGSWAN_source=$withval], [AC_ERROR([path to strongswan-4.4.0 source tree required])]) test -d $LIBSTRONGSWAN_source || AC_ERROR([strongswan source dir not found. Don't use ~, use \$HOME.]) AC_SUBST([LIBSTRONGSWAN_source]) AC_ARG_WITH([strongswan-ld-path], [AS_HELP_STRING([--with-strongswan-ld-path=PATH], [directory where libstrongswan is installed if not /usr/local/lib])], [strongswan_ld=$withval], [strongswan_ld="/usr/local/lib"]) LDFLAGS="$LDFLAGS -L$strongswan_ld" AC_ARG_WITH( [site-perl], [AS_HELP_STRING([--with-site-perl=DIR], [directory in which to install perl modules])], [SITE_PERL="$withval"], [SITE_PERL=""]) # this is so wrong libstrongswan_plugins=$(grep libstrongswan_plugins $LIBSTRONGSWAN_source/Makefile | awk -F= '{ print $2 }') test -z "$libstrongswan_plugins" && AC_ERROR([Can't find libstrongswan plugins. Make sure you've run ./configure --enable-monolithic in the strongswan source tree]) AC_SUBST(libstrongswan_plugins) # Ask perl for a likely site_perl directory. If the user has already specified # it using --with-site-perl, use that value. NB, this does not respect prefix, # so users wishing to do a local install must use --with-site-perl AC_MSG_CHECKING(for site_perl directory) if test -z "$SITE_PERL"; then SITE_PERL=`$PERL -e 'print((grep(/site_perl/ && !m#/mach#, @INC))[0], "\n");'` fi AC_MSG_RESULT($SITE_PERL) AC_SUBST(SITE_PERL) # Checks for header files. AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_TYPE_SIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT8_T AC_CHECK_TYPES([ptrdiff_t]) # Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS([atexit memset strchr strdup]) # Confirm that the link path includes strongswan AC_CHECK_LIB(strongswan, library_init,, [AC_MSG_ERROR('set --with-strongswan-ld-path')]) # snagged from strongswan, required AC_CHECK_FUNC( [register_printf_specifier], [AC_DEFINE(HAVE_PRINTF_SPECIFIER)], [AC_CHECK_FUNC( [register_printf_function], [AC_DEFINE(HAVE_PRINTF_FUNCTION)], [ AC_MSG_NOTICE([printf does not support custom format specifiers!]) vstr=true ] )] ) if test x$vstr = xtrue; then AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])]) AC_DEFINE(USE_VSTR) fi AC_CONFIG_FILES([Makefile]) AC_OUTPUT