source: configure.ac @ 2579c1a

abac0-leakabac0-meicompt_changesmei-idmei-rt0-nmei_rt0tvf-new-xml
Last change on this file since 2579c1a was 2579c1a, checked in by Tom Carroll <thomas.carroll@…>, 12 years ago

Default to BSD readpassphrase() to get secrets from users

  • Property mode set to 100644
File size: 3.4 KB
Line 
1AC_INIT([ABAC], [0.2.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
18
19AX_PKG_SWIG(1.3.17, [], [AC_MSG_ERROR([SWIG is required to build package])] )
20AX_SWIG_ENABLE_CXX
21AX_SWIG_PYTHON
22
23AC_ARG_ENABLE(debug,
24    [AC_HELP_STRING([--enable-debug], [build with debug symbols])],
25    [CFLAGS+="-g "],[])
26
27# Checks for libraries.
28AC_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])])
32test -d $LIBSTRONGSWAN_source || AC_ERROR([strongswan source dir not found. Don't use ~, use \$HOME.])
33AC_SUBST([LIBSTRONGSWAN_source])
34
35AC_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"])
39LDFLAGS="$LDFLAGS -L$strongswan_ld"
40
41AC_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
48# this is so wrong
49libstrongswan_plugins=$(grep libstrongswan_plugins $LIBSTRONGSWAN_source/Makefile | awk -F= '{ print $2 }')
50test -z "$libstrongswan_plugins" && AC_ERROR([Can't find libstrongswan plugins. Make sure you've run ./configure --enable-monolithic in the strongswan source tree])
51AC_SUBST(libstrongswan_plugins)
52
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
56AC_MSG_CHECKING(for site_perl directory)
57if test -z "$SITE_PERL"; then
58        SITE_PERL=`$PERL -e 'print((grep(/site_perl/ && !m#/mach#, @INC))[0], "\n");'`
59fi
60AC_MSG_RESULT($SITE_PERL)
61AC_SUBST(SITE_PERL)
62
63# Checks for header files.
64AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h readpassphrase.h paths.h])
65
66# Checks for typedefs, structures, and compiler characteristics.
67AC_HEADER_STDBOOL
68AC_TYPE_SIZE_T
69AC_TYPE_UINT16_T
70AC_TYPE_UINT32_T
71AC_TYPE_UINT8_T
72AC_CHECK_TYPES([ptrdiff_t])
73
74AC_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
80# Checks for library functions.
81AC_FUNC_MALLOC
82AC_CHECK_FUNCS([atexit memset strchr strdup readpassphrase])
83
84# Confirm that the link path includes strongswan
85AC_CHECK_LIB(strongswan, library_init,,
86             [AC_MSG_ERROR('set --with-strongswan-ld-path')])
87
88# snagged from strongswan, required
89AC_CHECK_FUNC(
90        [register_printf_specifier],
91        [AC_DEFINE([HAVE_PRINTF_SPECIFIER],[],[strongswan printf specififer])],
92        [AC_CHECK_FUNC(
93                [register_printf_function],
94                [AC_DEFINE([HAVE_PRINTF_FUNCTION],[],[strongswan printf function])],
95                [
96                        AC_MSG_NOTICE([printf does not support custom format specifiers!])
97                        vstr=true
98                ]
99        )]
100)
101
102if test x$vstr = xtrue; then
103        AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])])
104        AC_DEFINE([USE_VSTR],[],[use vstr])
105fi
106
107
108AC_CONFIG_FILES([Makefile])
109AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.