source: configure.ac @ 48fa0ee

abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change on this file since 48fa0ee was 48fa0ee, checked in by Ted Faber <faber@…>, 14 years ago

Fix a few configure bugs:

Find lib strongswan if it is in /usr/local/lib and give a user
override

Find the site_prel directory and give the user an override

Make the ABAC.py and ABAC.pm swig entries

Find python libraries correctly on FreeBSD
(m4/ac_python_devel.m4)

  • Property mode set to 100644
File size: 3.1 KB
Line 
1AC_INIT([ABAC], [0.1.0], [mikeryan@ISI.EDU])
2AC_CONFIG_SRCDIR([libabac/abac_role.c])
3AM_INIT_AUTOMAKE([foreign subdir-objects])
4LT_INIT
5
6AC_CONFIG_MACRO_DIR([m4])
7
8# Checks for programs.
9AC_PROG_CXX
10AC_PROG_CC
11AC_PROG_LIBTOOL
12
13# Explicitly hunt up perl
14AC_CHECK_PROGS(PERL, perl)
15
16# for python
17AM_PATH_PYTHON
18SWIG_ENABLE_CXX
19SWIG_PYTHON
20
21AC_ARG_ENABLE(debug,
22    [AC_HELP_STRING([--enable-debug], [build with debug symbols])],
23    [CFLAGS+="-g "],[])
24
25# Checks for libraries.
26AC_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])])
30test -d $LIBSTRONGSWAN_source || AC_ERROR([strongswan source dir not found. Don't use ~, use \$HOME.])
31AC_SUBST([LIBSTRONGSWAN_source])
32
33AC_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"])
37LDFLAGS="$LDFLAGS -L$strongswan_ld"
38
39AC_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
47libstrongswan_plugins=$(grep libstrongswan_plugins $LIBSTRONGSWAN_source/Makefile | awk -F= '{ print $2 }')
48test -z "$libstrongswan_plugins" && AC_ERROR([Can't find libstrongswan plugins. Make sure you've run ./configure --enable-monolithic in the strongswan source tree])
49AC_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
54AC_MSG_CHECKING(for site_perl directory)
55if test -z "$SITE_PERL"; then
56        SITE_PERL=`$PERL -e 'print((grep(/site_perl/ && !m#/mach#, @INC))[0], "\n");'`
57fi
58AC_MSG_RESULT($SITE_PERL)
59AC_SUBST(SITE_PERL)
60
61# Checks for header files.
62AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h])
63
64# Checks for typedefs, structures, and compiler characteristics.
65AC_HEADER_STDBOOL
66AC_TYPE_SIZE_T
67AC_TYPE_UINT16_T
68AC_TYPE_UINT32_T
69AC_TYPE_UINT8_T
70AC_CHECK_TYPES([ptrdiff_t])
71
72# Checks for library functions.
73AC_FUNC_MALLOC
74AC_CHECK_FUNCS([atexit memset strchr strdup])
75
76# Confirm that the link path includes strongswan
77AC_CHECK_LIB(strongswan, library_init,,
78             [AC_MSG_ERROR('set --with-strongswan-ld-path')])
79
80# snagged from strongswan, required
81AC_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
94if 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)
97fi
98
99AC_CONFIG_FILES([Makefile])
100AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.