~ubuntu-branches/ubuntu/trusty/apr-util/trusty-proposed

« back to all changes in this revision

Viewing changes to build/dbm.m4

  • Committer: Package Import Robot
  • Author(s): Stefan Fritsch
  • Date: 2013-05-05 15:43:34 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20130505154334-ljd2tn8515nf96mo
Tags: 1.5.2-1
* New upstream release.
* Ship find_apu.m4 in libaprutil1-dev. Closes: #699327

Show diffs side-by-side

added added

removed removed

Lines of Context:
367
367
 
368
368
 
369
369
dnl
370
 
dnl APU_CHECK_DB4: is DB4 present?
371
 
dnl
372
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
373
 
dnl
374
 
AC_DEFUN([APU_CHECK_DB4], [
375
 
  places=$1
376
 
  if test -z "$places"; then
377
 
    places="std /usr/local /usr/local/BerkeleyDB.4.0 /boot/home/config"
378
 
  fi
379
 
  APU_CHECK_BERKELEY_DB("4", "0", "-1",
380
 
    "$places",
381
 
    "db4/db.h db.h",
382
 
    "db-4.0 db4 db"
383
 
  )
384
 
  if test "$apu_have_db" = "1"; then
385
 
    apu_db_version=4
386
 
  fi
387
 
])
388
 
 
389
 
 
390
 
dnl
391
 
dnl APU_CHECK_DB41: is DB4.1 present?
392
 
dnl
393
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
394
 
dnl
395
 
AC_DEFUN([APU_CHECK_DB41], [
396
 
  places=$1
397
 
  if test -z "$places"; then
398
 
    places="std /usr/local /usr/local/BerkeleyDB.4.1 /boot/home/config"
399
 
  fi
400
 
  APU_CHECK_BERKELEY_DB("4", "1", "-1",
401
 
    "$places",
402
 
    "db41/db.h db4/db.h db.h",
403
 
    "db-4.1 db41 db4 db"
404
 
  )
405
 
  if test "$apu_have_db" = "1"; then
406
 
    apu_db_version=4
407
 
  fi
408
 
])
409
 
 
410
 
 
411
 
dnl
412
 
dnl APU_CHECK_DB42: is DB4.2 present?
413
 
dnl
414
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
415
 
dnl
416
 
AC_DEFUN([APU_CHECK_DB42], [
417
 
  places=$1
418
 
  if test -z "$places"; then
419
 
    places="std /usr/local /usr/local/BerkeleyDB.4.2 /boot/home/config"
420
 
  fi
421
 
  APU_CHECK_BERKELEY_DB("4", "2", "-1",
422
 
    "$places",
423
 
    "db42/db.h db4/db.h db.h",
424
 
    "db-4.2 db42 db4 db"
425
 
  )
426
 
  if test "$apu_have_db" = "1"; then
427
 
    apu_db_version=4
428
 
  fi
429
 
])
430
 
dnl
431
 
dnl APU_CHECK_DB43: is DB4.3 present?
432
 
dnl
433
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
434
 
dnl
435
 
AC_DEFUN([APU_CHECK_DB43], [
436
 
  places=$1
437
 
  if test -z "$places"; then
438
 
    places="std /usr/local/BerkeleyDB.4.3 /boot/home/config"
439
 
  fi
440
 
  APU_CHECK_BERKELEY_DB("4", "3", "-1",
441
 
    "$places",
442
 
    "db43/db.h db4/db.h db.h",
443
 
    "db-4.3 db4-4.3 db43 db4 db"
444
 
  )
445
 
  if test "$apu_have_db" = "1"; then
446
 
    apu_db_version=4
447
 
  fi
448
 
])
449
 
dnl
450
 
dnl APU_CHECK_DB44: is DB4.4 present?
451
 
dnl
452
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
453
 
dnl
454
 
AC_DEFUN([APU_CHECK_DB44], [
455
 
  places=$1
456
 
  if test -z "$places"; then
457
 
    places="std /usr/local/BerkeleyDB.4.4 /boot/home/config"
458
 
  fi
459
 
  APU_CHECK_BERKELEY_DB("4", "4", "-1",
460
 
    "$places",
461
 
    "db44/db.h db4/db.h db.h",
462
 
    "db-4.4 db4-4.4 db44 db4 db"
463
 
  )
464
 
  if test "$apu_have_db" = "1"; then
465
 
    apu_db_version=4
466
 
  fi
467
 
])
468
 
dnl
469
 
dnl APU_CHECK_DB45: is DB4.5 present?
470
 
dnl
471
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
472
 
dnl
473
 
AC_DEFUN([APU_CHECK_DB45], [
474
 
  places=$1
475
 
  if test -z "$places"; then
476
 
    places="std /usr/local/BerkeleyDB.4.5 /boot/home/config"
477
 
  fi
478
 
  APU_CHECK_BERKELEY_DB("4", "5", "-1",
479
 
    "$places",
480
 
    "db45/db.h db4/db.h db.h",
481
 
    "db-4.5 db4-4.5 db45 db4 db"
482
 
  )
483
 
  if test "$apu_have_db" = "1"; then
484
 
    apu_db_version=4
485
 
  fi
486
 
])
487
 
dnl
488
 
dnl APU_CHECK_DB46: is DB4.6 present?
489
 
dnl
490
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
491
 
dnl
492
 
AC_DEFUN([APU_CHECK_DB46], [
493
 
  places=$1
494
 
  if test -z "$places"; then
495
 
    places="std /usr/local/BerkeleyDB.4.6 /boot/home/config"
496
 
  fi
497
 
  APU_CHECK_BERKELEY_DB("4", "6", "-1",
498
 
    "$places",
499
 
    "db46/db.h db4/db.h db.h",
500
 
    "db-4.6 db4-4.6 db46 db4 db"
501
 
  )
502
 
  if test "$apu_have_db" = "1"; then
503
 
    apu_db_version=4
504
 
  fi
505
 
])
506
 
dnl
507
 
dnl APU_CHECK_DB47: is DB4.7 present?
508
 
dnl
509
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
510
 
dnl
511
 
AC_DEFUN([APU_CHECK_DB47], [
512
 
  places=$1
513
 
  if test -z "$places"; then
514
 
    places="std /usr/local/BerkeleyDB.4.7 /boot/home/config"
515
 
  fi
516
 
  APU_CHECK_BERKELEY_DB("4", "7", "-1",
517
 
    "$places",
518
 
    "db47/db.h db4/db.h db.h",
519
 
    "db-4.7 db4-4.7 db47 db4 db"
520
 
  )
521
 
  if test "$apu_have_db" = "1"; then
522
 
    apu_db_version=4
523
 
  fi
524
 
])
525
 
dnl
526
 
dnl APU_CHECK_DB48: is DB4.8 present?
527
 
dnl
528
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
529
 
dnl
530
 
AC_DEFUN([APU_CHECK_DB48], [
531
 
  places=$1
532
 
  if test -z "$places"; then
533
 
    places="std /usr/local/BerkeleyDB.4.8 /boot/home/config"
534
 
  fi
535
 
  APU_CHECK_BERKELEY_DB("4", "8", "-1",
536
 
    "$places",
537
 
    "db48/db.h db4/db.h db.h",
538
 
    "db-4.8 db4-4.8 db48 db4 db"
539
 
  )
540
 
  if test "$apu_have_db" = "1"; then
541
 
    apu_db_version=4
542
 
  fi
543
 
])
544
 
dnl
545
 
dnl APU_CHECK_DB50: is DB5.0 present?
546
 
dnl
547
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
548
 
dnl
549
 
AC_DEFUN([APU_CHECK_DB50], [
550
 
  places=$1
551
 
  if test -z "$places"; then
552
 
    places="std /usr/local/BerkeleyDB.5.0 /boot/home/config"
553
 
  fi
554
 
  APU_CHECK_BERKELEY_DB("5", "0", "-1",
555
 
    "$places",
556
 
    "db50/db.h db5/db.h db.h",
557
 
    "db-5.0 db5-5.0 db50 db5 db"
558
 
  )
559
 
  if test "$apu_have_db" = "1"; then
560
 
    apu_db_version=5
561
 
  fi
562
 
])
563
 
dnl
564
 
dnl APU_CHECK_DB51: is DB5.1 present?
565
 
dnl
566
 
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
567
 
dnl
568
 
AC_DEFUN([APU_CHECK_DB51], [
569
 
  places=$1
570
 
  if test -z "$places"; then
571
 
    places="std /usr/local/BerkeleyDB.5.1 /boot/home/config"
572
 
  fi
573
 
  APU_CHECK_BERKELEY_DB("5", "1", "-1",
574
 
    "$places",
575
 
    "db51/db.h db5/db.h db.h",
576
 
    "db-5.1 db5-5.1 db51 db5 db"
577
 
  )
578
 
  if test "$apu_have_db" = "1"; then
579
 
    apu_db_version=5
580
 
  fi
581
 
])
 
370
dnl APU_CHECK_DBXY: is DBX.Y present?
 
371
dnl
 
372
dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
 
373
dnl
 
374
AC_DEFUN([APU_CHECK_DBXY], [
 
375
  places=$1
 
376
  db_major=$2
 
377
  db_minor=$3
 
378
  if test -z "$places"; then
 
379
    places="std /usr/local /usr/local/BerkeleyDB.${db_major}.${db_minor} /boot/home/config"
 
380
  fi
 
381
  APU_CHECK_BERKELEY_DB("${db_major}", "${db_minor}", "-1",
 
382
    "$places",
 
383
    "db${db_major}${db_minor}/db.h db${db_major}/db.h db.h",
 
384
    "db-${db_major}.${db_minor} db${db_major}-${db_major}.${db_minor} db${db_major}${db_minor} db-${db_major} db${db_major} db"
 
385
  )
 
386
  if test "$apu_have_db" = "1"; then
 
387
    apu_db_version=${db_major}
 
388
  fi
 
389
])
 
390
 
582
391
 
583
392
AC_DEFUN([APU_CHECK_DB], [
584
393
  requested=$1
615
424
      AC_MSG_ERROR(Berkeley db3 not found)
616
425
    fi
617
426
    ;;
618
 
  db4)
619
 
    APU_CHECK_DB4("$check_places")
620
 
    if test "$apu_db_version" != "4"; then
621
 
      AC_MSG_ERROR(Berkeley db4 not found)
622
 
    fi
623
 
    ;;
624
 
  db41)
625
 
    APU_CHECK_DB41("$check_places")
626
 
    if test "$apu_db_version" != "4"; then
627
 
      AC_MSG_ERROR(Berkeley db4 not found)
628
 
    fi
629
 
    ;;
630
 
  db42)
631
 
    APU_CHECK_DB42("$check_places")
632
 
    if test "$apu_db_version" != "4"; then
633
 
      AC_MSG_ERROR(Berkeley db4 not found)
634
 
    fi
635
 
    ;;
636
 
  db43)
637
 
    APU_CHECK_DB43("$check_places")
638
 
    if test "$apu_db_version" != "4"; then
639
 
      AC_MSG_ERROR(Berkeley db4 not found)
640
 
    fi
641
 
    ;;
642
 
  db44)
643
 
    APU_CHECK_DB44("$check_places")
644
 
    if test "$apu_db_version" != "4"; then
645
 
      AC_MSG_ERROR(Berkeley db4 not found)
646
 
    fi
647
 
    ;;
648
 
  db45)
649
 
    APU_CHECK_DB45("$check_places")
650
 
    if test "$apu_db_version" != "4"; then
651
 
      AC_MSG_ERROR(Berkeley db4 not found)
652
 
    fi
653
 
    ;;
654
 
  db46)
655
 
    APU_CHECK_DB46("$check_places")
656
 
    if test "$apu_db_version" != "4"; then
657
 
      AC_MSG_ERROR(Berkeley db4 not found)
658
 
    fi
659
 
    ;;
660
 
  db47)
661
 
    APU_CHECK_DB47("$check_places")
662
 
    if test "$apu_db_version" != "4"; then
663
 
      AC_MSG_ERROR(Berkeley db4 not found)
664
 
    fi
665
 
    ;;
666
 
  db48)
667
 
    APU_CHECK_DB48("$check_places")
668
 
    if test "$apu_db_version" != "4"; then
669
 
      AC_MSG_ERROR(Berkeley db4 not found)
670
 
    fi
671
 
    ;;
672
 
  db50)
673
 
    APU_CHECK_DB50("$check_places")
674
 
    if test "$apu_db_version" != "5"; then
675
 
      AC_MSG_ERROR(Berkeley db5 not found)
676
 
    fi
677
 
    ;;
678
 
  db51)
679
 
    APU_CHECK_DB51("$check_places")
680
 
    if test "$apu_db_version" != "5"; then
681
 
      AC_MSG_ERROR(Berkeley db5 not found)
 
427
  db[[45]][[0-9]])
 
428
    db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//'`
 
429
    db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//'`
 
430
    APU_CHECK_DBXY("$check_places", "$db_major", "$db_minor")
 
431
    if test "$apu_db_version" != "$db_major"; then
 
432
      AC_MSG_ERROR(Berkeley db$db_major not found)
 
433
    fi
 
434
    ;;
 
435
  db[[45]])
 
436
    db_major=`echo "$requested" | sed -e 's/db//'`
 
437
    # Start version search at version x.9
 
438
    db_minor=9
 
439
    while [[ $db_minor -ge 0 ]]
 
440
    do
 
441
      APU_CHECK_DBXY("$check_places", "$db_major", "$db_minor")
 
442
      if test "$apu_have_db" = "1"; then
 
443
        break
 
444
      fi
 
445
      db_minor=`expr $db_minor - 1`
 
446
    done
 
447
    if test "$apu_db_version" != "$db_major"; then
 
448
      AC_MSG_ERROR(Berkeley db$db_major not found)
682
449
    fi
683
450
    ;;
684
451
  default)
688
455
])
689
456
 
690
457
dnl
691
 
dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 5.1 to 1.
 
458
dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 5.X to 1.
692
459
dnl
693
460
AC_DEFUN([APU_CHECK_DB_ALL], [
694
461
  all_places=$1
695
 
 
696
 
  APU_CHECK_DB51("$all_places")
697
 
  if test "$apu_db_version" != "5"; then
698
 
    APU_CHECK_DB50("$all_places")
699
 
    if test "$apu_db_version" != "5"; then
700
 
      APU_CHECK_DB48("$all_places")
701
 
      if test "$apu_db_version" != "4"; then
702
 
        APU_CHECK_DB47("$all_places")
703
 
        if test "$apu_db_version" != "4"; then
704
 
          APU_CHECK_DB46("$all_places")
705
 
          if test "$apu_db_version" != "4"; then
706
 
            APU_CHECK_DB45("$all_places")
707
 
            if test "$apu_db_version" != "4"; then
708
 
              APU_CHECK_DB44("$all_places")
709
 
              if test "$apu_db_version" != "4"; then
710
 
                APU_CHECK_DB43("$all_places")
711
 
                if test "$apu_db_version" != "4"; then
712
 
                  APU_CHECK_DB42("$all_places")
713
 
                  if test "$apu_db_version" != "4"; then
714
 
                    APU_CHECK_DB41("$all_places")
715
 
                    if test "$apu_db_version" != "4"; then
716
 
                      APU_CHECK_DB4("$all_places")
717
 
                      if test "$apu_db_version" != "4"; then
718
 
                        APU_CHECK_DB3("$all_places")
719
 
                        if test "$apu_db_version" != "3"; then
720
 
                          APU_CHECK_DB2("$all_places")
721
 
                          if test "$apu_db_version" != "2"; then
722
 
                            APU_CHECK_DB1("$all_places")
723
 
                            if test "$apu_db_version" != "1"; then
724
 
                              APU_CHECK_DB185("$all_places")
725
 
                            fi
726
 
                          fi
727
 
                        fi
728
 
                      fi
729
 
                    fi
730
 
                  fi
731
 
                fi
732
 
              fi
733
 
            fi
734
 
          fi
735
 
        fi
736
 
      fi
 
462
 
 
463
  # Start version search at version 5.9
 
464
  db_version=59
 
465
  while [[ $db_version -ge 40 ]]
 
466
  do
 
467
    db_major=`echo $db_version | sed -e 's/.$//'`
 
468
    db_minor=`echo $db_version | sed -e 's/.//'`
 
469
    APU_CHECK_DBXY("$all_places", "$db_major", "$db_minor")
 
470
    if test "$apu_have_db" = "1"; then
 
471
      break
737
472
    fi
 
473
    db_version=`expr $db_version - 1`
 
474
  done
 
475
  if test "$apu_have_db" = "0"; then
 
476
    APU_CHECK_DB3("$all_places")
 
477
  fi
 
478
  if test "$apu_have_db" = "0"; then
 
479
    APU_CHECK_DB2("$all_places")
 
480
  fi
 
481
  if test "$apu_have_db" = "0"; then
 
482
    APU_CHECK_DB1("$all_places")
 
483
  fi
 
484
  if test "$apu_have_db" = "0"; then
 
485
    APU_CHECK_DB185("$all_places")
738
486
  fi
739
487
  AC_MSG_CHECKING(for Berkeley DB)
740
488
  if test "$apu_have_db" = "1"; then
762
510
  apu_db_header=db.h                # default so apu_select_dbm.h is syntactically correct
763
511
  apu_db_version=0
764
512
 
 
513
  # Maximum supported version announced in help string.
 
514
  # Although we search for all versions up to 5.9,
 
515
  # we should only include existing versions in our
 
516
  # help string.
 
517
  db_max_version=53
 
518
  db_min_version=41
 
519
  dbm_list="sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4"
 
520
  db_version="$db_min_version"
 
521
  while [[ $db_version -le $db_max_version ]]
 
522
  do
 
523
    dbm_list="$dbm_list, db$db_version"
 
524
    db_version=`expr $db_version + 1`
 
525
  done
 
526
 
765
527
  AC_ARG_WITH(dbm, [APR_HELP_STRING([--with-dbm=DBM], [choose the DBM type to use.
766
 
      DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42,db43,db44,db45,db46,db47,db48,db50,db51}])],
 
528
      DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X} for some X=0,...,9])],
767
529
  [
768
530
    if test "$withval" = "yes"; then
769
531
      AC_MSG_ERROR([--with-dbm needs to specify a DBM type to use.
770
 
        One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48, db50, db51])
 
532
        One of: $dbm_list])
771
533
    fi
772
534
    requested="$withval"
773
535
  ], [
902
664
  fi
903
665
 
904
666
  case "$requested" in
905
 
    sdbm)
906
 
      apu_use_sdbm=1
907
 
      apu_default_dbm=sdbm
908
 
      ;;
909
 
    gdbm)
910
 
      apu_use_gdbm=1
911
 
      apu_default_dbm=gdbm
912
 
      ;;
913
 
    ndbm)
914
 
      apu_use_ndbm=1
915
 
      apu_default_dbm=ndbm
916
 
      ;;
917
 
    db)
918
 
      apu_use_db=1
919
 
      apu_default_dbm=db
920
 
      ;;
921
 
    db1)
922
 
      apu_use_db=1
923
 
      apu_default_dbm=db1
924
 
      ;;
925
 
    db185)
926
 
      apu_use_db=1
927
 
      apu_default_dbm=db185
928
 
      ;;
929
 
    db2)
930
 
      apu_use_db=1
931
 
      apu_default_dbm=db2
932
 
      ;;
933
 
    db3)
934
 
      apu_use_db=1
935
 
      apu_default_dbm=db3
936
 
      ;;
937
 
    db4)
938
 
      apu_use_db=1
939
 
      apu_default_dbm=db4
940
 
      ;;
941
 
    db41)
942
 
      apu_use_db=1
943
 
      apu_default_dbm=db4
944
 
      ;;
945
 
    db42)
946
 
      apu_use_db=1
947
 
      apu_default_dbm=db4
948
 
      ;;
949
 
    db43)
950
 
      apu_use_db=1
951
 
      apu_default_dbm=db4
952
 
      ;;
953
 
    db44)
954
 
      apu_use_db=1
955
 
      apu_default_dbm=db4
956
 
      ;;
957
 
    db45)
958
 
      apu_use_db=1
959
 
      apu_default_dbm=db4
960
 
      ;;
961
 
    db46)
962
 
      apu_use_db=1
963
 
      apu_default_dbm=db4
964
 
      ;;
965
 
    db47)
966
 
      apu_use_db=1
967
 
      apu_default_dbm=db4
968
 
      ;;
969
 
    db48)
970
 
      apu_use_db=1
971
 
      apu_default_dbm=db4
972
 
      ;;
973
 
    db50)
974
 
      apu_use_db=1
975
 
      apu_default_dbm=db5
976
 
      ;;
977
 
    db51)
978
 
      apu_use_db=1
979
 
      apu_default_dbm=db5
 
667
    sdbm | gdbm | ndbm | db)
 
668
      eval "apu_use_$requested=1"
 
669
      apu_default_dbm=$requested
 
670
      ;;
 
671
    db185 | db[[12345]])
 
672
      apu_use_db=1
 
673
      apu_default_dbm=$requested
 
674
      ;;
 
675
    db[[45]][[0-9]])
 
676
      apu_use_db=1
 
677
      apu_default_dbm=`echo $requested | sed -e 's/.$//'`
980
678
      ;;
981
679
    default)
982
680
      dnl ### use more sophisticated DBMs for the default?
984
682
      apu_use_sdbm=1
985
683
      ;;
986
684
    *)
987
 
      AC_MSG_ERROR([--with-dbm=$look_for is an unknown DBM type.
988
 
        Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48, db50, db51])
 
685
      AC_MSG_ERROR([--with-dbm=$requested is an unknown DBM type.
 
686
        Use one of: $dbm_list])
989
687
      ;;
990
688
  esac
991
689
 
1008
706
  AC_SUBST(apu_db_version)
1009
707
 
1010
708
  if test "$apu_have_db" = "1"; then
1011
 
    LDADD_dbm_db="-l$apu_db_lib"
 
709
    APR_ADDTO(LDADD_dbm_db, [-l$apu_db_lib])
1012
710
    if test -n "apu_db_xtra_libs"; then
1013
 
      LDADD_dbm_db="$LDADD_dbm_db $apu_db_xtra_libs"
 
711
      APR_ADDTO(LDADD_dbm_db, [$apu_db_xtra_libs])
1014
712
    fi
1015
713
  fi
1016
714
 
1017
715
  dnl Since we have already done the AC_CHECK_LIB tests, if we have it, 
1018
716
  dnl we know the library is there.
1019
717
  if test "$apu_have_gdbm" = "1"; then
1020
 
    LDADD_dbm_gdbm="-lgdbm"
 
718
    APR_ADDTO(LDADD_dbm_gdbm, [-lgdbm])
1021
719
  fi
1022
720
 
1023
721
  if test "$apu_have_ndbm" = "1"; then
1024
 
    LDADD_dbm_ndbm="-l$apu_ndbm_lib"
 
722
    APR_ADDTO(LDADD_dbm_ndbm, [-l$apu_ndbm_lib])
1025
723
  fi
1026
724
 
1027
725
  AC_SUBST(LDADD_dbm_db)