[ab52de1] | 1 | AC_INIT([ABAC], [0.2.0], [mikeryan@ISI.EDU]) |
---|
[4918535] | 2 | AC_CONFIG_SRCDIR([libabac/abac_role.c]) |
---|
| 3 | AM_INIT_AUTOMAKE([foreign subdir-objects]) |
---|
[6ede88c] | 4 | LT_INIT |
---|
| 5 | |
---|
| 6 | AC_CONFIG_MACRO_DIR([m4]) |
---|
| 7 | |
---|
| 8 | # Checks for programs. |
---|
| 9 | AC_PROG_CXX |
---|
| 10 | AC_PROG_CC |
---|
[b73c2538] | 11 | AC_PROG_LIBTOOL |
---|
[6ede88c] | 12 | |
---|
[48fa0ee] | 13 | # Explicitly hunt up perl |
---|
| 14 | AC_CHECK_PROGS(PERL, perl) |
---|
| 15 | |
---|
[43a5429] | 16 | # for python |
---|
| 17 | AM_PATH_PYTHON |
---|
[46a2dc3] | 18 | |
---|
| 19 | AX_PKG_SWIG(1.3.17, [], [AC_MSG_ERROR([SWIG is required to build package])] ) |
---|
| 20 | AX_SWIG_ENABLE_CXX |
---|
| 21 | AX_SWIG_PYTHON |
---|
[43a5429] | 22 | |
---|
[6ede88c] | 23 | AC_ARG_ENABLE(debug, |
---|
| 24 | [AC_HELP_STRING([--enable-debug], [build with debug symbols])], |
---|
| 25 | [CFLAGS+="-g "],[]) |
---|
| 26 | |
---|
| 27 | # Checks for libraries. |
---|
| 28 | AC_ARG_WITH([strongswan], |
---|
| 29 | [AS_HELP_STRING([--with-strongswan=PATH], [location of strongswan-4.4.0 source tree])], |
---|
| 30 | [LIBSTRONGSWAN_source=$withval], |
---|
| 31 | [AC_ERROR([path to strongswan-4.4.0 source tree required])]) |
---|
| 32 | test -d $LIBSTRONGSWAN_source || AC_ERROR([strongswan source dir not found. Don't use ~, use \$HOME.]) |
---|
| 33 | AC_SUBST([LIBSTRONGSWAN_source]) |
---|
| 34 | |
---|
[48fa0ee] | 35 | AC_ARG_WITH([strongswan-ld-path], |
---|
| 36 | [AS_HELP_STRING([--with-strongswan-ld-path=PATH], |
---|
| 37 | [directory where libstrongswan is installed if not /usr/local/lib])], |
---|
| 38 | [strongswan_ld=$withval], [strongswan_ld="/usr/local/lib"]) |
---|
| 39 | LDFLAGS="$LDFLAGS -L$strongswan_ld" |
---|
| 40 | |
---|
| 41 | AC_ARG_WITH( |
---|
| 42 | [site-perl], |
---|
| 43 | [AS_HELP_STRING([--with-site-perl=DIR], |
---|
| 44 | [directory in which to install perl modules])], |
---|
| 45 | [SITE_PERL="$withval"], [SITE_PERL=""]) |
---|
| 46 | |
---|
| 47 | |
---|
[6ede88c] | 48 | # this is so wrong |
---|
| 49 | libstrongswan_plugins=$(grep libstrongswan_plugins $LIBSTRONGSWAN_source/Makefile | awk -F= '{ print $2 }') |
---|
| 50 | test -z "$libstrongswan_plugins" && AC_ERROR([Can't find libstrongswan plugins. Make sure you've run ./configure --enable-monolithic in the strongswan source tree]) |
---|
| 51 | AC_SUBST(libstrongswan_plugins) |
---|
| 52 | |
---|
[48fa0ee] | 53 | # Ask perl for a likely site_perl directory. If the user has already specified |
---|
| 54 | # it using --with-site-perl, use that value. NB, this does not respect prefix, |
---|
| 55 | # so users wishing to do a local install must use --with-site-perl |
---|
| 56 | AC_MSG_CHECKING(for site_perl directory) |
---|
| 57 | if test -z "$SITE_PERL"; then |
---|
| 58 | SITE_PERL=`$PERL -e 'print((grep(/site_perl/ && !m#/mach#, @INC))[0], "\n");'` |
---|
| 59 | fi |
---|
| 60 | AC_MSG_RESULT($SITE_PERL) |
---|
| 61 | AC_SUBST(SITE_PERL) |
---|
| 62 | |
---|
[6ede88c] | 63 | # Checks for header files. |
---|
[2579c1a] | 64 | AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h readpassphrase.h paths.h]) |
---|
[6ede88c] | 65 | |
---|
| 66 | # Checks for typedefs, structures, and compiler characteristics. |
---|
| 67 | AC_HEADER_STDBOOL |
---|
| 68 | AC_TYPE_SIZE_T |
---|
| 69 | AC_TYPE_UINT16_T |
---|
| 70 | AC_TYPE_UINT32_T |
---|
| 71 | AC_TYPE_UINT8_T |
---|
| 72 | AC_CHECK_TYPES([ptrdiff_t]) |
---|
| 73 | |
---|
[2579c1a] | 74 | AC_CHECK_DECL([_PATH_TTY],[],AC_DEFINE_UNQUOTED([_PATH_TTY],"/dev/tty",[Define to tty device node path]),[ |
---|
| 75 | #ifdef HAVE_PATHS_H |
---|
| 76 | # include <paths.h> |
---|
| 77 | #endif |
---|
| 78 | ]) |
---|
| 79 | |
---|
[6ede88c] | 80 | # Checks for library functions. |
---|
| 81 | AC_FUNC_MALLOC |
---|
[2579c1a] | 82 | AC_CHECK_FUNCS([atexit memset strchr strdup readpassphrase]) |
---|
[6ede88c] | 83 | |
---|
[48fa0ee] | 84 | # Confirm that the link path includes strongswan |
---|
| 85 | AC_CHECK_LIB(strongswan, library_init,, |
---|
| 86 | [AC_MSG_ERROR('set --with-strongswan-ld-path')]) |
---|
| 87 | |
---|
[6ede88c] | 88 | # snagged from strongswan, required |
---|
| 89 | AC_CHECK_FUNC( |
---|
| 90 | [register_printf_specifier], |
---|
[2579c1a] | 91 | [AC_DEFINE([HAVE_PRINTF_SPECIFIER],[],[strongswan printf specififer])], |
---|
[6ede88c] | 92 | [AC_CHECK_FUNC( |
---|
| 93 | [register_printf_function], |
---|
[2579c1a] | 94 | [AC_DEFINE([HAVE_PRINTF_FUNCTION],[],[strongswan printf function])], |
---|
[6ede88c] | 95 | [ |
---|
| 96 | AC_MSG_NOTICE([printf does not support custom format specifiers!]) |
---|
| 97 | vstr=true |
---|
| 98 | ] |
---|
| 99 | )] |
---|
| 100 | ) |
---|
| 101 | |
---|
| 102 | if test x$vstr = xtrue; then |
---|
| 103 | AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])]) |
---|
[2579c1a] | 104 | AC_DEFINE([USE_VSTR],[],[use vstr]) |
---|
[6ede88c] | 105 | fi |
---|
| 106 | |
---|
[2579c1a] | 107 | |
---|
[6ede88c] | 108 | AC_CONFIG_FILES([Makefile]) |
---|
| 109 | AC_OUTPUT |
---|