File: configure.in

package info (click to toggle)
libapache2-mod-ldap-userdir 1.1.11-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 256 kB
  • ctags: 74
  • sloc: ansic: 830; makefile: 62; sh: 12
file content (96 lines) | stat: -rw-r--r-- 2,831 bytes parent folder | download | duplicates (2)
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
AC_INIT(mod_ldap_userdir.c)

AC_ARG_WITH(apxs,
            [AC_HELP_STRING(
              [--with-apxs],
              [Path to Apache's apxs command (version 1.3.x or 2.0.x)])
            ],
            APXS=$withval)
AC_ARG_WITH(activate,
            [AC_HELP_STRING(
              [--with-activate],
              [Activate mod_ldap_userdir in httpd.conf])
            ],
            test "$withval" != no && ACTIVATE=-a)
AC_ARG_WITH(sdk-headers,
            [AC_HELP_STRING(
              [--with-sdk-headers],
              [Specify the path to the LDAP SDK header files])
            ],
            [CPPFLAGS="-I$withval"])
AC_ARG_WITH(sdk-libdir,
            [AC_HELP_STRING(
              [--with-sdk-libdir],
              [Specify the path to the LDAP SDK libraries])
            ],
            [LDFLAGS="-L$withval"])

AC_PROG_CC
dnl We need to reset CFLAGS after AC_PROG_CC sets it. apxs will provide
dnl its own CFLAGS and gets confused when we try to feed ours to it.
CFLAGS=

if test -z "$APXS" || test "$APXS" = yes; then
	for location in /usr/local/apache/bin/apxs /usr/local/apache2/bin/apxs \
	                /opt/csw/apache2/sbin/apxs
	do
		if test -e $location; then
			APXS=$location
		fi
	done

	if test -z "$APXS"; then
		APXS=apxs
	fi
fi

AC_MSG_CHECKING(whether apxs works)
$APXS -q CFLAGS >/dev/null
if test $? = 0; then
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT(no)
	AC_MSG_ERROR(Cannot build mod_ldap_userdir without a valid apxs program)
fi

# There must be a better way, but I've yet to find it.
if echo $APXS | grep apxs2 >/dev/null; then
	TARGET=.libs/mod_ldap_userdir.so
elif echo $APXS | grep apache2 >/dev/null; then
	TARGET=.libs/mod_ldap_userdir.so
else
	TARGET=mod_ldap_userdir.so
fi

AC_CHECK_LIB(lber, ber_init)
AC_CHECK_LIB(ldap, ldap_init, found_openldap_libs=yes; LIBS="-lldap $LIBS",
	AC_MSG_ERROR(You must have libldap to build mod_ldap_userdir.))

AC_CHECK_HEADERS(lber.h, ,
	AC_MSG_ERROR(You must have lber.h to build mod_ldap_userdir.))
AC_CHECK_HEADERS(ldap.h, ,
	AC_MSG_ERROR(You must have ldap.h to build mod_ldap_userdir.),
	[#include <lber.h>])

dnl AC_CHECK_MEMBER(struct ldap_url_desc.lud_scheme,
dnl 	[AC_DEFINE(HAVE_LDAPURLDESC_LUD_SCHEME, 1, [Define if your LDAPURLDesc has a lud_scheme member.])], ,
dnl 	[#include <lber.h>
dnl #include <ldap.h>])
AC_CHECK_MEMBER(LDAPURLDesc.lud_scheme,
	[AC_DEFINE(HAVE_LDAPURLDESC_LUD_SCHEME, 1, [Define if your LDAPURLDesc has a lud_scheme member.])], ,
	[#include <lber.h>
#include <ldap.h>])

AC_ARG_WITH(tls,
            [AC_HELP_STRING(
              [--without-tls],
              [Don't build with TLS (LDAP over SSL) support])
            ], ,
            [AC_CHECK_FUNC(ldap_start_tls_s, TLS=-DTLS)])

AC_SUBST(APXS TARGET)
AC_SUBST(CPPFLAGS LDFLAGS LIBS)
AC_SUBST(TLS ACTIVATE)

AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)