~ubuntu-branches/ubuntu/precise/nss-pam-ldapd/precise-security

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Package Import Robot
  • Author(s): Arthur de Jong
  • Date: 2011-09-04 21:00:00 UTC
  • mfrom: (14.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20110904210000-pe3u91iga88vtr16
Tags: 0.8.4
* Upload to unstable
* switch to using the member attribute by default instead of
  uniqueMember (backwards incompatible change)
* only return "x" as a password hash when the object has the shadowAccount
  objectClass and nsswitch.conf is configured to do shadow lookups using
  LDAP (this avoids some problems with pam_unix)
* fix problem with partial attribute name matches in DN (thanks Timothy
  White)
* fix a problem with objectSid mappings with recent versions of OpenLDAP
  (patch by Wesley Mason)
* set the socket timeout in a connection callback to avoid timeout
  issues during the SSL handshake (patch by Stefan Völkel)
* check for unknown variables in pam_authz_search
* only check password expiration when authenticating, only check account
  expiration when doing authorisation
* make buffer sizes consistent and grow all buffers holding string
  representations of numbers to be able to hold 64-bit numbers
* update AX_PTHREAD from autoconf-archive
* support querying DNS SRV records from a different domain than the current
  one (based on a patch by James M. Leddy)
* fix a problem with uninitialised memory while parsing the tls_ciphers
  option (closes: #638872) (but doesn't work yet due to #640384)
* implement bounds checking of numeric values read from LDAP (patch by
  Jakub Hrozek)
* correctly support large uid and gid values from LDAP (patch by Jakub
  Hrozek)
* improvements to the configure script (patch by Jakub Hrozek)
* switch to dh for debian/rules and bump debhelper compatibility to 8
* build Debian packages with multiarch support
* ship shlibs (but still no symbol files) for libnss-ldapd since that was
  the easiest way to support multiarch
* fix output in init script when restarting nslcd (closes: #637132)
* correctly handle leading and trailing spaces in preseeded debconf uri
  option (patch by Andreas B. Mundt) (closes: #637863)
* support spaces around database names in /etc/nsswitch.conf while
  configuring package (closes: #640185)
* updated Russian debconf translation by Yuri Kozlov (closes: #637751)
* updated French debconf translation by Christian Perrier (closes: #637756)
* added Slovak debconf translation by Slavko (closes: #637759)
* updated Danish debconf translation by Joe Hansen (closes :#637763)
* updated Brazilian Portuguese debconf translation by Denis Doria
* updated Portuguese debconf translation by Américo Monteiro
* updated Japanese debconf translation by Kenshi Muto (closes: #638195)
* updated Czech debconf translation by Miroslav Kure (closes: #639026)
* updated German debconf translation by Chris Leick (closes: #639107)
* updated Spanish debconf translation by Francisco Javier Cuadrado
  (closes: #639236)
* updated Dutch debconf translation by Arthur de Jong with help from Paul
  Gevers and Jeroen Schot

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# Copyright (C) 2006 Luke Howard
4
4
# Copyright (C) 2006 West Consulting
5
 
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Arthur de Jong
 
5
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Arthur de Jong
6
6
#
7
7
# This library is free software; you can redistribute it and/or
8
8
# modify it under the terms of the GNU Lesser General Public
23
23
AC_COPYRIGHT(
24
24
[Copyright (C) 2006 Luke Howard
25
25
Copyright (C) 2006 West Consulting
26
 
Copyright (C) 2006, 2007, 2008, 2009, 2010 Arthur de Jong
 
26
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Arthur de Jong
27
27
 
28
28
This configure script is derived from configure.ac which is free software;
29
29
you can redistribute it and/or modify it under the terms of the GNU Lesser
32
32
configure.ac file for more details.])
33
33
 
34
34
# initialize and set version and bugreport address
35
 
AC_INIT([nss-pam-ldapd],[0.7.13],[nss-pam-ldapd-users@lists.arthurdejong.org])
36
 
RELEASE_MONTH="Dec 2010"
 
35
AC_INIT([nss-pam-ldapd],
 
36
        [0.8.4],
 
37
        [nss-pam-ldapd-users@lists.arthurdejong.org],,
 
38
        [http://arthurdejong.org/nss-pam-ldapd/])
 
39
RELEASE_MONTH="Sep 2011"
37
40
AC_SUBST(RELEASE_MONTH)
38
41
AC_CONFIG_SRCDIR([nslcd.h])
39
42
 
 
43
# define package URL (remove when switching to 2.64)
 
44
m4_ifndef([AC_PACKAGE_URL],
 
45
          PACKAGE_URL="http://arthurdejong.org/nss-pam-ldapd/"
 
46
          [AC_DEFINE_UNQUOTED([PACKAGE_URL],"$PACKAGE_URL",[Define to the home page for this package.])
 
47
           AC_SUBST(PACKAGE_URL)])
 
48
 
40
49
# some initialisation
41
50
AC_CANONICAL_TARGET
42
51
AC_PREFIX_DEFAULT()
56
65
AC_PROG_RANLIB
57
66
AM_PROG_CC_C_O
58
67
AC_USE_SYSTEM_EXTENSIONS
 
68
AC_PROG_LN_S
59
69
 
60
70
# checks for tool to convert docbook to man
61
71
AC_PATH_PROGS(DOCBOOK2X_MAN, docbook2x-man)
83
93
                 DESIRED_CFLAGS="$DESIRED_CFLAGS -Wextra -Wdeclaration-after-statement -Werror-implicit-function-declaration"
84
94
               fi])
85
95
test_gcc_flag() {
86
 
  AC_LANG_CONFTEST([int main() {}])
 
96
  AC_LANG_CONFTEST([AC_LANG_PROGRAM([int main() {}])])
87
97
  $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
88
98
  ret=$?
89
99
  rm -f conftest.o
123
133
AM_CONDITIONAL([ENABLE_PAM], [test "x$enable_pam" = "xyes"])
124
134
 
125
135
# check whether the nslcd daemon should be built
126
 
AC_MSG_CHECKING([whether to build the nslcd server])
 
136
AC_MSG_CHECKING([whether to build the nslcd daemon])
127
137
AC_ARG_ENABLE(nslcd,
128
138
              AS_HELP_STRING([--disable-nslcd],
129
 
                             [build the nslcd server [[default=enabled]]]),,
 
139
                             [build the nslcd daemon [[default=enabled]]]),,
130
140
              [enable_nslcd="yes"])
131
141
AC_MSG_RESULT($enable_nslcd)
132
142
AM_CONDITIONAL([ENABLE_NSLCD], [test "x$enable_nslcd" = "xyes"])
133
143
 
 
144
# check whether the Python version of the nslcd daemon should be built
 
145
AC_MSG_CHECKING([whether to build the pynslcd daemon])
 
146
AC_ARG_ENABLE(pynslcd,
 
147
              AS_HELP_STRING([--enable-pynslcd],
 
148
                             [build the pynslcd daemon [[default=disabled]]]),,
 
149
              [enable_pynslcd="no"])
 
150
AC_MSG_RESULT($enable_pynslcd)
 
151
AM_CONDITIONAL([ENABLE_PYNSLCD], [test "x$enable_pynslcd" = "xyes"])
 
152
if test "x$enable_pynslcd" = "xyes"
 
153
then
 
154
  AC_MSG_WARN([the pynslcd daemon is experimental])
 
155
fi
 
156
 
134
157
# check whether SASL support should be enabled
135
158
AC_MSG_CHECKING([whether to enable SASL support])
136
159
AC_ARG_ENABLE(sasl,
160
183
if test "x$configfile_checking" = "xyes"
161
184
then
162
185
  AC_DEFINE(ENABLE_CONFIGFILE_CHECKING,1,[Whether to check configfile options.])
 
186
  AC_SUBST(ENABLE_CONFIGFILE_CHECKING,1)
163
187
fi
164
188
 
165
189
# check the name of the configuration file
198
222
AC_DEFINE_UNQUOTED(NSLCD_SOCKET,"$NSLCD_SOCKET",[The location of the socket used for communicating.])
199
223
AC_SUBST(NSLCD_SOCKET)
200
224
 
 
225
# the directory PAM librabries are expected to be placed into
 
226
AC_ARG_WITH(pam-seclib-dir,
 
227
            AS_HELP_STRING([--with-pam-seclib-dir=PAM_SECLIB_DIR],
 
228
                           [path to PAM security library @<:@/lib/security@:>@]),
 
229
            [ PAM_SECLIB_DIR="$with_pam_seclib_dir" ],
 
230
            [ PAM_SECLIB_DIR="/lib/security" ])
 
231
AC_DEFINE_UNQUOTED(PAM_SECLIB_DIR,"$PAM_SECLIB_DIR",[path to PAM security library])
 
232
AC_SUBST(PAM_SECLIB_DIR)
 
233
 
201
234
# the SONAME to use for the NSS module
 
235
AC_MSG_CHECKING([name of NSS module])
202
236
AC_ARG_WITH(nss-ldap-soname,
203
237
            AS_HELP_STRING([--with-nss-ldap-soname=SONAME],
204
 
                           [name of NSS module @<:@libnss_ldap.so.2@:>@]),
 
238
                           [name of NSS module @<:@auto@:>@]),
205
239
            [ NSS_LDAP_SONAME="$with_nss_ldap_soname" ],
206
 
            [ NSS_LDAP_SONAME="libnss_ldap.so.2" ])
 
240
            [ NSS_LDAP_SONAME="auto" ])
 
241
if test "x$NSS_LDAP_SONAME" = "xauto"
 
242
then
 
243
  case "$target_os" in
 
244
    solaris*) NSS_LDAP_SONAME="nss_ldap.so.1" ;;
 
245
    freebsd*) NSS_LDAP_SONAME="nss_ldap.so.1" ;;
 
246
    *)        NSS_LDAP_SONAME="libnss_ldap.so.2" ;;
 
247
  esac
 
248
fi
 
249
AC_MSG_RESULT($NSS_LDAP_SONAME)
207
250
AC_DEFINE_UNQUOTED(NSS_LDAP_SONAME,"$NSS_LDAP_SONAME",[The SONAME of the NSS library module.])
208
251
AC_SUBST(NSS_LDAP_SONAME)
209
252
 
 
253
# the SONAME to use for the PAM module
 
254
AC_MSG_CHECKING([name of PAM module])
 
255
AC_ARG_WITH(pam-ldap-soname,
 
256
            AS_HELP_STRING([--with-pam-ldap-soname=SONAME],
 
257
                           [name of PAM module @<:@auto@:>@]),
 
258
            [ PAM_LDAP_SONAME="$with_pam_ldap_soname" ],
 
259
            [ PAM_LDAP_SONAME="auto" ])
 
260
if test "x$PAM_LDAP_SONAME" = "xauto"
 
261
then
 
262
  case "$target_os" in
 
263
    solaris*) PAM_LDAP_SONAME="pam_ldap.so.1" ;;
 
264
    *)        PAM_LDAP_SONAME="pam_ldap.so" ;;
 
265
  esac
 
266
fi
 
267
AC_MSG_RESULT($PAM_LDAP_SONAME)
 
268
AC_SUBST(PAM_LDAP_SONAME)
 
269
 
 
270
# check which modules should be build
 
271
AC_ARG_WITH(nss-maps,
 
272
            AS_HELP_STRING([--with-nss-maps=MAP LIST],
 
273
                           [comma separated list of NSS maps to build @<:@all@:>@]),
 
274
            ,[ with_nss_maps="all" ])
 
275
 
210
276
# checks for availability of header files
211
277
AC_CHECK_HEADERS([ctype.h strings.h pthread.h fcntl.h limits.h])
212
278
AC_CHECK_HEADERS([nss.h nss_common.h grp.h shadow.h aliases.h netdb.h rpc/rpcent.h])
213
279
AC_CHECK_HEADERS([netinet/ether.h arpa/inet.h netinet/in.h])
 
280
AC_CHECK_HEADERS([nsswitch.h nss_dbdefs.h])
214
281
AC_CHECK_HEADERS([sys/socket.h sys/un.h sys/ucred.h ucred.h sys/param.h sys/time.h])
215
282
AC_CHECK_HEADERS([getopt.h syslog.h])
216
283
 
222
289
AC_CHECK_FUNCS([sigaction snprintf])
223
290
AC_CHECK_FUNCS(gethostbyname)
224
291
AC_SEARCH_LIBS(socket,socket)
225
 
AC_CHECK_FUNCS([strcasecmp strncasecmp strchr strcspn strspn strtol])
 
292
AC_CHECK_FUNCS([strcasecmp strncasecmp strchr strcspn strspn strtol strtoul strtoull])
226
293
AC_CHECK_FUNCS([malloc realloc])
227
294
AC_FUNC_FORK
 
295
AC_CHECK_FUNCS(__assert_fail)
228
296
 
229
297
# checks for types
230
298
AC_TYPE_MODE_T
235
303
AC_TYPE_UINT8_T
236
304
AC_TYPE_UINT16_T
237
305
AC_TYPE_UINT32_T
 
306
AC_CHECK_SIZEOF(unsigned int)
 
307
AC_CHECK_SIZEOF(unsigned long int)
 
308
AC_CHECK_SIZEOF(unsigned long long int)
 
309
AC_CHECK_SIZEOF(uid_t)
 
310
AC_CHECK_SIZEOF(gid_t)
238
311
 
239
312
# check for support for the __thread keyword
240
313
AC_CACHE_CHECK([whether $CC supports '__thread'], [mn_cv_c___thread_supported],
241
 
               [AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[static __thread i;]], []),
 
314
               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[static __thread i;]], [])],
242
315
                       [mn_cv_c___thread_supported=yes],
243
316
                       [mn_cv_c___thread_supported=no])])
244
317
if test $mn_cv_c___thread_supported != yes
247
320
  AC_DEFINE(__thread,,[Define to empty if compiler does not support `__thread' keyword.])
248
321
fi
249
322
 
250
 
# check how to pass a symbol map to the linker
251
 
AC_MSG_CHECKING([how linker wants the symbol map])
252
 
if $CC -Wl,--help 2>&1 | grep -- --version-script >/dev/null
253
 
then
254
 
  VERSION_SCRIPT_FLAG="-Wl,--version-script,"
255
 
  AC_SUBST(VERSION_SCRIPT_FLAG)
256
 
  AC_MSG_RESULT([--version-script])
257
 
elif $CC -Wl,--help 2>&1 | grep -- '-M mapfile' >/dev/null
258
 
then
259
 
  VERSION_SCRIPT_FLAG="-Wl,-M,"
260
 
  AC_SUBST(VERSION_SCRIPT_FLAG)
261
 
  AC_MSG_RESULT([-M])
262
 
else
263
 
  AC_MSG_RESULT([unknown, not passing symbol map])
264
 
fi
265
 
AM_CONDITIONAL([HAVE_VERSION_SCRIPT_FLAG], [test "x${VERSION_SCRIPT_FLAG}" != x])
266
 
 
267
323
# check for support for the struct ether_addr structure
268
324
AC_CHECK_TYPES(struct ether_addr,,,[
 
325
    #include <sys/types.h>
 
326
    #include <sys/socket.h>
 
327
    #include <net/if.h>
 
328
    #include <netinet/in.h>
 
329
    #include <netinet/if_ether.h>
 
330
    #ifdef HAVE_NETINET_ETHER_H
 
331
    #include <netinet/ether.h>
 
332
    #endif])
 
333
 
 
334
# check for ether_aton and ether_ntoa functions
 
335
AC_CHECK_FUNCS(ether_aton ether_ntoa ether_aton_r ether_ntoa_r)
 
336
AC_CHECK_DECLS([ether_aton,ether_ntoa],,,[
 
337
    #include <sys/types.h>
269
338
    #include <sys/socket.h>
270
339
    #include <net/if.h>
271
340
    #include <netinet/in.h>
310
379
      #include <rpc/rpcent.h>
311
380
      #endif])
312
381
 
313
 
  # check for a definition of enum nss_status
314
 
  AC_CHECK_TYPES(enum nss_status,,,[
 
382
  # check for a definition of enum nss_status and nss_backend_t
 
383
  AC_CHECK_TYPES([enum nss_status,nss_backend_t],,,[
315
384
      #ifdef HAVE_NSS_H
316
385
      #include <nss.h>
317
386
      #endif
318
387
      #ifdef HAVE_NSS_COMMON_H
319
388
      #include <nss_common.h>
 
389
      #endif
 
390
      #ifdef HAVE_NSS_DBDEFS_H
 
391
      #include <nss_dbdefs.h>
 
392
      #endif
 
393
      #ifdef HAVE_NSSWITCH_H
 
394
      #include <nsswitch.h>
 
395
      #endif
 
396
      #ifdef HAVE_IRS_NSS_H
 
397
      #include "irs-nss.h"
320
398
      #endif])
321
399
 
 
400
  # check if struct nss_XbyY_args has a returnlen attribute
 
401
  AC_CHECK_MEMBERS([struct nss_XbyY_args.returnlen],,,[[
 
402
      #ifdef HAVE_NSS_H
 
403
      #include <nss.h>
 
404
      #endif
 
405
      #ifdef HAVE_NSS_COMMON_H
 
406
      #include <nss_common.h>
 
407
      #endif
 
408
      #ifdef HAVE_NSS_DBDEFS_H
 
409
      #include <nss_dbdefs.h>
 
410
      #endif
 
411
      #ifdef HAVE_NSSWITCH_H
 
412
      #include <nsswitch.h>
 
413
      #endif
 
414
      #ifdef HAVE_IRS_NSS_H
 
415
      #include "irs-nss.h"
 
416
      #endif]])
 
417
 
 
418
  # check which NSS flavour to build
 
419
  AC_MSG_CHECKING([which NSS flavour to build])
 
420
  AC_ARG_WITH(nss-flavour,
 
421
              AS_HELP_STRING([--with-nss-flavour=auto|glibc|solaris|freebsd],
 
422
                             [the libc flavour to build our NSS module for @<:@auto@:>@]),,
 
423
              with_nss_flavour=auto)
 
424
  if test "x$with_nss_flavour" = "xauto"
 
425
  then
 
426
    # do the guessing game
 
427
    case "$target_os" in
 
428
      solaris*) with_nss_flavour=solaris ;;
 
429
      freebsd*) with_nss_flavour=freebsd ;;
 
430
      *)        with_nss_flavour=glibc ;;
 
431
    esac
 
432
  fi
 
433
  AC_MSG_RESULT($with_nss_flavour)
 
434
  case "$with_nss_flavour" in
 
435
    glibc)   AC_DEFINE(NSS_FLAVOUR_GLIBC,1,[Whether to use the Glibc NSS interface flavour.]) ;;
 
436
    solaris) AC_DEFINE(NSS_FLAVOUR_SOLARIS,1,[Whether to use the Solaris NSS interface flavour.]) ;;
 
437
    freebsd) AC_DEFINE(NSS_FLAVOUR_FREEBSD,1,[Whether to use the FreeBSD NSS interface flavour.]) ;;
 
438
  esac
 
439
 
 
440
  # check which module source files to use
 
441
  AC_MSG_CHECKING([which NSS maps to build])
 
442
  if test "x$with_nss_maps" = "xall"
 
443
  then
 
444
    case "$with_nss_flavour" in
 
445
      glibc)   with_nss_maps="aliases,ethers,group,hosts,netgroup,networks,passwd,protocols,rpc,services,shadow" ;;
 
446
      solaris) with_nss_maps="ethers,group,hosts,netgroup,networks,passwd,protocols,rpc,services,shadow" ;;
 
447
      freebsd) with_nss_maps="group,hosts,passwd" ;;
 
448
    esac
 
449
  fi
 
450
  AC_MSG_RESULT($with_nss_maps)
 
451
  NSS_MODULE_OBJS="$(echo "$with_nss_maps " | sed 's/,/ /g;s/  */.$(OBJEXT) /g')"
 
452
  AC_SUBST(NSS_MODULE_OBJS)
 
453
 
 
454
  # find out how to link the library
 
455
  nss_ldap_so_LINK="\$(CCLD) \$(AM_CFLAGS) \$(CFLAGS) \$(nss_ldap_so_LDFLAGS) \$(LDFLAGS) -o \$@"
 
456
  case "$target_os" in
 
457
  solaris*)
 
458
    if test "x$GCC" = xyes
 
459
    then
 
460
      nss_ldap_so_LINK="/usr/ccs/bin/ld -Bdirect -z nodelete -Bdynamic -M \$(srcdir)/exports.solaris -G -o \$@"
 
461
    else
 
462
      nss_ldap_so_LDFLAGS="-Wl,-Bdirect -Wl,-z,nodelete -Wl,-Bdynamic -Wl,-M,\$(srcdir)/exports.solaris -Wl,-G"
 
463
    fi
 
464
    ;;
 
465
  *)
 
466
    nss_ldap_so_LDFLAGS="-shared -Wl,-h,\$(NSS_LDAP_SONAME) -Wl,--version-script,\$(srcdir)/exports.$with_nss_flavour"
 
467
    ;;
 
468
  esac
 
469
  AC_SUBST(nss_ldap_so_LDFLAGS)
 
470
  AC_SUBST(nss_ldap_so_LINK)
 
471
 
322
472
  # restore CFLAGS and LIBS
323
473
  CFLAGS="$nss_save_CFLAGS"
324
474
  LIBS="$nss_save_LIBS"
356
506
  AC_REPLACE_FUNCS(pam_get_authtok pam_prompt)
357
507
  AC_CHECK_FUNCS(pam_modutil_getpwnam pam_syslog)
358
508
 
 
509
  # find out how to link the library
 
510
  pam_ldap_so_LINK="\$(CCLD) \$(AM_CFLAGS) \$(CFLAGS) \$(pam_ldap_so_LDFLAGS) \$(LDFLAGS) -o \$@"
 
511
  case "$target_os" in
 
512
  solaris*)
 
513
    if test "x$GCC" = xyes
 
514
    then
 
515
      pam_ldap_so_LINK="/usr/ccs/bin/ld -Bdirect -z nodelete -Bdynamic -M \$(srcdir)/pam_ldap.map -G -o \$@"
 
516
    else
 
517
      pam_ldap_so_LDFLAGS="-shared -Wl,-Bdirect -Wl,-z,nodelete -Wl,-Bdynamic -Wl,-M,\$(srcdir)/pam_ldap.map -Wl,-G"
 
518
    fi
 
519
    ;;
 
520
  *)
 
521
    pam_ldap_so_LDFLAGS="-shared -Wl,--version-script,\$(srcdir)/pam_ldap.map"
 
522
    ;;
 
523
  esac
 
524
  AC_SUBST(pam_ldap_so_LDFLAGS)
 
525
  AC_SUBST(pam_ldap_so_LINK)
 
526
 
359
527
  # restore CFLAGS and LIBS
360
528
  CFLAGS="$pam_save_CFLAGS"
361
529
  LIBS="$pam_save_LIBS"
386
554
  then
387
555
    AC_CHECK_HEADERS(gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h gssapi.h)
388
556
  fi
 
557
  AC_CHECK_HEADERS(regex.h)
389
558
 
390
559
  # checks for availability of system libraries for nslcd
391
560
  AC_SEARCH_LIBS(gethostbyname,nsl socket)
 
561
  AC_SEARCH_LIBS(hstrerror,resolv)
392
562
  AC_SEARCH_LIBS(socket,socket)
393
563
  AC_SEARCH_LIBS(dlopen,dl)
394
564
 
399
569
  AC_CHECK_FUNCS(__nss_configure_lookup)
400
570
  AC_CHECK_FUNCS(getenv putenv clearenv)
401
571
  AC_CHECK_FUNCS(dlopen dlsym dlerror)
 
572
  AC_CHECK_FUNCS(regcomp regexec regerror)
402
573
 
403
 
  # replace getopt_long() function if it is not on the system
 
574
  # replace some functions if they are not on the system
404
575
  AC_REPLACE_FUNCS(getopt_long)
 
576
  AC_REPLACE_FUNCS(strndup)
405
577
 
406
578
  # replace daemon() function if it is not on the system
407
579
  AC_SEARCH_LIBS(daemon,bsd)
408
580
  AC_REPLACE_FUNCS(daemon)
 
581
  AC_CHECK_DECLS([daemon],,,[#include <unistd.h>])
409
582
 
410
 
  # replace ether_ntoa_r() and ether_aton_r() if they are not found
411
 
  AC_CHECK_FUNCS(ether_aton_r ether_ntoa_r,,[AC_CHECK_FUNCS(ether_aton ether_ntoa)
412
 
                                             AC_LIBOBJ(ether)])
 
583
  # replace ether_aton_r() and ether_ntoa_r() if they are not found
 
584
  AC_CHECK_FUNCS(ether_aton_r ether_ntoa_r,,[AC_LIBOBJ(ether)])
413
585
 
414
586
  # check to see if struct sockaddr_storage is defined
415
587
  AC_CHECK_TYPE(struct sockaddr_storage,,
426
598
 
427
599
  # check threading stuff
428
600
  AX_PTHREAD(,AC_MSG_ERROR([no support for pthreads]))
429
 
  AC_CHECK_FUNCS(pthread_mutex_lock)
 
601
  pthread_save_CFLAGS="$CFLAGS"
 
602
  pthread_save_LIBS="$LIBS"
 
603
  CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 
604
  LIBS="$LIBS $PTHREAD_LIBS"
 
605
  AC_CHECK_FUNCS([pthread_mutex_lock pthread_join pthread_timedjoin_np])
 
606
  CFLAGS="$pthread_save_CFLAGS"
 
607
  LIBS="$pthread_save_LIBS"
 
608
 
 
609
  # also use deprecated LDAP functions
 
610
  AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)
 
611
  # for compatibility on Solaris
 
612
  AC_DEFINE(LDAP_REFERRALS, 1, Define to get some functions on Solaris)
430
613
 
431
614
  # search for an LDAP library (only OpenLDAP is tested)
432
615
  AC_ARG_WITH(ldap-lib,
479
662
        #elif defined(HAVE_SASL_H)
480
663
        #include <sasl.h>
481
664
        #endif])
482
 
    AC_SEARCH_LIBS(sasl_client_init,sasl2)
483
 
    AC_CHECK_FUNCS(sasl_auxprop_request ldap_sasl_interactive_bind_s)
 
665
    AC_SEARCH_LIBS(ldap_sasl_interactive_bind_s,sasl2)
 
666
    AC_CHECK_FUNCS(ldap_sasl_interactive_bind_s)
484
667
  fi
485
668
 
486
669
  # check for extra Kerberos libraries
487
670
  if test "$enable_kerberos" = "yes"
488
671
  then
489
672
    AC_SEARCH_LIBS(gss_krb5_ccache_name,gssapi gssapi_krb5)
490
 
    AC_SEARCH_LIBS(ldap_gss_bind,gssldap)
491
673
    AC_CHECK_FUNCS(gss_krb5_ccache_name)
492
674
  fi
493
675
 
504
686
 
505
687
  # replace ldap_create_page_control() and ldap_parse_page_control()
506
688
  AC_CHECK_FUNCS(ldap_create_page_control ldap_parse_page_control,,[AC_LIBOBJ(pagectrl)])
 
689
  AC_CHECK_DECLS(ldap_extended_operation_s,,,[
 
690
      #if HAVE_LBER_H
 
691
      #include <lber.h>
 
692
      #endif
 
693
      #include <ldap.h>])
507
694
 
508
695
  # replace other ldap functions
509
696
  AC_REPLACE_FUNCS(ldap_passwd_s)
557
744
  AC_SUBST(nslcd_LIBS)
558
745
fi
559
746
 
 
747
# pynslcd daemon-specific tests
 
748
if test "x$enable_pynslcd" = "xyes"
 
749
then
 
750
  # check Python interpreter
 
751
  AM_PATH_PYTHON(2.5)
 
752
fi
 
753
 
 
754
AM_CONDITIONAL([NSS_FLAVOUR_GLIBC], [test "x${with_nss_flavour}" = xglibc])
 
755
AM_CONDITIONAL([NSS_FLAVOUR_SOLARIS], [test "x${with_nss_flavour}" = xsolaris])
 
756
AM_CONDITIONAL([NSS_FLAVOUR_FREEBSD], [test "x${with_nss_flavour}" = xfreebsd])
 
757
 
560
758
# generate files
561
759
AC_CONFIG_FILES([Makefile compat/Makefile common/Makefile nss/Makefile
562
 
                 pam/Makefile nslcd/Makefile man/Makefile tests/Makefile])
 
760
                 pam/Makefile nslcd/Makefile pynslcd/Makefile pynslcd/config.py
 
761
                 man/Makefile tests/Makefile])
563
762
AC_OUTPUT