summaryrefslogtreecommitdiff
path: root/configure.in
blob: d9d9a7dee4c7ffdd20441a316dbdc8eab17ed82f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
dnl 
dnl Copyright (c) 2009, Stefan Walter
dnl All rights reserved.
dnl 
dnl Redistribution and use in source and binary forms, with or without 
dnl modification, are permitted provided that the following conditions 
dnl are met:
dnl 
dnl     * Redistributions of source code must retain the above 
dnl       copyright notice, this list of conditions and the 
dnl       following disclaimer.
dnl     * Redistributions in binary form must reproduce the 
dnl       above copyright notice, this list of conditions and 
dnl       the following disclaimer in the documentation and/or 
dnl       other materials provided with the distribution.
dnl     * The names of contributors to this software may not be 
dnl       used to endorse or promote products derived from this 
dnl       software without specific prior written permission.
dnl 
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
dnl FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
dnl COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
dnl INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
dnl BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
dnl OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
dnl AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
dnl OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 
dnl THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
dnl DAMAGE.
dnl 
dnl
dnl CONTRIBUTORS
dnl  Stef Walter <stef@memberwebs.com>
dnl 

dnl Process this file with autoconf to produce a configure script.
AC_INIT(mod_auth_singleid, 0.4.5, stef@memberwebs.com)
AM_INIT_AUTOMAKE(mod_auth_singleid, 0.4.5)

AC_CONFIG_SRCDIR([module/mod_auth_singleid.c])
AM_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CXXCPP
AC_LANG_CPLUSPLUS
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AM_PROG_LIBTOOL

# APACHE Build stuff

AC_ARG_WITH(apr_config, AC_HELP_STRING([[--with-apr-config=FILE]], [Path to apr-config program]),
	[ apr_config="$withval" ],
	[AC_PATH_PROGS(apr_config,
		[apr-config apr-0-config apr-1-config], 
		[no], 
		[$PATH:/usr/sbin/:/usr/local/apache2/bin]
	)]
)

if test "$apr_config" = "no"; then
	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.)
fi

$apr_config --cppflags &> /dev/null
if test "$?" != "0"; then
	AC_MSG_ERROR($apr_config is not a valid apr-config program)
fi

AC_PATH_PROG(APXS, apxs, "failed")
if test "$APXS" = "failed"; then
	AC_PATH_PROG(APXS2, apxs2, "failed")
	if test "$APXS2" = "failed"; then
		APXS="apxs"
	else
	    APXS=$APXS2
	fi
fi

AM_CONDITIONAL(MANUAL_BUILD, false)
AC_SUBST(APXS)

AC_PATH_PROG(APACHECTL, apachectl, "failed")
if test "$APACHECTL" = "failed"; then
	AC_PATH_PROG(APACHE2CTL, apache2ctl, "failed")
	if test "$APACHE2CTL" = "failed"; then
		APACHECTL="apachectl"
	else
	    APACHECTL=$APACHE2CTL
	fi
fi

AC_SUBST(APACHECTL)

APR_CFLAGS="-I`$apr_config --includedir --cppflags`"
APACHE_CFLAGS="-I`$APXS -q INCLUDEDIR` $APR_CFLAGS"
APR_LIBS="`$apr_config --link-ld --libs` -laprutil-1"

AC_SUBST(APR_CFLAGS)
AC_SUBST(APR_LIBS)
AC_SUBST(APACHE_CFLAGS)


# ------------------------------------------------------------------------------------
# OPKELE

PKG_CHECK_MODULES([OPKELE], [libopkele >= 2.0], , [
	AC_MSG_ERROR([no libopkele library found (version 2.0 or higher). get one from http://kin.klever.net/libopkele/])
])


AC_DEFINE_UNQUOTED(CONF_PREFIX, "`eval echo ${sysconfdir}`", [Installation Prefix] )

# Debug mode
AC_ARG_ENABLE(debug, 
		AC_HELP_STRING([--enable-debug],
		[Compile binaries in debug mode]))

if test "$enable_debug" = "yes"; then
	CFLAGS="-Wall -Werror $CFLAGS -g -O0"
	CXXFLAGS="-Wall -Werror $CXXFLAGS -g -O0"
	AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
	echo "enabling debug compile mode"
fi

AC_CONFIG_FILES([
	Makefile 
	module/Makefile
	tests/Makefile
])

AC_OUTPUT