1 | AC_INIT([ABAC], [0.2.4], [mei@ISI.EDU]) |
---|
2 | AC_CONFIG_SRCDIR([libabac/abac_aspect.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 | AM_PROG_LEX |
---|
13 | AC_PROG_YACC |
---|
14 | ##MEI |
---|
15 | AC_PROG_YAP(6.2.2) |
---|
16 | AC_PROG_SWIG |
---|
17 | |
---|
18 | # Explicitly hunt up perl |
---|
19 | AC_CHECK_PROGS(PERL, perl) |
---|
20 | |
---|
21 | # for python |
---|
22 | AM_PATH_PYTHON |
---|
23 | SWIG_ENABLE_CXX |
---|
24 | SWIG_PYTHON |
---|
25 | |
---|
26 | # optionally check for java |
---|
27 | AC_ARG_ENABLE([java-feature], |
---|
28 | [AC_HELP_STRING([--disable-java-feature], |
---|
29 | [disable Java feature])]) |
---|
30 | |
---|
31 | AS_IF([test X$enable_java_feature != Xno], |
---|
32 | [ |
---|
33 | AC_CHECK_CLASSPATH |
---|
34 | AX_PROG_JAVAC |
---|
35 | AX_PROG_JAVA |
---|
36 | AX_CHECK_JNI |
---|
37 | ]) |
---|
38 | |
---|
39 | AM_CONDITIONAL(HAVE_JNI, test x$have_jni = xyes) |
---|
40 | |
---|
41 | AC_ARG_ENABLE(debug, |
---|
42 | [AC_HELP_STRING([--enable-debug], [build with debug symbols])], |
---|
43 | [CFLAGS+="-g "],[]) |
---|
44 | |
---|
45 | # Checks for libraries. |
---|
46 | AC_ARG_WITH([strongswan], |
---|
47 | [AS_HELP_STRING([--with-strongswan=PATH], [location of strongswan-4.6.4 source tree])], |
---|
48 | [LIBSTRONGSWAN_source=$withval], |
---|
49 | [AC_ERROR([path to strongswan source tree required])]) |
---|
50 | test -d $LIBSTRONGSWAN_source || AC_ERROR([strongswan-4.6.4 source dir not found. Don't use ~, use \$HOME.]) |
---|
51 | AC_SUBST([LIBSTRONGSWAN_source]) |
---|
52 | |
---|
53 | AC_ARG_WITH([strongswan-ld-path], |
---|
54 | [AS_HELP_STRING([--with-strongswan-ld-path=PATH], |
---|
55 | [directory where libstrongswan is installed if not /usr/local/lib])], |
---|
56 | [strongswan_ld=$withval], [strongswan_ld="/usr/local/lib"]) |
---|
57 | LDFLAGS="$LDFLAGS -L$strongswan_ld" |
---|
58 | |
---|
59 | AC_ARG_WITH( |
---|
60 | [site-perl], |
---|
61 | [AS_HELP_STRING([--with-site-perl=DIR], |
---|
62 | [directory in which to install perl modules])], |
---|
63 | [SITE_PERL="$withval"], [SITE_PERL=""]) |
---|
64 | |
---|
65 | # this is so wrong |
---|
66 | libstrongswan_plugins=$(grep scripts_plugins $LIBSTRONGSWAN_source/Makefile | awk -F= '{ print $2 }') |
---|
67 | test -z "$libstrongswan_plugins" && AC_ERROR([Can't find libstrongswan plugins. Make sure you've run ./configure --enable-monolithic in the strongswan source tree]) |
---|
68 | AC_SUBST(libstrongswan_plugins) |
---|
69 | |
---|
70 | # Make sure perl is threaded |
---|
71 | AC_MSG_CHECKING(for thread-capable perl) |
---|
72 | perl_threaded=`echo "use threads;" | $PERL` |
---|
73 | if test -n "$perl_threaded"; then |
---|
74 | AC_ERROR([Can't run ABAC with non-threaded Perl, please check with (perl -V) or (ldd /usr/bin/perl)]) |
---|
75 | fi |
---|
76 | AC_MSG_RESULT(ok) |
---|
77 | AC_SUBST(perl_threaded) |
---|
78 | |
---|
79 | # Ask perl for a likely site_perl directory. If the user has already specified |
---|
80 | # it using --with-site-perl, use that value. NB, this does not respect prefix, |
---|
81 | # so users wishing to do a local install must use --with-site-perl |
---|
82 | AC_MSG_CHECKING(for site_perl directory) |
---|
83 | if test -z "$SITE_PERL"; then |
---|
84 | SITE_PERL=`$PERL -e 'print((grep(/site_perl/ && !m#/mach#, @INC))[0], "\n");'` |
---|
85 | fi |
---|
86 | |
---|
87 | AC_ARG_WITH([extra-includes], |
---|
88 | [AC_HELP_STRING([--with-extra-includes=PATH], |
---|
89 | [Directory to search for additional includes, e.g, Yap includes])], |
---|
90 | [CFLAGS="$CFLAGS -I$withval" |
---|
91 | CXXFLAGS="$CXXFLAGS -I$withval" |
---|
92 | CPPFLAGS="$CPPFLAGS -I$withval" |
---|
93 | ]) |
---|
94 | |
---|
95 | AC_ARG_WITH([flex], |
---|
96 | [AC_HELP_STRING([--with-flex=PATH], |
---|
97 | [Suggestion for the flex binary])], |
---|
98 | [LEX=$withval]) |
---|
99 | |
---|
100 | AC_MSG_RESULT($SITE_PERL) |
---|
101 | AC_SUBST(SITE_PERL) |
---|
102 | |
---|
103 | # Checks for header files. |
---|
104 | AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h]) |
---|
105 | |
---|
106 | # Checks for typedefs, structures, and compiler characteristics. |
---|
107 | AC_HEADER_STDBOOL |
---|
108 | AC_TYPE_SIZE_T |
---|
109 | AC_TYPE_UINT16_T |
---|
110 | AC_TYPE_UINT32_T |
---|
111 | AC_TYPE_UINT8_T |
---|
112 | AC_CHECK_TYPES([ptrdiff_t]) |
---|
113 | AC_CHECK_HEADER([Yap/YapInterface.h],,[AC_MSG_ERROR(Cannot find Yap headers)]) |
---|
114 | |
---|
115 | # Checks for library functions. |
---|
116 | AC_FUNC_MALLOC |
---|
117 | AC_CHECK_FUNCS([atexit memset strchr strdup]) |
---|
118 | |
---|
119 | # Confirm that the link path includes strongswan |
---|
120 | AC_CHECK_LIB(strongswan, library_init,, |
---|
121 | [AC_MSG_ERROR('set --with-strongswan-ld-path')]) |
---|
122 | |
---|
123 | # snagged from strongswan, required |
---|
124 | AC_CHECK_FUNC( |
---|
125 | [register_printf_specifier], |
---|
126 | [AC_DEFINE(HAVE_PRINTF_SPECIFIER)], |
---|
127 | [AC_CHECK_FUNC( |
---|
128 | [register_printf_function], |
---|
129 | [AC_DEFINE(HAVE_PRINTF_FUNCTION)], |
---|
130 | [ |
---|
131 | AC_MSG_NOTICE([printf does not support custom format specifiers!]) |
---|
132 | vstr=true |
---|
133 | ] |
---|
134 | )] |
---|
135 | ) |
---|
136 | |
---|
137 | if test x$vstr = xtrue; then |
---|
138 | AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])]) |
---|
139 | AC_DEFINE(USE_VSTR) |
---|
140 | fi |
---|
141 | |
---|
142 | AC_CONFIG_FILES([Makefile]) |
---|
143 | AC_OUTPUT |
---|
144 | |
---|