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

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Arthur de Jong
  • Date: 2009-12-28 13:30:00 UTC
  • Revision ID: james.westby@ubuntu.com-20091228133000-n0hyju3c5tmo8bjq
Tags: 0.7.2
* some attributes may be mapped to a shell-like expression that expand
  attributes from LDAP entries; this allows attributes overrides, defaults
  and much more (as a result the passwd cn attribute mapping has been
  removed because the gecos mapping is now "${gecos:-$cn}" by default)
* update the NSS module to follow the change in Glibc where the addr 
  parameter of getnetbyaddr_r() was changed from network-byte-order to
  host-byte-order
* properly escape searches for uniqueMember attributes for DN with a comma
  in an attribute value
* miscellaneous improvements to the configure script implementing better
  (and simpler) library detection
* some general refactoring and other miscellaneous improvements
* make configure check if we need to explicitly link to -llber
  (closes: #555779)
* libnss-ldapd: recommend libpam-krb5 as an alternative to libpam-ldapd for
  Kerberos environments
* updated Italian debconf translation by Vincenzo Campanella
  (closes: #556107)
* fix nslcd postrm to remove old config file (thanks piuparts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.1],[arthur@arthurdejong.org])
36
 
RELEASE_MONTH="Oct 2009"
 
35
AC_INIT([nss-pam-ldapd],[0.7.2],[arthur@arthurdejong.org])
 
36
RELEASE_MONTH="Dec 2009"
37
37
AC_SUBST(RELEASE_MONTH)
38
38
AC_CONFIG_SRCDIR([nslcd.h])
39
39
 
77
77
                             [enable extra compiler warnings (gcc)]),
78
78
              [if test "x$enableval" != "no"
79
79
               then
80
 
                 CFLAGS="$CFLAGS -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Waggregate-return -Wmissing-declarations -Wunused -Wformat=2 -Wswitch-default -Wswitch-enum -Wfloat-equal -Wbad-function-cast -Wunreachable-code -Wredundant-decls"
 
80
                 CFLAGS="$CFLAGS -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Waggregate-return -Wmissing-declarations -Wunused -Wformat=2 -Wswitch-default -Wswitch-enum -Wfloat-equal -Wbad-function-cast -Wredundant-decls"
81
81
                 DESIRED_CFLAGS="$DESIRED_CFLAGS -Wextra -Wdeclaration-after-statement -Werror-implicit-function-declaration"
82
82
               fi])
83
83
test_gcc_flag() {
106
106
AC_MSG_CHECKING([whether to build the NSS module])
107
107
AC_ARG_ENABLE(nss,
108
108
              AS_HELP_STRING([--disable-nss],
109
 
                             [build the NSS module [[default=yes]]]),,
 
109
                             [build the NSS module [[default=enabled]]]),,
110
110
              [enable_nss="yes"])
111
111
AC_MSG_RESULT($enable_nss)
112
112
AM_CONDITIONAL([ENABLE_NSS], [test "x$enable_nss" = "xyes"])
115
115
AC_MSG_CHECKING([whether to build the PAM module])
116
116
AC_ARG_ENABLE(pam,
117
117
              AS_HELP_STRING([--disable-pam],
118
 
                             [build the PAM module [[default=yes]]]),,
 
118
                             [build the PAM module [[default=enabled]]]),,
119
119
              [enable_pam="yes"])
120
120
AC_MSG_RESULT($enable_pam)
121
121
AM_CONDITIONAL([ENABLE_PAM], [test "x$enable_pam" = "xyes"])
124
124
AC_MSG_CHECKING([whether to build the nslcd server])
125
125
AC_ARG_ENABLE(nslcd,
126
126
              AS_HELP_STRING([--disable-nslcd],
127
 
                             [build the nslcd server [[default=yes]]]),,
 
127
                             [build the nslcd server [[default=enabled]]]),,
128
128
              [enable_nslcd="yes"])
129
129
AC_MSG_RESULT($enable_nslcd)
130
130
AM_CONDITIONAL([ENABLE_NSLCD], [test "x$enable_nslcd" = "xyes"])
133
133
AC_MSG_CHECKING([whether to enable SASL support])
134
134
AC_ARG_ENABLE(sasl,
135
135
              AS_HELP_STRING([--disable-sasl],
136
 
                             [disable SASL support [[default=yes]]]),
 
136
                             [disable SASL support [[default=enabled]]]),
137
137
              [enable_sasl=$enableval],
138
138
              [enable_sasl="yes"])
139
139
AC_MSG_RESULT($enable_sasl)
142
142
AC_MSG_CHECKING([whether to enable Kerberos support])
143
143
AC_ARG_ENABLE(kerberos,
144
144
              AS_HELP_STRING([--disable-kerberos],
145
 
                             [disable Kerberos support [[default=yes]]]),
 
145
                             [disable Kerberos support [[default=enabled]]]),
146
146
              [enable_kerberos=$enableval],
147
147
              [enable_kerberos="yes"])
148
148
AC_MSG_RESULT($enable_kerberos)
151
151
AC_MSG_CHECKING([whether to check configfile options])
152
152
AC_ARG_ENABLE(configfile_checking,
153
153
              AS_HELP_STRING([--disable-configfile-checking],
154
 
                             [check configfile options [[default=yes]]]),
 
154
                             [check configfile options [[default=enabled]]]),
155
155
              [configfile_checking=$enableval],
156
156
              [configfile_checking="yes"])
157
157
AC_MSG_RESULT($configfile_checking)
216
216
      ])
217
217
  AC_CHECK_HEADERS(pam/pam_modules.h)
218
218
  AC_CHECK_HEADERS(security/pam_ext.h)
 
219
  # at least one of security/pam_modules.h or pam/pam_modules.h is required
 
220
  if test "x$ac_cv_header_security_pam_modules_h" != "xyes" && \
 
221
     test "x$ac_cv_header_pam_pam_modules_h" != "xyes"
 
222
  then
 
223
    AC_MSG_ERROR(PAM header files are missing)
 
224
  fi
219
225
fi
220
226
 
221
227
# LDAP-specific headers
269
275
    #include <sys/socket.h>
270
276
    #include <net/if.h>
271
277
    #include <netinet/in.h>
272
 
    #include <netinet/if_ether.h>])
 
278
    #include <netinet/if_ether.h>
 
279
    #ifdef HAVE_NETINET_ETHER_H
 
280
    #include <netinet/ether.h>
 
281
    #endif])
273
282
 
274
283
# check to see if socklen_t is defined
275
284
AC_CHECK_TYPE(socklen_t,,
287
296
  # save CFLAGS and LIBS to restore later
288
297
  save_CFLAGS="$CFLAGS"
289
298
  save_LIBS="$LIBS"
 
299
  # find pam library
 
300
  AC_SEARCH_LIBS(pam_get_data,pam,,AC_MSG_ERROR(no PAM library available))
290
301
  # replace the pam_get_authtok() function if it's unavailable
291
 
  AC_SEARCH_LIBS(pam_get_authtok,pam)
292
302
  AC_REPLACE_FUNCS(pam_get_authtok)
293
303
  # restore CFLAGS and LIBS
294
304
  CFLAGS="$save_CFLAGS"
304
314
  CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
305
315
  LIBS="$PTHREAD_LIBS $LIBS"
306
316
 
307
 
  # check which LDAP flavour to use (unsupported)
308
 
  AC_ARG_WITH(ldap-lib,
309
 
              AS_HELP_STRING([--with-ldap-lib=TYPE],
310
 
                             [select ldap library (auto|netscape5|netscape4|netscape3|umich|openldap) @<:@auto@:>@]))
311
 
  if test -z "$with_ldap_lib"
312
 
  then
313
 
    with_ldap_lib=auto
314
 
  fi
315
 
 
316
317
  # checks for availability of system libraries for nslcd
317
318
  AC_SEARCH_LIBS(gethostbyname,nsl socket)
318
319
  AC_SEARCH_LIBS(socket,socket)
348
349
      #include <sys/un.h>
349
350
      #include <sys/types.h>])
350
351
 
 
352
  # search for an LDAP library (only OpenLDAP is tested)
 
353
  AC_ARG_WITH(ldap-lib,
 
354
              AS_HELP_STRING([--with-ldap-lib=TYPE],
 
355
                             [select ldap library (auto|netscape5|netscape4|netscape3|umich|openldap) @<:@auto@:>@]))
 
356
  if test -z "$with_ldap_lib"
 
357
  then
 
358
    with_ldap_lib=auto
 
359
  fi
 
360
  if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \)
 
361
  then
 
362
    AC_SEARCH_LIBS(ldap_search_ext,[ldap_r ldap],found_ldap_lib=yes,,)
 
363
  fi
 
364
  if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \)
 
365
  then
 
366
    AC_CHECK_LIB(ldap50, main, LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBS" found_ldap_lib=yes,, -lpthread)
 
367
  fi
 
368
  if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \)
 
369
  then
 
370
    AC_CHECK_LIB(ldapssl41, main, LIBS="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBS" found_ldap_lib=yes,, -lpthread)
 
371
    if test -z "$found_ldap_lib"
 
372
    then
 
373
      AC_CHECK_LIB(ldapssl40, main, LIBS="-lldapssl40 $LIBS" found_ldap_lib=yes,, -lpthread)
 
374
    fi
 
375
    if test -z "$found_ldap_lib"
 
376
    then
 
377
      AC_CHECK_LIB(ldap41, main, LIBS="-lldap41 $LIBS" found_ldap_lib=yes,,)
 
378
    fi
 
379
    if test -z "$found_ldap_lib"
 
380
    then
 
381
      AC_CHECK_LIB(ldap40, main, LIBS="-lldap40 $LIBS" found_ldap_lib=yes,,)
 
382
    fi
 
383
  fi
 
384
  if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \)
 
385
  then
 
386
    AC_CHECK_LIB(ldapssl30, main, LIBS="-lldapssl30 $LIBS" found_ldap_lib=yes,, -lpthread)
 
387
  fi
 
388
  AC_CHECK_FUNCS(ldap_search_ext,,AC_MSG_ERROR([could not locate a valid LDAP library]))
 
389
 
 
390
  # see if we need a BER library
 
391
  AC_SEARCH_LIBS(ber_bvfree,lber)
 
392
 
 
393
  # check for extra SASL libraries
351
394
  if test "$enable_sasl" = "yes"
352
395
  then
353
396
    AC_CHECK_TYPE(sasl_interact_t,
357
400
        #elif defined(HAVE_SASL_H)
358
401
        #include <sasl.h>
359
402
        #endif])
360
 
  fi
361
 
 
362
 
  if test "$enable_kerberos" = "yes"
363
 
  then
364
 
    AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,[LIBS="-lgssapi $LIBS" found_gssapi_lib=yes],,$LIBS)
365
 
    if test -z "$found_gssapi_lib"
366
 
    then
367
 
      AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,[LIBS="-lgssapi_krb5 $LIBS"],,$LIBS)
368
 
    fi
369
 
  fi
370
 
 
371
 
  if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \)
372
 
  then
373
 
    AC_SEARCH_LIBS(ldap_search_ext,[ldap_r ldap],found_ldap_lib=yes,,)
374
 
  fi
375
 
  if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \)
376
 
  then
377
 
    AC_CHECK_LIB(ldap50, main, LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread)
378
 
  fi
379
 
  if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \)
380
 
  then
381
 
    AC_CHECK_LIB(ldapssl41, main, LIBS="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread)
382
 
    if test -z "$found_ldap_lib"
383
 
    then
384
 
      AC_CHECK_LIB(ldapssl40, main, LIBS="-lldapssl40 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread)
385
 
    fi
386
 
    if test -z "$found_ldap_lib"
387
 
    then
388
 
      AC_CHECK_LIB(ldap41, main, LIBS="-lldap41 $LIBS" found_ldap_lib=yes need_pthread=no,,)
389
 
    fi
390
 
    if test -z "$found_ldap_lib"
391
 
    then
392
 
      AC_CHECK_LIB(ldap40, main, LIBS="-lldap40 $LIBS" found_ldap_lib=yes need_pthread=no,,)
393
 
    fi
394
 
  fi
395
 
  if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \)
396
 
  then
397
 
    AC_CHECK_LIB(ldapssl30, main, LIBS="-lldapssl30 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread)
398
 
  fi
399
 
  if test -z "$found_ldap_lib"
400
 
  then
401
 
    AC_MSG_ERROR(could not locate a valid LDAP library)
402
 
  fi
403
 
  if test "$need_pthread" = "yes"
404
 
  then
405
 
    AC_CHECK_LIB(pthread, main)
406
 
  fi
407
 
  AC_CHECK_LIB(gssldap, ldap_gss_bind,[LIBS="-lgssldap $LIBS"],,$LIBS)
408
 
 
409
 
  if test "$enable_sasl" = "yes"
410
 
  then
411
 
    AC_CHECK_LIB(sasl2, sasl_client_init)
412
 
    AC_CHECK_FUNCS(sasl_auxprop_request)
413
 
    AC_CHECK_FUNCS(ldap_sasl_interactive_bind_s)
414
 
  fi
415
 
  if test "$enable_kerberos" = "yes"
416
 
  then
 
403
    AC_SEARCH_LIBS(sasl_client_init,sasl2)
 
404
    AC_CHECK_FUNCS(sasl_auxprop_request ldap_sasl_interactive_bind_s)
 
405
  fi
 
406
 
 
407
  # check for extra Kerberos libraries
 
408
  if test "$enable_kerberos" = "yes"
 
409
  then
 
410
    AC_SEARCH_LIBS(gss_krb5_ccache_name,gssapi gssapi_krb5)
 
411
    AC_SEARCH_LIBS(ldap_gss_bind,gssldap)
417
412
    AC_CHECK_FUNCS(gss_krb5_ccache_name)
418
413
  fi
419
414
 
421
416
  AC_CHECK_FUNCS(ldap_parse_result ldap_memfree ldap_controls_free ldap_control_free)
422
417
  AC_CHECK_FUNCS(ldap_explode_dn ldap_explode_rdn ldap_set_option ldap_get_option)
423
418
  AC_CHECK_FUNCS(ldap_abandon ldap_simple_bind_s ldap_unbind ldap_set_rebind_proc)
424
 
  AC_CHECK_FUNCS(ldap_initialize ldap_search_ext ber_memfree)
 
419
  AC_CHECK_FUNCS(ldap_initialize ldap_search_ext)
425
420
  AC_CHECK_FUNCS(ldap_create_control ldap_extended_operation_s)
426
421
  AC_CHECK_FUNCS(ldap_domain2hostlist ldap_domain2dn)
427
422
  AC_CHECK_FUNCS(ldap_get_values ldap_value_free ldap_get_dn)
428
423
  AC_CHECK_FUNCS(ldap_err2string ldap_msgfree ldap_result)
 
424
  AC_CHECK_FUNCS(ber_bvfree ber_free ber_set_option)
429
425
 
430
426
  # replace ldap_create_page_control() and ldap_parse_page_control()
431
427
  AC_CHECK_FUNCS(ldap_create_page_control ldap_parse_page_control,,[AC_LIBOBJ(pagectrl)])