-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
94 lines (83 loc) · 2.08 KB
/
configure.in
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
AC_INIT(mod_ldap_userdir.c)
AC_ARG_WITH(apxs,
[AS_HELP_STRING(
[--with-apxs],
[Path to Apache's apxs command (version 1.3.x or 2.0.x)]
)],
APXS=$withval)
AC_ARG_WITH(activate,
[AS_HELP_STRING(
[--with-activate],
[Activate mod_ldap_userdir in httpd.conf]
)],
test "$withval" != no && ACTIVATE=-a
)
AC_ARG_WITH(sdk-headers,
[AS_HELP_STRING(
[--with-sdk-headers],
[Specify the path to the LDAP SDK header files]
)],
[CPPFLAGS="-I$withval"]
)
AC_ARG_WITH(sdk-libdir,
[AS_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
APXS=apxs
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
fi
AC_MSG_CHECKING(whether apxs works)
if $APXS -q CFLAGS >/dev/null; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Cannot build mod_ldap_userdir without a valid apxs program)
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>]
)
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_ENABLE([tls],
[AS_HELP_STRING(
[--disable-tls],
[Don't build with LDAP TLS support]
)],
[enable_tls=$enableval],
[enable_tls=yes]
)
AS_IF([test "x$enable_tls" != xno],
[AC_CHECK_FUNC(ldap_start_tls_s, TLS=-DTLS)]
)
AC_SUBST(APXS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
AC_SUBST(TLS)
AC_SUBST(ACTIVATE)
AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)