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 | # Explicitly hunt up perl |
---|
14 | AC_CHECK_PROGS(PERL, perl) |
---|
15 | |
---|
16 | # for python |
---|
17 | AM_PATH_PYTHON |
---|
18 | SWIG_ENABLE_CXX |
---|
19 | SWIG_PYTHON |
---|
20 | |
---|
21 | AC_ARG_ENABLE(debug, |
---|
22 | [AC_HELP_STRING([--enable-debug], [build with debug symbols])], |
---|
23 | [CFLAGS+="-g "],[]) |
---|
24 | |
---|
25 | # Checks for libraries. |
---|
26 | AC_ARG_WITH([strongswan], |
---|
27 | [AS_HELP_STRING([--with-strongswan=PATH], [location of strongswan-4.4.0 source tree])], |
---|
28 | [LIBSTRONGSWAN_source=$withval], |
---|
29 | [AC_ERROR([path to strongswan-4.4.0 source tree required])]) |
---|
30 | test -d $LIBSTRONGSWAN_source || AC_ERROR([strongswan source dir not found. Don't use ~, use \$HOME.]) |
---|
31 | AC_SUBST([LIBSTRONGSWAN_source]) |
---|
32 | |
---|
33 | AC_ARG_WITH([strongswan-ld-path], |
---|
34 | [AS_HELP_STRING([--with-strongswan-ld-path=PATH], |
---|
35 | [directory where libstrongswan is installed if not /usr/local/lib])], |
---|
36 | [strongswan_ld=$withval], [strongswan_ld="/usr/local/lib"]) |
---|
37 | LDFLAGS="$LDFLAGS -L$strongswan_ld" |
---|
38 | |
---|
39 | AC_ARG_WITH( |
---|
40 | [site-perl], |
---|
41 | [AS_HELP_STRING([--with-site-perl=DIR], |
---|
42 | [directory in which to install perl modules])], |
---|
43 | [SITE_PERL="$withval"], [SITE_PERL=""]) |
---|
44 | |
---|
45 | |
---|
46 | # this is so wrong |
---|
47 | libstrongswan_plugins=$(grep libstrongswan_plugins $LIBSTRONGSWAN_source/Makefile | awk -F= '{ print $2 }') |
---|
48 | test -z "$libstrongswan_plugins" && AC_ERROR([Can't find libstrongswan plugins. Make sure you've run ./configure --enable-monolithic in the strongswan source tree]) |
---|
49 | AC_SUBST(libstrongswan_plugins) |
---|
50 | |
---|
51 | # Ask perl for a likely site_perl directory. If the user has already specified |
---|
52 | # it using --with-site-perl, use that value. NB, this does not respect prefix, |
---|
53 | # so users wishing to do a local install must use --with-site-perl |
---|
54 | AC_MSG_CHECKING(for site_perl directory) |
---|
55 | if test -z "$SITE_PERL"; then |
---|
56 | SITE_PERL=`$PERL -e 'print((grep(/site_perl/ && !m#/mach#, @INC))[0], "\n");'` |
---|
57 | fi |
---|
58 | AC_MSG_RESULT($SITE_PERL) |
---|
59 | AC_SUBST(SITE_PERL) |
---|
60 | |
---|
61 | # Checks for header files. |
---|
62 | AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h]) |
---|
63 | |
---|
64 | # Checks for typedefs, structures, and compiler characteristics. |
---|
65 | AC_HEADER_STDBOOL |
---|
66 | AC_TYPE_SIZE_T |
---|
67 | AC_TYPE_UINT16_T |
---|
68 | AC_TYPE_UINT32_T |
---|
69 | AC_TYPE_UINT8_T |
---|
70 | AC_CHECK_TYPES([ptrdiff_t]) |
---|
71 | |
---|
72 | # Checks for library functions. |
---|
73 | AC_FUNC_MALLOC |
---|
74 | AC_CHECK_FUNCS([atexit memset strchr strdup]) |
---|
75 | |
---|
76 | # Confirm that the link path includes strongswan |
---|
77 | AC_CHECK_LIB(strongswan, library_init,, |
---|
78 | [AC_MSG_ERROR('set --with-strongswan-ld-path')]) |
---|
79 | |
---|
80 | # snagged from strongswan, required |
---|
81 | AC_CHECK_FUNC( |
---|
82 | [register_printf_specifier], |
---|
83 | [AC_DEFINE(HAVE_PRINTF_SPECIFIER)], |
---|
84 | [AC_CHECK_FUNC( |
---|
85 | [register_printf_function], |
---|
86 | [AC_DEFINE(HAVE_PRINTF_FUNCTION)], |
---|
87 | [ |
---|
88 | AC_MSG_NOTICE([printf does not support custom format specifiers!]) |
---|
89 | vstr=true |
---|
90 | ] |
---|
91 | )] |
---|
92 | ) |
---|
93 | |
---|
94 | if test x$vstr = xtrue; then |
---|
95 | AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])]) |
---|
96 | AC_DEFINE(USE_VSTR) |
---|
97 | fi |
---|
98 | |
---|
99 | AC_CONFIG_FILES([Makefile]) |
---|
100 | AC_OUTPUT |
---|