~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to build/openldap.m4

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug, Steve Langasek, Mathias Gug
  • Date: 2009-02-18 18:44:00 UTC
  • mfrom: (1.1.2 upstream) (0.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20090218184400-zw4mjse9eywt5566
Tags: 2.4.14-0ubuntu1
[ Steve Langasek ]
* New upstream version
  - Fixes a bug with the pcache overlay not returning cached entries
    (closes: #497697)
  - Update evolution-ntlm patch to apply to current Makefiles.
  - (tentatively) drop gnutls-ciphers, since this bug was reported to be
    fixed upstream in 2.4.8.  The fix applied in 2.4.8 didn't match the
    patch from the bug report, so this should be watched for regressions.
* Build against db4.7 instead of db4.2 at last!  Closes: #421946.
* Build with --disable-ndb, to avoid a misbuild when libmysqlclient is
  installed in the build environment.
* New patch, no-crlcheck-for-gnutls, to fix a build failure when using
  --with-tls=gnutls.

[ Mathias Gug ]
* Merge from debian unstable, remaining changes:
  - debian/apparmor-profile: add AppArmor profile
  - debian/slapd.postinst: Reload AA profile on configuration
  - updated debian/slapd.README.Debian for note on AppArmor
  - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6
  - debian/control: Conflicts with apparmor-profiles << 2.1+1075-0ubuntu4
    to make sure that if earlier version of apparmour-profiles gets
    installed it won't overwrite our profile.
  - Modify Maintainer value to match the DebianMaintainerField
    speficication.
  - follow ApparmorProfileMigration and force apparmor compalin mode on 
    some upgrades (LP: #203529)
  - debian/slapd.dirs: add etc/apparmor.d/force-complain
  - debian/slapd.preinst: create symlink for force-complain on pre-feisty
    upgrades, upgrades where apparmor-profiles profile is unchanged (ie
    non-enforcing) and upgrades where apparmor profile does not exist.
  - debian/slapd.postrm: remove symlink in force-complain/ on purge
  - debian/patches/fix-ucred-libc due to changes how newer glibc handle
    the ucred struct now.
  - debian/control:
    - Build-depend on libltdl7-dev rather then libltdl3-dev.
  - debian/patches/autogen.sh:
    - Call libtoolize with the --install option to install config.{guess,sub}
      files.
  - Don't use local statement in config script as it fails if /bin/sh
    points to bash (LP: #286063).
  - Disable the testsuite on hppa. Allows building of packages on this
    architecture again, once this package is in the archive.
    LP: #288908.
  - debian/slapd.postinst, debian/slapd.script-common: set correct ownership
    and permissions on /var/lib/ldap, /etc/ldap/slapd.d (group readable) and
    /var/run/slapd (world readable). (LP: #257667).
  - debian/patches/nssov-build, debian/rules: 
    Build and package the nss overlay.
    debian/schema/misc.ldif: add ldif file for the misc schema, which defines
    rfc822MailMember (required by the nss overlay).
  - debian/{control,rules}: enable PIE hardening
  - Use cn=config as the default configuration backend instead of 
    slapd.conf. Migrate slapd.conf  file to /etc/ldap/slapd.d/ on upgrade
    asking the end user to enter a new password to control the access to the
    cn=config tree.
* debian/patches/corrupt-contextCSN: The contextCSN can get corrupted at
  times. (ITS: #5947)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl OpenLDAP Autoconf Macros
2
 
dnl $OpenLDAP: pkg/ldap/build/openldap.m4,v 1.157.2.5 2008/02/11 23:26:37 kurt Exp $
 
2
dnl $OpenLDAP: pkg/ldap/build/openldap.m4,v 1.157.2.9 2009/01/22 00:00:41 kurt Exp $
3
3
dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
dnl
5
 
dnl Copyright 1998-2008 The OpenLDAP Foundation.
 
5
dnl Copyright 1998-2009 The OpenLDAP Foundation.
6
6
dnl All rights reserved.
7
7
dnl
8
8
dnl Redistribution and use in source and binary forms, with or without
120
120
])
121
121
dnl
122
122
dnl --------------------------------------------------------------------
 
123
dnl Check for MSVC
 
124
AC_DEFUN([OL_MSVC],
 
125
[AC_REQUIRE_CPP()dnl
 
126
AC_CACHE_CHECK([whether we are using MS Visual C++], ol_cv_msvc,
 
127
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
 
128
#ifndef _MSC_VER
 
129
#include <__FOO__/generate_error.h>
 
130
#endif
 
131
]])],[ol_cv_msvc=yes],[ol_cv_msvc=no])])])
 
132
 
 
133
dnl --------------------------------------------------------------------
123
134
dnl OpenLDAP version of STDC header check w/ EBCDIC support
124
135
AC_DEFUN([OL_HEADER_STDC],
125
136
[AC_REQUIRE_CPP()dnl
288
299
#define NULL ((void*)0)
289
300
#endif
290
301
]], [[
291
 
#if DB_VERSION_MAJOR > 1
292
 
        {
293
 
                char *version;
294
 
                int major, minor, patch;
295
 
 
296
 
                version = db_version( &major, &minor, &patch );
297
 
 
298
 
                if( major != DB_VERSION_MAJOR ||
299
 
                        minor < DB_VERSION_MINOR )
300
 
                {
301
 
                        printf("Berkeley DB version mismatch\n"
302
 
                                "\theader: %s\n\tlibrary: %s\n",
303
 
                                DB_VERSION_STRING, version);
304
 
                        return 1;
305
 
                }
306
 
        }
307
 
#endif
308
 
 
309
302
#if DB_VERSION_MAJOR > 2
310
303
        db_env_create( NULL, 0 );
311
304
#elif DB_VERSION_MAJOR > 1
325
318
])
326
319
dnl
327
320
dnl --------------------------------------------------------------------
 
321
dnl Get major and minor version from <db.h>
 
322
AC_DEFUN([OL_BDB_HEADER_VERSION],
 
323
[AC_CACHE_CHECK([for Berkeley DB major version in db.h], [ol_cv_bdb_major],[
 
324
        AC_LANG_CONFTEST([
 
325
#include <db.h>
 
326
#ifndef DB_VERSION_MAJOR
 
327
#       define DB_VERSION_MAJOR 1
 
328
#endif
 
329
__db_version DB_VERSION_MAJOR
 
330
])
 
331
        set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
 
332
        ol_cv_bdb_major=${3}
 
333
])
 
334
case $ol_cv_bdb_major in [[1-9]]*) : ;; *)
 
335
        AC_MSG_ERROR([Unknown Berkeley DB major version in db.h]) ;;
 
336
esac
 
337
 
 
338
dnl Determine minor version
 
339
AC_CACHE_CHECK([for Berkeley DB minor version in db.h], [ol_cv_bdb_minor],[
 
340
        AC_LANG_CONFTEST([
 
341
#include <db.h>
 
342
#ifndef DB_VERSION_MINOR
 
343
#       define DB_VERSION_MINOR 0
 
344
#endif
 
345
__db_version DB_VERSION_MINOR
 
346
])
 
347
        set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
 
348
        ol_cv_bdb_minor=${3}
 
349
])
 
350
case $ol_cv_bdb_minor in [[0-9]]*) : ;; *)
 
351
        AC_MSG_ERROR([Unknown Berkeley DB minor version in db.h]) ;;
 
352
esac
 
353
])
 
354
dnl
 
355
dnl --------------------------------------------------------------------
328
356
dnl Try to locate appropriate library
329
357
AC_DEFUN([OL_BERKELEY_DB_LINK],
330
358
[ol_cv_lib_db=no
331
359
 
332
 
dnl Determine major version
333
 
AC_CACHE_CHECK([for Berkeley DB major version], [ol_cv_bdb_major],[
334
 
        ol_cv_bdb_major=0
335
 
        if test $ol_cv_bdb_major = 0 ; then
336
 
                AC_EGREP_CPP(__db_version, [
337
 
#include <db.h>
338
 
#ifndef DB_VERSION_MAJOR
339
 
#       define DB_VERSION_MAJOR 1
340
 
#endif
341
 
#if DB_VERSION_MAJOR == 4
342
 
__db_version
343
 
#endif
344
 
                ], [ol_cv_bdb_major=4], [:])
345
 
        fi
346
 
        if test $ol_cv_bdb_major = 0 ; then
347
 
                AC_EGREP_CPP(__db_version, [
348
 
#include <db.h>
349
 
#ifndef DB_VERSION_MAJOR
350
 
#       define DB_VERSION_MAJOR 1
351
 
#endif
352
 
#if DB_VERSION_MAJOR == 3
353
 
__db_version
354
 
#endif
355
 
                ], [ol_cv_bdb_major=3], [:])
356
 
        fi
357
 
        if test $ol_cv_bdb_major = 0 ; then
358
 
                AC_EGREP_CPP(__db_version, [
359
 
#include <db.h>
360
 
#ifndef DB_VERSION_MAJOR
361
 
#       define DB_VERSION_MAJOR 1
362
 
#endif
363
 
#if DB_VERSION_MAJOR == 2
364
 
__db_version
365
 
#endif
366
 
                ], [ol_cv_bdb_major=2], [:])
367
 
        fi
368
 
        if test $ol_cv_bdb_major = 0 ; then
369
 
                AC_EGREP_CPP(__db_version, [
370
 
#include <db.h>
371
 
#ifndef DB_VERSION_MAJOR
372
 
#       define DB_VERSION_MAJOR 1
373
 
#endif
374
 
#if DB_VERSION_MAJOR == 1
375
 
__db_version
376
 
#endif
377
 
                ], [ol_cv_bdb_major=1], [:])
378
 
        fi
379
 
 
380
 
        if test $ol_cv_bdb_major = 0 ; then
381
 
                AC_MSG_ERROR([Unknown Berkeley DB major version])
382
 
        fi
383
 
])
384
 
 
385
 
dnl Determine minor version
386
 
AC_CACHE_CHECK([for Berkeley DB minor version], [ol_cv_bdb_minor],[
387
 
        ol_cv_bdb_minor=0
388
 
        if test $ol_cv_bdb_minor = 0 ; then
389
 
                AC_EGREP_CPP(__db_version, [
390
 
#include <db.h>
391
 
#ifndef DB_VERSION_MINOR
392
 
#       define DB_VERSION_MINOR 0
393
 
#endif
394
 
#if DB_VERSION_MINOR == 9
395
 
__db_version
396
 
#endif
397
 
                ], [ol_cv_bdb_minor=9], [:])
398
 
        fi
399
 
        if test $ol_cv_bdb_minor = 0 ; then
400
 
                AC_EGREP_CPP(__db_version, [
401
 
#include <db.h>
402
 
#ifndef DB_VERSION_MINOR
403
 
#       define DB_VERSION_MINOR 0
404
 
#endif
405
 
#if DB_VERSION_MINOR == 8
406
 
__db_version
407
 
#endif
408
 
                ], [ol_cv_bdb_minor=8], [:])
409
 
        fi
410
 
        if test $ol_cv_bdb_minor = 0 ; then
411
 
                AC_EGREP_CPP(__db_version, [
412
 
#include <db.h>
413
 
#ifndef DB_VERSION_MINOR
414
 
#       define DB_VERSION_MINOR 0
415
 
#endif
416
 
#if DB_VERSION_MINOR == 7
417
 
__db_version
418
 
#endif
419
 
                ], [ol_cv_bdb_minor=7], [:])
420
 
        fi
421
 
        if test $ol_cv_bdb_minor = 0 ; then
422
 
                AC_EGREP_CPP(__db_version, [
423
 
#include <db.h>
424
 
#ifndef DB_VERSION_MINOR
425
 
#       define DB_VERSION_MINOR 0
426
 
#endif
427
 
#if DB_VERSION_MINOR == 6
428
 
__db_version
429
 
#endif
430
 
                ], [ol_cv_bdb_minor=6], [:])
431
 
        fi
432
 
        if test $ol_cv_bdb_minor = 0 ; then
433
 
                AC_EGREP_CPP(__db_version, [
434
 
#include <db.h>
435
 
#ifndef DB_VERSION_MINOR
436
 
#       define DB_VERSION_MINOR 0
437
 
#endif
438
 
#if DB_VERSION_MINOR == 5
439
 
__db_version
440
 
#endif
441
 
                ], [ol_cv_bdb_minor=5], [:])
442
 
        fi
443
 
        if test $ol_cv_bdb_minor = 0 ; then
444
 
                AC_EGREP_CPP(__db_version, [
445
 
#include <db.h>
446
 
#ifndef DB_VERSION_MINOR
447
 
#       define DB_VERSION_MINOR 0
448
 
#endif
449
 
#if DB_VERSION_MINOR == 4
450
 
__db_version
451
 
#endif
452
 
                ], [ol_cv_bdb_minor=4], [:])
453
 
        fi
454
 
        if test $ol_cv_bdb_minor = 0 ; then
455
 
                AC_EGREP_CPP(__db_version, [
456
 
#include <db.h>
457
 
#ifndef DB_VERSION_MINOR
458
 
#       define DB_VERSION_MINOR 0
459
 
#endif
460
 
#if DB_VERSION_MINOR == 3
461
 
__db_version
462
 
#endif
463
 
                ], [ol_cv_bdb_minor=3], [:])
464
 
        fi
465
 
        if test $ol_cv_bdb_minor = 0 ; then
466
 
                AC_EGREP_CPP(__db_version, [
467
 
#include <db.h>
468
 
#ifndef DB_VERSION_MINOR
469
 
#       define DB_VERSION_MINOR 0
470
 
#endif
471
 
#if DB_VERSION_MINOR == 2
472
 
__db_version
473
 
#endif
474
 
                ], [ol_cv_bdb_minor=2], [:])
475
 
        fi
476
 
        if test $ol_cv_bdb_minor = 0 ; then
477
 
                AC_EGREP_CPP(__db_version, [
478
 
#include <db.h>
479
 
#ifndef DB_VERSION_MINOR
480
 
#       define DB_VERSION_MINOR 0
481
 
#endif
482
 
#if DB_VERSION_MINOR == 1
483
 
__db_version
484
 
#endif
485
 
                ], [ol_cv_bdb_minor=1], [:])
486
 
        fi
487
 
])
488
 
 
489
360
if test $ol_cv_bdb_major = 4 ; then
490
 
        if test $ol_cv_bdb_minor = 6 ; then
491
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_6,[-ldb-4.6])
492
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db46,[-ldb46])
493
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_46,[-ldb-46])
494
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_6,[-ldb-4-6])
495
 
        elif test $ol_cv_bdb_minor = 5 ; then
496
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_5,[-ldb-4.5])
497
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db45,[-ldb45])
498
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_45,[-ldb-45])
499
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_5,[-ldb-4-5])
500
 
        elif test $ol_cv_bdb_minor = 4 ; then
501
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_4,[-ldb-4.4])
502
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db44,[-ldb44])
503
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_44,[-ldb-44])
504
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_4,[-ldb-4-4])
505
 
        elif test $ol_cv_bdb_minor = 3 ; then
506
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_3,[-ldb-4.3])
507
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db43,[-ldb43])
508
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_43,[-ldb-43])
509
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_3,[-ldb-4-3])
510
 
        elif test $ol_cv_bdb_minor = 2 ; then
511
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_2,[-ldb-4.2])
512
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db42,[-ldb42])
513
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_42,[-ldb-42])
514
 
                OL_BERKELEY_DB_TRY(ol_cv_db_db_4_2,[-ldb-4-2])
515
 
        fi
 
361
        OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_m,[-ldb-4.$ol_cv_bdb_minor])
 
362
        OL_BERKELEY_DB_TRY(ol_cv_db_db4m,[-ldb4$ol_cv_bdb_minor])
 
363
        OL_BERKELEY_DB_TRY(ol_cv_db_db_4m,[-ldb-4$ol_cv_bdb_minor])
 
364
        OL_BERKELEY_DB_TRY(ol_cv_db_db_4_m,[-ldb-4-$ol_cv_bdb_minor])
516
365
        OL_BERKELEY_DB_TRY(ol_cv_db_db_4,[-ldb-4])
517
366
        OL_BERKELEY_DB_TRY(ol_cv_db_db4,[-ldb4])
518
367
        OL_BERKELEY_DB_TRY(ol_cv_db_db,[-ldb])
519
 
 
520
 
elif test $ol_cv_bdb_major = 3 ; then
521
 
        OL_BERKELEY_DB_TRY(ol_cv_db_db3,[-ldb3])
522
 
        OL_BERKELEY_DB_TRY(ol_cv_db_db_3,[-ldb-3])
523
 
 
524
 
elif test $ol_cv_bdb_major = 2 ; then
525
 
        OL_BERKELEY_DB_TRY(ol_cv_db_db2,[-ldb2])
526
 
        OL_BERKELEY_DB_TRY(ol_cv_db_db_2,[-ldb-2])
527
 
 
528
 
elif test $ol_cv_bdb_major = 1 ; then
529
 
        OL_BERKELEY_DB_TRY(ol_cv_db_db1,[-ldb1])
530
 
        OL_BERKELEY_DB_TRY(ol_cv_db_db_1,[-ldb-1])
531
368
fi
532
369
OL_BERKELEY_DB_TRY(ol_cv_db_none)
533
370
])
535
372
dnl --------------------------------------------------------------------
536
373
dnl Check if Berkeley DB version
537
374
AC_DEFUN([OL_BERKELEY_DB_VERSION],
538
 
[AC_CACHE_CHECK([for Berkeley DB version match], [ol_cv_berkeley_db_version], [
 
375
[AC_CACHE_CHECK([for Berkeley DB library and header version match], [ol_cv_berkeley_db_version], [
539
376
        ol_LIBS="$LIBS"
540
377
        LIBS="$LTHREAD_LIBS $LIBS"
541
378
        if test $ol_cv_lib_db != yes ; then
674
511
[ol_cv_berkeley_db=no
675
512
AC_CHECK_HEADERS(db.h)
676
513
if test $ac_cv_header_db_h = yes; then
 
514
        OL_BDB_HEADER_VERSION
 
515
        OL_BDB_COMPAT
 
516
 
 
517
        if test $ol_cv_bdb_compat != yes ; then
 
518
                AC_MSG_ERROR([BerkeleyDB version incompatible with BDB/HDB backends])
 
519
        fi
 
520
 
677
521
        OL_BERKELEY_DB_LINK
678
522
        if test "$ol_cv_lib_db" != no ; then
679
523
                ol_cv_berkeley_db=yes
685
529
dnl --------------------------------------------------------------------
686
530
dnl Check for version compatility with back-bdb
687
531
AC_DEFUN([OL_BDB_COMPAT],
688
 
[AC_CACHE_CHECK([Berkeley DB version for BDB/HDB backends], [ol_cv_bdb_compat],[
 
532
[AC_CACHE_CHECK([if Berkeley DB version supported by BDB/HDB backends], [ol_cv_bdb_compat],[
689
533
        AC_EGREP_CPP(__db_version_compat,[
690
534
#include <db.h>
691
535
 
697
541
#       define DB_VERSION_MINOR 0
698
542
#endif
699
543
 
700
 
/* require 4.2 or later, but exclude 4.3 */
701
 
#if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 2) && (DB_VERSION_MINOR !=3)
 
544
#define DB_VERSION_MM   ((DB_VERSION_MAJOR<<8)|DB_VERSION_MINOR)
 
545
 
 
546
/* require 4.4 or later */
 
547
#if DB_VERSION_MM >= 0x0404
702
548
        __db_version_compat
703
549
#endif
704
550
        ], [ol_cv_bdb_compat=yes], [ol_cv_bdb_compat=no])])
705
551
])
706
552
 
707
 
dnl --------------------------------------------------------------------
708
 
dnl Find old Berkeley DB 1.85/1.86
709
 
AC_DEFUN([OL_BERKELEY_COMPAT_DB],
710
 
[AC_CHECK_HEADERS(db_185.h db.h)
711
 
if test $ac_cv_header_db_185_h = yes || test $ac_cv_header_db_h = yes; then
712
 
        AC_CACHE_CHECK([if Berkeley DB header compatibility], [ol_cv_header_db1],[
713
 
                AC_EGREP_CPP(__db_version_1,[
714
 
#if HAVE_DB_185_H
715
 
#       include <db_185.h>
716
 
#else
717
 
#       include <db.h>
718
 
#endif
719
 
 
720
 
 /* this check could be improved */
721
 
#ifndef DB_VERSION_MAJOR
722
 
#       define DB_VERSION_MAJOR 1
723
 
#endif
724
 
 
725
 
#if DB_VERSION_MAJOR == 1 
726
 
        __db_version_1
727
 
#endif
728
 
],      [ol_cv_header_db1=yes], [ol_cv_header_db1=no])])
729
 
 
730
 
        if test $ol_cv_header_db1 = yes ; then
731
 
                OL_BERKELEY_DB_LINK
732
 
                if test "$ol_cv_lib_db" != no ; then
733
 
                        ol_cv_berkeley_db=yes
734
 
                fi
735
 
        fi
736
 
fi
737
 
])
738
553
dnl
739
554
dnl ====================================================================
740
555
dnl Check POSIX Thread version 
1106
921
LIBS="-lfetch -lcom_err $LIBS"
1107
922
AC_CACHE_CHECK([fetch(3) library],ol_cv_lib_fetch,[
1108
923
        AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
924
#ifdef HAVE_SYS_PARAM_H
1109
925
#include <sys/param.h>
 
926
#endif
1110
927
#include <stdio.h>
1111
928
#include <fetch.h>]], [[struct url *u = fetchParseURL("file:///"); ]])],[ol_cv_lib_fetch=yes],[ol_cv_lib_fetch=no])])
1112
929
LIBS=$ol_LIBS