source: configure.ac

Last change on this file was 560b453, checked in by Ted Faber <faber@…>, 9 years ago

Fine tune header-guard check (and add messages)

  • Property mode set to 100644
File size: 2.8 KB
RevLine 
[a8617e0]1AC_INIT([ABAC], [0.1.9], [faber@ISI.EDU])
[4918535]2AC_CONFIG_SRCDIR([libabac/abac_role.c])
3AM_INIT_AUTOMAKE([foreign subdir-objects])
[6ede88c]4LT_INIT
5
6AC_CONFIG_MACRO_DIR([m4])
7
8# Checks for programs.
9AC_PROG_CXX
10AC_PROG_CC
[b73c2538]11AC_PROG_LIBTOOL
[6ede88c]12
[48fa0ee]13# Explicitly hunt up perl
14AC_CHECK_PROGS(PERL, perl)
15
[43a5429]16# for python
[831da18]17AX_PYTHON_DEVEL([], [AC_MSG_ERROR([python-devel is required])] )
[43a5429]18AM_PATH_PYTHON
[46a2dc3]19
[461541a]20# for openssl
21AX_CHECK_OPENSSL([], [AC_MSG_ERROR([openssl is required to build pacakge])] )
22
23# for xmlsec1
24AX_CHECK_XMLSEC1([], [AC_MSG_ERROR([xmlsec1 is required to build pacakge])] )
25# for xml2
26AX_CHECK_XML2([], [AC_MSG_ERROR([xml2 is required to build pacakge])] )
27
28# for swig
[46a2dc3]29AX_PKG_SWIG(1.3.17, [], [AC_MSG_ERROR([SWIG is required to build package])] )
30AX_SWIG_ENABLE_CXX
31AX_SWIG_PYTHON
[43a5429]32
[6ede88c]33AC_ARG_ENABLE(debug,
34    [AC_HELP_STRING([--enable-debug], [build with debug symbols])],
35    [CFLAGS+="-g "],[])
36
37# Checks for libraries.
[48fa0ee]38AC_ARG_WITH(
39    [site-perl],
40    [AS_HELP_STRING([--with-site-perl=DIR],
41                   [directory in which to install perl modules])],
42    [SITE_PERL="$withval"], [SITE_PERL=""])
43   
44
45# Ask perl for a likely site_perl directory.  If the user has already specified
46# it using --with-site-perl, use that value.  NB, this does not respect prefix,
47# so users wishing to do a local install must use --with-site-perl
48AC_MSG_CHECKING(for site_perl directory)
49if test -z "$SITE_PERL"; then
50        SITE_PERL=`$PERL -e 'print((grep(/site_perl/ && !m#/mach#, @INC))[0], "\n");'`
51fi
52AC_MSG_RESULT($SITE_PERL)
53AC_SUBST(SITE_PERL)
54
[d469e63]55AC_LANG(C)
[6ede88c]56# Checks for header files.
[2579c1a]57AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h readpassphrase.h paths.h])
[6ede88c]58
59# Checks for typedefs, structures, and compiler characteristics.
60AC_HEADER_STDBOOL
61AC_TYPE_SIZE_T
62AC_TYPE_UINT16_T
63AC_TYPE_UINT32_T
64AC_TYPE_UINT8_T
65AC_CHECK_TYPES([ptrdiff_t])
[560b453]66AC_MSG_CHECKING([checking for header-guard])
[d469e63]67HOLD_CFLAGS=$CFLAGS
[560b453]68CFLAGS="$CFLAGS -Werror -Wno-error=header-guard"
69AC_COMPILE_IFELSE([[]],AC_MSG_RESULT([yes]),CFLAGS=$HOLD_CFLAGS;AC_MSG_RESULT([no]))
[6ede88c]70
[2579c1a]71AC_CHECK_DECL([_PATH_TTY],[],AC_DEFINE_UNQUOTED([_PATH_TTY],"/dev/tty",[Define to tty device node path]),[
72#ifdef HAVE_PATHS_H
73#  include <paths.h>
74#endif
75])
76
[6ede88c]77# Checks for library functions.
78AC_FUNC_MALLOC
[2579c1a]79AC_CHECK_FUNCS([atexit memset strchr strdup readpassphrase])
[6ede88c]80
[4f79997]81AC_CONFIG_FILES([Makefile tests/Makefile tests/creddy_tests/Makefile tests/creddy_prover_tests/Makefile tests/attr_tests/Makefile tests/python_tests/Makefile tests/scaling_tests/Makefile tests/scaling_tests/daisychain/Makefile tests/scaling_tests/daisychain/likes_python/Makefile tests/scaling_tests/haystack/Makefile tests/scaling_tests/haystack/ralphs_prover/Makefile tests/example_scripts/Makefile tests/example_scripts/wiki/Makefile tests/example_scripts/c/Makefile tests/example_scripts/python/Makefile tests/example_scripts/perl/Makefile])
[6ede88c]82AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.