1AC_INIT([mod_auth_openid], [0.8], [bamuller@gmail.com])
2AC_DEFINE([PACKAGE_URL],["http://findingscience.com/mod_auth_openid"],[project url])
3AM_CONFIG_HEADER(src/config.h)
4AM_INIT_AUTOMAKE()
5
6AC_CONFIG_MACRO_DIR([acinclude.d])
7
8AC_PROG_CXX
9AC_PROG_CXXCPP
10AC_LANG_CPLUSPLUS
11AC_CANONICAL_HOST
12AC_PROG_INSTALL
13AM_PROG_LIBTOOL
14
15AC_HEADER_STDC
16
17# provide flag --enable-debug
18AC_ARG_ENABLE([debug],
19    [  --enable-debug    Enable debugging output to Apache error log],
20    [case "${enableval}" in
21        yes) debug=true ;;
22        no)  debug=false ;;
23        *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
24     esac],[debug=false])
25AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
26
27# this will look for apxs command - put it in $APXS, fail on failure
28AX_WITH_APXS()
29
30# find apr-config binary
31AC_ARG_WITH(apr_config, AC_HELP_STRING([[--with-apr-config=FILE]], [Path to apr-config program]),
32			[ apr_config="$withval" ],
33			[AC_PATH_PROGS(apr_config,
34				[apr-config apr-0-config apr-1-config],
35				[no],
36				[$PATH:/usr/sbin/:/usr/local/apache2/bin]
37			)]
38)
39
40if test "$apr_config" = "no"; then
41   AC_MSG_ERROR(Could not find the apr-config program.  You can specify a location with the --with-apr-config=FILE option.  It may be named apr-0-config or apr-1-config and can be found in your apache2 bin directory.)
42fi
43
44$apr_config --cppflags &> /dev/null
45if test "$?" != "0"; then
46  AC_MSG_ERROR($apr_config is not a valid apr-config program)
47fi
48
49AX_LIB_SQLITE3([3.3.0])
50if test "$SQLITE3_VERSION" == ""; then
51  AC_MSG_ERROR([No sqlite 3 (http://www.sqlite.org) library found.])
52fi
53
54APR_LDFLAGS="`${apr_config} --link-ld --libs`"
55AC_SUBST(APR_LDFLAGS)
56
57APACHE_CFLAGS="-I`${APXS} -q INCLUDEDIR` -I`${apr_config} --includedir`"
58AC_SUBST(APACHE_CFLAGS)
59
60PKG_CHECK_MODULES([OPKELE],[libopkele >= 2.0],,[
61 AC_MSG_ERROR([no libopkele library found (version 2.0 or higher). get one from http://kin.klever.net/libopkele/])
62])
63
64# These next few are prerequisites for libopekele, but it's possible they've been removed since that install....
65# Check for pcre
66AX_PATH_LIB_PCRE([], [ AC_MSG_ERROR([No pcre library found.  You can get it at http://www.pcre.org]) ])
67AC_SUBST(PCRE_LIBS)
68AC_SUBST(PCRE_CFLAGS)
69
70# Check for curl
71AC_CHECK_CURL([7], [], [ AC_MSG_ERROR([No curl library found.  You can get it at http://curl.haxx.se]) ])
72AC_SUBST(CURL_CFLAGS)
73AC_SUBST(CURL_LIBS)
74
75# Idea taken from libopekele
76nitpick=false
77AC_ARG_ENABLE([nitpicking],
78 AC_HELP_STRING([--enable-nitpicking],[make compiler warn about possible problems]),
79 [ test "$enableval" = "no" || nitpick=true ]
80)
81AM_CONDITIONAL(NITPICK, test x$nitpick = xtrue)
82
83
84AC_CONFIG_FILES([
85 Makefile
86 src/Makefile
87])
88AC_OUTPUT
89
90echo " ***"
91echo " *** You are now ready to build mod_auth_openid:"
92echo " *** Enter the following commands:"
93echo " ***"
94echo " *** $> make"
95echo " *** $> su root"
96echo " *** $> make install"
97echo " ***"
98echo " *** Report bugs at http://github.com/bmuller/mod_auth_openid/issues"
99echo " *** Thanks for using free (as in speech and beer) software."
100echo " ***"
101echo
102