Move shib-target.h into shib-target subdir
[shibboleth/sp.git] / configure.ac
1 dnl $Id$ 
2
3 AC_PREREQ([2.50])
4 AC_INIT([shibboleth], [0.1], [mace-shib-users@internet2.edu], [shibboleth])
5 AM_CONFIG_HEADER(config.h)
6 AM_INIT_AUTOMAKE
7
8 sinclude(acx_pthread.m4)
9
10 AC_PROG_CC([gcc3 gcc cc])
11 AC_PROG_CXX([g++3 g++ c++ CC])
12 AC_DISABLE_STATIC
13 AC_PROG_LIBTOOL
14
15 AC_LANG(C++)
16
17 # Checks for typedefs, structures, and compiler characteristics.
18 AC_C_CONST
19 AC_TYPE_SIZE_T
20 AC_STRUCT_TM
21
22 # Checks for library functions.
23 AC_FUNC_STRFTIME
24 AC_CHECK_FUNCS([strchr strdup strstr gmtime_r])
25 AC_CHECK_HEADERS([dlfcn.h])
26
27 # C++ requirements
28 AC_CXX_REQUIRE_STL
29 AC_CXX_NAMESPACES
30
31 # checks for pthreads
32 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
33 if test $enable_threads != "pthread"; then
34     AC_MSG_ERROR([unable to find pthreads, currently this is required])
35 else
36     AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
37     LIBS="$PTHREAD_LIBS $LIBS"
38     CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
39     CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
40 fi
41
42 AC_ARG_WITH(xerces, 
43             AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
44             [if test x_$with_xerces != x_/usr; then
45                 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
46                 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
47             fi])
48
49
50 AC_ARG_WITH(openssl, 
51             AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
52             [if test x_$with_openssl != x_/usr; then
53                 LDFLAGS="-L${with_openssl}/lib $LDFLAGS"
54                 CPPFLAGS="-I${with_openssl}/include $CPPFLAGS"
55             fi])
56
57 AC_ARG_WITH(log4cpp, 
58             AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
59             [if test x_$with_log4cpp != x_/usr; then
60                 LDFLAGS="-L${with_log4cpp}/lib $LDFLAGS"
61                 CPPFLAGS="-I${with_log4cpp}/include $CPPFLAGS"
62             fi])
63
64 AC_ARG_WITH(saml,
65             AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
66             [if test x_$with_saml != x_/usr; then
67                 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
68                 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
69             fi])
70
71 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
72                 AC_MSG_ERROR([unable to find xerces header files]))
73 saved_LIBS="$LIBS"
74 LIBS="-lxerces-c $LIBS"
75 AC_TRY_LINK(
76         [#include <xercesc/util/PlatformUtils.hpp>],
77         [XMLPlatformUtils::Initialize()],
78         [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
79         [AC_MSG_ERROR([unable to link with Xerces])
80                 LIBS="$saved_LIBS"
81         ])
82
83 AC_CHECK_HEADER([openssl/ssl.h],,
84                 AC_MSG_ERROR([unable to find openssl header files]))
85 AC_CHECK_LIB([crypto], [ERR_load_CRYPTO_strings],,
86              AC_MSG_ERROR([unable to link with openssl libraries]))
87 AC_CHECK_LIB([ssl], [SSL_library_init],, 
88              AC_MSG_ERROR([unable to link with openssl libraries]))
89
90 AC_CHECK_HEADER([log4cpp/Category.hh],,
91                 AC_MSG_ERROR([unable to find log4cpp header files]))
92
93 AC_CHECK_HEADER([saml/saml.h],,
94                 AC_MSG_ERROR([unable to find saml header files]))
95
96 saved_LIBS="$LIBS"
97 LIBS="-llog4cpp $LIBS"
98 AC_TRY_LINK(
99         [#include <log4cpp/Category.hh>],
100         [log4cpp::Category::getInstance("foo")],
101         [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
102         [AC_MSG_ERROR([unable to link with log4cpp])
103                 LIBS="$saved_LIBS"
104         ])
105
106 saved_LIBS="$LIBS"
107 LIBS="-lsaml $LIBS"
108 AC_TRY_LINK(
109         [#include <saml/saml.h>],
110         [saml::SAMLConfig::getConfig()],
111         [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
112         [AC_MSG_ERROR([unable to link with saml])
113                 LIBS="$saved_LIBS"
114         ])
115
116 # output makefiles
117 AC_OUTPUT(Makefile shib/Makefile schemas/Makefile eduPerson/Makefile \
118                    shib-target/Makefile test/Makefile)
119