# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([1.92]) AC_INIT([ees], [0.0.1], aramv@nikhef.nl) AM_INIT_AUTOMAKE AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([include/private/config.h]) # Checks for programs. # needs to be called before AC_PROG_LIBTOOL AC_LIBTOOL_DLOPEN AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CC_STDC #AC_PROG_CC_C89 AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LEX AC_PROG_YACC if test "$LEX" == ":" ; then AC_MSG_ERROR([No lex program found]) else if test "$LEX" == "flex" ; then AC_DEFINE(HAVE_FLEX, 1,[Flex installed]) fi fi if test "$YACC" != "bison -y"; then AC_MSG_ERROR([No yacc program found]) fi AC_PROG_LIBTOOL # Checks for libraries. # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([dlfcn.h fcntl.h malloc.h stddef.h stdarg.h stdio.h sys/dir.h stdlib.h string.h syslog.h wchar.h stdio.h linux/limits.h errno.h time.h sys/param.h pthread.h getopt.h signal.h sys/ioctl.h sys/stat.h netdb.h netinet/in.h arpa/inet.h sys/syscall.h sys/types.h ]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([memset daemon getpwnam_r getgrnam_r]) AC_CHECK_LIB([dl], [dlopen]) AC_CHECK_LIB([pthread], [pthread_create]) #AC_CHECK_LIB([xacml]) #AC_CHECK_LIB([crypto]) #AC_CHECK_LIB([ssl]) # SVN revision SVN_REVISION=`svn info . | sed -ne "s/^Revision: \(.*\:\)\{0,1\}\(.*\)$/\2/p"` AC_SUBST(SVN_REVISION) AC_DEFINE_UNQUOTED(SVN_REVISION, [$SVN_REVISION], [will be returned by EEF_getVersion]) # Checks Lex version lex_version=`$LEX --version | sed -e 's/\(f*\)lex\s\?//g'` preferred_lex_version="2.5.9" AC_MSG_CHECKING([for lex/flex version]) AC_MSG_RESULT($lex_version) AX_COMPARE_VERSION([$preferred_lex_version], [le], [$lex_version], [enable_yylex_destroy="yes"], [enable_yylex_destroy="no"], [whether yylex_destroy() is available to clean up the lexer.]) AM_CONDITIONAL([ENABLE_YYLEX_DESTROY], [test "x$enable_yylex_destroy" = "xyes"]) AS_IF([test "x$enable_yylex_destroy" = "xyes"], [ AC_DEFINE(HAVE_YYLEX_DESTROY, 1,[yylex_destroy is available to clean up the parser]) ], [ AC_DEFINE(HAVE_YYLEX_DESTROY, 0,[yylex_destroy is not available to clean up the parser]) ]) # Release version AC_SUBST(MAJOR_VERSION,["0"]) # Doxygen options DX_PDF_FEATURE(ON) DX_HTML_FEATURE(ON) DX_INIT_DOXYGEN(FULL-PACKAGE-NAME, doxygen.cfg, doc) # Debug mode debug_default=no AC_MSG_CHECKING([whether to enable debugging]) AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug],[turn on debugging])], [ AC_MSG_RESULT(yes) enable_debug="yes" ],[ AC_MSG_RESULT($debug_default) enable_debug=$debug_default ] ) # Set XACML variables AC_XACML if test "x$have_xacml" = "xno" ; then AC_MSG_FAILURE(["no SAML2-XACML2-C-library interface found"]) fi # This is for the Makefile.am files AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = "xyes"]) AS_IF([test "x$enable_debug" = "xyes"], [ AC_MSG_NOTICE("debugging enabled!") AX_CHECK_COMPILER_FLAGS([-g], [CFLAGS="$CFLAGS -g"]) AX_CHECK_COMPILER_FLAGS([-ggdb], [CFLAGS="$CFLAGS -ggdb3"]) AX_CHECK_COMPILER_FLAGS([-Wextra], [CFLAGS="$CFLAGS -Wextra"]) AX_CHECK_COMPILER_FLAGS([-Wbad-function-cast], [CFLAGS="$CFLAGS -Wbad-function-cast"]) AX_CHECK_COMPILER_FLAGS([-Wchar-subscripts], [CFLAGS="$CFLAGS -Wchar-subscripts"]) AX_CHECK_COMPILER_FLAGS([-Wno-long-long], [CFLAGS="$CFLAGS -Wno-long-long"]) AX_CHECK_COMPILER_FLAGS([-pedantic], [CFLAGS="$CFLAGS -pedantic"]) # This is for the C files. AC_DEFINE(ENABLE_DEBUG, 1,[Debug enabled]) ], [ AX_CHECK_COMPILER_FLAGS([-O2], [CFLAGS="$CFLAGS -O2"]) AC_DEFINE(ENABLE_DEBUG, 0,[Debug disabled]) ]) AX_CHECK_COMPILER_FLAGS([-Wuninitialized], [CFLAGS="$CFLAGS -Wuninitialized"]) AX_CHECK_COMPILER_FLAGS([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"]) AX_CHECK_COMPILER_FLAGS([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"]) AX_CHECK_COMPILER_FLAGS([-Wcast-qual], [CFLAGS="$CFLAGS -Wcast-qual"]) AX_CHECK_COMPILER_FLAGS([-Winline], [CFLAGS="$CFLAGS -Winline"]) AX_CHECK_COMPILER_FLAGS([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"]) AX_CHECK_COMPILER_FLAGS([-Wpointer-arith], [CFLAGS="$CFLAGS -Wpointer-arith"]) AX_CHECK_COMPILER_FLAGS([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"]) AX_CHECK_COMPILER_FLAGS([-Wredundant-decls], [CFLAGS="$CFLAGS -Wredundant-decls"]) AX_CHECK_COMPILER_FLAGS([-Wstrict-prototypes], [CFLAGS="$CFLAGS -Wstrict-prototypes"]) AX_CHECK_COMPILER_FLAGS([-std], [CFLAGS="$CFLAGS -std=c89"]) AX_CHECK_COMPILER_FLAGS([-Wall], [CFLAGS="$CFLAGS -Wall"]) AM_MAINTAINER_MODE([enable]) # Check for a libdir named lib64 on 64-bit or hybrid architectures AX_DEFINE_DIR(MODULE_DIR, [libdir/modules], ["Module directory: $module_dir."]) AC_SUBST(MODULE_DIR) # Dependant Makefiles AC_CONFIG_FILES([ Makefile src/Makefile plugin_examples/Makefile setup/sed.template setup/ees.init.d ]) AC_OUTPUT