[6ede88c] | 1 | AC_INIT([libabac], [0.1], [mikeryan@ISI.EDU]) |
---|
| 2 | AC_CONFIG_SRCDIR([abac_role.c]) |
---|
| 3 | AM_INIT_AUTOMAKE([foreign]) |
---|
| 4 | LT_INIT |
---|
| 5 | |
---|
| 6 | AC_CONFIG_MACRO_DIR([m4]) |
---|
| 7 | |
---|
| 8 | # Checks for programs. |
---|
| 9 | AC_PROG_CXX |
---|
| 10 | AC_PROG_CC |
---|
| 11 | |
---|
| 12 | AC_ARG_ENABLE(debug, |
---|
| 13 | [AC_HELP_STRING([--enable-debug], [build with debug symbols])], |
---|
| 14 | [CFLAGS+="-g "],[]) |
---|
| 15 | |
---|
| 16 | # Checks for libraries. |
---|
| 17 | AC_ARG_WITH([strongswan], |
---|
| 18 | [AS_HELP_STRING([--with-strongswan=PATH], [location of strongswan-4.4.0 source tree])], |
---|
| 19 | [LIBSTRONGSWAN_source=$withval], |
---|
| 20 | [AC_ERROR([path to strongswan-4.4.0 source tree required])]) |
---|
| 21 | test -d $LIBSTRONGSWAN_source || AC_ERROR([strongswan source dir not found. Don't use ~, use \$HOME.]) |
---|
| 22 | AC_SUBST([LIBSTRONGSWAN_source]) |
---|
| 23 | |
---|
| 24 | # this is so wrong |
---|
| 25 | libstrongswan_plugins=$(grep libstrongswan_plugins $LIBSTRONGSWAN_source/Makefile | awk -F= '{ print $2 }') |
---|
| 26 | test -z "$libstrongswan_plugins" && AC_ERROR([Can't find libstrongswan plugins. Make sure you've run ./configure --enable-monolithic in the strongswan source tree]) |
---|
| 27 | AC_SUBST(libstrongswan_plugins) |
---|
| 28 | |
---|
| 29 | # Checks for header files. |
---|
| 30 | AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h]) |
---|
| 31 | |
---|
| 32 | # Checks for typedefs, structures, and compiler characteristics. |
---|
| 33 | AC_HEADER_STDBOOL |
---|
| 34 | AC_TYPE_SIZE_T |
---|
| 35 | AC_TYPE_UINT16_T |
---|
| 36 | AC_TYPE_UINT32_T |
---|
| 37 | AC_TYPE_UINT8_T |
---|
| 38 | AC_CHECK_TYPES([ptrdiff_t]) |
---|
| 39 | |
---|
| 40 | # Checks for library functions. |
---|
| 41 | AC_FUNC_MALLOC |
---|
| 42 | AC_CHECK_FUNCS([atexit memset strchr strdup]) |
---|
| 43 | |
---|
| 44 | # snagged from strongswan, required |
---|
| 45 | AC_CHECK_FUNC( |
---|
| 46 | [register_printf_specifier], |
---|
| 47 | [AC_DEFINE(HAVE_PRINTF_SPECIFIER)], |
---|
| 48 | [AC_CHECK_FUNC( |
---|
| 49 | [register_printf_function], |
---|
| 50 | [AC_DEFINE(HAVE_PRINTF_FUNCTION)], |
---|
| 51 | [ |
---|
| 52 | AC_MSG_NOTICE([printf does not support custom format specifiers!]) |
---|
| 53 | vstr=true |
---|
| 54 | ] |
---|
| 55 | )] |
---|
| 56 | ) |
---|
| 57 | |
---|
| 58 | if test x$vstr = xtrue; then |
---|
| 59 | AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])]) |
---|
| 60 | AC_DEFINE(USE_VSTR) |
---|
| 61 | fi |
---|
| 62 | |
---|
| 63 | AC_CONFIG_FILES([Makefile]) |
---|
| 64 | AC_OUTPUT |
---|