AC_INIT([libabac], [0.1], [mikeryan@ISI.EDU]) AC_CONFIG_SRCDIR([abac_role.c]) AM_INIT_AUTOMAKE([foreign]) LT_INIT AC_CONFIG_MACRO_DIR([m4]) # Checks for programs. AC_PROG_CXX AC_PROG_CC 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]) # 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) # 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]) # 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