File: configure.in.old

package info (click to toggle)
libpam-ldap 140-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 644 kB
  • ctags: 271
  • sloc: ansic: 3,168; sh: 2,267; perl: 156; makefile: 67
file content (236 lines) | stat: -rw-r--r-- 8,906 bytes parent folder | download
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
AC_INIT(pam_ldap.c)
AC_CANONICAL_SYSTEM
AC_PREFIX_DEFAULT()

AM_INIT_AUTOMAKE(pam_ldap, 134)
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL

AC_ARG_ENABLE(ypldapd, [  --enable-ypldapd        enable PADL ypldapd specific features], [AC_DEFINE(YPLDAPD)])
AC_ARG_ENABLE(ssl, [  --disable-ssl           disable SSL/TSL support])
AC_ARG_WITH(ldap-lib, [  --with-ldap-lib=type    select ldap library [auto|netscape5|netscape4|netscape3|umich|openldap]])
AC_ARG_WITH(ldap-dir, [  --with-ldap-dir=DIR     base directory of ldap SDK])

AM_CONDITIONAL(EXTENSION_SO, test "$target_os" = "linux" -o "$target_os" = "linux-gnu")
if test "$ac_cv_prog_gcc" = "yes"; then CFLAGS="$CFLAGS -Wall -fPIC"; fi

dnl This is needed for the native Solaris LDAP SDK
CPPFLAGS="$CPPFLAGS -DLDAP_REFERRALS"

case "$target_os" in
freebsd*) CPPFLAGS="$CPPFLAGS -DPIC -D_REENTRANT" ;;
aix*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
esac

case "$target_os" in
aix*) pam_ldap_so_LDFLAGS="-bM:SRE -bnoentry -bE:\$(srcdir)/exports.aix" ;;
solaris*) pam_ldap_so_LDFLAGS="-Wl,-M -Wl,mapfile -Wl,-G" ;;
darwin*) pam_ldap_so_LDFLAGS="-bundle" ;;
*) pam_ldap_so_LDFLAGS="-shared" ;;
esac
AC_SUBST(pam_ldap_so_LDFLAGS)

if test -n "$with_ldap_dir"; then
  CPPFLAGS="$CPPFLAGS -I$with_ldap_dir/include"
  LDFLAGS="$LDFLAGS -L$with_ldap_dir/lib"
  case "$target_os" in  
  solaris*) LDFLAGS="$LDFLAGS -Wl,-R$with_ldap_dir/lib" ;;  
  *) LDFLAGS="$LDFLAGS -Wl,-rpath,$with_ldap_dir/lib" ;;
  esac  
fi

AC_CHECK_HEADERS(security/pam_appl.h security/pam_misc.h)
AC_CHECK_HEADERS(des.h crypt.h)
AC_CHECK_HEADERS(lber.h)
AC_CHECK_HEADERS(ldap.h, , AC_MSG_ERROR(could not locate <ldap.h>))
AC_CHECK_HEADERS(ldap_ssl.h)

AC_CHECK_LIB(dl, main)
AC_CHECK_LIB(pam, main)
dnl AC_CHECK_LIB(pthread, main)
AC_CHECK_LIB(resolv, main)
AC_CHECK_LIB(crypt, main)

AC_CHECK_FUNCS(gethostbyname)
if test "$ac_cv_func_gethostbyname" = "no"; then
  unset ac_cv_func_gethostbyname
  AC_CHECK_LIB(nsl, main)
  AC_CHECK_FUNCS(gethostbyname)
fi


dnl check which ldap library we have
if test -z "$with_ldap_lib"; then
  with_ldap_lib=auto
fi

if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \); then
  AC_CHECK_LIB(lber, main)
  AC_CHECK_LIB(ldap, main, LIBS="-lldap $LIBS" found_ldap_lib=yes)
fi

if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then
  AC_CHECK_LIB(ldap50, main, LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBS" found_ldap_lib=yes need_pthread=true,, -lpthread)
fi
if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \); then
  AC_CHECK_LIB(ldapssl41, main, LIBS="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBS" found_ldap_lib=yes need_pthread=true,, -lpthread)
  if test -z "$found_ldap_lib"; then
    AC_CHECK_LIB(ldapssl40, main, LIBS="-lldapssl40 $LIBS" found_ldap_lib=yes need_pthread=true,, -lpthread)
  fi
fi
if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \); then
  AC_CHECK_LIB(ldapssl30, main, LIBS="-lldapssl30 $LIBS" found_ldap_lib=yes need_pthread=true,, -lpthread)
fi

if test -z "$found_ldap_lib"; then
  AC_MSG_ERROR(could not locate a valid LDAP library)
fi

if test "$need_pthread" = "true"; then
  AC_CHECK_LIB(pthread, main)
fi

AC_CHECK_FUNCS(ldap_init ldap_get_lderrno ldap_parse_result ldap_memfree ldap_controls_free ldap_set_option ldap_get_option)
if test "$enable_ssl" \!= "no"; then
  AC_CHECK_FUNCS(ldapssl_init ldap_start_tls_s ldap_pvt_tls_set_option)
fi
AC_CHECK_FUNCS(ldap_initialize)
AC_CHECK_FUNCS(gethostbyname_r)

if test "$ac_cv_func_gethostbyname_r" = "yes"; then
AC_CACHE_CHECK(whether gethostbyname_r takes 6 arguments, pam_ldap_cv_gethostbyname_r_args, [
AC_TRY_COMPILE([
#include <netdb.h>], [gethostbyname_r(0, 0, 0, 0, 0, 0);], [pam_ldap_cv_gethostbyname_r_args=6], [pam_ldap_cv_gethostbyname_r_args=5]) ])
AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $pam_ldap_cv_gethostbyname_r_args)
fi

AC_CHECK_FUNCS(ldap_set_rebind_proc)
AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, pam_ldap_cv_ldap_set_rebind_proc, [
AC_TRY_COMPILE([
#include <lber.h>
#include <ldap.h>], [ldap_set_rebind_proc(0, 0, 0);], [pam_ldap_cv_ldap_set_rebind_proc=3], [pam_ldap_cv_ldap_set_rebind_proc=2]) ])
AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $pam_ldap_cv_ldap_set_rebind_proc)

AC_OUTPUT(Makefile)
AC_INIT(pam_ldap.c)
AC_CANONICAL_SYSTEM
AC_PREFIX_DEFAULT()

AM_INIT_AUTOMAKE(pam_ldap, 135)
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL

AC_ARG_ENABLE(ypldapd, [  --enable-ypldapd        enable PADL ypldapd specific features], [AC_DEFINE(YPLDAPD)])
AC_ARG_ENABLE(ssl, [  --disable-ssl           disable SSL/TSL support])
AC_ARG_WITH(ldap-lib, [  --with-ldap-lib=type    select ldap library [auto|netscape5|netscape4|netscape3|umich|openldap]])
AC_ARG_WITH(ldap-dir, [  --with-ldap-dir=DIR     base directory of ldap SDK])

AM_CONDITIONAL(EXTENSION_SO, test "$target_os" = "linux" -o "$target_os" = "linux-gnu")
if test "$ac_cv_prog_gcc" = "yes"; then CFLAGS="$CFLAGS -Wall -fPIC"; fi

dnl This is needed for the native Solaris LDAP SDK
CPPFLAGS="$CPPFLAGS -DLDAP_REFERRALS"

case "$target_os" in
freebsd*) CPPFLAGS="$CPPFLAGS -DPIC -D_REENTRANT" ;;
aix*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
esac

case "$target_os" in
aix*) pam_ldap_so_LDFLAGS="-bM:SRE -bnoentry -bE:\$(srcdir)/exports.aix" ;;
solaris*) pam_ldap_so_LDFLAGS="-Wl,-M -Wl,mapfile -Wl,-G" ;;
darwin*) pam_ldap_so_LDFLAGS="-bundle" ;;
*) pam_ldap_so_LDFLAGS="-shared" ;;
esac
AC_SUBST(pam_ldap_so_LDFLAGS)

if test -n "$with_ldap_dir"; then
  CPPFLAGS="$CPPFLAGS -I$with_ldap_dir/include"
  LDFLAGS="$LDFLAGS -L$with_ldap_dir/lib"
  case "$target_os" in  
  solaris*) LDFLAGS="$LDFLAGS -Wl,-R$with_ldap_dir/lib" ;;  
  *) LDFLAGS="$LDFLAGS -Wl,-rpath,$with_ldap_dir/lib" ;;
  esac  
fi

AC_CHECK_HEADERS(security/pam_appl.h security/pam_misc.h)
AC_CHECK_HEADERS(des.h crypt.h)
AC_CHECK_HEADERS(lber.h)
AC_CHECK_HEADERS(ldap.h, , AC_MSG_ERROR(could not locate <ldap.h>))
AC_CHECK_HEADERS(ldap_ssl.h)

AC_CHECK_LIB(dl, main)
AC_CHECK_LIB(pam, main)
dnl AC_CHECK_LIB(pthread, main)
AC_CHECK_LIB(resolv, main)
AC_CHECK_LIB(crypt, main)

AC_CHECK_FUNCS(gethostbyname)
if test "$ac_cv_func_gethostbyname" = "no"; then
  unset ac_cv_func_gethostbyname
  AC_CHECK_LIB(nsl, main)
  AC_CHECK_FUNCS(gethostbyname)
fi


dnl check which ldap library we have
if test -z "$with_ldap_lib"; then
  with_ldap_lib=auto
fi

if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \); then
  AC_CHECK_LIB(lber, main)
  AC_CHECK_LIB(ldap, main, LIBS="-lldap $LIBS" found_ldap_lib=yes)
fi

if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then
  AC_CHECK_LIB(ldap50, main, LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBS" found_ldap_lib=yes need_pthread=true,, -lpthread)
fi
if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \); then
  AC_CHECK_LIB(ldapssl41, main, LIBS="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBS" found_ldap_lib=yes need_pthread=true,, -lpthread)
  if test -z "$found_ldap_lib"; then
    AC_CHECK_LIB(ldapssl40, main, LIBS="-lldapssl40 $LIBS" found_ldap_lib=yes need_pthread=true,, -lpthread)
  fi
fi
if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \); then
  AC_CHECK_LIB(ldapssl30, main, LIBS="-lldapssl30 $LIBS" found_ldap_lib=yes need_pthread=true,, -lpthread)
fi

if test -z "$found_ldap_lib"; then
  AC_MSG_ERROR(could not locate a valid LDAP library)
fi

if test "$need_pthread" = "true"; then
  AC_CHECK_LIB(pthread, main)
fi

AC_CHECK_FUNCS(ldap_init ldap_get_lderrno ldap_parse_result ldap_memfree ldap_controls_free ldap_set_option ldap_get_option)
if test "$enable_ssl" \!= "no"; then
  AC_CHECK_FUNCS(ldapssl_init ldap_start_tls_s ldap_pvt_tls_set_option)
fi
AC_CHECK_FUNCS(ldap_initialize)
AC_CHECK_FUNCS(gethostbyname_r)

if test "$ac_cv_func_gethostbyname_r" = "yes"; then
AC_CACHE_CHECK(whether gethostbyname_r takes 6 arguments, pam_ldap_cv_gethostbyname_r_args, [
AC_TRY_COMPILE([
#include <netdb.h>], [gethostbyname_r(0, 0, 0, 0, 0, 0);], [pam_ldap_cv_gethostbyname_r_args=6], [pam_ldap_cv_gethostbyname_r_args=5]) ])
AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $pam_ldap_cv_gethostbyname_r_args)
fi

AC_CHECK_FUNCS(ldap_set_rebind_proc)
AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, pam_ldap_cv_ldap_set_rebind_proc, [
AC_TRY_COMPILE([
#include <lber.h>
#include <ldap.h>], [ldap_set_rebind_proc(0, 0, 0);], [pam_ldap_cv_ldap_set_rebind_proc=3], [pam_ldap_cv_ldap_set_rebind_proc=2]) ])
AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $pam_ldap_cv_ldap_set_rebind_proc)

AC_OUTPUT(Makefile)