"Fossies" - the Fresh Open Source Software Archive 
Member "nss_ldap-265/configure.in" (6 Nov 2009, 13731 Bytes) of package /linux/privat/old/nss_ldap-265.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 AC_INIT(ldap-nss.c)
2 AC_CANONICAL_SYSTEM
3 AC_PREFIX_DEFAULT()
4
5 AM_INIT_AUTOMAKE(nss_ldap, 265)
6 AM_CONFIG_HEADER(config.h)
7 AM_MAINTAINER_MODE
8
9 AC_PROG_CC
10 AC_PROG_CPP
11 AC_PROG_INSTALL
12
13 dnl
14 dnl --enable-rfc2307bis is now deprecated; if this option is set,
15 dnl then RFC2307bis support will be enabled by default. However
16 dnl it can now always be enabled at runtime with the nss_schema
17 dnl keyword. See nss_ldap(5) for more information.
18 dnl
19 AC_ARG_ENABLE(rfc2307bis, [ --enable-rfc2307bis use RFC2307bis schema by default ], [AC_DEFINE(RFC2307BIS)])
20
21 dnl
22 dnl --enable-schema-mapping is no longer necessary as schema
23 dnl mapping is enabled by default
24 dnl
25 dnl AC_ARG_ENABLE(schema-mapping, [ --enable-schema-mapping enable attribute/objectclass mapping ], [AC_DEFINE(AT_OC_MAP)])
26 dnl
27
28 AC_ARG_ENABLE(debugging, [ --enable-debugging enable debug code ], [AC_DEFINE(DEBUG)])
29
30 dnl
31 dnl --enable-paged-results is now deprecated; if this option is set,
32 dnl then paged results will be enabled by default. However, it can
33 dnl now always be enabled at runtime (as long as the underlying LDAP
34 dnl library supports ldap_search_ext()) with the nss_paged_results
35 dnl keyword. See nss_ldap(5) for more information
36 dnl
37 AC_ARG_ENABLE(paged-results, [ --enable-paged-results use paged results control by default ], [AC_DEFINE(PAGE_RESULTS)])
38
39 dnl
40 dnl XXX TODO make configurable-krb5-ccname-* configurable at runtime
41 dnl
42 AC_ARG_ENABLE(configurable-krb5-ccname-env, [ --enable-configurable-krb5-ccname-env enable configurable Kerberos V credentials cache name (putenv method)], [AC_DEFINE(CONFIGURE_KRB5_CCNAME) AC_DEFINE(CONFIGURE_KRB5_CCNAME_ENV)])
43 AC_ARG_ENABLE(configurable-krb5-ccname-gssapi, [ --enable-configurable-krb5-ccname-gssapi enable configurable Kerberos V credentials cache name (gssapi method)], [AC_DEFINE(CONFIGURE_KRB5_CCNAME) AC_DEFINE(CONFIGURE_KRB5_CCNAME_GSSAPI)])
44 AC_ARG_ENABLE(configurable-krb5-keytab, [ --enable-configurable-krb5-keytab enable configurable Kerberos V keytab file name], [AC_DEFINE(CONFIGURE_KRB5_KEYTAB)])
45
46 AC_ARG_WITH(ldap-lib, [ --with-ldap-lib=type select ldap library [auto|netscape5|netscape4|netscape3|umich|openldap]])
47 AC_ARG_WITH(ldap-dir, [ --with-ldap-dir=DIR base directory of LDAP SDK])
48 AC_ARG_WITH(ldap-conf-file, [ --with-ldap-conf-file path to LDAP configuration file],
49 [ NSS_LDAP_PATH_CONF="$with_ldap_conf_file" ],
50 [ NSS_LDAP_PATH_CONF="/etc/ldap.conf" ])
51 AC_ARG_WITH(ldap-secret-file, [ --with-ldap-secret-file path to LDAP root secret file],
52 [ NSS_LDAP_PATH_ROOTPASSWD="$with_ldap_secret_file" ],
53 [ NSS_LDAP_PATH_ROOTPASSWD="/etc/ldap.secret" ])
54 AC_ARG_WITH(gssapi-dir, [ --with-gssapi-dir=DIR base directory of gssapi SDK])
55 AC_ARG_WITH(ngroups, [ --with-ngroups=num average group size hint, experts only], [AC_DEFINE_UNQUOTED(LDAP_NSS_NGROUPS, $with_ngroups)])
56
57 AC_DEFINE_UNQUOTED(NSS_LDAP_PATH_CONF, "$NSS_LDAP_PATH_CONF")
58 AC_DEFINE_UNQUOTED(NSS_LDAP_PATH_ROOTPASSWD, "$NSS_LDAP_PATH_ROOTPASSWD")
59 AC_SUBST(NSS_LDAP_PATH_CONF)
60 AC_SUBST(NSS_LDAP_PATH_ROOTPASSWD)
61
62 if test "$ac_cv_prog_gcc" = "yes"; then CFLAGS="$CFLAGS -Wall -fPIC"; fi
63
64 dnl This is needed for the native Solaris LDAP SDK and
65 dnl OpenLDAP 2.2, respectively
66 CPPFLAGS="$CPPFLAGS -DLDAP_REFERRALS -DLDAP_DEPRECATED"
67
68 case "$target_os" in
69 freebsd*) CPPFLAGS="$CPPFLAGS -DPIC -D_REENTRANT" ;;
70 aix*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
71 *) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
72 esac
73
74 # Always use native linker on Solaris and AIX
75 # but only invoke directly if compiling with gcc (?)
76
77 case "$target_os" in
78 aix*) if test "$ac_cv_prog_gcc" = "yes"; then
79 nss_ldap_so_LD="/usr/bin/ld"
80 fi
81 LDFLAGS="$LDFLAGS -Wl,-brtl"
82 nss_ldap_so_LDFLAGS="-bM:SRE -bnoentry -bE:\$(srcdir)/exports.aix -brtl -lc"
83 NSS_LDAP_LDFLAGS="-bM:SRE -enss_ldap_initialize -brtl -lc"
84 CPPFLAGS="$CPPFLAGS -I."
85 need_pthread=yes
86 TARGET_OS=AIX ;;
87 solaris*) if test "$ac_cv_prog_gcc" = yes; then
88 nss_ldap_so_LD="/usr/ccs/bin/ld"
89 fi
90 nss_ldap_so_LDFLAGS="-Bdirect -z nodelete -Bdynamic -M \$(srcdir)/exports.solaris -G" ;;
91 hpux*) if test "$ac_cv_prog_gcc" = yes; then
92 nss_ldap_so_LD="/bin/ld"
93 fi
94 nss_ldap_so_LDFLAGS="-b -dynamic -G `cat exports.hpux`"
95 CPPFLAGS="$CPPFLAGS -I. -DHPUX"
96 TARGET_OS=HPUX ;;
97 linux*) nss_ldap_so_LDFLAGS="-shared -Wl,-Bdynamic -Wl,--version-script,\$(srcdir)/exports.linux" ;;
98 *) nss_ldap_so_LDFLAGS="-shared -Wl,-Bdynamic" ;;
99 esac
100
101 AM_CONDITIONAL(GCC, test "$GCC" = "yes")
102 AM_CONDITIONAL(GLIBC, test "$target_os" = "linux" -o "$target_os" = "linux-gnu")
103 AM_CONDITIONAL(AIX, test "$TARGET_OS" = AIX)
104 AM_CONDITIONAL(HPUX, test "$TARGET_OS" = HPUX)
105
106 AM_CONDITIONAL(USE_NATIVE_LINKER, test -n "$nss_ldap_so_LD")
107
108 # unfortunately the linker flags have to be defined twice for
109 # AIX as we can't force using the native linker for configure
110 # tests, and the gcc front-end does not understand native
111 # linker flags.
112 if test -n "$with_ldap_dir"; then
113 CPPFLAGS="$CPPFLAGS -I$with_ldap_dir/include"
114 LDFLAGS="$LDFLAGS -L$with_ldap_dir/lib"
115 case "$target_os" in
116 aix*) LDFLAGS="$LDFLAGS -Wl,-blibpath:$with_ldap_dir/lib"
117 nss_ldap_so_LDFLAGS="$nss_ldap_so_LDFLAGS -L$with_ldap_dir/lib -blibpath:$with_ldap_dir/lib"
118 NSS_LDAP_LDFLAGS="$NSS_LDAP_LDFLAGS -L$with_ldap_dir/lib -blibpath:$with_ldap_dir/lib" ;;
119 hpux*) LDFLAGS="$LDFLAGS -Wl,+b$with_ldap_dir/lib"
120 nss_ldap_so_LDFLAGS="$nss_ldap_so_LDFLAGS -L$with_ldap_dir/lib +b$with_ldap_dir/lib" ;;
121 solaris*) LDFLAGS="$LDFLAGS -R$with_ldap_dir/lib"
122 nss_ldap_so_LDFLAGS="$nss_ldap_so_LDFLAGS -L$with_ldap_dir/lib -R$with_ldap_dir/lib" ;;
123 *) LDFLAGS="$LDFLAGS -Wl,-rpath,$with_ldap_dir/lib" ;;
124 esac
125 fi
126 if test -n "$with_gssapi_dir"; then
127 CPPFLAGS="$CPPFLAGS -I$with_gssapi_dir/include"
128 LDFLAGS="$LDFLAGS -L$with_gssapi_dir/lib"
129 fi
130
131 AC_SUBST(nss_ldap_so_LD)
132 AC_SUBST(nss_ldap_so_LDFLAGS)
133 AC_SUBST(NSS_LDAP_LDFLAGS)
134
135 AC_CHECK_HEADERS(lber.h)
136 AC_CHECK_HEADERS(ldap.h, , AC_MSG_ERROR(could not locate <ldap.h>))
137 AC_CHECK_HEADERS(ldap_ssl.h)
138
139 dnl AC_MSG_CHECKING(for ldap_ssl.h)
140 dnl AC_TRY_COMPILE([#include <sys/types.h>
141 dnl #include <ldap.h>
142 dnl #include <ldap_ssl.h>], ,
143 dnl [
144 dnl AC_MSG_RESULT(yes),
145 dnl AC_DEFINE(HAVE_LDAP_SSL_H, 1)
146 dnl ],
147 dnl AC_MSG_RESULT(no))
148
149 # For HP-UX and AIX we use private API, the headers for which
150 # are included locally. We need to do something to stop both
151 # API being detected.
152 case "$target_os" in
153 aix*) AC_CHECK_HEADERS(irs.h usersec.h) ;;
154 hpux*) AC_CHECK_HEADERS(nsswitch.h) ;;
155 *) AC_CHECK_HEADERS(nss.h)
156 AC_CHECK_HEADERS(nsswitch.h)
157 AC_CHECK_HEADERS(irs.h) ;;
158 esac
159 AC_CHECK_HEADERS(thread.h)
160 AC_CHECK_HEADERS(pthread.h)
161 AC_CHECK_HEADERS(synch.h)
162 AC_CHECK_HEADERS(malloc.h)
163 AC_CHECK_HEADERS(shadow.h)
164 AC_CHECK_HEADERS(prot.h)
165 AC_CHECK_HEADERS(port_before.h)
166 AC_CHECK_HEADERS(port_after.h)
167 AC_CHECK_HEADERS(aliases.h)
168 AC_CHECK_HEADERS(net/route.h)
169 AC_CHECK_HEADERS(netinet/if_ether.h)
170 AC_CHECK_HEADERS(netinet/ether.h)
171 AC_CHECK_HEADERS(arpa/nameser.h)
172 AC_CHECK_HEADERS(arpa/nameser_compat.h)
173 AC_CHECK_HEADERS(ctype.h)
174 dnl AC_CHECK_HEADERS(db.h)
175 dnl AC_CHECK_HEADERS(db1/db.h)
176 dnl AC_CHECK_HEADERS(db_185.h)
177 dnl AC_CHECK_HEADERS(db3/db_185.h)
178 AC_CHECK_HEADERS(alignof.h)
179 AC_CHECK_HEADERS(rpc/rpcent.h)
180 AC_CHECK_HEADERS(sys/byteorder.h)
181 AC_CHECK_HEADERS(sys/un.h)
182 AC_CHECK_HEADERS(libc-lock.h)
183 AC_CHECK_HEADERS(bits/libc-lock.h)
184 AC_CHECK_HEADERS(sasl.h sasl/sasl.h)
185 AC_CHECK_HEADERS(strings.h)
186 AC_CHECK_HEADERS(gssldap.h)
187 AC_CHECK_HEADERS(gsssasl.h)
188 AC_CHECK_HEADERS(gssapi/gssapi_krb5.h gssapi.h)
189 AC_CHECK_HEADERS(krb5.h)
190
191 AC_CHECK_LIB(resolv, main)
192 AC_CHECK_LIB(nsl, main)
193 AC_CHECK_LIB(socket, main)
194
195 AC_CHECK_FUNCS(strtok_r)
196 AC_CHECK_FUNCS(sigaction)
197 AC_CHECK_FUNCS(sigset)
198 AC_CHECK_FUNCS(res_search)
199 AC_CHECK_FUNCS(dn_expand)
200 AC_CHECK_HEADERS(resolv.h)
201 if test x$ac_cv_func_res_search = xno ; then
202 AC_MSG_CHECKING([for res_search again])
203 AC_TRY_LINK([#ifdef HAVE_RESOLV_H
204 #include <resolv.h>
205 #endif
206 #ifdef HAVE_STDLIB_H
207 #include <stdlib.h>
208 #endif],
209 [res_search(NULL,0,0,NULL,0);],
210 AC_DEFINE(HAVE_RES_SEARCH,1,
211 [Define if you have res_search().])
212 ac_cv_func_res_search=yes)
213 AC_CHECK_FUNCS(res_search)
214 fi
215 if test x$ac_cv_func_dn_expand = xno ; then
216 AC_MSG_CHECKING([for dn_expand again])
217 AC_TRY_LINK([#ifdef HAVE_RESOLV_H
218 #include <resolv.h>
219 #endif
220 #ifdef HAVE_STDLIB_H
221 #include <stdlib.h>
222 #endif],
223 [dn_expand(NULL,NULL,NULL,NULL,0);],
224 AC_DEFINE(HAVE_DN_EXPAND,1,
225 [Define if you have dn_expand().])
226 ac_cv_func_dn_expand=yes)
227 AC_CHECK_FUNCS(dn_expand)
228 fi
229 AC_CHECK_FUNCS(snprintf)
230 AC_CHECK_FUNCS(gethostbyname)
231 AC_CHECK_FUNCS(nsdispatch)
232 AC_CHECK_LIB(pthread_nonshared, main)
233 AC_CHECK_FUNCS(pthread_atfork)
234 AC_CHECK_FUNCS(pthread_once)
235 AC_CHECK_FUNCS(ether_aton)
236 AC_CHECK_FUNCS(ether_ntoa)
237
238 AC_MSG_CHECKING(for struct ether_addr)
239 AC_TRY_COMPILE([#include <sys/types.h>
240 #include <sys/socket.h>
241 #include <net/if.h>
242 #include <netinet/in.h>
243 #include <netinet/if_ether.h>],
244 [struct ether_addr x;],
245 [
246 AC_MSG_RESULT(yes)
247 AC_DEFINE(HAVE_STRUCT_ETHER_ADDR, 1)
248 ],
249 AC_MSG_RESULT(no))
250
251 AC_MSG_CHECKING(for socklen_t)
252 AC_TRY_COMPILE([#include <sys/types.h>
253 #include <sys/socket.h>],
254 [socklen_t len;],
255 [
256 AC_MSG_RESULT(yes)
257 AC_DEFINE(HAVE_SOCKLEN_T, 1)
258 ],
259 AC_MSG_RESULT(no))
260
261 AC_MSG_CHECKING(for pw_change in struct passwd)
262 AC_TRY_COMPILE([#include <pwd.h>],
263 [struct passwd pwd; time_t t = pwd.pw_change],
264 [
265 AC_MSG_RESULT(yes)
266 AC_DEFINE(HAVE_PASSWD_PW_CHANGE, 1)
267 ],
268 AC_MSG_RESULT(no))
269 AC_MSG_CHECKING(for pw_expire in struct passwd)
270 AC_TRY_COMPILE([#include <pwd.h>],
271 [struct passwd pwd; time_t t = pwd.pw_expire],
272 [
273 AC_MSG_RESULT(yes)
274 AC_DEFINE(HAVE_PASSWD_PW_EXPIRE, 1)
275 ],
276 AC_MSG_RESULT(no))
277
278 dnl check which ldap library we have
279 dnl check which ldap library we have
280 if test -z "$with_ldap_lib"; then
281 with_ldap_lib=auto
282 fi
283
284 AC_CHECK_SIZEOF([unsigned int])
285 AC_CHECK_SIZEOF([unsigned long])
286 AC_CHECK_SIZEOF([uid_t],,[#include <pwd.h>])
287 AC_CHECK_SIZEOF([gid_t],,[#include <grp.h>])
288
289 AC_CHECK_LIB(dl, dlopen,[LIBS="-ldl $LIBS"],,$LIBS)
290 dnl AC_CHECK_LIB(db, main,[LIBS="-ldb $LIBS"],,$LIBS)
291
292 AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,[LIBS="-lgssapi $LIBS" found_gssapi_lib=yes],,$LIBS)
293 if test -z "$found_gssapi_lib"; then
294 AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,[LIBS="-lgssapi_krb5 $LIBS"],,$LIBS)
295 fi
296
297 dnl Following checks probably not strictly necessary.
298 dnl AC_CHECK_LIB(crypto, main,[LIBS="-lcrypto $LIBS"],,$LIBS)
299 dnl AC_CHECK_LIB(ssl, main,[LIBS="-lssl $LIBS"],,$LIBS)
300 AC_CHECK_LIB(com_err, main,[LIBS="-lcom_err $LIBS"],,$LIBS)
301 dnl AC_CHECK_LIB(k5crypto, main,[LIBS="-lk5crypto $LIBS"],,$LIBS)
302 AC_CHECK_LIB(krb5, main,[LIBS="-lkrb5 $LIBS"],,$LIBS)
303 dnl AC_CHECK_LIB(krb4, main,[LIBS="-lkrb4 $LIBS"],,$LIBS)
304 AC_CHECK_LIB(sasl2, sasl_client_init)
305
306 if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \); then
307 AC_CHECK_LIB(lber, main)
308 AC_CHECK_LIB(ldap, main, [LIBS="-lldap $LIBS" found_ldap_lib=yes],,$LIBS)
309 fi
310 if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then
311 AC_CHECK_LIB(ldap50, main, LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread)
312 fi
313 if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \); then
314 AC_CHECK_LIB(ldapssl41, main, LIBS="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread)
315 if test -z "$found_ldap_lib"; then
316 AC_CHECK_LIB(ldapssl40, main, LIBS="-lldapssl40 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread)
317 fi
318 if test -z "$found_ldap_lib"; then
319 AC_CHECK_LIB(ldap41, main, LIBS="-lldap41 $LIBS" found_ldap_lib=yes need_pthread=no,,)
320 fi
321 if test -z "$found_ldap_lib"; then
322 AC_CHECK_LIB(ldap40, main, LIBS="-lldap40 $LIBS" found_ldap_lib=yes need_pthread=no,,)
323 fi
324 fi
325 if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \); then
326 AC_CHECK_LIB(ldapssl30, main, LIBS="-lldapssl30 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread)
327 fi
328
329 if test -z "$found_ldap_lib"; then
330 AC_MSG_ERROR(could not locate a valid LDAP library)
331 fi
332
333 if test "$need_pthread" = "yes"; then
334 AC_CHECK_LIB(pthread, main)
335 fi
336
337 AC_CHECK_LIB(gssldap, ldap_gss_bind,[LIBS="-lgssldap $LIBS"],,$LIBS)
338
339 AC_CHECK_FUNCS(sasl_auxprop_request)
340 AC_CHECK_FUNCS(ldap_init ldap_get_lderrno ldap_parse_result ldap_memfree ldap_controls_free)
341 AC_CHECK_FUNCS(ldap_ld_free ldap_explode_rdn ldap_set_option ldap_get_option)
342 AC_CHECK_FUNCS(ldap_sasl_interactive_bind_s ldap_initialize ldap_search_ext)
343 AC_CHECK_FUNCS(ldap_create_control ldap_create_page_control ldap_parse_page_control)
344 if test "$enable_ssl" \!= "no"; then
345 AC_CHECK_FUNCS(ldapssl_client_init ldap_start_tls_s ldap_pvt_tls_set_option ldap_start_tls)
346 fi
347 AC_CHECK_FUNCS(gethostbyname_r)
348
349 if test "$ac_cv_func_gethostbyname_r" = "yes"; then
350 AC_CACHE_CHECK(whether gethostbyname_r takes 6 arguments, nss_ldap_cv_gethostbyname_r_args, [
351 AC_TRY_COMPILE([
352 #include <netdb.h>], [gethostbyname_r(0, 0, 0, 0, 0, 0);], [nss_ldap_cv_gethostbyname_r_args=6], [nss_ldap_cv_gethostbyname_r_args=5]) ])
353 AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $nss_ldap_cv_gethostbyname_r_args)
354 fi
355
356 AC_CHECK_FUNCS(ldap_set_rebind_proc)
357 AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, nss_ldap_cv_ldap_set_rebind_proc, [
358 AC_TRY_COMPILE([
359 #include <lber.h>
360 #include <ldap.h>], [ldap_set_rebind_proc(0, 0, 0);], [nss_ldap_cv_ldap_set_rebind_proc=3], [nss_ldap_cv_ldap_set_rebind_proc=2]) ])
361 AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $nss_ldap_cv_ldap_set_rebind_proc)
362
363 AC_OUTPUT(Makefile)