1AC_PREREQ([2.50])
2AC_INIT([opensaml],[3.2.1],[https://issues.shibboleth.net/],[opensaml])
3AC_CONFIG_SRCDIR(saml)
4AC_CONFIG_AUX_DIR(build-aux)
5AC_CONFIG_MACRO_DIR(m4)
6AM_INIT_AUTOMAKE
7PKG_INSTALLDIR
8
9# Doxygen features
10DX_HTML_FEATURE(ON)
11DX_DOT_FEATURE(ON)
12DX_CHM_FEATURE(OFF)
13DX_CHI_FEATURE(OFF)
14DX_MAN_FEATURE(OFF)
15DX_RTF_FEATURE(OFF)
16DX_XML_FEATURE(OFF)
17DX_PDF_FEATURE(OFF)
18DX_PS_FEATURE(OFF)
19DX_INIT_DOXYGEN(opensaml, doxygen.cfg, doc/api)
20
21AC_ARG_ENABLE(debug,
22    AS_HELP_STRING([--enable-debug],[Produce debug variant (Default = no)]),
23    enable_debug=$enableval, enable_debug=no)
24
25if test "$enable_debug" = "yes" ; then
26    AM_CFLAGS="-D_DEBUG"
27    AM_CXXFLAGS="-D_DEBUG"
28fi
29
30AC_CONFIG_HEADERS([config.h])
31AC_CONFIG_FILES([opensaml.pc opensaml.spec])
32AC_CONFIG_FILES([Makefile saml/Makefile samltest/Makefile samlsign/Makefile schemas/Makefile doc/Makefile])
33
34AC_PROG_CC([gcc gcc3 cc])
35AC_PROG_CXX([g++ g++3 c++ CC])
36
37if test "$GCC" = "yes" ; then
38    AM_CFLAGS="$AM_CFLAGS -Wall -W"
39    AM_CXXFLAGS="$AM_CXXFLAGS -Wall -W"
40fi
41
42AC_SUBST([AM_CFLAGS])
43AC_SUBST([AM_CXXFLAGS])
44
45LT_INIT([disable-static])
46
47# Checks for typedefs, structures, and compiler characteristics.
48AC_C_CONST
49AC_TYPE_SIZE_T
50AC_HEADER_DIRENT
51
52# Checks for library functions.
53AC_CHECK_FUNCS([strchr strdup strstr])
54
55AX_PTHREAD(,[AC_MSG_ERROR([unable to find pthreads, currently this is required])])
56
57AC_LANG([C++])
58
59# C++ requirements
60AC_CXX_NAMESPACES
61AC_CXX_REQUIRE_STL
62
63# Boost
64BOOST_REQUIRE
65BOOST_BIND
66BOOST_LAMBDA
67BOOST_POINTER_CONTAINER
68BOOST_SMART_PTR
69BOOST_STRING_ALGO
70
71AX_PKG_CHECK_MODULES([log4shib],,[log4shib],
72    [AC_DEFINE([OPENSAML_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
73    [AX_PKG_CHECK_MODULES([log4cpp],,[log4cpp],
74        [AC_DEFINE([OPENSAML_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])])])
75
76AX_PKG_CHECK_MODULES([xerces],,[xerces-c >= 3.2])
77
78AX_PKG_CHECK_MODULES([xmlsec],,[xml-security-c >= 2])
79
80AX_PKG_CHECK_MODULES([xmltooling],,[xmltooling >= 3.1])
81PKG_CHECK_VAR([DX_INCLUDE], [xmltooling], [includedir])
82
83# Check for unit test support
84AC_ARG_VAR([CXXTEST], [override the cxxtestgen executable and options])
85AC_CHECK_PROGS([CXXTEST], [cxxtestgen cxxtestgen.pl], [false])
86AC_ARG_VAR([CXXTESTFLAGS], [override the cxxtest compiler flags needed to build tests])
87AM_CONDITIONAL([BUILD_UNITTEST], [test "x${CXXTEST}" != xfalse])
88
89AC_ARG_WITH([pkgxmldir],
90    AS_HELP_STRING([--with-pkgxmldir],
91        [where to install the schema files @<:@default=${datadir}/xml/AC_PACKAGE_TARNAME@:>@])],
92    [],[with_pkgxmldir=${datadir}/xml/AC_PACKAGE_TARNAME])
93AC_SUBST([pkgxmldir],[${with_pkgxmldir}])
94
95# output packaging and makefiles
96AC_OUTPUT
97