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