From 123a580107bc3de8048d145b70062e9e336470c7 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 5 Aug 1999 01:05:03 +0000 Subject: [PATCH] remove ldapd(8) from 2.0 --- configure | 12777 ++++++++++++++++++++++++++++++ configure.in | 1999 +++++ doc/man/man8/ldapd.8 | 127 - include/portable.h.in | 822 ++ servers/Makefile.in | 7 + servers/ldapd/Version.c | 13 - servers/ldapd/abandon.c | 61 - servers/ldapd/add.c | 126 - servers/ldapd/association.c | 280 - servers/ldapd/bind.c | 271 - servers/ldapd/certificate.c | 316 - servers/ldapd/common.h | 72 - servers/ldapd/compare.c | 131 - servers/ldapd/delete.c | 107 - servers/ldapd/error.c | 189 - servers/ldapd/kerberos.c | 143 - servers/ldapd/ldap.py | 231 - servers/ldapd/main.c | 691 -- servers/ldapd/message.c | 172 - servers/ldapd/modify.c | 645 -- servers/ldapd/modrdn.c | 119 - servers/ldapd/proto-ldapd.h | 158 - servers/ldapd/request.c | 518 -- servers/ldapd/result.c | 379 - servers/ldapd/search.c | 710 -- servers/ldapd/syntax.c | 1029 --- servers/ldapd/util.c | 185 - servers/slapd/tools/Vers-edb2.c | 13 - 28 files changed, 15605 insertions(+), 6686 deletions(-) create mode 100755 configure create mode 100644 configure.in delete mode 100644 doc/man/man8/ldapd.8 create mode 100644 include/portable.h.in create mode 100644 servers/Makefile.in delete mode 100644 servers/ldapd/Version.c delete mode 100644 servers/ldapd/abandon.c delete mode 100644 servers/ldapd/add.c delete mode 100644 servers/ldapd/association.c delete mode 100644 servers/ldapd/bind.c delete mode 100644 servers/ldapd/certificate.c delete mode 100644 servers/ldapd/common.h delete mode 100644 servers/ldapd/compare.c delete mode 100644 servers/ldapd/delete.c delete mode 100644 servers/ldapd/error.c delete mode 100644 servers/ldapd/kerberos.c delete mode 100644 servers/ldapd/ldap.py delete mode 100644 servers/ldapd/main.c delete mode 100644 servers/ldapd/message.c delete mode 100644 servers/ldapd/modify.c delete mode 100644 servers/ldapd/modrdn.c delete mode 100644 servers/ldapd/proto-ldapd.h delete mode 100644 servers/ldapd/request.c delete mode 100644 servers/ldapd/result.c delete mode 100644 servers/ldapd/search.c delete mode 100644 servers/ldapd/syntax.c delete mode 100644 servers/ldapd/util.c delete mode 100644 servers/slapd/tools/Vers-edb2.c diff --git a/configure b/configure new file mode 100755 index 0000000000..6ae2c91da3 --- /dev/null +++ b/configure @@ -0,0 +1,12777 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13.1 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_default_prefix=/usr/local +ac_help="$ac_help + --with-subdir=DIR change default subdirectory used for installs" +ac_help="$ac_help + --enable-debug enable debugging (yes)" +ac_help="$ac_help + --enable-syslog enable syslog support (auto)" +ac_help="$ac_help + --enable-proctitle enable proctitle support (yes)" +ac_help="$ac_help + --enable-cache enable caching (yes)" +ac_help="$ac_help + --enable-dns enable V2 DNS extension (no)" +ac_help="$ac_help + --enable-referrals enable V2 Referrals extension (yes)" +ac_help="$ac_help + --enable-cldap enable connectionless ldap (no)" +ac_help="$ac_help + --enable-x-compile enable cross compiling (no)" +ac_help="$ac_help + --enable-dmalloc enable debug malloc support (no)" +ac_help="$ac_help + --with-kerberos with Kerberos support (auto)" +ac_help="$ac_help + --with-readline with readline support (auto)" +ac_help="$ac_help + --with-threads use threads (auto)" +ac_help="$ac_help + --with-tls with TLS/SSL support (auto)" +ac_help="$ac_help + --with-yielding-select with implicitly yielding select (auto)" +ac_help="$ac_help +SLAPD Options:" +ac_help="$ac_help + --enable-slapd enable building slapd (yes)" +ac_help="$ac_help + --enable-cleartext enable cleartext passwords (yes)" +ac_help="$ac_help + --enable-crypt enable crypt(3) passwords (auto)" +ac_help="$ac_help + --enable-modules enable dynamic module support (no)" +ac_help="$ac_help + --enable-phonetic enable phonetic/soundex (no)" +ac_help="$ac_help + --enable-rlookups enable reverse lookups (auto)" +ac_help="$ac_help + --enable-wrappers enable tcp wrapper support (no)" +ac_help="$ac_help + --enable-bdb2 enable bdb2 backend (no)" +ac_help="$ac_help + --with-bdb2-module module type (static)" +ac_help="$ac_help + --enable-ldap enable ldap backend (no)" +ac_help="$ac_help + --with-ldap-module module type (static)" +ac_help="$ac_help + --enable-ldbm enable ldbm backend (yes)" +ac_help="$ac_help + --with-ldbm-module module type (static)" +ac_help="$ac_help + --with-ldbm-api use LDBM API (auto)" +ac_help="$ac_help + --with-ldbm-type use LDBM type (auto)" +ac_help="$ac_help + --enable-passwd enable passwd backend (no)" +ac_help="$ac_help + --with-passwd-module module type (static)" +ac_help="$ac_help + --enable-perl enable perl backend (no)" +ac_help="$ac_help + --with-perl-module module type (static)" +ac_help="$ac_help + --enable-shell enable shell backend (no)" +ac_help="$ac_help + --with-shell-module module type (static)" +ac_help="$ac_help + --enable-tcl enable tcl backend (no)" +ac_help="$ac_help + --with-tcl-module module type (static)" +ac_help="$ac_help +SLURPD Options:" +ac_help="$ac_help + --enable-slurpd enable building slurpd (auto)" +ac_help="$ac_help +Library Generation & Linking Options" +ac_help="$ac_help + --enable-static[=PKGS] build static libraries [default=yes]" +ac_help="$ac_help + --enable-shared[=PKGS] build shared libraries [default=yes]" +ac_help="$ac_help + --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" +ac_help="$ac_help + --with-gnu-ld assume the C compiler uses GNU ld [default=no]" +ac_help="$ac_help + --disable-libtool-lock avoid locking (might break parallel builds)" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13.1" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=build/version + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + +ac_aux_dir= +for ac_dir in build $srcdir/build; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +OL_VERSION=`cat $ac_aux_dir/version` +if test -z "$OL_VERSION"; then + { echo "configure: error: could not determine version" 1>&2; exit 1; } +fi + + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:638: checking host system type" >&5 +if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then + +# Make sure we can run config.sub. + if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + ac_cv_host_alias=$host + case "$ac_cv_host_alias" in + NONE) + case $nonopt in + NONE) + if ac_cv_host_alias=`$ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) ac_cv_host_alias=$nonopt ;; + esac ;; + esac + + ac_cv_host=`$ac_config_sub $ac_cv_host_alias` + ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +else + echo $ac_n "(cached) $ac_c" 1>&6 +fi + +echo "$ac_t""$ac_cv_host" 1>&6 + +host=$ac_cv_host +host_alias=$ac_cv_host_alias +host_cpu=$ac_cv_host_cpu +host_vendor=$ac_cv_host_vendor +host_os=$ac_cv_host_os + + + + + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:679: checking target system type" >&5 +if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then + +# Make sure we can run config.sub. + if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + ac_cv_target_alias=$target + case "$ac_cv_target_alias" in + NONE) + case $nonopt in + NONE) + ac_cv_target_alias=$host_alias ;; + + *) ac_cv_target_alias=$nonopt ;; + esac ;; + esac + + ac_cv_target=`$ac_config_sub $ac_cv_target_alias` + ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +else + echo $ac_n "(cached) $ac_c" 1>&6 +fi + +echo "$ac_t""$ac_cv_target" 1>&6 + +target=$ac_cv_target +target_alias=$ac_cv_target_alias +target_cpu=$ac_cv_target_cpu +target_vendor=$ac_cv_target_vendor +target_os=$ac_cv_target_os + + + + + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:719: checking build system type" >&5 +if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then + +# Make sure we can run config.sub. + if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + ac_cv_build_alias=$build + case "$ac_cv_build_alias" in + NONE) + case $nonopt in + NONE) + ac_cv_build_alias=$host_alias ;; + + *) ac_cv_build_alias=$nonopt ;; + esac ;; + esac + + ac_cv_build=`$ac_config_sub $ac_cv_build_alias` + ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +else + echo $ac_n "(cached) $ac_c" 1>&6 +fi + +echo "$ac_t""$ac_cv_build" 1>&6 + +build=$ac_cv_build +build_alias=$ac_cv_build_alias +build_cpu=$ac_cv_build_cpu +build_vendor=$ac_cv_build_vendor +build_os=$ac_cv_build_os + + + + + +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:796: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"\${ac_cv_path_install+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:853: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},;$program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +for ac_prog in mawk gawk nawk awk +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:914: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AWK="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AWK="$ac_cv_prog_AWK" +if test -n "$AWK"; then + echo "$ac_t""$AWK" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$AWK" && break +done + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:944: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + + +PACKAGE=OpenLDAP + +VERSION=$OL_VERSION + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi + + + +missing_dir=`cd $ac_aux_dir && pwd` +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:984: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:997: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:1010: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:1023: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:1036: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + +install_sh="$missing_dir/install-sh" +test -f "$install_sh" || install_sh="$missing_dir/install.sh" + +for ac_prog in gnutar gtar tar +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1056: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AMTAR"; then + ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AMTAR="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AMTAR="$ac_cv_prog_AMTAR" +if test -n "$AMTAR"; then + echo "$ac_t""$AMTAR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$AMTAR" && break +done + + +AMTARFLAGS= +if test -n "$AMTAR"; then + if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then + AMTARFLAGS=o + fi +fi + + + +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:1107: checking configure arguments" >&5 + + +top_builddir=`pwd` + +ldap_subdir="openldap" + +# Check whether --with-subdir or --without-subdir was given. +if test "${with_subdir+set}" = set; then + withval="$with_subdir" + + if test "$withval" = "no"; then + ldap_subdir="" + elif test "$withval" != "yes"; then + ldap_subdir="$withval" + fi + +fi + + +# OpenLDAP --enable-debug + # Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; } + fi + ol_enable_debug="$ol_arg" + +else + ol_enable_debug="yes" +fi +# end --enable-debug +# OpenLDAP --enable-syslog + # Check whether --enable-syslog or --disable-syslog was given. +if test "${enable_syslog+set}" = set; then + enableval="$enable_syslog" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; } + fi + ol_enable_syslog="$ol_arg" + +else + ol_enable_syslog="auto" +fi +# end --enable-syslog +# OpenLDAP --enable-proctitle + # Check whether --enable-proctitle or --disable-proctitle was given. +if test "${enable_proctitle+set}" = set; then + enableval="$enable_proctitle" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; } + fi + ol_enable_proctitle="$ol_arg" + +else + ol_enable_proctitle="yes" +fi +# end --enable-proctitle +# OpenLDAP --enable-cache + # Check whether --enable-cache or --disable-cache was given. +if test "${enable_cache+set}" = set; then + enableval="$enable_cache" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; } + fi + ol_enable_cache="$ol_arg" + +else + ol_enable_cache="yes" +fi +# end --enable-cache +# OpenLDAP --enable-dns + # Check whether --enable-dns or --disable-dns was given. +if test "${enable_dns+set}" = set; then + enableval="$enable_dns" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; } + fi + ol_enable_dns="$ol_arg" + +else + ol_enable_dns="no" +fi +# end --enable-dns +# OpenLDAP --enable-referrals + # Check whether --enable-referrals or --disable-referrals was given. +if test "${enable_referrals+set}" = set; then + enableval="$enable_referrals" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; } + fi + ol_enable_referrals="$ol_arg" + +else + ol_enable_referrals="yes" +fi +# end --enable-referrals +# OpenLDAP --enable-cldap + # Check whether --enable-cldap or --disable-cldap was given. +if test "${enable_cldap+set}" = set; then + enableval="$enable_cldap" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; } + fi + ol_enable_cldap="$ol_arg" + +else + ol_enable_cldap="no" +fi +# end --enable-cldap +# OpenLDAP --enable-x_compile + # Check whether --enable-x_compile or --disable-x_compile was given. +if test "${enable_x_compile+set}" = set; then + enableval="$enable_x_compile" + + ol_arg=invalid + for ol_val in yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; } + fi + ol_enable_x_compile="$ol_arg" + +else + ol_enable_x_compile="no" +fi +# end --enable-x_compile + +# OpenLDAP --enable-dmalloc + # Check whether --enable-dmalloc or --disable-dmalloc was given. +if test "${enable_dmalloc+set}" = set; then + enableval="$enable_dmalloc" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; } + fi + ol_enable_dmalloc="$ol_arg" + +else + ol_enable_dmalloc="no" +fi +# end --enable-dmalloc + +# OpenLDAP --with-kerberos + # Check whether --with-kerberos or --without-kerberos was given. +if test "${with_kerberos+set}" = set; then + withval="$with_kerberos" + + ol_arg=invalid + for ol_val in auto k5 k4 afs yes no ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; } + fi + ol_with_kerberos="$ol_arg" + +else + ol_with_kerberos="auto" +fi +# end --with-kerberos + +# OpenLDAP --with-readline + # Check whether --with-readline or --without-readline was given. +if test "${with_readline+set}" = set; then + withval="$with_readline" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; } + fi + ol_with_readline="$ol_arg" + +else + ol_with_readline="auto" +fi +# end --with-readline + +# OpenLDAP --with-threads + # Check whether --with-threads or --without-threads was given. +if test "${with_threads+set}" = set; then + withval="$with_threads" + + ol_arg=invalid + for ol_val in auto posix mach lwp yes no manual ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; } + fi + ol_with_threads="$ol_arg" + +else + ol_with_threads="auto" +fi +# end --with-threads + +# OpenLDAP --with-tls + # Check whether --with-tls or --without-tls was given. +if test "${with_tls+set}" = set; then + withval="$with_tls" + + ol_arg=invalid + for ol_val in auto ssleay openssl yes no ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; } + fi + ol_with_tls="$ol_arg" + +else + ol_with_tls="auto" +fi +# end --with-tls + +# OpenLDAP --with-yielding_select + # Check whether --with-yielding_select or --without-yielding_select was given. +if test "${with_yielding_select+set}" = set; then + withval="$with_yielding_select" + + ol_arg=invalid + for ol_val in auto yes no manual ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; } + fi + ol_with_yielding_select="$ol_arg" + +else + ol_with_yielding_select="auto" +fi +# end --with-yielding_select + + + +# Check whether --with-xxslapdoptions or --without-xxslapdoptions was given. +if test "${with_xxslapdoptions+set}" = set; then + withval="$with_xxslapdoptions" + : +fi + +# OpenLDAP --enable-slapd + # Check whether --enable-slapd or --disable-slapd was given. +if test "${enable_slapd+set}" = set; then + enableval="$enable_slapd" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; } + fi + ol_enable_slapd="$ol_arg" + +else + ol_enable_slapd="yes" +fi +# end --enable-slapd +# OpenLDAP --enable-cleartext + # Check whether --enable-cleartext or --disable-cleartext was given. +if test "${enable_cleartext+set}" = set; then + enableval="$enable_cleartext" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; } + fi + ol_enable_cleartext="$ol_arg" + +else + ol_enable_cleartext="yes" +fi +# end --enable-cleartext +# OpenLDAP --enable-crypt + # Check whether --enable-crypt or --disable-crypt was given. +if test "${enable_crypt+set}" = set; then + enableval="$enable_crypt" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; } + fi + ol_enable_crypt="$ol_arg" + +else + ol_enable_crypt="auto" +fi +# end --enable-crypt +# OpenLDAP --enable-modules + # Check whether --enable-modules or --disable-modules was given. +if test "${enable_modules+set}" = set; then + enableval="$enable_modules" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; } + fi + ol_enable_modules="$ol_arg" + +else + ol_enable_modules="no" +fi +# end --enable-modules +# OpenLDAP --enable-phonetic + # Check whether --enable-phonetic or --disable-phonetic was given. +if test "${enable_phonetic+set}" = set; then + enableval="$enable_phonetic" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; } + fi + ol_enable_phonetic="$ol_arg" + +else + ol_enable_phonetic="no" +fi +# end --enable-phonetic +# OpenLDAP --enable-rlookups + # Check whether --enable-rlookups or --disable-rlookups was given. +if test "${enable_rlookups+set}" = set; then + enableval="$enable_rlookups" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; } + fi + ol_enable_rlookups="$ol_arg" + +else + ol_enable_rlookups="auto" +fi +# end --enable-rlookups +# OpenLDAP --enable-wrappers + # Check whether --enable-wrappers or --disable-wrappers was given. +if test "${enable_wrappers+set}" = set; then + enableval="$enable_wrappers" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; } + fi + ol_enable_wrappers="$ol_arg" + +else + ol_enable_wrappers="no" +fi +# end --enable-wrappers + +# OpenLDAP --enable-bdb2 + # Check whether --enable-bdb2 or --disable-bdb2 was given. +if test "${enable_bdb2+set}" = set; then + enableval="$enable_bdb2" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; } + fi + ol_enable_bdb2="$ol_arg" + +else + ol_enable_bdb2="no" +fi +# end --enable-bdb2 +# OpenLDAP --with-bdb2_module + # Check whether --with-bdb2_module or --without-bdb2_module was given. +if test "${with_bdb2_module+set}" = set; then + withval="$with_bdb2_module" + + ol_arg=invalid + for ol_val in static dynamic ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; } + fi + ol_with_bdb2_module="$ol_arg" + +else + ol_with_bdb2_module="static" +fi +# end --with-bdb2_module + +# OpenLDAP --enable-ldap + # Check whether --enable-ldap or --disable-ldap was given. +if test "${enable_ldap+set}" = set; then + enableval="$enable_ldap" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; } + fi + ol_enable_ldap="$ol_arg" + +else + ol_enable_ldap="no" +fi +# end --enable-ldap +# OpenLDAP --with-ldap_module + # Check whether --with-ldap_module or --without-ldap_module was given. +if test "${with_ldap_module+set}" = set; then + withval="$with_ldap_module" + + ol_arg=invalid + for ol_val in static dynamic ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; } + fi + ol_with_ldap_module="$ol_arg" + +else + ol_with_ldap_module="static" +fi +# end --with-ldap_module + +# OpenLDAP --enable-ldbm + # Check whether --enable-ldbm or --disable-ldbm was given. +if test "${enable_ldbm+set}" = set; then + enableval="$enable_ldbm" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; } + fi + ol_enable_ldbm="$ol_arg" + +else + ol_enable_ldbm="yes" +fi +# end --enable-ldbm +# OpenLDAP --with-ldbm_module + # Check whether --with-ldbm_module or --without-ldbm_module was given. +if test "${with_ldbm_module+set}" = set; then + withval="$with_ldbm_module" + + ol_arg=invalid + for ol_val in static dynamic ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; } + fi + ol_with_ldbm_module="$ol_arg" + +else + ol_with_ldbm_module="static" +fi +# end --with-ldbm_module + +# OpenLDAP --with-ldbm_api + # Check whether --with-ldbm_api or --without-ldbm_api was given. +if test "${with_ldbm_api+set}" = set; then + withval="$with_ldbm_api" + + ol_arg=invalid + for ol_val in auto db2 db mdbm gdbm ndbm manual ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; } + fi + ol_with_ldbm_api="$ol_arg" + +else + ol_with_ldbm_api="auto" +fi +# end --with-ldbm_api + +# OpenLDAP --with-ldbm_type + # Check whether --with-ldbm_type or --without-ldbm_type was given. +if test "${with_ldbm_type+set}" = set; then + withval="$with_ldbm_type" + + ol_arg=invalid + for ol_val in auto btree hash ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; } + fi + ol_with_ldbm_type="$ol_arg" + +else + ol_with_ldbm_type="auto" +fi +# end --with-ldbm_type + + +# OpenLDAP --enable-passwd + # Check whether --enable-passwd or --disable-passwd was given. +if test "${enable_passwd+set}" = set; then + enableval="$enable_passwd" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; } + fi + ol_enable_passwd="$ol_arg" + +else + ol_enable_passwd="no" +fi +# end --enable-passwd +# OpenLDAP --with-passwd_module + # Check whether --with-passwd_module or --without-passwd_module was given. +if test "${with_passwd_module+set}" = set; then + withval="$with_passwd_module" + + ol_arg=invalid + for ol_val in static dynamic ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; } + fi + ol_with_passwd_module="$ol_arg" + +else + ol_with_passwd_module="static" +fi +# end --with-passwd_module + +# OpenLDAP --enable-perl + # Check whether --enable-perl or --disable-perl was given. +if test "${enable_perl+set}" = set; then + enableval="$enable_perl" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; } + fi + ol_enable_perl="$ol_arg" + +else + ol_enable_perl="no" +fi +# end --enable-perl +# OpenLDAP --with-perl_module + # Check whether --with-perl_module or --without-perl_module was given. +if test "${with_perl_module+set}" = set; then + withval="$with_perl_module" + + ol_arg=invalid + for ol_val in static dynamic ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; } + fi + ol_with_perl_module="$ol_arg" + +else + ol_with_perl_module="static" +fi +# end --with-perl_module + +# OpenLDAP --enable-shell + # Check whether --enable-shell or --disable-shell was given. +if test "${enable_shell+set}" = set; then + enableval="$enable_shell" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; } + fi + ol_enable_shell="$ol_arg" + +else + ol_enable_shell="no" +fi +# end --enable-shell +# OpenLDAP --with-shell_module + # Check whether --with-shell_module or --without-shell_module was given. +if test "${with_shell_module+set}" = set; then + withval="$with_shell_module" + + ol_arg=invalid + for ol_val in static dynamic ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; } + fi + ol_with_shell_module="$ol_arg" + +else + ol_with_shell_module="static" +fi +# end --with-shell_module + +# OpenLDAP --enable-tcl + # Check whether --enable-tcl or --disable-tcl was given. +if test "${enable_tcl+set}" = set; then + enableval="$enable_tcl" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; } + fi + ol_enable_tcl="$ol_arg" + +else + ol_enable_tcl="no" +fi +# end --enable-tcl +# OpenLDAP --with-tcl_module + # Check whether --with-tcl_module or --without-tcl_module was given. +if test "${with_tcl_module+set}" = set; then + withval="$with_tcl_module" + + ol_arg=invalid + for ol_val in static dynamic ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; } + fi + ol_with_tcl_module="$ol_arg" + +else + ol_with_tcl_module="static" +fi +# end --with-tcl_module + + +# Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given. +if test "${with_xxslurpdoptions+set}" = set; then + withval="$with_xxslurpdoptions" + : +fi + +# OpenLDAP --enable-slurpd + # Check whether --enable-slurpd or --disable-slurpd was given. +if test "${enable_slurpd+set}" = set; then + enableval="$enable_slurpd" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; } + fi + ol_enable_slurpd="$ol_arg" + +else + ol_enable_slurpd="auto" +fi +# end --enable-slurpd + +# Check whether --with-xxliboptions or --without-xxliboptions was given. +if test "${with_xxliboptions+set}" = set; then + withval="$with_xxliboptions" + : +fi + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} +case "$enableval" in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_static=yes +fi + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} +case "$enableval" in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_shared=yes +fi + + +# validate options +if test $ol_enable_dns = yes ; then + if test $ol_enable_referrals = no ; then + { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; } + fi + if test $ol_enable_referrals = auto ; then + echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2 + ol_enable_referrals=yes + fi +fi + +if test $ol_enable_slapd = no ; then + if test $ol_enable_bdb2 = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2 + fi + if test $ol_enable_ldap = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2 + fi + if test $ol_enable_ldbm = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2 + fi + if test $ol_enable_passwd = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2 + fi + if test $ol_enable_perl = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2 + fi + if test $ol_enable_shell = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2 + fi + if test $ol_enable_tcl = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2 + fi + if test $ol_enable_modules = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2 + fi + if test $ol_enable_wrappers = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2 + fi + if test $ol_enable_phonetic = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2 + fi + if test $ol_enable_rlookups = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2 + fi + if test $ol_with_ldbm_api != auto ; then + echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2 + fi + if test $ol_with_ldbm_type != auto ; then + echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2 + fi + if test $ol_with_bdb2_module != static ; then + echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2 + fi + if test $ol_with_ldap_module != static ; then + echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2 + fi + if test $ol_with_ldbm_module != static ; then + echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2 + fi + if test $ol_with_passwd_module != static ; then + echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2 + fi + if test $ol_with_perl_module != static ; then + echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2 + fi + if test $ol_with_shell_module != static ; then + echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2 + fi + if test $ol_with_tcl_module != static ; then + echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2 + fi + if test $ol_enable_slurpd = yes ; then + { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; } + fi + + # force settings to no + ol_enable_bdb2=no + ol_enable_ldap=no + ol_enable_ldbm=no + ol_enable_passwd=no + ol_enable_perl=no + ol_enable_shell=no + ol_enable_tcl=no + + ol_enable_modules=no + ol_enable_phonetic=no + ol_enable_rlookups=no + ol_enable_wrappers=no + + ol_with_ldbm_api=no + ol_with_ldbm_type=no + + ol_with_bdb2_module=static + ol_with_ldap_module=static + ol_with_ldbm_module=static + ol_with_passwd_module=static + ol_with_perl_module=static + ol_with_shell_module=static + ol_with_tcl_module=static + + ol_enable_slurpd=no + +elif test $ol_enable_ldbm = no ; then + + if test $ol_with_ldbm_api != auto ; then + echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2 + fi + + if test $ol_with_ldbm_type != auto ; then + echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2 + fi + + if test $ol_with_ldbm_module != static ; then + echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2 + fi + + if test $ol_enable_bdb2 = yes ; then + { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; } + fi + + if test $ol_enable_modules != yes -a \ + $ol_enable_ldap = no -a \ + $ol_enable_passwd = no -a \ + $ol_enable_perl = no -a \ + $ol_enable_shell = no -a \ + $ol_enable_tcl = no ; then + { echo "configure: error: slapd requires a backend" 1>&2; exit 1; } + fi + + ol_with_ldbm_api=no + ol_with_ldbm_type=no + ol_with_ldbm_module=static + +elif test $ol_enable_bdb2 = yes ; then + + if test $ol_with_ldbm_api != auto -a \ + $ol_with_ldbm_api != db2 ; then + { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; } + fi + + ol_with_ldbm_api=db2 + +else + + if test $ol_enable_bdb2 != no ; then + if test $ol_with_ldbm_api != auto -a \ + $ol_with_ldbm_api != db2 ; then + echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2 + ol_enable_bdb2=no + fi + fi + + if test $ol_with_ldbm_api = gdbm -a \ + $ol_with_ldbm_type = btree ; then + { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; } + fi + if test $ol_with_ldbm_api = mdbm -a \ + $ol_with_ldbm_type = btree ; then + { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; } + fi + if test $ol_with_ldbm_api = ndbm -a \ + $ol_with_ldbm_type = btree ; then + { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; } + fi +fi + +if test $ol_enable_slurpd = yes ; then + if test $ol_with_threads = no ; then + { echo "configure: error: slurpd requires threads" 1>&2; exit 1; } + fi +fi + +echo "$ac_t""done" 1>&6 + +## Initialize vars +LDAP_LIBS= +LDBM_LIBS= +LTHREAD_LIBS= +LUTIL_LIBS= + +SLAPD_LIBS= +SLURPD_LIBS= + +BUILD_SLAPD=no +BUILD_SLURPD=no + +BUILD_BDB2=no +BUILD_LDAP=no +BUILD_LDBM=no +BUILD_PASSWD=no +BUILD_PERL=no +BUILD_SHELL=no +BUILD_TCL=no +BUILD_THREAD=no + +BUILD_BDB2_DYNAMIC=no +BUILD_LDAP_DYNAMIC=no +BUILD_LDBM_DYNAMIC=no +BUILD_PASSWD_DYNAMIC=no +BUILD_PERL_DYNAMIC=no +BUILD_SHELL_DYNAMIC=no +BUILD_TCL_DYNAMIC=no + +SLAPD_MODULES_LDFLAGS= +SLAPD_MODULES_CPPFLAGS= + +SLAPD_PERL_LDFLAGS= +SLAPD_PERL_CPPFLAGS= + +KRB_LIBS= +READLINE_LIBS= +TERMCAP_LIBS= +TLS_LIBS= + + + +cat >> confdefs.h <<\EOF +#define HAVE_MKVERSION 1 +EOF + + + + + +ol_aix_threads=no +case "$target" in +*-*-aix*) if test -z "$CC" ; then + case "$ol_with_threads" in + auto | yes | posix) ol_aix_threads=yes ;; + esac + fi +;; +esac + +if test $ol_aix_threads = yes ; then + if test -z "${CC}" ; then + for ac_prog in cc_r xlc_r cc +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2216: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CC" && break +done + + + if test "$CC" = cc ; then + if test $ol_with_threads != auto ; then + { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; } + else + echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2 + fi + ol_with_threads=no + fi + fi + + if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then + ol_with_threads=posix + ol_cv_pthread_create=yes + fi +fi + +if test -z "${CC}"; then + for ac_prog in cc +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2268: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CC" && break +done + +fi + + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} +case "$enableval" in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_fast_install=yes +fi + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2326: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2356: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2386: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32* | *CYGWIN*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2437: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:2469: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 2480 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:2485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:2511: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:2516: checking whether we are using GNU C" >&5 +if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:2544: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 +echo "configure:2587: checking for ld used by GCC" >&5 + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 +echo "configure:2611: checking for GNU ld" >&5 +else + echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 +echo "configure:2614: checking for non-GNU ld" >&5 +fi +if eval "test \"\${ac_cv_path_LD+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$ac_cv_path_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi +test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } + +echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 +echo "configure:2650: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 + + +echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 +echo "configure:2666: checking for BSD-compatible nm" >&5 +if eval "test \"\${ac_cv_path_NM+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$NM"; then + # Let the user override the test. + ac_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + break + else + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm +fi +fi + +NM="$ac_cv_path_NM" +echo "$ac_t""$NM" 1>&6 + + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:2703: checking whether ln -s works" >&5 +if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Check for any special flags to pass to ltconfig. +libtool_flags="--cache-file=$cache_file" +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + : +fi + +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$host" in +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 2747 "configure"' > conftest.$ac_ext + if { (eval echo configure:2748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 +echo "configure:2769: checking whether the C compiler needs -belf" >&5 +if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + lt_cv_cc_needs_belf=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + lt_cv_cc_needs_belf=no +fi +rm -f conftest* +fi + +echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + + +esac + + +# Save cache, so that ltconfig can load it + + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ +|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; } + +# Reload cache, that may have been modified by ltconfig + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log + + +for ac_prog in mawk gawk nawk awk +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2835: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AWK="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AWK="$ac_cv_prog_AWK" +if test -n "$AWK"; then + echo "$ac_t""$AWK" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$AWK" && break +done + +# test for ln hardlink support +echo $ac_n "checking whether ln works""... $ac_c" 1>&6 +echo "configure:2866: checking whether ln works" >&5 +if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftest.src conftest.dst +echo "conftest" > conftest.src +if ln conftest.src conftest.dst 2>/dev/null +then + ol_cv_prog_LN_H="ln" +else + ol_cv_prog_LN_H="cp" +fi +rm -f conftest.src conftest.dst + +fi +LN_H="$ol_cv_prog_LN_H" +if test "$ol_cv_prog_LN_H" = "ln"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:2889: checking whether ln -s works" >&5 +if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then + LN_S="$LN_H" +fi + +# Extract the first word of "sendmail", so it can be a program name with args. +set dummy sendmail; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2917: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$SENDMAIL" in + /*) + ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_SENDMAIL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail" + ;; +esac +fi +SENDMAIL="$ac_cv_path_SENDMAIL" +if test -n "$SENDMAIL"; then + echo "$ac_t""$SENDMAIL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "vi", so it can be a program name with args. +set dummy vi; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2953: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$EDITOR" in + /*) + ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH:/usr/ucb" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_EDITOR="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi" + ;; +esac +fi +EDITOR="$ac_cv_path_EDITOR" +if test -n "$EDITOR"; then + echo "$ac_t""$EDITOR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "finger", so it can be a program name with args. +set dummy finger; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2989: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$FINGER" in + /*) + ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH:/usr/ucb" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_FINGER="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger" + ;; +esac +fi +FINGER="$ac_cv_path_FINGER" +if test -n "$FINGER"; then + echo "$ac_t""$FINGER" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +ol_link_perl=no +if test $ol_enable_perl != no ; then + # Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3028: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PERLBIN" in + /*) + ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PERLBIN="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl" + ;; +esac +fi +PERLBIN="$ac_cv_path_PERLBIN" +if test -n "$PERLBIN"; then + echo "$ac_t""$PERLBIN" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + if test "no$PERLBIN" = "no" ; then + if test $ol_enable_perl = yes ; then + { echo "configure: error: could not locate perl" 1>&2; exit 1; } + fi + + else + SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`" + SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`" + + ol_link_perl=yes + fi +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:3076: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + + +if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then + echo "configure: warning: cross compiling.... some functionality will be removed." 1>&2 + +elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then + echo "configure: warning: programs compiled here do run here..." 1>&2 + { echo "configure: error: if not cross compiling, use --disable-x-compile." 1>&2; exit 1; } + +elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then + echo "configure: warning: programs compiled here do not run here..." 1>&2 + { echo "configure: error: if cross compiling, add --enable-x-compile." 1>&2; exit 1; } +fi + +echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:3169: checking for AIX" >&5 +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF +#define _ALL_SOURCE 1 +EOF + +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:3193: checking for POSIXized ISC" >&5 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + +ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +echo "configure:3215: checking for minix/config.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + MINIX=yes +else + echo "$ac_t""no" 1>&6 +MINIX= +fi + +if test "$MINIX" = yes; then + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _POSIX_1_SOURCE 2 +EOF + + cat >> confdefs.h <<\EOF +#define _MINIX 1 +EOF + +fi + + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:3264: checking for Cygwin environment" >&5 +if eval "test \"\${ac_cv_cygwin+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:3296: checking for mingw32 environment" >&5 +if eval "test \"\${ac_cv_mingw32+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes +echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6 +echo "configure:3324: checking for EMX OS/2 environment" >&5 +if eval "test \"\${ac_cv_emxos2+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_emxos2=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_emxos2=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_emxos2" 1>&6 +EMXOS2= +test "$ac_cv_emxos2" = yes && EMXOS2=yes + + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:3355: checking for executable suffix" >&5 +if eval "test \"\${ac_cv_exeext+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:3365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.C | *.o | *.obj | *.xcoff) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +echo "configure:3386: checking for object suffix" >&5 +if eval "test \"\${ac_cv_objext+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftest* +echo 'int i = 1;' > conftest.$ac_ext +if { (eval echo configure:3392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_objext" 1>&6 +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext + + +cat >> confdefs.h <&6 +echo "configure:3416: checking for be_app in -lbe" >&5 +ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lbe -lroot -lnet $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lbe -lroot -lnet" +else + echo "$ac_t""no" 1>&6 +: +fi + + + + + +echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 +echo "configure:3461: checking for ${CC-cc} option to accept ANSI C" >&5 +if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + cat > conftest.$ac_ext < +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; + +int main() { + +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + +; return 0; } +EOF +if { (eval echo configure:3515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + am_cv_prog_cc_stdc="$ac_arg"; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done +CC="$ac_save_CC" + +fi + +if test -z "$am_cv_prog_cc_stdc"; then + echo "$ac_t""none needed" 1>&6 +else + echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6 +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac + +if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then + { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; } +fi + +# test for make depend flag +OL_MKDEP= +OL_MKDEP_FLAGS= +if test -z "${MKDEP}"; then + OL_MKDEP="${CC-cc}" + if test -z "${MKDEP_FLAGS}"; then + echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6 +echo "configure:3549: checking for ${OL_MKDEP} depend flag" >&5 +if eval "test \"\${ol_cv_mkdep+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + ol_cv_mkdep=no + for flag in "-M" "-xM"; do + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } \ + | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1 + then + if test ! -f conftest."${ac_object}" ; then + ol_cv_mkdep=$flag + OL_MKDEP_FLAGS="$flag" + break + fi + fi + done + rm -f conftest* + +fi + +echo "$ac_t""$ol_cv_mkdep" 1>&6 + else + cc_cv_mkdep=yes + OL_MKDEP_FLAGS="${MKDEP_FLAGS}" + fi +else + cc_cv_mkdep=yes + OL_MKDEP="${MKDEP}" + OL_MKDEP_FLAGS="${MKDEP_FLAGS}" +fi + + + +if test "${ol_cv_mkdep}" = no ; then + # this will soon become an error + echo "configure: warning: do not know how to generate dependencies" 1>&2 +fi + +ol_link_modules=no +if test $ol_enable_modules != no ; then + # Extract the first word of "glib-config", so it can be a program name with args. +set dummy glib-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3596: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_path_GLIBCONFIG+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GLIBCONFIG" in + /*) + ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +GLIBCONFIG="$ac_cv_path_GLIBCONFIG" +if test -n "$GLIBCONFIG"; then + echo "$ac_t""$GLIBCONFIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + if test "no$GLIBCONFIG" = "no" ; then + if test $ol_enable_modules = yes ; then + { echo "configure: error: could not locate glib-config" 1>&2; exit 1; } + fi + + else + SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`" + SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`" + SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`" + + ol_link_modules=yes + fi +else + ol_with_bdb2_module=static + ol_with_ldap_module=static + ol_with_ldbm_module=static + ol_with_passwd_module=static + ol_with_perl_module=static + ol_with_shell_module=static + ol_with_tcl_module=static +fi + +# test for EBCDIC +echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6 +echo "configure:3653: checking for EBCDIC" >&5 +if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#endif + +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ol_cv_cpp_ebcdic=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_cpp_ebcdic=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6 +if test $ol_cv_cpp_ebcdic = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_EBCDIC 1 +EOF + +fi + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:3692: checking for ANSI C header files" >&5 +if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ol_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_header_stdc=no +fi +rm -f conftest* + +if test $ol_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ol_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ol_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ol_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ol_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#ifndef HAVE_EBCDIC +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:3779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ol_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ol_cv_header_stdc" 1>&6 +if test $ol_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi +ac_cv_header_stdc=disable + + +if test $ol_cv_header_stdc != yes; then + echo "configure: warning: could not locate Standard C compliant headers" 1>&2 +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:3813: checking for $ac_hdr that defines DIR" >&5 +if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include <$ac_hdr> +int main() { +DIR *dirp = 0; +; return 0; } +EOF +if { (eval echo configure:3826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:3851: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldir $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -ldir" +else + echo "$ac_t""no" 1>&6 +fi + +else +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:3892: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lx $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lx" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:3934: checking for sys/wait.h that is POSIX.1 compatible" >&5 +if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif +int main() { +int s; +wait (&s); +s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; +; return 0; } +EOF +if { (eval echo configure:3955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_sys_wait_h=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_sys_wait_h=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 +if test $ac_cv_header_sys_wait_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +echo $ac_n "checking POSIX termios""... $ac_c" 1>&6 +echo "configure:3976: checking POSIX termios" >&5 +if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +/* SunOS 4.0.3 has termios.h but not the library calls. */ + tcgetattr(0, 0); +; return 0; } +EOF +if { (eval echo configure:3991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_sys_posix_termios=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_sys_posix_termios=no +fi +rm -f conftest* +fi + +echo "$ac_t""$am_cv_sys_posix_termios" 1>&6 + + + echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6 +echo "configure:4007: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 +if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no + + gwinsz_in_termios_h=no + if test $am_cv_sys_posix_termios = yes; then + cat > conftest.$ac_ext < +# include +# ifdef TIOCGWINSZ + yes +# endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + gwinsz_in_termios_h=yes +fi +rm -f conftest* + + fi + + if test $gwinsz_in_termios_h = no; then + cat > conftest.$ac_ext < +# include +# ifdef TIOCGWINSZ + yes +# endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes +fi +rm -f conftest* + + fi + +fi + +echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6 + if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then + cat >> confdefs.h <<\EOF +#define GWINSZ_IN_SYS_IOCTL 1 +EOF + + fi + +if test $am_cv_sys_posix_termios = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_POSIX_TERMIOS 1 +EOF + +fi + +for ac_hdr in \ + arpa/inet.h \ + arpa/nameser.h \ + assert.h \ + crypt.h \ + errno.h \ + fcntl.h \ + filio.h \ + getopt.h \ + grp.h \ + libutil.h \ + limits.h \ + locale.h \ + netinet/tcp.h \ + malloc.h \ + memory.h \ + psap.h \ + pwd.h \ + resolv.h \ + sgtty.h \ + shadow.h \ + stdarg.h \ + stddef.h \ + string.h \ + strings.h \ + sysexits.h \ + sys/file.h \ + sys/filio.h \ + sys/errno.h \ + sys/ioctl.h \ + sys/param.h \ + sys/resource.h \ + sys/select.h \ + sys/socket.h \ + sys/syslog.h \ + sys/time.h \ + sys/types.h \ + syslog.h \ + termios.h \ + unistd.h \ + +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:4115: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + + +echo $ac_n "checking for socket""... $ac_c" 1>&6 +echo "configure:4155: checking for socket" >&5 +if eval "test \"\${ac_cv_func_socket+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char socket(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_socket) || defined (__stub___socket) +choke me +#else +f = socket; +#endif + +; return 0; } +EOF +if { (eval echo configure:4184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_socket=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_socket=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 +echo "configure:4203: checking for main in -lsocket" >&5 +ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6 +echo "configure:4246: checking for main in -lnet" >&5 +ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnet $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6 +echo "configure:4289: checking for socket in -lnet" >&5 +ac_lib_var=`echo net'_'socket | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnet $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6 +echo "configure:4336: checking for main in -lnsl_s" >&5 +ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl_s $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 +echo "configure:4379: checking for main in -lnsl" >&5 +ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6 +echo "configure:4422: checking for socket in -linet" >&5 +ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-linet $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6 +echo "configure:4469: checking for main in -lgen" >&5 +ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lgen $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + +fi + + +echo $ac_n "checking for select""... $ac_c" 1>&6 +echo "configure:4516: checking for select" >&5 +if eval "test \"\${ac_cv_func_select+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char select(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_select) || defined (__stub___select) +choke me +#else +f = select; +#endif + +; return 0; } +EOF +if { (eval echo configure:4545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_select=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_select=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +{ echo "configure: error: select() required." 1>&2; exit 1; } +fi + + +echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6 +echo "configure:4567: checking types of arguments for select()" >&5 + if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do + for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat > conftest.$ac_ext < +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5); +int main() { + +; return 0; } +EOF +if { (eval echo configure:4600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_not_found=no ; break 3 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_not_found=yes +fi +rm -f conftest* + done + done + done + +fi + +fi + +fi + if test "$ac_not_found" = yes; then + ac_cv_func_select_arg1=int + ac_cv_func_select_arg234='int *' + ac_cv_func_select_arg5='struct timeval *' + fi + echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6 + cat >> confdefs.h <> confdefs.h <> confdefs.h <&6 +echo "configure:4644: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +if test "$ac_cv_header_regex_h" != yes ; then + { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; } +fi +echo $ac_n "checking for regfree""... $ac_c" 1>&6 +echo "configure:4684: checking for regfree" >&5 +if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char regfree(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_regfree) || defined (__stub___regfree) +choke me +#else +f = regfree; +#endif + +; return 0; } +EOF +if { (eval echo configure:4713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_regfree=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_regfree=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +{ echo "configure: error: POSIX regex required." 1>&2; exit 1; } +fi + + + +echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6 +echo "configure:4736: checking for compatible POSIX regex" >&5 +if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$cross_compiling" = yes; then + ol_cv_c_posix_regex=cross +else + cat > conftest.$ac_ext < +#include +static char *pattern, *string; +main() +{ + int rc; + regex_t re; + + pattern = "^A"; + + if(regcomp(&re, pattern, 0)) { + return -1; + } + + string = "ALL MATCH"; + + rc = regexec(&re, string, 0, (void*)0, 0); + + regfree(&re); + + return rc; +} +EOF +if { (eval echo configure:4771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ol_cv_c_posix_regex=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ol_cv_c_posix_regex=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ol_cv_c_posix_regex" 1>&6 + +if test "$ol_cv_c_posix_regex" = no ; then + { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; } +fi + + +echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6 +echo "configure:4793: checking for sigset in -lV3" >&5 +ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lV3 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + + +# find res_search +if test $ol_enable_dns != no ; then + echo $ac_n "checking for res_search""... $ac_c" 1>&6 +echo "configure:4844: checking for res_search" >&5 +if eval "test \"\${ac_cv_func_res_search+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char res_search(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_res_search) || defined (__stub___res_search) +choke me +#else +f = res_search; +#endif + +; return 0; } +EOF +if { (eval echo configure:4873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_res_search=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_res_search=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_res_search = no ; then + echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6 +echo "configure:4894: checking for res_search in -lbind" >&5 +ac_lib_var=`echo bind'_'res_search | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lbind $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + ac_cv_func_res_search=$ac_cv_lib_bind_res_search + fi + if test $ac_cv_func_res_search = no ; then + echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6 +echo "configure:4944: checking for res_search in -lresolv" >&5 +ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lresolv $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + ac_cv_func_res_search=$ac_cv_lib_resolv_res_search + fi + + if test "$ac_cv_func_res_search" = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_RES_SEARCH 1 +EOF + + elif test $ol_enable_dns = yes ; then + { echo "configure: error: --enable-dns requires res_search" 1>&2; exit 1; } + else + echo "configure: warning: no res_search, disabling DNS support" 1>&2 + fi +fi + +ol_link_kerberos=no + +if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then + for ac_hdr in kerberosIV/krb.h kerberosIV/des.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5012: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_kerberosIV_krb_h = yes ; then + echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6 +echo "configure:5051: checking for main in -lkrb4" >&5 +ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_k5=yes +else + echo "$ac_t""no" 1>&6 +have_k5=no +fi + + + if test $have_k5 = yes ; then + ol_with_kerberos=found + ol_link_kerberos=yes + + KRB_LIBS="-lkrb4 -lkrb5 -ldes425" + + LIBS="$KRB_LIBS $LIBS" + + echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6 +echo "configure:5097: checking for des_debug in Kerberos libraries" >&5 +if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + save_LIBS="$LIBS" + LIBS="$KRB_LIBS $LIBS" + cat > conftest.$ac_ext < +#include +extern int des_debug; + +int main() { + +des_debug = 1; + +; return 0; } +EOF +if { (eval echo configure:5118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_var_des_debug=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_var_des_debug=no +fi +rm -f conftest* + LIBS="$save_LIBS" + +fi + +echo "$ac_t""$ol_cv_var_des_debug" 1>&6 + + if test $ol_cv_var_des_debug = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_DES_DEBUG 1 +EOF + + fi + + LIBS="$save_LIBS" + fi + fi +fi + +if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then + for ac_hdr in krb.h des.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5151: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_krb_h = yes ; then + echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6 +echo "configure:5190: checking for main in -lkrb" >&5 +ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lkrb -ldes $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_k4=yes +else + echo "$ac_t""no" 1>&6 +have_k4=no +fi + + + if test $have_k4 = yes ; then + ol_with_kerberos=found + ol_link_kerberos=yes + + KRB_LIBS="-lkrb -ldes" + fi + fi +fi + +if test $ol_link_kerberos = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_KERBEROS 1 +EOF + +fi + +ol_link_tls=no +if test $ol_with_tls != no ; then + + for ac_hdr in openssl/ssl.h ssl.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5250: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then + echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6 +echo "configure:5289: checking for SSLeay_add_ssl_algorithms in -lssl" >&5 +ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lssl -lcrypto $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_ssleay=yes + need_rsaref=no +else + echo "$ac_t""no" 1>&6 +have_ssleay=no +fi + + + if test $have_ssleay = no ; then + echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6 +echo "configure:5333: checking for SSL_library_init in -lssl" >&5 +ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lssl -lcrypto $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_ssleay=yes + need_rsaref=no +else + echo "$ac_t""no" 1>&6 +have_ssleay=no +fi + + fi + + if test $have_ssleay = no ; then + echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6 +echo "configure:5378: checking for ssl3_accept in -lssl" >&5 +ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_ssleay=yes + need_rsaref=yes +else + echo "$ac_t""no" 1>&6 +have_ssleay=no +fi + + fi + + if test $have_ssleay = yes ; then + ol_with_tls=found + ol_link_tls=yes + + cat >> confdefs.h <<\EOF +#define HAVE_SSLEAY 1 +EOF + + + if test $need_rsaref = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_RSAREF 1 +EOF + + + TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref" + else + TLS_LIBS="-lssl -lcrypto" + fi + fi + fi +fi + +if test $ol_link_tls = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_TLS 1 +EOF + +fi + +for ac_func in \ + ctime_r \ + gethostbyname_r gethostbyaddr_r \ + +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5457: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:5486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +if test "$ac_cv_func_ctime_r" = no ; then + ol_cv_func_ctime_r_nargs=0 +else + echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6 +echo "configure:5515: checking number of arguments of ctime_r" >&5 +if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +time_t ti; char *buffer; ctime_r(&ti,buffer,32); +; return 0; } +EOF +if { (eval echo configure:5527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_func_ctime_r_nargs=3 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext < +int main() { +time_t ti; char *buffer; ctime_r(&ti,buffer); +; return 0; } +EOF +if { (eval echo configure:5542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_func_ctime_r_nargs=2 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_func_ctime_r_nargs=0 +fi +rm -f conftest* +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6 + if test $ol_cv_func_ctime_r_nargs -gt 1 ; then + cat >> confdefs.h <&6 +echo "configure:5568: checking number of arguments of gethostbyname_r" >&5 +if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +#define BUFSIZE (sizeof(struct hostent)+10) +int main() { +struct hostent hent; char buffer[BUFSIZE]; + int bufsize=BUFSIZE;int h_errno; + (void)gethostbyname_r("segovia.cs.purdue.edu", &hent, + buffer, bufsize, &h_errno); +; return 0; } +EOF +if { (eval echo configure:5587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_func_gethostbyname_r_nargs=5 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext < +#include +#include +#include +#define BUFSIZE (sizeof(struct hostent)+10) +int main() { +struct hostent hent;struct hostent *rhent; + char buffer[BUFSIZE]; + int bufsize=BUFSIZE;int h_errno; + (void)gethostbyname_r("localhost", &hent, buffer, bufsize, + &rhent, &h_errno); +; return 0; } +EOF +if { (eval echo configure:5610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_func_gethostbyname_r_nargs=6 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_func_gethostbyname_r_nargs=0 +fi +rm -f conftest* +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6 + if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then + cat >> confdefs.h <&6 +echo "configure:5638: checking number of arguments of gethostbyaddr_r" >&5 +if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +#define BUFSIZE (sizeof(struct hostent)+10) +int main() { +struct hostent hent; char buffer[BUFSIZE]; + struct in_addr add; + size_t alen=sizeof(struct in_addr); + int bufsize=BUFSIZE;int h_errno; + (void)gethostbyaddr_r( (void *)&(add.s_addr), + alen, AF_INET, &hent, buffer, bufsize, &h_errno); +; return 0; } +EOF +if { (eval echo configure:5659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_func_gethostbyaddr_r_nargs=7 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext < +#include +#include +#include +#define BUFSIZE (sizeof(struct hostent)+10) +int main() { +struct hostent hent; + struct hostent *rhent; char buffer[BUFSIZE]; + struct in_addr add; + size_t alen=sizeof(struct in_addr); + int bufsize=BUFSIZE;int h_errno; + (void)gethostbyaddr_r( (void *)&(add.s_addr), + alen, AF_INET, &hent, buffer, bufsize, + &rhent, &h_errno); +; return 0; } +EOF +if { (eval echo configure:5685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_func_gethostbyaddr_r_nargs=8 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_func_gethostbyaddr_r_nargs=0 +fi +rm -f conftest* +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6 + if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then + cat >> confdefs.h <> confdefs.h <<\EOF +#define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1 +EOF + +fi + +ol_link_threads=no +if test $ol_with_threads = auto -o $ol_with_threads = yes \ + -o $ol_with_threads = posix ; then + + for ac_hdr in pthread.h sched.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5736: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_pthread_h = yes ; then + echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6 +echo "configure:5775: checking POSIX thread version" >&5 +if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < + /* this check could be improved */ +# ifdef PTHREAD_ONCE_INIT + pthread_version_final +# endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "pthread_version_final" >/dev/null 2>&1; then + rm -rf conftest* + ol_pthread_final=yes +else + rm -rf conftest* + ol_pthread_final=no +fi +rm -f conftest* + + + cat > conftest.$ac_ext < + /* this check could be improved */ +# ifdef pthread_once_init + pthread_version_draft4 +# endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "pthread_version_draft4" >/dev/null 2>&1; then + rm -rf conftest* + ol_pthread_draft4=yes +else + rm -rf conftest* + ol_pthread_draft4=no +fi +rm -f conftest* + + + if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then + ol_cv_pthread_version=final + elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then + ol_cv_pthread_version=draft4 + else + ol_cv_pthread_version=unknown + fi + +fi + +echo "$ac_t""$ol_cv_pthread_version" 1>&6 + + + if test $ol_cv_pthread_version = final ; then + cat >> confdefs.h <<\EOF +#define HAVE_PTHREADS_FINAL 1 +EOF + + elif test $ol_cv_pthread_version = draft4 ; then + cat >> confdefs.h <<\EOF +#define HAVE_PTHREADS_D4 1 +EOF + + else + { echo "configure: error: unknown pthread version" 1>&2; exit 1; } + fi + + # consider threads found + ol_with_threads=found + + + echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6 +echo "configure:5856: checking for LinuxThreads pthread.h" >&5 +if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then + rm -rf conftest* + ol_cv_header_linux_threads=yes +else + rm -rf conftest* + ol_cv_header_linux_threads=no +fi +rm -f conftest* + + +fi + +echo "$ac_t""$ol_cv_header_linux_threads" 1>&6 + if test $ol_cv_header_linux_threads = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LINUX_THREADS 1 +EOF + + fi + + + + echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6 +echo "configure:5889: checking for pthread_create in default libraries" >&5 +if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$cross_compiling" = yes; then + ol_cv_pthread_create=yes +else + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + +int main(argc, argv) + int argc; + char **argv; +{ + pthread_t t; + int status; + + /* make sure pthread_create() isn't just a stub */ +#if HAVE_PTHREADS_D4 + status = pthread_create(&t, pthread_attr_default, task, NULL); +#else + status = pthread_create(&t, NULL, task, NULL); +#endif + + if( status ) return status; + + /* make sure pthread_detach() isn't just a stub */ +#if HAVE_PTHREADS_D4 + status = pthread_detach( &t ); +#else + status = pthread_detach( t ); +#endif + + return status; +} + +EOF +if { (eval echo configure:5939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ol_cv_pthread_create=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ol_cv_pthread_create=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ol_cv_pthread_create" 1>&6 + + if test $ol_cv_pthread_create != no ; then + ol_link_threads=posix + ol_link_pthreads="" + fi + + # Pthread try link: -mt (ol_cv_pthread_mt) + if test "$ol_link_threads" = no ; then + # try -mt + echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6 +echo "configure:5964: checking for pthread link with -mt" >&5 +if eval "test \"\${ol_cv_pthread_mt+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-mt $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_mt=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_mt=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_mt" 1>&6 + + if test $ol_cv_pthread_mt = yes ; then + ol_link_pthreads="-mt" + ol_link_threads=posix + fi + fi + + # Pthread try link: -kthread (ol_cv_pthread_kthread) + if test "$ol_link_threads" = no ; then + # try -kthread + echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6 +echo "configure:6027: checking for pthread link with -kthread" >&5 +if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-kthread $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_kthread=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_kthread=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_kthread" 1>&6 + + if test $ol_cv_pthread_kthread = yes ; then + ol_link_pthreads="-kthread" + ol_link_threads=posix + fi + fi + + # Pthread try link: -pthread (ol_cv_pthread_pthread) + if test "$ol_link_threads" = no ; then + # try -pthread + echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6 +echo "configure:6090: checking for pthread link with -pthread" >&5 +if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-pthread $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_pthread=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_pthread=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_pthread" 1>&6 + + if test $ol_cv_pthread_pthread = yes ; then + ol_link_pthreads="-pthread" + ol_link_threads=posix + fi + fi + + # Pthread try link: -pthreads (ol_cv_pthread_pthreads) + if test "$ol_link_threads" = no ; then + # try -pthreads + echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6 +echo "configure:6153: checking for pthread link with -pthreads" >&5 +if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-pthreads $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_pthreads=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_pthreads=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6 + + if test $ol_cv_pthread_pthreads = yes ; then + ol_link_pthreads="-pthreads" + ol_link_threads=posix + fi + fi + + # Pthread try link: -mthreads (ol_cv_pthread_mthreads) + if test "$ol_link_threads" = no ; then + # try -mthreads + echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6 +echo "configure:6216: checking for pthread link with -mthreads" >&5 +if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-mthreads $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_mthreads=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_mthreads=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6 + + if test $ol_cv_pthread_mthreads = yes ; then + ol_link_pthreads="-mthreads" + ol_link_threads=posix + fi + fi + + # Pthread try link: -thread (ol_cv_pthread_thread) + if test "$ol_link_threads" = no ; then + # try -thread + echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6 +echo "configure:6279: checking for pthread link with -thread" >&5 +if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-thread $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_thread=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_thread=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_thread" 1>&6 + + if test $ol_cv_pthread_thread = yes ; then + ol_link_pthreads="-thread" + ol_link_threads=posix + fi + fi + + + # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r) + if test "$ol_link_threads" = no ; then + # try -lpthread -lmach -lexc -lc_r + echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6 +echo "configure:6343: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5 +if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthread -lmach -lexc -lc_r $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_lpthread_lmach_lexc_lc_r=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6 + + if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then + ol_link_pthreads="-lpthread -lmach -lexc -lc_r" + ol_link_threads=posix + fi + fi + + # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc) + if test "$ol_link_threads" = no ; then + # try -lpthread -lmach -lexc + echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6 +echo "configure:6406: checking for pthread link with -lpthread -lmach -lexc" >&5 +if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthread -lmach -lexc $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_lpthread_lmach_lexc=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_lpthread_lmach_lexc=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6 + + if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then + ol_link_pthreads="-lpthread -lmach -lexc" + ol_link_threads=posix + fi + fi + + + # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff) + if test "$ol_link_threads" = no ; then + # try -lpthread -Wl,-woff,85 + echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6 +echo "configure:6470: checking for pthread link with -lpthread -Wl,-woff,85" >&5 +if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthread -Wl,-woff,85 $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_lib_lpthread_woff=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_lib_lpthread_woff=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6 + + if test $ol_cv_pthread_lib_lpthread_woff = yes ; then + ol_link_pthreads="-lpthread -Wl,-woff,85" + ol_link_threads=posix + fi + fi + + + # Pthread try link: -lpthread (ol_cv_pthread_lpthread) + if test "$ol_link_threads" = no ; then + # try -lpthread + echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6 +echo "configure:6534: checking for pthread link with -lpthread" >&5 +if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthread $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_lpthread=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_lpthread=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6 + + if test $ol_cv_pthread_lpthread = yes ; then + ol_link_pthreads="-lpthread" + ol_link_threads=posix + fi + fi + + # Pthread try link: -lc_r (ol_cv_pthread_lc_r) + if test "$ol_link_threads" = no ; then + # try -lc_r + echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6 +echo "configure:6597: checking for pthread link with -lc_r" >&5 +if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lc_r $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_lc_r=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_lc_r=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6 + + if test $ol_cv_pthread_lc_r = yes ; then + ol_link_pthreads="-lc_r" + ol_link_threads=posix + fi + fi + + + # Pthread try link: -threads (ol_cv_pthread_threads) + if test "$ol_link_threads" = no ; then + # try -threads + echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6 +echo "configure:6661: checking for pthread link with -threads" >&5 +if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-threads $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_threads=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_threads=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_threads" 1>&6 + + if test $ol_cv_pthread_threads = yes ; then + ol_link_pthreads="-threads" + ol_link_threads=posix + fi + fi + + + # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r) + if test "$ol_link_threads" = no ; then + # try -lpthreads -lmach -lexc -lc_r + echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6 +echo "configure:6725: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5 +if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthreads -lmach -lexc -lc_r $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6 + + if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then + ol_link_pthreads="-lpthreads -lmach -lexc -lc_r" + ol_link_threads=posix + fi + fi + + # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc) + if test "$ol_link_threads" = no ; then + # try -lpthreads -lmach -lexc + echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6 +echo "configure:6788: checking for pthread link with -lpthreads -lmach -lexc" >&5 +if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthreads -lmach -lexc $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_lpthreads_lmach_lexc=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_lpthreads_lmach_lexc=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6 + + if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then + ol_link_pthreads="-lpthreads -lmach -lexc" + ol_link_threads=posix + fi + fi + + # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc) + if test "$ol_link_threads" = no ; then + # try -lpthreads -lexc + echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6 +echo "configure:6851: checking for pthread link with -lpthreads -lexc" >&5 +if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthreads -lexc $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_lpthreads_lexc=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_lpthreads_lexc=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6 + + if test $ol_cv_pthread_lpthreads_lexc = yes ; then + ol_link_pthreads="-lpthreads -lexc" + ol_link_threads=posix + fi + fi + + + # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads) + if test "$ol_link_threads" = no ; then + # try -lpthreads + echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6 +echo "configure:6915: checking for pthread link with -lpthreads" >&5 +if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + # save the flags + ol_LIBS="$LIBS" + LIBS="-lpthreads $LIBS" + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { + + pthread_t t; + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, NULL, NULL); + pthread_detach( &t ); +#else + pthread_create(&t, NULL, NULL, NULL); + pthread_detach( t ); +#endif +#ifdef HAVE_LINUX_THREADS + pthread_kill_other_threads_np(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_pthread_lib_lpthreads=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_lib_lpthreads=no +fi +rm -f conftest* + + # restore the LIBS + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6 + + if test $ol_cv_pthread_lib_lpthreads = yes ; then + ol_link_pthreads="-lpthreads" + ol_link_threads=posix + fi + fi + + + if test $ol_link_threads != no ; then + cat >> confdefs.h <<\EOF +#define HAVE_PTHREADS 1 +EOF + + + LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads" + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + LIBS="$LTHREAD_LIBS $LIBS" + + for ac_func in sched_yield pthread_yield +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:6990: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:7019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_func_sched_yield = no -a \ + $ac_cv_func_pthread_yield = no ; then + echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6 +echo "configure:7047: checking for sched_yield in -lrt" >&5 +ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lrt $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LTHREAD_LIBS="$LTHREAD_LIBS -lrt" + cat >> confdefs.h <<\EOF +#define HAVE_SCHED_YIELD 1 +EOF + + ac_cv_func_sched_yield=yes +else + echo "$ac_t""no" 1>&6 +ac_cv_func_sched_yield=no +fi + + fi + if test $ac_cv_func_sched_yield = no -a \ + $ac_cv_func_pthread_yield = no ; then + for ac_func in thr_yield +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:7098: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:7127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + fi + if test $ac_cv_func_sched_yield = no -a \ + $ac_cv_func_pthread_yield = no -a \ + "$ac_cv_func_thr_yield" = no ; then + echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2 + fi + + for ac_func in pthread_kill +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:7161: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:7190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + echo $ac_n "checking for pthread_detach with ""... $ac_c" 1>&6 +echo "configure:7216: checking for pthread_detach with " >&5 +if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +int main() { +pthread_detach(NULL); +; return 0; } +EOF +if { (eval echo configure:7234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_func_pthread_detach=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_func_pthread_detach=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6 + + if test $ol_cv_func_pthread_detach = no ; then + { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; } + fi + + cat >> confdefs.h <<\EOF +#define HAVE_PTHREAD_DETACH 1 +EOF + + + for ac_func in \ + pthread_setconcurrency \ + pthread_getconcurrency \ + thr_setconcurrency \ + thr_getconcurrency \ + +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:7266: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:7295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + + echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6 +echo "configure:7322: checking for pthread_kill_other_threads_np" >&5 +if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_kill_other_threads_np(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np) +choke me +#else +f = pthread_kill_other_threads_np; +#endif + +; return 0; } +EOF +if { (eval echo configure:7351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_pthread_kill_other_threads_np=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_pthread_kill_other_threads_np=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6 +echo "configure:7371: checking for LinuxThreads implementation" >&5 +if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np +fi + +echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6 + + + + + echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6 +echo "configure:7384: checking for LinuxThreads consistency" >&5 +if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test $ol_cv_header_linux_threads = yes -a \ + $ol_cv_sys_linux_threads = yes; then + ol_cv_linux_threads=yes + elif test $ol_cv_header_linux_threads = no -a \ + $ol_cv_sys_linux_threads = no; then + ol_cv_linux_threads=no + else + ol_cv_linux_threads=error + fi + +fi + +echo "$ac_t""$ol_cv_linux_threads" 1>&6 + + + if test $ol_cv_linux_threads = error; then + { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; }; + fi + + echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6 +echo "configure:7409: checking if pthread_create() works" >&5 +if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$cross_compiling" = yes; then + ol_cv_pthread_create_works=yes +else + cat > conftest.$ac_ext < +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + +int main(argc, argv) + int argc; + char **argv; +{ + pthread_t t; +#if HAVE_PTHREADS_D4 + exit(pthread_create(&t, pthread_attr_default, task, NULL)); +#else + exit(pthread_create(&t, NULL, task, NULL)); +#endif +} + +EOF +if { (eval echo configure:7445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ol_cv_pthread_create_works=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ol_cv_pthread_create_works=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ol_cv_pthread_create_works" 1>&6 + + if test $ol_cv_pthread_create_works = no ; then + { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; } + fi + + if test $ol_with_yielding_select = auto ; then + echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6 +echo "configure:7467: checking if select yields when using pthreads" >&5 +if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$cross_compiling" = yes; then + ol_cv_pthread_select_yields=cross +else + cat > conftest.$ac_ext < +#include +#include +#include +#ifndef NULL +#define NULL (void*) 0 +#endif + +static int fildes[2]; + +static void *task(p) + void *p; +{ + int i; + struct timeval tv; + + fd_set rfds; + + tv.tv_sec=10; + tv.tv_usec=0; + + FD_ZERO(&rfds); + FD_SET(fildes[0], &rfds); + + /* we're not interested in any fds */ + i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv); + + if(i < 0) { + perror("select"); + exit(10); + } + + exit(0); /* if we exit here, the select blocked the whole process */ +} + +int main(argc, argv) + int argc; + char **argv; +{ + pthread_t t; + + /* create a pipe to select */ + if(pipe(&fildes[0])) { + perror("select"); + exit(1); + } + +#ifdef HAVE_PTHREAD_SETCONCURRENCY + (void) pthread_setconcurrency(2); +#else +#ifdef HAVE_THR_SETCONCURRENCY + /* Set Solaris LWP concurrency to 2 */ + thr_setconcurrency(2); +#endif +#endif + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, task, NULL); +#else + pthread_create(&t, NULL, task, NULL); +#endif + +#if HAVE_SCHED_YIELD + sched_yield(); /* make sure task runs first */ +#else +#ifdef HAVE_PTHREAD_YIELD + pthread_yield(); /* make sure task runs first */ +#endif +#endif + + exit(2); +} +EOF +if { (eval echo configure:7552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ol_cv_pthread_select_yields=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ol_cv_pthread_select_yields=yes +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6 + + if test $ol_cv_pthread_select_yields = cross ; then + { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; } + fi + + if test $ol_cv_pthread_select_yields = yes ; then + ol_with_yielding_select=yes + fi + fi + + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + else + { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; } + fi + fi + + if test $ol_with_threads = posix ; then + { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; } + fi +fi + +if test $ol_with_threads = auto -o $ol_with_threads = yes \ + -o $ol_with_threads = mach ; then + + for ac_hdr in mach/cthreads.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:7596: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:7606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + if test $ac_cv_header_mach_cthreads_h = yes ; then + ol_with_threads=found + + echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6 +echo "configure:7636: checking for cthread_fork" >&5 +if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char cthread_fork(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_cthread_fork) || defined (__stub___cthread_fork) +choke me +#else +f = cthread_fork; +#endif + +; return 0; } +EOF +if { (eval echo configure:7665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_cthread_fork=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_cthread_fork=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_link_threads=yes +else + echo "$ac_t""no" 1>&6 +fi + + + if test $ol_link_threads = no ; then + echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6 +echo "configure:7687: checking for cthread_fork with -all_load" >&5 +if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + save_LIBS="$LIBS" + LIBS="-all_load $LIBS" + cat > conftest.$ac_ext < +int main() { + + cthread_fork((void *)0, (void *)0); + +; return 0; } +EOF +if { (eval echo configure:7704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_cthread_all_load=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_cthread_all_load=no +fi +rm -f conftest* + LIBS="$save_LIBS" + +fi + +echo "$ac_t""$ol_cv_cthread_all_load" 1>&6 + + if test $ol_cv_cthread_all_load = yes ; then + LTHREAD_LIBS="$LTHREAD_LIBS -all_load" + ol_link_threads=mach + fi + fi + + if test $ol_link_threads != no ; then + : check for cthread specific functionality here + cat >> confdefs.h <<\EOF +#define HAVE_MACH_CTHREADS 1 +EOF + + else + { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; } + fi + fi + + if test $ol_with_threads = mach ; then + { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; } + fi +fi + +if test $ol_with_threads = auto -o $ol_with_threads = yes \ + -o $ol_with_threads = lwp ; then + + for ac_hdr in thread.h synch.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:7749: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:7759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then + echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6 +echo "configure:7787: checking for thr_create in -lthread" >&5 +ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lthread $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_thr=yes +else + echo "$ac_t""no" 1>&6 +have_thr=no +fi + + + if test $have_thr = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_THR 1 +EOF + + LTHREAD_LIBS="$LTHREAD_LIBS -lthread" + ol_link_threads=thr + + if test $ol_with_yielding_select = auto ; then + ol_with_yielding_select=yes + fi + + for ac_func in \ + thr_setconcurrency \ + thr_getconcurrency \ + +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:7846: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:7875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + fi + fi + + for ac_hdr in lwp/lwp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:7906: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:7916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + if test $ac_cv_header_lwp_lwp_h = yes ; then + echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6 +echo "configure:7944: checking for lwp_create in -llwp" >&5 +ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-llwp $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_lwp=yes +else + echo "$ac_t""no" 1>&6 +have_lwp=no +fi + + + if test $have_lwp = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_LWP 1 +EOF + + LTHREAD_LIBS="$LTHREAD_LIBS -llwp" + ol_link_threads=lwp + + if test $ol_with_yielding_select = auto ; then + ol_with_yielding_select=no + fi + fi + fi +fi + +if test $ol_with_yielding_select = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_YIELDING_SELECT 1 +EOF + +fi + +if test $ol_with_threads = manual ; then + ol_link_threads=yes + + echo "configure: warning: thread defines and link options must be set manually" 1>&2 + + for ac_hdr in pthread.h sched.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:8016: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:8026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + for ac_func in sched_yield pthread_yield +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:8055: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:8084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6 +echo "configure:8110: checking for LinuxThreads pthread.h" >&5 +if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then + rm -rf conftest* + ol_cv_header_linux_threads=yes +else + rm -rf conftest* + ol_cv_header_linux_threads=no +fi +rm -f conftest* + + +fi + +echo "$ac_t""$ol_cv_header_linux_threads" 1>&6 + if test $ol_cv_header_linux_threads = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LINUX_THREADS 1 +EOF + + fi + + + for ac_hdr in mach/cthreads.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:8145: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:8155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + for ac_hdr in lwp/lwp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:8185: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:8195: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + for ac_hdr in thread.h synch.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:8225: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:8235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +fi + +if test $ol_link_threads != no ; then + cat >> confdefs.h <<\EOF +#define REENTRANT 1 +EOF + + cat >> confdefs.h <<\EOF +#define _REENTRANT 1 +EOF + + cat >> confdefs.h <<\EOF +#define THREAD_SAFE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _THREAD_SAFE 1 +EOF + + cat >> confdefs.h <<\EOF +#define THREADSAFE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _THREADSAFE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _SGI_MP_SOURCE 1 +EOF + + + echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6 +echo "configure:8294: checking for thread specific errno" >&5 +if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +int main() { +errno = 0; +; return 0; } +EOF +if { (eval echo configure:8307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_errno_thread_specific=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_errno_thread_specific=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6 + + echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6 +echo "configure:8323: checking for thread specific h_errno" >&5 +if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +int main() { +h_errno = 0; +; return 0; } +EOF +if { (eval echo configure:8336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_h_errno_thread_specific=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_h_errno_thread_specific=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6 + + if test $ol_cv_errno_thread_specific != yes \ + -o $ol_cv_h_errno_thread_specific != yes ; then + LIBS="$LTHREAD_LIBS $LIBS" + LTHREAD_LIBS="" + fi + +fi + +if test $ol_link_threads = no ; then + if test $ol_with_threads = yes ; then + { echo "configure: error: no suitable thread support" 1>&2; exit 1; } + fi + + if test $ol_with_threads = auto ; then + echo "configure: warning: no suitable thread support, disabling threads" 1>&2 + ol_with_threads=no + fi + + cat >> confdefs.h <<\EOF +#define NO_THREADS 1 +EOF + + LTHREAD_LIBS="" +fi + +if test $ol_link_threads != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1 +EOF + +fi + + +ol_link_ldbm=no +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then + echo $ac_n "checking for DB2 library""... $ac_c" 1>&6 +echo "configure:8387: checking for DB2 library" >&5 +if eval "test \"\${ol_cv_lib_db2+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ol_LIBS="$LIBS" + echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6 +echo "configure:8393: checking for db_open in -ldb" >&5 +ac_lib_var=`echo db'_'db_open | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldb $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_db2=-ldb +else + echo "$ac_t""no" 1>&6 +ol_cv_lib_db2=no +fi + + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_lib_db2" 1>&6 + +for ac_hdr in db.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:8443: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:8453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +if test $ac_cv_header_db_h = yes ; then + echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6 +echo "configure:8481: checking if db.h is DB2" >&5 +if eval "test \"\${ol_cv_header_db2+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < + /* this check could be improved */ +# ifdef DB_VERSION_MAJOR +# if DB_VERSION_MAJOR == 2 + __db_version_2 +# endif +# endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "__db_version_2" >/dev/null 2>&1; then + rm -rf conftest* + ol_cv_header_db2=yes +else + rm -rf conftest* + ol_cv_header_db2=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ol_cv_header_db2" 1>&6 +else + ol_cv_header_db2=no +fi + + + + echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6 +echo "configure:8519: checking for Berkeley DB2" >&5 +if eval "test \"\${ol_cv_berkeley_db2+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then + ol_cv_berkeley_db2=no + else + ol_cv_berkeley_db2=yes + fi + +fi + +echo "$ac_t""$ol_cv_berkeley_db2" 1>&6 + if test $ol_cv_berkeley_db2 = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_BERKELEY_DB2 1 +EOF + + fi + + + if test $ol_cv_berkeley_db2 = yes ; then + ol_link_ldbm=db2 + ol_with_ldbm_api=db2 + + if test $ol_with_ldbm_type = hash ; then + cat >> confdefs.h <<\EOF +#define LDBM_USE_DBHASH 1 +EOF + + else + cat >> confdefs.h <<\EOF +#define LDBM_USE_DBBTREE 1 +EOF + + fi + + if test $ol_cv_lib_db2 != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2" + fi + fi +fi + +ol_link_bdb2=no +if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then + ol_link_bdb2=yes +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then + echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6 +echo "configure:8570: checking for Berkeley DB library" >&5 +if eval "test \"\${ol_cv_lib_db+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + for ac_hdr in db1/db.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:8579: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:8589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + ol_LIBS="$LIBS" + echo $ac_n "checking for dbopen""... $ac_c" 1>&6 +echo "configure:8617: checking for dbopen" >&5 +if eval "test \"\${ac_cv_func_dbopen+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dbopen(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dbopen) || defined (__stub___dbopen) +choke me +#else +f = dbopen; +#endif + +; return 0; } +EOF +if { (eval echo configure:8646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_dbopen=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_dbopen=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_db=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6 +echo "configure:8665: checking for dbopen in -ldb1" >&5 +ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldb1 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_db=-ldb1 +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6 +echo "configure:8704: checking for dbopen in -ldb" >&5 +ac_lib_var=`echo db'_'dbopen | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldb $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_db=-ldb +else + echo "$ac_t""no" 1>&6 +ol_cv_lib_db=no +fi + + +fi + + +fi + + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_lib_db" 1>&6 + + +for ac_hdr in db_185.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:8761: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:8771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +if test "$ol_cv_header_db2" = yes ; then + + ol_cv_header_db=$ac_cv_header_db_185_h +else + ol_cv_header_db=$ac_cv_header_db_h +fi + + + + echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6 +echo "configure:8807: checking for Berkeley DB" >&5 +if eval "test \"\${ol_cv_berkeley_db+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then + ol_cv_berkeley_db=no + else + ol_cv_berkeley_db=yes + fi + +fi + +echo "$ac_t""$ol_cv_berkeley_db" 1>&6 + if test $ol_cv_berkeley_db = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_BERKELEY_DB 1 +EOF + + fi + + + if test $ol_cv_berkeley_db = yes ; then + ol_link_ldbm=db + ol_with_ldbm_api=db + + if test $ol_with_ldbm_type = hash ; then + cat >> confdefs.h <<\EOF +#define LDBM_USE_DBHASH 1 +EOF + + else + cat >> confdefs.h <<\EOF +#define LDBM_USE_DBBTREE 1 +EOF + + fi + + if test $ol_cv_lib_db != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db" + fi + fi +fi + +if test $ol_with_ldbm_api = manual ; then + ol_link_ldbm=yes + + echo "configure: warning: LDBM defines and link options must be set manually" 1>&2 + + for ac_hdr in db.h db_185.h gdbm.h ndbm.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:8860: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:8870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +fi + +if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then + echo "configure: warning: Could not find LDBM with BTREE support" 1>&2 + ol_with_ldbm_api=none +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then + echo $ac_n "checking for MDBM library""... $ac_c" 1>&6 +echo "configure:8905: checking for MDBM library" >&5 +if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ol_LIBS="$LIBS" + echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6 +echo "configure:8911: checking for mdbm_set_chain" >&5 +if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mdbm_set_chain(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain) +choke me +#else +f = mdbm_set_chain; +#endif + +; return 0; } +EOF +if { (eval echo configure:8940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_mdbm_set_chain=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_mdbm_set_chain=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_mdbm=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6 +echo "configure:8959: checking for mdbm_set_chain in -lmdbm" >&5 +ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lmdbm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_mdbm=-lmdbm +else + echo "$ac_t""no" 1>&6 +ol_cv_lib_mdbm=no +fi + + +fi + + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_lib_mdbm" 1>&6 + + + for ac_hdr in mdbm.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:9013: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:9023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + echo $ac_n "checking for db""... $ac_c" 1>&6 +echo "configure:9050: checking for db" >&5 +if eval "test \"\${ol_cv_mdbm+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then + ol_cv_mdbm=no + else + ol_cv_mdbm=yes + fi + +fi + +echo "$ac_t""$ol_cv_mdbm" 1>&6 + if test $ol_cv_mdbm = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_MDBM 1 +EOF + + fi + + + if test $ol_cv_mdbm = yes ; then + ol_link_ldbm=mdbm + ol_with_ldbm_api=mdbm + if test $ol_cv_lib_mdbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm" + fi + fi +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then + echo $ac_n "checking for GDBM library""... $ac_c" 1>&6 +echo "configure:9083: checking for GDBM library" >&5 +if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ol_LIBS="$LIBS" + echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6 +echo "configure:9089: checking for gdbm_open" >&5 +if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gdbm_open(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gdbm_open) || defined (__stub___gdbm_open) +choke me +#else +f = gdbm_open; +#endif + +; return 0; } +EOF +if { (eval echo configure:9118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_gdbm_open=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_gdbm_open=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_gdbm=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6 +echo "configure:9137: checking for gdbm_open in -lgdbm" >&5 +ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lgdbm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_gdbm=-lgdbm +else + echo "$ac_t""no" 1>&6 +ol_cv_lib_gdbm=no +fi + + +fi + + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_lib_gdbm" 1>&6 + + + for ac_hdr in gdbm.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:9191: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:9201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + echo $ac_n "checking for db""... $ac_c" 1>&6 +echo "configure:9228: checking for db" >&5 +if eval "test \"\${ol_cv_gdbm+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then + ol_cv_gdbm=no + else + ol_cv_gdbm=yes + fi + +fi + +echo "$ac_t""$ol_cv_gdbm" 1>&6 + if test $ol_cv_gdbm = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_GDBM 1 +EOF + + fi + + + if test $ol_cv_gdbm = yes ; then + ol_link_ldbm=gdbm + ol_with_ldbm_api=gdbm + + if test $ol_cv_lib_gdbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm" + fi + fi +fi + +if test $ol_with_ldbm_api = auto ; then + echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2 +elif test $ol_with_ldbm_api = ndbm ; then + echo $ac_n "checking for NDBM library""... $ac_c" 1>&6 +echo "configure:9264: checking for NDBM library" >&5 +if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ol_LIBS="$LIBS" + echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 +echo "configure:9270: checking for dbm_open" >&5 +if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dbm_open(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dbm_open) || defined (__stub___dbm_open) +choke me +#else +f = dbm_open; +#endif + +; return 0; } +EOF +if { (eval echo configure:9299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_dbm_open=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_dbm_open=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_ndbm=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6 +echo "configure:9318: checking for dbm_open in -lndbm" >&5 +ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lndbm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_ndbm=-lndbm +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 +echo "configure:9357: checking for dbm_open in -ldbm" >&5 +ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldbm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_ndbm=-ldbm +else + echo "$ac_t""no" 1>&6 +ol_cv_lib_ndbm=no +fi + +fi + + +fi + + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_lib_ndbm" 1>&6 + + + for ac_hdr in ndbm.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:9413: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:9423: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + echo $ac_n "checking for db""... $ac_c" 1>&6 +echo "configure:9450: checking for db" >&5 +if eval "test \"\${ol_cv_ndbm+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then + ol_cv_ndbm=no + else + ol_cv_ndbm=yes + fi + +fi + +echo "$ac_t""$ol_cv_ndbm" 1>&6 + if test $ol_cv_ndbm = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_NDBM 1 +EOF + + fi + + + if test $ol_cv_ndbm = yes ; then + ol_link_ldbm=ndbm + ol_with_ldbm_api=ndbm + + if test $ol_cv_lib_ndbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm" + fi + fi +fi + +if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then + echo "configure: warning: could not find suitable LDBM backend" 1>&2 + if test $ol_enable_ldbm = yes ; then + { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; } + fi + + echo "configure: warning: disabling LDBM" 1>&2 + ol_enable_ldbm=no +fi + +if test $ol_enable_wrappers != no ; then + for ac_hdr in tcpd.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:9497: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:9507: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_tcpd_h != yes ; then + have_wrappers=no + else + echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6 +echo "configure:9538: checking for main in -lwrap" >&5 +ac_lib_var=`echo wrap'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lwrap $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_wrappers=yes +else + echo "$ac_t""no" 1>&6 +have_wrappers=no +fi + + fi + + if test $have_wrappers = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_TCPD 1 +EOF + + SLAPD_LIBS="$SLAPD_LIBS -lwrap" + + echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 +echo "configure:9584: checking for main in -lnsl" >&5 +ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + else + echo "configure: warning: could not find -lwrap" 1>&2 + if test $ol_enable_wrappers = yes ; then + { echo "configure: error: could not find wrappers" 1>&2; exit 1; } + fi + + echo "configure: warning: disabling wrappers support" 1>&2 + ol_enable_wrappers=no + fi +fi + +if test $ol_enable_syslog != no ; then + echo $ac_n "checking for openlog""... $ac_c" 1>&6 +echo "configure:9639: checking for openlog" >&5 +if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char openlog(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_openlog) || defined (__stub___openlog) +choke me +#else +f = openlog; +#endif + +; return 0; } +EOF +if { (eval echo configure:9668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_openlog=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_openlog=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then + { echo "configure: error: could not find syslog" 1>&2; exit 1; } + fi + ol_enable_syslog=$ac_cv_func_openlog +fi + +if test $ol_enable_dmalloc != no ; then + for ac_hdr in dmalloc.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:9698: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:9708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6 +echo "configure:9735: checking for dmalloc_shutdown in -ldmalloc" >&5 +ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldmalloc $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +fi + +if test $ol_enable_tcl != no ; then + for ac_hdr in tcl.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:9788: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:9798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_tcl_h != yes ; then + have_tcl=no + else + echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6 +echo "configure:9829: checking for main in -ltcl" >&5 +ac_lib_var=`echo tcl'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ltcl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl" +else + echo "$ac_t""no" 1>&6 +have_tcl=no +fi + + + if test $have_tcl != yes; then + echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6 +echo "configure:9868: checking for main in -ltcl7.6" >&5 +ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ltcl7.6 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6" +else + echo "$ac_t""no" 1>&6 +have_tcl=no +fi + + fi + + if test $have_tcl != yes; then + echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6 +echo "configure:9908: checking for main in -ltcl8.0" >&5 +ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ltcl8.0 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0" +else + echo "$ac_t""no" 1>&6 +have_tcl=no +fi + + fi + fi + + if test $have_tcl != yes ; then + echo "configure: warning: could not find -ltcl" 1>&2 + if test $ol_enable_tcl = yes ; then + { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; } + fi + + ol_enable_tcl=no + fi +fi + +# ud needs termcap (should insert check here) +ol_link_termcap=no +for ac_hdr in termcap.h ncurses.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:9963: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:9973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +if test $ol_link_termcap = no ; then + echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6 +echo "configure:10002: checking for tputs in -ltermcap" >&5 +ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ltermcap $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_termcap=yes +else + echo "$ac_t""no" 1>&6 +have_termcap=no +fi + + if test $have_termcap = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_TERMCAP 1 +EOF + + ol_link_termcap=yes + TERMCAP_LIBS=-ltermcap + fi +fi + +if test $ol_link_termcap = no ; then + echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 +echo "configure:10054: checking for initscr in -lncurses" >&5 +ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lncurses $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_ncurses=yes +else + echo "$ac_t""no" 1>&6 +have_ncurses=no +fi + + if test $have_ncurses = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_NCURSES 1 +EOF + + ol_link_termcap=yes + TERMCAP_LIBS=-lncurses + fi +fi + +if test $ol_link_termcap = no ; then + cat >> confdefs.h <<\EOF +#define NO_TERMCAP 1 +EOF + + TERMCAP_LIBS= +fi + +ol_link_readline=no +if test $ol_with_readline != no ; then + for ac_hdr in readline/readline.h readline/history.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:10118: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:10128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_readline_readline_h = yes ; then + save_LIBS="$LIBS" + LIBS="$TERMCAP_LIBS $LIBS" + echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 +echo "configure:10159: checking for readline in -lreadline" >&5 +ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lreadline $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_readline=yes +else + echo "$ac_t""no" 1>&6 +have_readline=no +fi + + LIBS="$save_LIBS" + + if test $have_readline = yes ; then + ol_with_readline=found + ol_link_readline=yes + + READLINE_LIBS="-lreadline" + fi + fi +fi + +if test $ol_link_readline = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_READLINE 1 +EOF + +fi + + +# FreeBSD (and others) have crypt(3) in -lcrypt +if test $ol_enable_crypt != no ; then + echo $ac_n "checking for crypt""... $ac_c" 1>&6 +echo "configure:10221: checking for crypt" >&5 +if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char crypt(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_crypt) || defined (__stub___crypt) +choke me +#else +f = crypt; +#endif + +; return 0; } +EOF +if { (eval echo configure:10250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_crypt=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_crypt=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_crypt=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 +echo "configure:10269: checking for crypt in -lcrypt" >&5 +ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lcrypt $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LUTIL_LIBS="$LUTIL_LIBS -lcrypt" + have_crypt=yes +else + echo "$ac_t""no" 1>&6 +have_crypt=no +fi + +fi + + + if test $have_crypt = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_CRYPT 1 +EOF + + else + echo "configure: warning: could not find crypt" 1>&2 + if test $ol_enable_crypt = yes ; then + { echo "configure: error: could not find crypt" 1>&2; exit 1; } + fi + + echo "configure: warning: disabling crypt support" 1>&2 + ol_enable_crypt=no + fi +fi + +# FreeBSD (and others) have setproctitle(3) in -lutil +if test $ol_enable_proctitle != no ; then + echo $ac_n "checking for setproctitle""... $ac_c" 1>&6 +echo "configure:10332: checking for setproctitle" >&5 +if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setproctitle(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setproctitle) || defined (__stub___setproctitle) +choke me +#else +f = setproctitle; +#endif + +; return 0; } +EOF +if { (eval echo configure:10361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_setproctitle=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_setproctitle=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_setproctitle=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6 +echo "configure:10380: checking for setproctitle in -lutil" >&5 +ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lutil $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_setproctitle=yes + LUTIL_LIBS="$LUTIL_LIBS -lutil" +else + echo "$ac_t""no" 1>&6 +have_setproctitle=no + LIBOBJS="$LIBOBJS setproctitle.o" +fi + +fi + + + if test $have_setproctitle = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_SETPROCTITLE 1 +EOF + + fi +fi + +echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 +echo "configure:10434: checking for uid_t in sys/types.h" >&5 +if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "uid_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_uid_t=yes +else + rm -rf conftest* + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_type_uid_t" 1>&6 +if test $ac_cv_type_uid_t = no; then + cat >> confdefs.h <<\EOF +#define uid_t int +EOF + + cat >> confdefs.h <<\EOF +#define gid_t int +EOF + +fi + +echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 +echo "configure:10468: checking type of array argument to getgroups" >&5 +if eval "test \"\${ac_cv_type_getgroups+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_type_getgroups=cross +else + cat > conftest.$ac_ext < +#define NGID 256 +#undef MAX +#define MAX(x, y) ((x) > (y) ? (x) : (y)) +main() +{ + gid_t gidset[NGID]; + int i, n; + union { gid_t gval; long lval; } val; + + val.lval = -1; + for (i = 0; i < NGID; i++) + gidset[i] = val.gval; + n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, + gidset); + /* Exit non-zero if getgroups seems to require an array of ints. This + happens when gid_t is short but getgroups modifies an array of ints. */ + exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); +} + +EOF +if { (eval echo configure:10501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_type_getgroups=gid_t +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_type_getgroups=int +fi +rm -fr conftest* +fi + +if test $ac_cv_type_getgroups = cross; then + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_getgroups=gid_t +else + rm -rf conftest* + ac_cv_type_getgroups=int +fi +rm -f conftest* + +fi +fi + +echo "$ac_t""$ac_cv_type_getgroups" 1>&6 +cat >> confdefs.h <&6 +echo "configure:10538: checking for ANSI C header files" >&5 +if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:10551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:10618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo $ac_n "checking for mode_t""... $ac_c" 1>&6 +echo "configure:10642: checking for mode_t" >&5 +if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + eval "ac_cv_type_mode_t=yes" +else + rm -rf conftest* + eval "ac_cv_type_mode_t=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 + cat >> confdefs.h <&6 +echo "configure:10677: checking for off_t" >&5 +if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + eval "ac_cv_type_off_t=yes" +else + rm -rf conftest* + eval "ac_cv_type_off_t=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 + cat >> confdefs.h <&6 +echo "configure:10712: checking for pid_t" >&5 +if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + eval "ac_cv_type_pid_t=yes" +else + rm -rf conftest* + eval "ac_cv_type_pid_t=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 + cat >> confdefs.h <&6 +echo "configure:10747: checking for ptrdiff_t" >&5 +if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +ptrdiff_t p +; return 0; } +EOF +if { (eval echo configure:10759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + am_cv_type_ptrdiff_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_type_ptrdiff_t=no +fi +rm -f conftest* +fi + +echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6 + if test $am_cv_type_ptrdiff_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PTRDIFF_T 1 +EOF + + fi + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:10780: checking return type of signal handlers" >&5 +if eval "test \"\${ac_cv_type_signal+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:10802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <&6 +echo "configure:10821: checking for sig_atomic_t" >&5 +if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +sig_atomic_t atomic; +; return 0; } +EOF +if { (eval echo configure:10833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_type_sig_atomic_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_type_sig_atomic_t=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6 + if test $ol_cv_type_sig_atomic_t = no; then + cat >> confdefs.h <<\EOF +#define sig_atomic_t int +EOF + + fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:10854: checking for size_t" >&5 +if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + eval "ac_cv_type_size_t=yes" +else + rm -rf conftest* + eval "ac_cv_type_size_t=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 + cat >> confdefs.h <&6 +echo "configure:10889: checking for socklen_t" >&5 +if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +int main() { +socklen_t len; +; return 0; } +EOF +if { (eval echo configure:10908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_type_socklen_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_type_socklen_t=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_type_socklen_t" 1>&6 + if test $ol_cv_type_socklen_t = no; then + cat >> confdefs.h <<\EOF +#define socklen_t int +EOF + + fi + +echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6 +echo "configure:10929: checking for member st_blksize in aggregate type struct stat" >&5 +if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { +struct stat foo; foo.st_blksize; +; return 0; } +EOF +if { (eval echo configure:10942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_struct_member_st_blksize=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_struct_member_st_blksize=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6 +st_blksize="$ac_cv_c_struct_member_st_blksize" +if test $ac_cv_c_struct_member_st_blksize = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ST_BLKSIZE 1 +EOF + +fi + +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:10964: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"\${ac_cv_header_time+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +struct tm *tp; +; return 0; } +EOF +if { (eval echo configure:10978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_time" 1>&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + +echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 +echo "configure:10999: checking whether struct tm is in sys/time.h or time.h" >&5 +if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { +struct tm *tp; tp->tm_sec; +; return 0; } +EOF +if { (eval echo configure:11012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_tm=time.h +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_tm=sys/time.h +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_struct_tm" 1>&6 +if test $ac_cv_struct_tm = sys/time.h; then + cat >> confdefs.h <<\EOF +#define TM_IN_SYS_TIME 1 +EOF + +fi + +# test for pw_gecos in struct passwd +echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6 +echo "configure:11034: checking struct passwd for pw_gecos" >&5 +if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +int main() { + + struct passwd pwd; + pwd.pw_gecos = pwd.pw_name; + +; return 0; } +EOF +if { (eval echo configure:11050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_struct_passwd_pw_gecos=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_struct_passwd_pw_gecos=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6 +if test $ol_cv_struct_passwd_pw_gecos = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_PW_GECOS 1 +EOF + +fi + +# test for pw_passwd in struct passwd +echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6 +echo "configure:11072: checking struct passwd for pw_passwd" >&5 +if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +int main() { + + struct passwd pwd; + pwd.pw_passwd = pwd.pw_name; + +; return 0; } +EOF +if { (eval echo configure:11088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_struct_passwd_pw_passwd=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_struct_passwd_pw_passwd=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6 +if test $ol_cv_struct_passwd_pw_passwd = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_PW_PASSWD 1 +EOF + +fi + + +echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6 +echo "configure:11110: checking if toupper() requires islower()" >&5 +if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$cross_compiling" = yes; then + ol_cv_c_upper_lower=safe +else + cat > conftest.$ac_ext < +main() +{ + if ('C' == toupper('C')) + exit(0); + else + exit(1); +} +EOF +if { (eval echo configure:11131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ol_cv_c_upper_lower=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ol_cv_c_upper_lower=yes +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ol_cv_c_upper_lower" 1>&6 +if test $ol_cv_c_upper_lower != no ; then + cat >> confdefs.h <<\EOF +#define C_UPPER_LOWER 1 +EOF + +fi + +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:11154: checking for working const" >&5 +if eval "test \"\${ac_cv_c_const+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:11208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + +echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6 +echo "configure:11229: checking if compiler understands volatile" >&5 +if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_c_volatile=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_c_volatile=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_c_volatile" 1>&6 + if test $ol_cv_c_volatile = yes; then + : + else + cat >> confdefs.h <<\EOF +#define volatile +EOF + + fi + + +if test $cross_compiling = yes ; then + cat >> confdefs.h <<\EOF +#define CROSS_COMPILING 1 +EOF + + + cat >> confdefs.h <<\EOF +#define LBER_INT_T long +EOF + + cat >> confdefs.h <<\EOF +#define LBER_TAG_T long +EOF + + cat >> confdefs.h <<\EOF +#define LBER_SOCKET_T int +EOF + + +else + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:11287: checking whether byte ordering is bigendian" >&5 +if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat > conftest.$ac_ext < +#include +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:11305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. +cat > conftest.$ac_ext < +#include +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:11320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_bigendian=no +fi +rm -f conftest* +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + +fi + + echo $ac_n "checking size of short""... $ac_c" 1>&6 +echo "configure:11377: checking size of short" >&5 +if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(short)); + exit(0); +} +EOF +if { (eval echo configure:11396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_short=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_short=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_short" 1>&6 +cat >> confdefs.h <&6 +echo "configure:11416: checking size of int" >&5 +if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(int)); + exit(0); +} +EOF +if { (eval echo configure:11435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_int=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_int=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_int" 1>&6 +cat >> confdefs.h <&6 +echo "configure:11455: checking size of long" >&5 +if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(long)); + exit(0); +} +EOF +if { (eval echo configure:11474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_long=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_long=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_long" 1>&6 +cat >> confdefs.h <&2 + + cat >> confdefs.h <<\EOF +#define LBER_INT_T long +EOF + + cat >> confdefs.h <<\EOF +#define LBER_TAG_T long +EOF + + cat >> confdefs.h <<\EOF +#define LBER_SOCKET_T int +EOF + + else + cat >> confdefs.h <<\EOF +#define LBER_INT_T int +EOF + + cat >> confdefs.h <<\EOF +#define LBER_TAG_T long +EOF + + cat >> confdefs.h <<\EOF +#define LBER_SOCKET_T int +EOF + + fi +fi + +cat >> confdefs.h <<\EOF +#define LBER_LEN_T long +EOF + + +echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 +echo "configure:11531: checking for 8-bit clean memcmp" >&5 +if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_memcmp_clean=no +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_memcmp_clean=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_memcmp_clean=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 +test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" + +echo $ac_n "checking for strftime""... $ac_c" 1>&6 +echo "configure:11567: checking for strftime" >&5 +if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strftime(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_strftime) || defined (__stub___strftime) +choke me +#else +f = strftime; +#endif + +; return 0; } +EOF +if { (eval echo configure:11596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_strftime=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_strftime=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_STRFTIME 1 +EOF + +else + echo "$ac_t""no" 1>&6 +# strftime is in -lintl on SCO UNIX. +echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 +echo "configure:11618: checking for strftime in -lintl" >&5 +ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lintl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_STRFTIME 1 +EOF + +LIBS="-lintl $LIBS" +else + echo "$ac_t""no" 1>&6 +fi + +fi + + +echo $ac_n "checking for vprintf""... $ac_c" 1>&6 +echo "configure:11665: checking for vprintf" >&5 +if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char vprintf(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_vprintf) || defined (__stub___vprintf) +choke me +#else +f = vprintf; +#endif + +; return 0; } +EOF +if { (eval echo configure:11694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_vprintf=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_vprintf=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_VPRINTF 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +if test "$ac_cv_func_vprintf" != yes; then +echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 +echo "configure:11718: checking for _doprnt" >&5 +if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _doprnt(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub__doprnt) || defined (__stub____doprnt) +choke me +#else +f = _doprnt; +#endif + +; return 0; } +EOF +if { (eval echo configure:11747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func__doprnt=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func__doprnt=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_DOPRNT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +fi + + +if test $ac_cv_func_vprintf = yes ; then + for ac_func in vsnprintf vsprintf +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:11776: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:11805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +fi + +for ac_func in \ + bcopy \ + closesocket \ + endgrent \ + endpwent \ + flock \ + getdtablesize \ + getgrgid \ + gethostname \ + getpass \ + getpwuid \ + getpwnam \ + getspnam \ + gettimeofday \ + initgroups \ + lockf \ + memcpy \ + memmove \ + mkstemp \ + read \ + recv \ + recvfrom \ + setpwfile \ + setgid \ + setegid \ + setsid \ + setuid \ + seteuid \ + signal \ + sigset \ + snprintf \ + strdup \ + strerror \ + strpbrk \ + strrchr \ + strsep \ + strstr \ + strtol \ + strtoul \ + strspn \ + sysconf \ + waitpid \ + wait4 \ + write \ + send \ + sendto \ + +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:11880: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:11909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +for ac_func in getopt tempnam +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:11937: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:11966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" +fi +done + + + +# Check Configuration +echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 +echo "configure:11995: checking declaration of sys_errlist" >&5 +if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include +#include +int main() { +char *c = (char *) *sys_errlist +; return 0; } +EOF +if { (eval echo configure:12011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_dcl_sys_errlist=yes + ol_cv_have_sys_errlist=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_dcl_sys_errlist=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6 +# +# It's possible (for near-UNIX clones) that sys_errlist doesn't exist +if test $ol_cv_dcl_sys_errlist = no ; then + cat >> confdefs.h <<\EOF +#define DECL_SYS_ERRLIST 1 +EOF + + + echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 +echo "configure:12034: checking existence of sys_errlist" >&5 +if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +int main() { +char *c = (char *) *sys_errlist +; return 0; } +EOF +if { (eval echo configure:12047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ol_cv_have_sys_errlist=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_have_sys_errlist=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6 +fi +if test $ol_cv_have_sys_errlist = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_ERRLIST 1 +EOF + +fi + + + +if test "$ol_enable_debug" != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_DEBUG 1 +EOF + +fi +if test "$ol_enable_syslog" = yes ; then + cat >> confdefs.h <<\EOF +#define LDAP_SYSLOG 1 +EOF + +fi +if test "$ol_enable_libui" = yes ; then + cat >> confdefs.h <<\EOF +#define LDAP_LIBUI 1 +EOF + +fi +if test "$ol_enable_cache" = no ; then + cat >> confdefs.h <<\EOF +#define LDAP_NOCACHE 1 +EOF + +fi +if test "$ol_enable_dns" != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION +EOF + +fi +if test "$ol_enable_proctitle" != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_PROCTITLE 1 +EOF + +fi +if test "$ol_enable_referrals" != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION +EOF + +fi +if test "$ol_enable_cldap" != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_CONNECTIONLESS 1 +EOF + +fi + +if test "$ol_enable_crypt" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_CRYPT 1 +EOF + +fi +if test "$ol_enable_cleartext" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_CLEARTEXT 1 +EOF + +fi +if test "$ol_enable_phonetic" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_PHONETIC 1 +EOF + +fi +if test "$ol_enable_rlookups" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_RLOOKUPS 1 +EOF + +fi + +if test "$ol_link_modules" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_MODULES 1 +EOF + + BUILD_SLAPD=yes +fi + +if test "$ol_link_bdb2" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_BDB2 1 +EOF + + BUILD_SLAPD=yes + BUILD_BDB2=yes + if test "$ol_with_bdb2_module" != static ; then + cat >> confdefs.h <<\EOF +#define SLAPD_BDB2_DYNAMIC 1 +EOF + + BUILD_BDB2_DYNAMIC=yes + fi +fi + +if test "$ol_enable_ldap" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_LDAP 1 +EOF + + BUILD_SLAPD=yes + BUILD_LDAP=yes + if test "$ol_with_ldap_module" != static ; then + cat >> confdefs.h <<\EOF +#define SLAPD_LDAP_DYNAMIC 1 +EOF + + BUILD_LDAP_DYNAMIC=yes + fi +fi + +if test "$ol_link_ldbm" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_LDBM 1 +EOF + + BUILD_SLAPD=yes + BUILD_LDBM=yes + if test "$ol_with_ldbm_module" != static ; then + cat >> confdefs.h <<\EOF +#define SLAPD_LDBM_DYNAMIC 1 +EOF + + BUILD_LDBM_DYNAMIC=yes + fi +fi + +if test "$ol_enable_passwd" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_PASSWD 1 +EOF + + BUILD_SLAPD=yes + BUILD_PASSWD=yes + if test "$ol_with_passwd_module" != static ; then + cat >> confdefs.h <<\EOF +#define SLAPD_PASSWD_DYNAMIC 1 +EOF + + BUILD_PASSWD_DYNAMIC=yes + fi +fi + +if test "$ol_link_perl" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_PERL 1 +EOF + + BUILD_SLAPD=yes + BUILD_PERL=yes + if test "$ol_with_perl_module" != static ; then + cat >> confdefs.h <<\EOF +#define SLAPD_PERL_DYNAMIC 1 +EOF + + BUILD_PERL_DYNAMIC=yes + fi +fi + +if test "$ol_enable_shell" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_SHELL 1 +EOF + + BUILD_SLAPD=yes + BUILD_SHELL=yes + if test "$ol_with_shell_module" != static ; then + cat >> confdefs.h <<\EOF +#define SLAPD_SHELL_DYNAMIC 1 +EOF + + BUILD_SHELL_DYNAMIC=yes + fi +fi + +if test "$ol_enable_tcl" != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_TCL 1 +EOF + + BUILD_SLAPD=yes + BUILD_TCL=yes + if test "$ol_with_tcl_module" != static; then + cat >> confdefs.h <<\EOF +#define SLAPD_TCL_DYNAMIC 1 +EOF + + BUILD_TCL_DYNAMIC=yes + fi +fi + +if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \ + $BUILD_SLAPD = yes ; then + BUILD_SLURPD=yes +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +trap '' 1 2 15 + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13.1" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "\ +Makefile:build/top.mk:Makefile.in:build/dir.mk \ +doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \ +doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \ +doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \ +doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \ +doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \ +doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \ +clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \ +clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \ +clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \ +clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \ +clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \ +clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \ +clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \ +clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \ +include/Makefile:build/top.mk:include/Makefile.in \ +libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \ +libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk \ +libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk \ +libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk \ +libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk \ +libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk \ +libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \ +libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk \ +servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \ +servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \ +servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \ +servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \ +servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \ +servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \ +servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \ +servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \ +servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \ +servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \ +servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \ +servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \ +tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \ +tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \ +contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \ +contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \ +contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \ + include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@target@%$target%g +s%@target_alias@%$target_alias%g +s%@target_cpu@%$target_cpu%g +s%@target_vendor@%$target_vendor%g +s%@target_os@%$target_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@install_sh@%$install_sh%g +s%@AMTAR@%$AMTAR%g +s%@AWK@%$AWK%g +s%@AMTARFLAGS@%$AMTARFLAGS%g +s%@SET_MAKE@%$SET_MAKE%g +s%@top_builddir@%$top_builddir%g +s%@ldap_subdir@%$ldap_subdir%g +s%@CC@%$CC%g +s%@RANLIB@%$RANLIB%g +s%@LD@%$LD%g +s%@NM@%$NM%g +s%@LN_S@%$LN_S%g +s%@LIBTOOL@%$LIBTOOL%g +s%@LN_H@%$LN_H%g +s%@SENDMAIL@%$SENDMAIL%g +s%@EDITOR@%$EDITOR%g +s%@FINGER@%$FINGER%g +s%@PERLBIN@%$PERLBIN%g +s%@CPP@%$CPP%g +s%@EXEEXT@%$EXEEXT%g +s%@OBJEXT@%$OBJEXT%g +s%@OL_MKDEP@%$OL_MKDEP%g +s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g +s%@GLIBCONFIG@%$GLIBCONFIG%g +s%@LIBOBJS@%$LIBOBJS%g +s%@BUILD_SLAPD@%$BUILD_SLAPD%g +s%@BUILD_BDB2@%$BUILD_BDB2%g +s%@BUILD_LDAP@%$BUILD_LDAP%g +s%@BUILD_LDBM@%$BUILD_LDBM%g +s%@BUILD_PASSWD@%$BUILD_PASSWD%g +s%@BUILD_PERL@%$BUILD_PERL%g +s%@BUILD_SHELL@%$BUILD_SHELL%g +s%@BUILD_TCL@%$BUILD_TCL%g +s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g +s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g +s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g +s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g +s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g +s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g +s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g +s%@BUILD_SLURPD@%$BUILD_SLURPD%g +s%@LDAP_LIBS@%$LDAP_LIBS%g +s%@SLAPD_LIBS@%$SLAPD_LIBS%g +s%@SLURPD_LIBS@%$SLURPD_LIBS%g +s%@LDBM_LIBS@%$LDBM_LIBS%g +s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g +s%@LUTIL_LIBS@%$LUTIL_LIBS%g +s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g +s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g +s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g +s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g +s%@KRB_LIBS@%$KRB_LIBS%g +s%@READLINE_LIBS@%$READLINE_LIBS%g +s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g +s%@TLS_LIBS@%$TLS_LIBS%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +date > stamp-h +echo Please \"make depend\" to build dependencies + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1 + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000000..3ee362d9fb --- /dev/null +++ b/configure.in @@ -0,0 +1,1999 @@ +dnl +dnl Copyright 1998,1999 The OpenLDAP Foundation. All Rights Reserved. +dnl +dnl Redistribution and use in source and binary forms are permitted only +dnl as authorized by the OpenLDAP Public License. A copy of this +dnl license is available at http://www.OpenLDAP.org/license.html or +dnl in file LICENSE in the top-level directory of the distribution. +dnl + +dnl Disable config.cache! +define([AC_CACHE_LOAD], )dnl +define([AC_CACHE_SAVE], )dnl + +dnl Configure.in for OpenLDAP +AC_INIT(build/version)dnl +AC_CONFIG_AUX_DIR(build)dnl + +OL_VERSION=`cat $ac_aux_dir/version` +if test -z "$OL_VERSION"; then + AC_MSG_ERROR([could not determine version]) +fi + +dnl ---------------------------------------------------------------- +dnl Determine host platform +dnl we try not to use this for much +AC_CANONICAL_SYSTEM + +AM_INIT_AUTOMAKE(OpenLDAP,[$OL_VERSION], [no defines])dnl +AC_SUBST(PACKAGE) +AC_SUBST(VERSION) +AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package) +AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version) + +dnl We use autoconf features new to 2.13. +dnl aclocal.m4 should be built using aclocal from automake 1.4 +dnl libtool 1.3.3 should be installed. +AC_PREREQ(2.13)dnl Required Autoconf version + +AC_CONFIG_HEADER(include/portable.h include/ldap_features.h include/lber_types.h)dnl + +dnl ---------------------------------------------------------------- +dnl Start Args +AC_MSG_CHECKING(configure arguments) +AC_PREFIX_DEFAULT(/usr/local) + +top_builddir=`pwd` +AC_SUBST(top_builddir)dnl + +ldap_subdir="openldap" + +AC_ARG_WITH(subdir, [ --with-subdir=DIR change default subdirectory used for installs], [ + if test "$withval" = "no"; then + ldap_subdir="" + elif test "$withval" != "yes"; then + ldap_subdir="$withval" + fi +])dnl + +AC_SUBST(ldap_subdir)dnl + +OL_ARG_ENABLE(debug,[ --enable-debug enable debugging], yes)dnl +dnl ol_enable_syslog=no +OL_ARG_ENABLE(syslog,[ --enable-syslog enable syslog support], auto)dnl +OL_ARG_ENABLE(proctitle,[ --enable-proctitle enable proctitle support], yes)dnl +OL_ARG_ENABLE(cache,[ --enable-cache enable caching], yes)dnl +OL_ARG_ENABLE(dns,[ --enable-dns enable V2 DNS extension], no)dnl +OL_ARG_ENABLE(referrals,[ --enable-referrals enable V2 Referrals extension], yes)dnl +OL_ARG_ENABLE(cldap,[ --enable-cldap enable connectionless ldap], no)dnl +OL_ARG_ENABLE(x_compile,[ --enable-x-compile enable cross compiling], + no, [yes no])dnl + +dnl General "with" options +OL_ARG_ENABLE(dmalloc,[ --enable-dmalloc enable debug malloc support], no)dnl + +OL_ARG_WITH(kerberos,[ --with-kerberos with Kerberos support], + auto, [auto k5 k4 afs yes no]) +OL_ARG_WITH(readline,[ --with-readline with readline support], + auto, [auto yes no] ) +OL_ARG_WITH(threads,[ --with-threads use threads], + auto, [auto posix mach lwp yes no manual] ) +OL_ARG_WITH(tls,[ --with-tls with TLS/SSL support], + auto, [auto ssleay openssl yes no] ) +OL_ARG_WITH(yielding_select,[ --with-yielding-select with implicitly yielding select], + auto, [auto yes no manual] ) + +dnl Server options + +dnl SLAPD OPTIONS +AC_ARG_WITH(xxslapdoptions,[SLAPD Options:]) +OL_ARG_ENABLE(slapd,[ --enable-slapd enable building slapd], yes)dnl +OL_ARG_ENABLE(cleartext,[ --enable-cleartext enable cleartext passwords], yes)dnl +OL_ARG_ENABLE(crypt,[ --enable-crypt enable crypt(3) passwords], auto)dnl +OL_ARG_ENABLE(modules,[ --enable-modules enable dynamic module support], no)dnl +OL_ARG_ENABLE(phonetic,[ --enable-phonetic enable phonetic/soundex], no)dnl +OL_ARG_ENABLE(rlookups,[ --enable-rlookups enable reverse lookups], auto)dnl +OL_ARG_ENABLE(wrappers,[ --enable-wrappers enable tcp wrapper support], no)dnl + +dnl SLAPD Backend options +OL_ARG_ENABLE(bdb2,[ --enable-bdb2 enable bdb2 backend], no)dnl +OL_ARG_WITH(bdb2_module,[ --with-bdb2-module module type], static, + [static dynamic]) +OL_ARG_ENABLE(ldap,[ --enable-ldap enable ldap backend], no)dnl +OL_ARG_WITH(ldap_module,[ --with-ldap-module module type], static, + [static dynamic]) +OL_ARG_ENABLE(ldbm,[ --enable-ldbm enable ldbm backend], yes)dnl +OL_ARG_WITH(ldbm_module,[ --with-ldbm-module module type], static, + [static dynamic]) +OL_ARG_WITH(ldbm_api,[ --with-ldbm-api use LDBM API], auto, + [auto db2 db mdbm gdbm ndbm manual]) +OL_ARG_WITH(ldbm_type,[ --with-ldbm-type use LDBM type], auto, + [auto btree hash]) + +OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend], no)dnl +OL_ARG_WITH(passwd_module,[ --with-passwd-module module type], static, + [static dynamic]) +OL_ARG_ENABLE(perl,[ --enable-perl enable perl backend], no)dnl +OL_ARG_WITH(perl_module,[ --with-perl-module module type], static, + [static dynamic]) +OL_ARG_ENABLE(shell,[ --enable-shell enable shell backend], no)dnl +OL_ARG_WITH(shell_module,[ --with-shell-module module type], static, + [static dynamic]) +OL_ARG_ENABLE(tcl,[ --enable-tcl enable tcl backend], no)dnl +OL_ARG_WITH(tcl_module,[ --with-tcl-module module type], static, + [static dynamic]) + +dnl SLURPD OPTIONS +AC_ARG_WITH(xxslurpdoptions,[SLURPD Options:]) +OL_ARG_ENABLE(slurpd,[ --enable-slurpd enable building slurpd], auto)dnl + +AC_ARG_WITH(xxliboptions,[Library Generation & Linking Options]) +AC_ENABLE_STATIC +dnl AC_DISABLE_SHARED +AC_ENABLE_SHARED + +dnl General "enable" options +# validate options +if test $ol_enable_dns = yes ; then + if test $ol_enable_referrals = no ; then + AC_MSG_ERROR([DNS requires --enable-referrals]) + fi + if test $ol_enable_referrals = auto ; then + AC_MSG_WARN([DNS requires referrals, adding --enable-referrals]) + ol_enable_referrals=yes + fi +fi + +if test $ol_enable_slapd = no ; then + dnl SLAPD was specificallly disabled + if test $ol_enable_bdb2 = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-bdb2 argument]) + fi + if test $ol_enable_ldap = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-ldap argument]) + fi + if test $ol_enable_ldbm = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-ldbm argument]) + fi + if test $ol_enable_passwd = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-passwd argument]) + fi + if test $ol_enable_perl = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-perl argument]) + fi + if test $ol_enable_shell = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-shell argument]) + fi + if test $ol_enable_tcl = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-tcl argument]) + fi + if test $ol_enable_modules = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-modules argument]) + fi + if test $ol_enable_wrappers = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-wrappers argument]) + fi + if test $ol_enable_phonetic = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-phonetic argument]) + fi + if test $ol_enable_rlookups = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-rlookups argument]) + fi + if test $ol_with_ldbm_api != auto ; then + AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-api argument]) + fi + if test $ol_with_ldbm_type != auto ; then + AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-type argument]) + fi + if test $ol_with_bdb2_module != static ; then + AC_MSG_WARN([slapd disabled, ignoring --with-bdb2-module argument]) + fi + if test $ol_with_ldap_module != static ; then + AC_MSG_WARN([slapd disabled, ignoring --with-ldap-module argument]) + fi + if test $ol_with_ldbm_module != static ; then + AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-module argument]) + fi + if test $ol_with_passwd_module != static ; then + AC_MSG_WARN([slapd disabled, ignoring --with-passwd-module argument]) + fi + if test $ol_with_perl_module != static ; then + AC_MSG_WARN([slapd disabled, ignoring --with-perl-module argument]) + fi + if test $ol_with_shell_module != static ; then + AC_MSG_WARN([slapd disabled, ignoring --with-shell-module argument]) + fi + if test $ol_with_tcl_module != static ; then + AC_MSG_WARN([slapd disabled, ignoring --with-tcl-module argument]) + fi + if test $ol_enable_slurpd = yes ; then + AC_MSG_ERROR([slurpd requires slapd]) + fi + + # force settings to no + ol_enable_bdb2=no + ol_enable_ldap=no + ol_enable_ldbm=no + ol_enable_passwd=no + ol_enable_perl=no + ol_enable_shell=no + ol_enable_tcl=no + + ol_enable_modules=no + ol_enable_phonetic=no + ol_enable_rlookups=no + ol_enable_wrappers=no + + ol_with_ldbm_api=no + ol_with_ldbm_type=no + + ol_with_bdb2_module=static + ol_with_ldap_module=static + ol_with_ldbm_module=static + ol_with_passwd_module=static + ol_with_perl_module=static + ol_with_shell_module=static + ol_with_tcl_module=static + + ol_enable_slurpd=no + +elif test $ol_enable_ldbm = no ; then + dnl SLAPD without LDBM + + if test $ol_with_ldbm_api != auto ; then + AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-api argument]) + fi + + if test $ol_with_ldbm_type != auto ; then + AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-type argument]) + fi + + if test $ol_with_ldbm_module != static ; then + AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-module argument]) + fi + + if test $ol_enable_bdb2 = yes ; then + AC_MSG_ERROR([BDB2 requires --enable-ldbm]) + fi + + if test $ol_enable_modules != yes -a \ + $ol_enable_ldap = no -a \ + $ol_enable_passwd = no -a \ + $ol_enable_perl = no -a \ + $ol_enable_shell = no -a \ + $ol_enable_tcl = no ; then + AC_MSG_ERROR([slapd requires a backend]) + fi + + ol_with_ldbm_api=no + ol_with_ldbm_type=no + ol_with_ldbm_module=static + +elif test $ol_enable_bdb2 = yes ; then + dnl SLAPD with BDB2 + + if test $ol_with_ldbm_api != auto -a \ + $ol_with_ldbm_api != db2 ; then + AC_MSG_ERROR([BDB2 requires LDBM API DB2]) + fi + + ol_with_ldbm_api=db2 + +else + dnl SLAPD with LDBM + + if test $ol_enable_bdb2 != no ; then + if test $ol_with_ldbm_api != auto -a \ + $ol_with_ldbm_api != db2 ; then + AC_MSG_WARN([BDB2 requires LDBM api db2 or auto]) + ol_enable_bdb2=no + fi + fi + + if test $ol_with_ldbm_api = gdbm -a \ + $ol_with_ldbm_type = btree ; then + AC_MSG_ERROR([GDBM only supports LDBM type hash]) + fi + if test $ol_with_ldbm_api = mdbm -a \ + $ol_with_ldbm_type = btree ; then + AC_MSG_ERROR([MDBM only supports LDBM type hash]) + fi + if test $ol_with_ldbm_api = ndbm -a \ + $ol_with_ldbm_type = btree ; then + AC_MSG_ERROR([NDBM only supports LDBM type hash]) + fi +fi + +if test $ol_enable_slurpd = yes ; then + dnl SLURPD was specifically enabled + if test $ol_with_threads = no ; then + AC_MSG_ERROR([slurpd requires threads]) + fi +fi + +AC_MSG_RESULT(done) + +## Initialize vars +LDAP_LIBS= +LDBM_LIBS= +LTHREAD_LIBS= +LUTIL_LIBS= + +SLAPD_LIBS= +SLURPD_LIBS= + +BUILD_SLAPD=no +BUILD_SLURPD=no + +BUILD_BDB2=no +BUILD_LDAP=no +BUILD_LDBM=no +BUILD_PASSWD=no +BUILD_PERL=no +BUILD_SHELL=no +BUILD_TCL=no +BUILD_THREAD=no + +BUILD_BDB2_DYNAMIC=no +BUILD_LDAP_DYNAMIC=no +BUILD_LDBM_DYNAMIC=no +BUILD_PASSWD_DYNAMIC=no +BUILD_PERL_DYNAMIC=no +BUILD_SHELL_DYNAMIC=no +BUILD_TCL_DYNAMIC=no + +SLAPD_MODULES_LDFLAGS= +SLAPD_MODULES_CPPFLAGS= + +SLAPD_PERL_LDFLAGS= +SLAPD_PERL_CPPFLAGS= + +KRB_LIBS= +READLINE_LIBS= +TERMCAP_LIBS= +TLS_LIBS= + +dnl ---------------------------------------------------------------- +dnl Checks for programs + +dnl AC_PROG_INSTALL + +AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion]) + + +dnl +dnl Determine which C translator to use +dnl + +dnl AIX Thread requires we use cc_r or xlc_r. +dnl But only do this IF AIX and CC is not set +dnl and threads are auto|yes|posix. +dnl +dnl If we find cc_r|xlc_r, force pthreads and assume +dnl pthread_create is in $LIBS (ie: don't bring in +dnl any additional thread libraries) +dnl If we do not find cc_r|xlc_r, disable threads + +ol_aix_threads=no +case "$target" in +*-*-aix*) dnl all AIX is not a good idea. + if test -z "$CC" ; then + case "$ol_with_threads" in + auto | yes | posix) ol_aix_threads=yes ;; + esac + fi +;; +esac + +if test $ol_aix_threads = yes ; then + if test -z "${CC}" ; then + AC_CHECK_PROGS(CC,cc_r xlc_r cc) + + if test "$CC" = cc ; then + dnl no CC! don't allow --with-threads + if test $ol_with_threads != auto ; then + AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX]) + else + AC_MSG_WARN([disabling threads, no cc_r on AIX]) + fi + ol_with_threads=no + fi + fi + + if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then + ol_with_threads=posix + ol_cv_pthread_create=yes + fi +fi + +if test -z "${CC}"; then + AC_CHECK_PROGS(CC,cc) +fi + +dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets. +dnl (for now, let autoconf sort this out) +dnl CFLAGS=${CFLAGS-""} + +AC_PROG_LIBTOOL +dnl AC_PROG_MAKE_SET + +AC_PROG_AWK +OL_PROG_LN_H +AC_PROG_LN_S + +if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then + LN_S="$LN_H" +fi + +AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail, + $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc) +AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb) +AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb) + +ol_link_perl=no +if test $ol_enable_perl != no ; then + AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl) + + if test "no$PERLBIN" = "no" ; then + if test $ol_enable_perl = yes ; then + AC_MSG_ERROR([could not locate perl]) + fi + + else + SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`" + SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`" + + dnl should check perl version + ol_link_perl=yes + fi +fi + +AC_PROG_CPP + +if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then + AC_MSG_WARN([cross compiling.... some functionality will be removed.]) + +elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then + AC_MSG_WARN([programs compiled here do run here...]) + AC_MSG_ERROR([ if not cross compiling, use --disable-x-compile.]) + +elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then + AC_MSG_WARN([programs compiled here do not run here...]) + AC_MSG_ERROR([ if cross compiling, add --enable-x-compile.]) +fi + +dnl Checks for UNIX Variants +AC_AIX +AC_ISC_POSIX +AC_MINIX + +dnl Checks for system services +AC_CYGWIN +AC_MINGW32 +AC_EXEEXT +AC_OBJEXT + +AC_DEFINE_UNQUOTED( EXEEXT, "${EXEEXT}", [defined to be the EXE extension]) + +dnl BeOS requires -lbe -lroot -lnet +AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot -lnet"], :, [-lroot -lnet]) + +dnl OpenLDAP requires STDC features +AM_PROG_CC_STDC +if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then + AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.]) +fi + +dnl Check cc depend flags +OL_MKDEPEND +if test "${ol_cv_mkdep}" = no ; then + # this will soon become an error + AC_MSG_WARN([do not know how to generate dependencies]) +fi + +dnl +dnl Check for module support +dnl +ol_link_modules=no +if test $ol_enable_modules != no ; then + AC_PATH_PROG(GLIBCONFIG, glib-config) + + if test "no$GLIBCONFIG" = "no" ; then + if test $ol_enable_modules = yes ; then + AC_MSG_ERROR([could not locate glib-config]) + fi + + else + SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`" + SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`" + SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`" + + dnl should check glib version + ol_link_modules=yes + fi +else + ol_with_bdb2_module=static + ol_with_ldap_module=static + ol_with_ldbm_module=static + ol_with_passwd_module=static + ol_with_perl_module=static + ol_with_shell_module=static + ol_with_tcl_module=static +fi + +dnl ---------------------------------------------------------------- +dnl Checks for header files. +OL_HEADER_STDC + +if test $ol_cv_header_stdc != yes; then + AC_MSG_WARN([could not locate Standard C compliant headers]) +fi + +AC_HEADER_DIRENT +AC_HEADER_SYS_WAIT +AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL +if test $am_cv_sys_posix_termios = yes ; then + AC_DEFINE(HAVE_POSIX_TERMIOS,1, + [define if you have POSIX termios]) +fi + +AC_CHECK_HEADERS( \ + arpa/inet.h \ + arpa/nameser.h \ + assert.h \ + crypt.h \ + errno.h \ + fcntl.h \ + filio.h \ + getopt.h \ + grp.h \ + libutil.h \ + limits.h \ + locale.h \ + netinet/tcp.h \ + malloc.h \ + memory.h \ + psap.h \ + pwd.h \ + resolv.h \ + sgtty.h \ + shadow.h \ + stdarg.h \ + stddef.h \ + string.h \ + strings.h \ + sysexits.h \ + sys/file.h \ + sys/filio.h \ + sys/errno.h \ + sys/ioctl.h \ + sys/param.h \ + sys/resource.h \ + sys/select.h \ + sys/socket.h \ + sys/syslog.h \ + sys/time.h \ + sys/types.h \ + syslog.h \ + termios.h \ + unistd.h \ +) + +dnl ---------------------------------------------------------------- +dnl Checks for libraries + +dnl Find socket() +dnl Likely combinations: +dnl -lsocket [ -lnsl_s | -lnsl ] +dnl -linet + +AC_CHECK_FUNC(socket, :, [ +dnl +dnl hopefully we won't include too many libraries +dnl + AC_CHECK_LIB(socket, main) + AC_CHECK_LIB(net, main) + AC_CHECK_LIB(net, socket) + AC_CHECK_LIB(nsl_s, main) + AC_CHECK_LIB(nsl, main) + AC_CHECK_LIB(inet, socket) + AC_CHECK_LIB(gen, main) +]) + +AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.])) + +dnl Select arg types +dnl (if this detection becomes permenent, it and the select() detection +dnl should be done before the yielding select test) +AC_FUNC_SELECT_ARGTYPES + + +AC_CHECK_HEADERS( regex.h ) +if test "$ac_cv_header_regex_h" != yes ; then + AC_MSG_ERROR([POSIX regex.h required.]) +fi +AC_CHECK_FUNC(regfree, :, AC_MSG_ERROR([POSIX regex required.])) + +OL_POSIX_REGEX +if test "$ol_cv_c_posix_regex" = no ; then + AC_MSG_ERROR([broken POSIX regex!]) +fi + + +dnl HP-UX requires -lV3 +AC_CHECK_LIB(V3, sigset) + + +# find res_search +if test $ol_enable_dns != no ; then + dnl Check for resolver routines + AC_CHECK_FUNC(res_search,:) + if test $ac_cv_func_res_search = no ; then + AC_CHECK_LIB(bind, res_search) + ac_cv_func_res_search=$ac_cv_lib_bind_res_search + fi + if test $ac_cv_func_res_search = no ; then + AC_CHECK_LIB(resolv, res_search) + ac_cv_func_res_search=$ac_cv_lib_resolv_res_search + fi + + if test "$ac_cv_func_res_search" = yes ; then + AC_DEFINE(HAVE_RES_SEARCH,1, + [define if you have res_search()]) + elif test $ol_enable_dns = yes ; then + AC_MSG_ERROR([--enable-dns requires res_search]) + else + AC_MSG_WARN([no res_search, disabling DNS support]) + fi +fi + +dnl +dnl check for kerberos +dnl +ol_link_kerberos=no + +if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then + AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h) + + if test $ac_cv_header_kerberosIV_krb_h = yes ; then + AC_CHECK_LIB(krb4, main, [have_k5=yes], [have_k5=no], + [-lkrb5 -ldes425]) + + if test $have_k5 = yes ; then + ol_with_kerberos=found + ol_link_kerberos=yes + + KRB_LIBS="-lkrb4 -lkrb5 -ldes425" + + LIBS="$KRB_LIBS $LIBS" + + AC_CACHE_CHECK([for des_debug in Kerberos libraries], + [ol_cv_var_des_debug], [ + dnl save the flags + save_LIBS="$LIBS" + LIBS="$KRB_LIBS $LIBS" + AC_TRY_LINK([ +#include +#include +extern int des_debug; +],[ +des_debug = 1; +], ol_cv_var_des_debug=yes, ol_cv_var_des_debug=no) + dnl restore the LIBS + LIBS="$save_LIBS" + ]) + + if test $ol_cv_var_des_debug = yes ; then + AC_DEFINE(HAVE_DES_DEBUG,1, + [define if you have Kerberos des_debug]) + fi + + LIBS="$save_LIBS" + fi + fi +fi + +if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then + AC_CHECK_HEADERS(krb.h des.h) + + if test $ac_cv_header_krb_h = yes ; then + AC_CHECK_LIB(krb, main, [have_k4=yes], [have_k4=no], [-ldes]) + + if test $have_k4 = yes ; then + ol_with_kerberos=found + ol_link_kerberos=yes + + KRB_LIBS="-lkrb -ldes" + fi + fi +fi + +if test $ol_link_kerberos = yes ; then + AC_DEFINE(HAVE_KERBEROS, 1, [define if you have Kerberos]) +fi + +dnl +dnl Check for SSL/TLS +dnl +ol_link_tls=no +if test $ol_with_tls != no ; then + + AC_CHECK_HEADERS(openssl/ssl.h ssl.h) + + if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then + AC_CHECK_LIB(ssl, SSLeay_add_ssl_algorithms, + [have_ssleay=yes + need_rsaref=no], + [have_ssleay=no], + [-lcrypto]) + + if test $have_ssleay = no ; then + AC_CHECK_LIB(ssl, SSL_library_init, + [have_ssleay=yes + need_rsaref=no], [have_ssleay=no], + [-lcrypto]) + fi + + if test $have_ssleay = no ; then + AC_CHECK_LIB(ssl, ssl3_accept, + [have_ssleay=yes + need_rsaref=yes], [have_ssleay=no], + [-lcrypto -lRSAglue -lrsaref]) + fi + + if test $have_ssleay = yes ; then + ol_with_tls=found + ol_link_tls=yes + + AC_DEFINE(HAVE_SSLEAY, 1, + [define if you have SSLeay or OpenSSL]) + + if test $need_rsaref = yes; then + AC_DEFINE(HAVE_RSAREF, 1, + [define if you have RSAref]) + + TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref" + else + TLS_LIBS="-lssl -lcrypto" + fi + fi + fi +fi + +if test $ol_link_tls = yes ; then + AC_DEFINE(HAVE_TLS, 1, [define if you have TLS]) +fi + +dnl Tests for reentrant functions necessary to build a +dnl thread_safe -lldap. +AC_CHECK_FUNCS( \ + ctime_r \ + gethostbyname_r gethostbyaddr_r \ +) + +if test "$ac_cv_func_ctime_r" = no ; then + ol_cv_func_ctime_r_nargs=0 +else + OL_FUNC_CTIME_R_NARGS +dnl OL_FUNC_CTIME_R_TYPE +fi + +if test "$ac_cv_func_gethostbyname_r" = yes ; then + OL_FUNC_GETHOSTBYNAME_R_NARGS +else + ol_cv_func_gethostbyname_r_nargs=0 +fi + +if test "$ac_cv_func_gethostbyaddr_r" = yes ; then + OL_FUNC_GETHOSTBYADDR_R_NARGS +else + ol_cv_func_gethostbyaddr_r_nargs=0 +fi + +if test "$ac_cv_func_ctime_r" = yes \ + -a "$ol_cv_func_ctime_r_nargs" -ge 2 \ + -a "$ol_cv_func_ctime_r_nargs" -le 3 \ + -a "$ac_cv_func_gethostbyname_r" = yes \ + -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \ + -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \ + -a "$ac_cv_func_gethostbyaddr_r" = yes \ + -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \ + -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \ + ; then + + AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT,1) +fi + +ol_link_threads=no +if test $ol_with_threads = auto -o $ol_with_threads = yes \ + -o $ol_with_threads = posix ; then + + AC_CHECK_HEADERS(pthread.h sched.h) + + if test $ac_cv_header_pthread_h = yes ; then + OL_POSIX_THREAD_VERSION + + if test $ol_cv_pthread_version = final ; then + AC_DEFINE(HAVE_PTHREADS_FINAL,1, + [define if pthreads API compatible with final spec]) + elif test $ol_cv_pthread_version = draft4 ; then + AC_DEFINE(HAVE_PTHREADS_D4,1, + [define if pthreads API compatible with draft4 spec]) + else + AC_MSG_ERROR([unknown pthread version]) + fi + + # consider threads found + ol_with_threads=found + + OL_HEADER_LINUX_THREADS + + dnl Now the hard part, how to link? + dnl + dnl currently supported checks: + dnl + dnl Check for no flags + dnl pthread_create() in $LIBS + dnl + dnl Check special pthread (final) flags + dnl pthread_create() with -mt (Solaris) + dnl pthread_create() with -kthread (FreeBSD) + dnl pthread_create() with -pthread (FreeBSD/Digital Unix) + dnl pthread_create() with -pthreads (?) + dnl pthread_create() with -mthreads (AIX) + dnl pthread_create() with -thread (?) + dnl + dnl Check pthread (final) libraries + dnl pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1) + dnl pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1) + dnl (skipped) pthread_mutex_trylock() in -lpthread -lexc (OSF/1) + dnl pthread_join() -Wl,-woff,85 -lpthread (IRIX) + dnl pthread_create() in -lpthread (many) + dnl pthread_create() in -lc_r (FreeBSD) + dnl + dnl Check pthread (draft4) flags (depreciated) + dnl pthread_create() with -threads (OSF/1) + dnl + dnl Check pthread (draft4) libraries (depreciated) + dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1) + dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1) + dnl pthread_mutex_trylock() in -lpthreads -lexc (OSF/1) + dnl pthread_create() in -lpthreads (many) + dnl + + dnl pthread_create in $LIBS + AC_CACHE_CHECK([for pthread_create in default libraries], + ol_cv_pthread_create,[ + AC_TRY_RUN([ +#include +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + +int main(argc, argv) + int argc; + char **argv; +{ + pthread_t t; + int status; + + /* make sure pthread_create() isn't just a stub */ +#if HAVE_PTHREADS_D4 + status = pthread_create(&t, pthread_attr_default, task, NULL); +#else + status = pthread_create(&t, NULL, task, NULL); +#endif + + if( status ) return status; + + /* make sure pthread_detach() isn't just a stub */ +#if HAVE_PTHREADS_D4 + status = pthread_detach( &t ); +#else + status = pthread_detach( t ); +#endif + + return status; +} +], + [ol_cv_pthread_create=yes], + [ol_cv_pthread_create=no], + [dnl assume yes + ol_cv_pthread_create=yes])]) + + if test $ol_cv_pthread_create != no ; then + ol_link_threads=posix + ol_link_pthreads="" + fi + + OL_PTHREAD_TRY_LINK([-mt], [ol_cv_pthread_mt]) + OL_PTHREAD_TRY_LINK([-kthread], [ol_cv_pthread_kthread]) + OL_PTHREAD_TRY_LINK([-pthread], [ol_cv_pthread_pthread]) + OL_PTHREAD_TRY_LINK([-pthreads],[ol_cv_pthread_pthreads]) + OL_PTHREAD_TRY_LINK([-mthreads],[ol_cv_pthread_mthreads]) + OL_PTHREAD_TRY_LINK([-thread], [ol_cv_pthread_thread]) + + OL_PTHREAD_TRY_LINK([-lpthread -lmach -lexc -lc_r], + [ol_cv_pthread_lpthread_lmach_lexc_lc_r]) + OL_PTHREAD_TRY_LINK([-lpthread -lmach -lexc], + [ol_cv_pthread_lpthread_lmach_lexc]) +dnl OL_PTHREAD_TRY_LINK([-lpthread -lexc], +dnl [ol_cv_pthread_lpthread_lexc]) + + OL_PTHREAD_TRY_LINK([-lpthread -Wl,-woff,85], + [ol_cv_pthread_lib_lpthread_woff]) + + OL_PTHREAD_TRY_LINK([-lpthread],[ol_cv_pthread_lpthread]) + OL_PTHREAD_TRY_LINK([-lc_r], [ol_cv_pthread_lc_r]) + + OL_PTHREAD_TRY_LINK([-threads], [ol_cv_pthread_threads]) + + OL_PTHREAD_TRY_LINK([-lpthreads -lmach -lexc -lc_r], + [ol_cv_pthread_lpthreads_lmach_lexc_lc_r]) + OL_PTHREAD_TRY_LINK([-lpthreads -lmach -lexc], + [ol_cv_pthread_lpthreads_lmach_lexc]) + OL_PTHREAD_TRY_LINK([-lpthreads -lexc], + [ol_cv_pthread_lpthreads_lexc]) + + OL_PTHREAD_TRY_LINK([-lpthreads], [ol_cv_pthread_lib_lpthreads]) + + if test $ol_link_threads != no ; then + AC_DEFINE(HAVE_PTHREADS,1, + [define if you have POSIX Threads]) + + LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads" + + dnl save flags + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + LIBS="$LTHREAD_LIBS $LIBS" + + dnl All POSIX Thread (final) implementations should have + dnl sched_yield instead of pthread yield. + dnl check for both + AC_CHECK_FUNCS(sched_yield pthread_yield) + + if test $ac_cv_func_sched_yield = no -a \ + $ac_cv_func_pthread_yield = no ; then + dnl Digital UNIX has sched_yield() in -lrt + AC_CHECK_LIB(rt, sched_yield, + [LTHREAD_LIBS="$LTHREAD_LIBS -lrt" + AC_DEFINE(HAVE_SCHED_YIELD,1, + [Define if you have the sched_yield function.]) + ac_cv_func_sched_yield=yes], + [ac_cv_func_sched_yield=no]) + fi + if test $ac_cv_func_sched_yield = no -a \ + $ac_cv_func_pthread_yield = no ; then + dnl Solaris has sched_yield() stub in -lposix4 + dnl but we'll use thr_yield instead. + AC_CHECK_FUNCS(thr_yield) + fi + if test $ac_cv_func_sched_yield = no -a \ + $ac_cv_func_pthread_yield = no -a \ + "$ac_cv_func_thr_yield" = no ; then + AC_MSG_WARN([could not locate sched_yield() or pthread_yield()]) + fi + + dnl Check functions for compatibility + AC_CHECK_FUNCS(pthread_kill) + + dnl Check for pthread_detach with inclusion + dnl as it's symbol may have been mangled. + AC_CACHE_CHECK([for pthread_detach with ], + [ol_cv_func_pthread_detach], [ + dnl save the flags + AC_TRY_LINK([ +#include +#ifndef NULL +#define NULL (void*)0 +#endif +], + [pthread_detach(NULL);], + [ol_cv_func_pthread_detach=yes], + [ol_cv_func_pthread_detach=no]) + ]) + + if test $ol_cv_func_pthread_detach = no ; then + AC_MSG_ERROR([could not locate pthread_detach()]) + fi + + AC_DEFINE(HAVE_PTHREAD_DETACH,1, + [define if you have pthread_detach function]) + + dnl Check for setconcurreny functions + AC_CHECK_FUNCS( \ + pthread_setconcurrency \ + pthread_getconcurrency \ + thr_setconcurrency \ + thr_getconcurrency \ + ) + + OL_SYS_LINUX_THREADS + OL_LINUX_THREADS + + if test $ol_cv_linux_threads = error; then + AC_MSG_ERROR([LinuxThreads header/library mismatch]); + fi + + AC_CACHE_CHECK([if pthread_create() works], + ol_cv_pthread_create_works,[ + AC_TRY_RUN([ +#include +#ifndef NULL +#define NULL (void*)0 +#endif + +static void *task(p) + void *p; +{ + return (void *) (p == NULL); +} + +int main(argc, argv) + int argc; + char **argv; +{ + pthread_t t; +#if HAVE_PTHREADS_D4 + exit(pthread_create(&t, pthread_attr_default, task, NULL)); +#else + exit(pthread_create(&t, NULL, task, NULL)); +#endif +} +], + [ol_cv_pthread_create_works=yes], + [ol_cv_pthread_create_works=no], + [dnl assume yes + ol_cv_pthread_create_works=yes])]) + + if test $ol_cv_pthread_create_works = no ; then + AC_MSG_ERROR([pthread_create is not usable, check environment settings]) + fi + + dnl Check if select causes an yield + if test $ol_with_yielding_select = auto ; then + AC_CACHE_CHECK([if select yields when using pthreads], + ol_cv_pthread_select_yields,[ + AC_TRY_RUN([ +#include +#include +#include +#include +#ifndef NULL +#define NULL (void*) 0 +#endif + +static int fildes[2]; + +static void *task(p) + void *p; +{ + int i; + struct timeval tv; + + fd_set rfds; + + tv.tv_sec=10; + tv.tv_usec=0; + + FD_ZERO(&rfds); + FD_SET(fildes[0], &rfds); + + /* we're not interested in any fds */ + i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv); + + if(i < 0) { + perror("select"); + exit(10); + } + + exit(0); /* if we exit here, the select blocked the whole process */ +} + +int main(argc, argv) + int argc; + char **argv; +{ + pthread_t t; + + /* create a pipe to select */ + if(pipe(&fildes[0])) { + perror("select"); + exit(1); + } + +#ifdef HAVE_PTHREAD_SETCONCURRENCY + (void) pthread_setconcurrency(2); +#else +#ifdef HAVE_THR_SETCONCURRENCY + /* Set Solaris LWP concurrency to 2 */ + thr_setconcurrency(2); +#endif +#endif + +#if HAVE_PTHREADS_D4 + pthread_create(&t, pthread_attr_default, task, NULL); +#else + pthread_create(&t, NULL, task, NULL); +#endif + +#if HAVE_SCHED_YIELD + sched_yield(); /* make sure task runs first */ +#else +#ifdef HAVE_PTHREAD_YIELD + pthread_yield(); /* make sure task runs first */ +#endif +#endif + + exit(2); +}], + [ol_cv_pthread_select_yields=no], + [ol_cv_pthread_select_yields=yes], + [ol_cv_pthread_select_yields=cross])]) + + if test $ol_cv_pthread_select_yields = cross ; then + AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual]) + fi + + if test $ol_cv_pthread_select_yields = yes ; then + ol_with_yielding_select=yes + fi + fi + + dnl restore flags + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + else + AC_MSG_ERROR([could not link with POSIX Threads]) + fi + fi + + if test $ol_with_threads = posix ; then + AC_MSG_ERROR([could not locate POSIX Threads]) + fi +fi + +if test $ol_with_threads = auto -o $ol_with_threads = yes \ + -o $ol_with_threads = mach ; then + + dnl check for Mach CThreads + AC_CHECK_HEADERS(mach/cthreads.h) + if test $ac_cv_header_mach_cthreads_h = yes ; then + ol_with_threads=found + + dnl check for cthread support in current $LIBS + AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes]) + + if test $ol_link_threads = no ; then + dnl try -all_load + dnl this test needs work + AC_CACHE_CHECK([for cthread_fork with -all_load], + [ol_cv_cthread_all_load], [ + dnl save the flags + save_LIBS="$LIBS" + LIBS="-all_load $LIBS" + AC_TRY_LINK([#include ],[ + cthread_fork((void *)0, (void *)0); + ], ol_cv_cthread_all_load=yes, ol_cv_cthread_all_load=no) + dnl restore the LIBS + LIBS="$save_LIBS" + ]) + + if test $ol_cv_cthread_all_load = yes ; then + LTHREAD_LIBS="$LTHREAD_LIBS -all_load" + ol_link_threads=mach + fi + fi + + if test $ol_link_threads != no ; then + : check for cthread specific functionality here + AC_DEFINE(HAVE_MACH_CTHREADS,1, + [define if you have Mach Cthreads]) + else + AC_MSG_ERROR([could not link with Mach CThreads]) + fi + fi + + if test $ol_with_threads = mach ; then + AC_MSG_ERROR([could not locate Mach CThreads]) + fi +fi + +if test $ol_with_threads = auto -o $ol_with_threads = yes \ + -o $ol_with_threads = lwp ; then + + dnl check for SunOS5 LWP + AC_CHECK_HEADERS(thread.h synch.h) + if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then + AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no]) + + if test $have_thr = yes ; then + AC_DEFINE(HAVE_THR,1, + [if you have Solaris LWP (thr) package]) + LTHREAD_LIBS="$LTHREAD_LIBS -lthread" + ol_link_threads=thr + + if test $ol_with_yielding_select = auto ; then + ol_with_yielding_select=yes + fi + + dnl Check for setconcurreny functions + AC_CHECK_FUNCS( \ + thr_setconcurrency \ + thr_getconcurrency \ + ) + fi + fi + + dnl check for SunOS4 LWP + AC_CHECK_HEADERS(lwp/lwp.h) + if test $ac_cv_header_lwp_lwp_h = yes ; then + AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no]) + + if test $have_lwp = yes ; then + AC_DEFINE(HAVE_LWP,1, + [if you have SunOS LWP package]) + LTHREAD_LIBS="$LTHREAD_LIBS -llwp" + ol_link_threads=lwp + + if test $ol_with_yielding_select = auto ; then + ol_with_yielding_select=no + fi + fi + fi +fi + +if test $ol_with_yielding_select = yes ; then + AC_DEFINE(HAVE_YIELDING_SELECT,1, + [define if select implicitly yields]) +fi + +if test $ol_with_threads = manual ; then + dnl User thinks he can manually configure threads. + ol_link_threads=yes + + AC_MSG_WARN([thread defines and link options must be set manually]) + + AC_CHECK_HEADERS(pthread.h sched.h) + AC_CHECK_FUNCS(sched_yield pthread_yield) + OL_HEADER_LINUX_THREADS + + AC_CHECK_HEADERS(mach/cthreads.h) + AC_CHECK_HEADERS(lwp/lwp.h) + AC_CHECK_HEADERS(thread.h synch.h) +fi + +if test $ol_link_threads != no ; then + dnl needed to get reentrant/threadsafe versions + dnl + AC_DEFINE(REENTRANT,1) + AC_DEFINE(_REENTRANT,1) + AC_DEFINE(THREAD_SAFE,1) + AC_DEFINE(_THREAD_SAFE,1) + AC_DEFINE(THREADSAFE,1) + AC_DEFINE(_THREADSAFE,1) + AC_DEFINE(_SGI_MP_SOURCE,1) + + dnl The errno declaration may dependent upon _REENTRANT. + dnl If it does, we must link with thread support. + AC_CACHE_CHECK([for thread specific errno], + [ol_cv_errno_thread_specific], [ + AC_TRY_LINK([#include ], [errno = 0;], + [ol_cv_errno_thread_specific=yes], + [ol_cv_errno_thread_specific=no]) + ]) + + dnl The h_errno declaration may dependent upon _REENTRANT. + dnl If it does, we must link with thread support. + AC_CACHE_CHECK([for thread specific h_errno], + [ol_cv_h_errno_thread_specific], [ + AC_TRY_LINK([#include ], [h_errno = 0;], + [ol_cv_h_errno_thread_specific=yes], + [ol_cv_h_errno_thread_specific=no]) + ]) + + if test $ol_cv_errno_thread_specific != yes \ + -o $ol_cv_h_errno_thread_specific != yes ; then + LIBS="$LTHREAD_LIBS $LIBS" + LTHREAD_LIBS="" + fi + +dnl When in thread environment, use +dnl #if defined( HAVE_REENTRANT_FUNCTIONS ) \ +dnl || defined( HAVE_FUNC_R ) +dnl func_r(...); +dnl #else +dnl # if defined( HAVE_THREADS ) +dnl /* lock */ +dnl # endif +dnl func(...); +dnl # if defined( HAVE_THREADS ) +dnl /* unlock */ +dnl # endif +dnl #endif +dnl +dnl HAVE_REENTRANT_FUNCTIONS is derived from: +dnl _POSIX_REENTRANT_FUNCTIONS +dnl _POSIX_THREAD_SAFE_FUNCTIONS +dnl _POSIX_THREADSAFE_FUNCTIONS +dnl +dnl and is currently defined in lthread.h +dnl +dnl HAVE_THREADS is defined by lthread.h iff -UNO_THREADS +dnl +dnl libldap/*.c should only include iff +dnl LDAP_R_COMPILE is defined. ie: +dnl #ifdef LDAP_R_COMPILE +dnl # include LDAP_R_COMPILE +dnl #endif +dnl +dnl LDAP_R_COMPILE is defined by libldap_r/Makefile.in +dnl specifically for compiling the threadsafe version of +dnl the ldap library (-lldap_r). +dnl +dnl dnl check for reentrant/threadsafe functions +dnl dnl +dnl dnl note: these should only be used when linking +dnl dnl with $LTHREAD_LIBS +dnl dnl +dnl save_CPPFLAGS="$CPPFLAGS" +dnl save_LIBS="$LIBS" +dnl LIBS="$LTHREAD_LIBS $LIBS" +dnl AC_CHECK_FUNCS( \ +dnl gmtime_r \ +dnl gethostbyaddr_r gethostbyname_r \ +dnl feof_unlocked unlocked_feof \ +dnl putc_unlocked unlocked_putc \ +dnl flockfile ftrylockfile \ +dnl ) +dnl CPPFLAGS="$save_CPPFLAGS" +dnl LIBS="$save_LIBS" +fi + +if test $ol_link_threads = no ; then + if test $ol_with_threads = yes ; then + AC_MSG_ERROR([no suitable thread support]) + fi + + if test $ol_with_threads = auto ; then + AC_MSG_WARN([no suitable thread support, disabling threads]) + ol_with_threads=no + fi + + AC_DEFINE(NO_THREADS,1, + [define if you have (or want) no threads]) + LTHREAD_LIBS="" +fi + +if test $ol_link_threads != no ; then + AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE,1) +fi + +dnl ---------------------------------------------------------------- + +ol_link_ldbm=no +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then + OL_BERKELEY_DB2 + + if test $ol_cv_berkeley_db2 = yes ; then + ol_link_ldbm=db2 + ol_with_ldbm_api=db2 + + if test $ol_with_ldbm_type = hash ; then + AC_DEFINE(LDBM_USE_DBHASH,1, + [define this to use DBHASH w/ LDBM backend]) + else + AC_DEFINE(LDBM_USE_DBBTREE,1, + [define this to use DBBTREE w/ LDBM backend]) + fi + + dnl $ol_cv_lib_db2 should be yes or -ldb + dnl (it could be no, but that would be an error + if test $ol_cv_lib_db2 != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2" + fi + fi +fi + +ol_link_bdb2=no +if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then + ol_link_bdb2=yes +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then + OL_BERKELEY_DB + + if test $ol_cv_berkeley_db = yes ; then + ol_link_ldbm=db + ol_with_ldbm_api=db + + if test $ol_with_ldbm_type = hash ; then + AC_DEFINE(LDBM_USE_DBHASH,1, + [define this to use DBHASH w/ LDBM backend]) + else + AC_DEFINE(LDBM_USE_DBBTREE,1, + [define this to use DBBTREE w/ LDBM backend]) + fi + + dnl $ol_cv_lib_db should be yes or -ldb + dnl (it could be no, but that would be an error + if test $ol_cv_lib_db != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db" + fi + fi +fi + +if test $ol_with_ldbm_api = manual ; then + dnl User thinks he can manually configure LDBM api. + ol_link_ldbm=yes + + AC_MSG_WARN([LDBM defines and link options must be set manually]) + + AC_CHECK_HEADERS(db.h db_185.h gdbm.h ndbm.h) +fi + +if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then + AC_MSG_WARN(Could not find LDBM with BTREE support) + ol_with_ldbm_api=none +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then + OL_MDBM + + if test $ol_cv_mdbm = yes ; then + ol_link_ldbm=mdbm + ol_with_ldbm_api=mdbm + if test $ol_cv_lib_mdbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm" + fi + fi +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then + OL_GDBM + + if test $ol_cv_gdbm = yes ; then + ol_link_ldbm=gdbm + ol_with_ldbm_api=gdbm + + if test $ol_cv_lib_gdbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm" + fi + fi +fi + +if test $ol_with_ldbm_api = auto ; then + AC_MSG_WARN([skipping automatic checking for NDBM, must be manually enabled.]) +elif test $ol_with_ldbm_api = ndbm ; then + OL_NDBM + + if test $ol_cv_ndbm = yes ; then + ol_link_ldbm=ndbm + ol_with_ldbm_api=ndbm + + if test $ol_cv_lib_ndbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm" + fi + fi +fi + +if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then + AC_MSG_WARN(could not find suitable LDBM backend) + if test $ol_enable_ldbm = yes ; then + AC_MSG_ERROR(select appropriate LDBM options or disable) + fi + + AC_MSG_WARN(disabling LDBM) + ol_enable_ldbm=no +fi + +if test $ol_enable_wrappers != no ; then + AC_CHECK_HEADERS(tcpd.h) + + if test $ac_cv_header_tcpd_h != yes ; then + have_wrappers=no + else + AC_CHECK_LIB(wrap, main, + [have_wrappers=yes], [have_wrappers=no]) + fi + + if test $have_wrappers = yes ; then + AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap]) + SLAPD_LIBS="$SLAPD_LIBS -lwrap" + + dnl We add another check for -lnsl since some libwrap's + dnl need it, but it isn't always included from above + AC_CHECK_LIB(nsl, main) + else + AC_MSG_WARN(could not find -lwrap) + if test $ol_enable_wrappers = yes ; then + AC_MSG_ERROR(could not find wrappers, select appropriate options or disable) + fi + + AC_MSG_WARN(disabling wrappers support) + ol_enable_wrappers=no + fi +fi + +if test $ol_enable_syslog != no ; then + AC_CHECK_FUNC(openlog) + if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then + AC_MSG_ERROR(could not find syslog, select appropriate options or disable) + fi + ol_enable_syslog=$ac_cv_func_openlog +fi + +if test $ol_enable_dmalloc != no ; then + AC_CHECK_HEADERS(dmalloc.h) + AC_CHECK_LIB(dmalloc, dmalloc_shutdown) +fi + +if test $ol_enable_tcl != no ; then + AC_CHECK_HEADERS(tcl.h) + + if test $ac_cv_header_tcl_h != yes ; then + have_tcl=no + else + AC_CHECK_LIB(tcl,main, + [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"], + [have_tcl=no]) + + if test $have_tcl != yes; then + AC_CHECK_LIB(tcl7.6,main, + [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"], + [have_tcl=no]) + fi + + if test $have_tcl != yes; then + AC_CHECK_LIB(tcl8.0,main, + [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"], + [have_tcl=no]) + fi + fi + + if test $have_tcl != yes ; then + AC_MSG_WARN([could not find -ltcl]) + if test $ol_enable_tcl = yes ; then + AC_MSG_ERROR([could not find tcl, select appropriate options or disable]) + fi + + ol_enable_tcl=no + fi +fi + +# ud needs termcap (should insert check here) +ol_link_termcap=no +AC_CHECK_HEADERS(termcap.h ncurses.h) + +if test $ol_link_termcap = no ; then + AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no]) + if test $have_termcap = yes ; then + AC_DEFINE(HAVE_TERMCAP, 1, [define if you have -ltermcap]) + ol_link_termcap=yes + TERMCAP_LIBS=-ltermcap + fi +fi + +if test $ol_link_termcap = no ; then + AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no]) + if test $have_ncurses = yes ; then + AC_DEFINE(HAVE_NCURSES, 1, [define if you have -lncurses]) + ol_link_termcap=yes + TERMCAP_LIBS=-lncurses + fi +fi + +if test $ol_link_termcap = no ; then + AC_DEFINE(NO_TERMCAP,1, [define if you have no termcap support]) + TERMCAP_LIBS= +fi + +dnl +dnl Check for GNU readline +dnl +ol_link_readline=no +if test $ol_with_readline != no ; then + AC_CHECK_HEADERS(readline/readline.h readline/history.h) + + if test $ac_cv_header_readline_readline_h = yes ; then + save_LIBS="$LIBS" + LIBS="$TERMCAP_LIBS $LIBS" + AC_CHECK_LIB(readline, readline, + [have_readline=yes], [have_readline=no]) + LIBS="$save_LIBS" + + if test $have_readline = yes ; then + ol_with_readline=found + ol_link_readline=yes + + READLINE_LIBS="-lreadline" + fi + fi +fi + +if test $ol_link_readline = yes ; then + AC_DEFINE(HAVE_READLINE, 1, [define if you have -lreadline]) +fi + + +# FreeBSD (and others) have crypt(3) in -lcrypt +if test $ol_enable_crypt != no ; then + AC_CHECK_FUNC(crypt, [have_crypt=yes], [ + AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt" + have_crypt=yes], [have_crypt=no])]) + + if test $have_crypt = yes ; then + AC_DEFINE(HAVE_CRYPT,1, [define if crypt(3) is available]) + else + AC_MSG_WARN(could not find crypt) + if test $ol_enable_crypt = yes ; then + AC_MSG_ERROR(could not find crypt, select appropriate options or disable) + fi + + AC_MSG_WARN(disabling crypt support) + ol_enable_crypt=no + fi +fi + +# FreeBSD (and others) have setproctitle(3) in -lutil +if test $ol_enable_proctitle != no ; then + AC_CHECK_FUNC(setproctitle, [have_setproctitle=yes], [ + AC_CHECK_LIB(util, setproctitle, + [have_setproctitle=yes + LUTIL_LIBS="$LUTIL_LIBS -lutil"], + [have_setproctitle=no + LIBOBJS="$LIBOBJS setproctitle.o"])]) + + if test $have_setproctitle = yes ; then + AC_DEFINE(HAVE_SETPROCTITLE,1, + [define if setproctitle(3) is available]) + fi +fi + +dnl ---------------------------------------------------------------- +dnl Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_GETGROUPS dnl requires AC_TYPE_UID_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AM_TYPE_PTRDIFF_T +AC_TYPE_SIGNAL +OL_TYPE_SIG_ATOMIC_T +AC_TYPE_SIZE_T +OL_TYPE_SOCKLEN_T +AC_STRUCT_ST_BLKSIZE +AC_HEADER_TIME +AC_STRUCT_TM +OL_STRUCT_PASSWD_PW_GECOS +OL_STRUCT_PASSWD_PW_PASSWD + +OL_C_UPPER_LOWER +AC_C_CONST +OL_C_VOLATILE + +if test $cross_compiling = yes ; then + AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling]) + + AC_DEFINE(LBER_INT_T,long) + AC_DEFINE(LBER_TAG_T,long) + AC_DEFINE(LBER_SOCKET_T,int) + +else + AC_C_BIGENDIAN + AC_CHECK_SIZEOF(short) + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + + if test "$ac_cv_sizeof_int" -lt 4 ; then + AC_MSG_WARN([OpenLDAP requires 'int' to be 32 bits or greater.]) + + AC_DEFINE(LBER_INT_T,long) + AC_DEFINE(LBER_TAG_T,long) + AC_DEFINE(LBER_SOCKET_T,int) + else + AC_DEFINE(LBER_INT_T,int) + AC_DEFINE(LBER_TAG_T,long) + AC_DEFINE(LBER_SOCKET_T,int) + fi +fi + +AC_DEFINE(LBER_LEN_T,long) + +dnl ---------------------------------------------------------------- +dnl Checks for library functions. +AC_FUNC_MEMCMP +dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h +AC_FUNC_STRFTIME +dnl AM_FUNC_STRTOD + +dnl we should use vfork instead of fork in a number of places... +dnl AC_FUNC_VFORK +AC_FUNC_VPRINTF + +if test $ac_cv_func_vprintf = yes ; then + dnl check for vsnprintf + AC_CHECK_FUNCS(vsnprintf vsprintf) +fi + +AC_CHECK_FUNCS( \ + bcopy \ + closesocket \ + endgrent \ + endpwent \ + flock \ + getdtablesize \ + getgrgid \ + gethostname \ + getpass \ + getpwuid \ + getpwnam \ + getspnam \ + gettimeofday \ + initgroups \ + lockf \ + memcpy \ + memmove \ + mkstemp \ + read \ + recv \ + recvfrom \ + setpwfile \ + setgid \ + setegid \ + setsid \ + setuid \ + seteuid \ + signal \ + sigset \ + snprintf \ + strdup \ + strerror \ + strpbrk \ + strrchr \ + strsep \ + strstr \ + strtol \ + strtoul \ + strspn \ + sysconf \ + waitpid \ + wait4 \ + write \ + send \ + sendto \ +) + +dnl We actually may need to replace more than this. +AC_REPLACE_FUNCS(getopt tempnam) + +dnl ---------------------------------------------------------------- +# Check Configuration +OL_SYS_ERRLIST + +dnl ---------------------------------------------------------------- +dnl Sort out defines + +if test "$ol_enable_debug" != no ; then + AC_DEFINE(LDAP_DEBUG,1, + [define this to add debugging code]) +fi +if test "$ol_enable_syslog" = yes ; then + AC_DEFINE(LDAP_SYSLOG,1, + [define this to add syslog code]) +fi +if test "$ol_enable_libui" = yes ; then + AC_DEFINE(LDAP_LIBUI,1, + [define this for LDAP User Interface support]) +fi +if test "$ol_enable_cache" = no ; then + AC_DEFINE(LDAP_NOCACHE,1, + [define this to remove -lldap cache support]) +fi +if test "$ol_enable_dns" != no ; then + AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_DNS,LDAP_VENDOR_VERSION) +fi +if test "$ol_enable_proctitle" != no ; then + AC_DEFINE(LDAP_PROCTITLE,1, + [define this for LDAP process title support]) +fi +if test "$ol_enable_referrals" != no ; then + AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS,LDAP_VENDOR_VERSION) +fi +if test "$ol_enable_cldap" != no ; then + AC_DEFINE(LDAP_CONNECTIONLESS,1,[define to support CLDAP]) +fi + +if test "$ol_enable_crypt" != no ; then + AC_DEFINE(SLAPD_CRYPT,1,[define to support crypt(3) passwords]) +fi +if test "$ol_enable_cleartext" != no ; then + AC_DEFINE(SLAPD_CLEARTEXT,1,[define to support cleartext passwords]) +fi +if test "$ol_enable_phonetic" != no ; then + AC_DEFINE(SLAPD_PHONETIC,1,[define to support phonetic]) +fi +if test "$ol_enable_rlookups" != no ; then + AC_DEFINE(SLAPD_RLOOKUPS,1,[define to support reverse lookups]) +fi + +if test "$ol_link_modules" != no ; then + AC_DEFINE(SLAPD_MODULES,1,[define to support modules]) + BUILD_SLAPD=yes +fi + +if test "$ol_link_bdb2" != no ; then + AC_DEFINE(SLAPD_BDB2,1,[define to support BDB2 backend]) + BUILD_SLAPD=yes + BUILD_BDB2=yes + if test "$ol_with_bdb2_module" != static ; then + AC_DEFINE(SLAPD_BDB2_DYNAMIC,1, + [define to support dynamic BDB2 backend]) + BUILD_BDB2_DYNAMIC=yes + fi +fi + +if test "$ol_enable_ldap" != no ; then + AC_DEFINE(SLAPD_LDAP,1,[define to support LDAP backend]) + BUILD_SLAPD=yes + BUILD_LDAP=yes + if test "$ol_with_ldap_module" != static ; then + AC_DEFINE(SLAPD_LDAP_DYNAMIC,1, + [define to support dynamic LDAP backend]) + BUILD_LDAP_DYNAMIC=yes + fi +fi + +if test "$ol_link_ldbm" != no ; then + AC_DEFINE(SLAPD_LDBM,1,[define to support LDBM backend]) + BUILD_SLAPD=yes + BUILD_LDBM=yes + if test "$ol_with_ldbm_module" != static ; then + AC_DEFINE(SLAPD_LDBM_DYNAMIC,1, + [define to support dynamic LDBM backend]) + BUILD_LDBM_DYNAMIC=yes + fi +fi + +if test "$ol_enable_passwd" != no ; then + AC_DEFINE(SLAPD_PASSWD,1,[define to support PASSWD backend]) + BUILD_SLAPD=yes + BUILD_PASSWD=yes + if test "$ol_with_passwd_module" != static ; then + AC_DEFINE(SLAPD_PASSWD_DYNAMIC,1, + [define to support dynamic PASSWD backend]) + BUILD_PASSWD_DYNAMIC=yes + fi +fi + +if test "$ol_link_perl" != no ; then + AC_DEFINE(SLAPD_PERL,1,[define to support PERL backend]) + BUILD_SLAPD=yes + BUILD_PERL=yes + if test "$ol_with_perl_module" != static ; then + AC_DEFINE(SLAPD_PERL_DYNAMIC,1, + [define to support dynamic PERL backend]) + BUILD_PERL_DYNAMIC=yes + fi +fi + +if test "$ol_enable_shell" != no ; then + AC_DEFINE(SLAPD_SHELL,1,[define to support SHELL backend]) + BUILD_SLAPD=yes + BUILD_SHELL=yes + if test "$ol_with_shell_module" != static ; then + AC_DEFINE(SLAPD_SHELL_DYNAMIC,1, + [define to support dynamic SHELL backend]) + BUILD_SHELL_DYNAMIC=yes + fi +fi + +if test "$ol_enable_tcl" != no ; then + AC_DEFINE(SLAPD_TCL,1,[define to support TCL backend]) + BUILD_SLAPD=yes + BUILD_TCL=yes + if test "$ol_with_tcl_module" != static; then + AC_DEFINE(SLAPD_TCL_DYNAMIC,1, + [define to support dynamic TCL backend]) + BUILD_TCL_DYNAMIC=yes + fi +fi + +if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \ + $BUILD_SLAPD = yes ; then + BUILD_SLURPD=yes +fi + +dnl ---------------------------------------------------------------- + +AC_SUBST(BUILD_SLAPD) + AC_SUBST(BUILD_BDB2) + AC_SUBST(BUILD_LDAP) + AC_SUBST(BUILD_LDBM) + AC_SUBST(BUILD_PASSWD) + AC_SUBST(BUILD_PERL) + AC_SUBST(BUILD_SHELL) + AC_SUBST(BUILD_TCL) + AC_SUBST(BUILD_BDB2_DYNAMIC) + AC_SUBST(BUILD_LDAP_DYNAMIC) + AC_SUBST(BUILD_LDBM_DYNAMIC) + AC_SUBST(BUILD_PASSWD_DYNAMIC) + AC_SUBST(BUILD_PERL_DYNAMIC) + AC_SUBST(BUILD_SHELL_DYNAMIC) + AC_SUBST(BUILD_TCL_DYNAMIC) +AC_SUBST(BUILD_SLURPD) + +AC_SUBST(LDAP_LIBS) +AC_SUBST(SLAPD_LIBS) +AC_SUBST(SLURPD_LIBS) +AC_SUBST(LDBM_LIBS) +AC_SUBST(LTHREAD_LIBS) +AC_SUBST(LUTIL_LIBS) + +AC_SUBST(SLAPD_MODULES_CPPFLAGS) +AC_SUBST(SLAPD_MODULES_LDFLAGS) + +AC_SUBST(SLAPD_PERL_CPPFLAGS) +AC_SUBST(SLAPD_PERL_LDFLAGS) + +AC_SUBST(KRB_LIBS) +AC_SUBST(READLINE_LIBS) +AC_SUBST(TERMCAP_LIBS) +AC_SUBST(TLS_LIBS) + +dnl ---------------------------------------------------------------- +dnl final output +dnl + +AC_OUTPUT( \ +Makefile:build/top.mk:Makefile.in:build/dir.mk \ +doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \ +doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \ +doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \ +doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \ +doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \ +doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \ +clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \ +clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \ +clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \ +clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \ +clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \ +clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \ +clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \ +clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \ +include/Makefile:build/top.mk:include/Makefile.in \ +libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \ +libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk \ +libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk \ +libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk \ +libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk \ +libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk \ +libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \ +libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk \ +servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \ +servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \ +servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \ +servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \ +servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \ +servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \ +servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \ +servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \ +servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \ +servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \ +servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \ +servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \ +tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \ +tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \ +contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \ +contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \ +contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \ +,[ +date > stamp-h +echo Please \"make depend\" to build dependencies +]) diff --git a/doc/man/man8/ldapd.8 b/doc/man/man8/ldapd.8 deleted file mode 100644 index d771093776..0000000000 --- a/doc/man/man8/ldapd.8 +++ /dev/null @@ -1,127 +0,0 @@ -.TH LDAPD 8C "15 June 1992" "U-M LDAP LDVERSION" -.SH NAME -ldapd \- LDAP X.500 Protocol Daemon -.SH SYNOPSIS -.B ETCDIR/ldapd [\-d level] [\-l] [\-c dsaname] -.B [\-p port] [\-t timeout] [\-r referraltimeout] -.B [\-I] [\-U] -.SH DESCRIPTION -.LP -.B Ldapd -is the LDAP to X.500 gateway daemon. The LDAP protocol is used to -provide lightweight TCP/IP access to the X.500 Directory. The -.B ldapd -server is typically invoked at boot time, usually out of -.BR /etc/rc.local . -Upon startup, -.B ldapd -normally forks and disassociates itself from the invoking tty, and then -listens on port 389 for TCP connections from LDAP clients. -The server performs the following basic operations for the client: -.TP 14 -.B Bind -Bind to the X.500 directory. Currently only simple (clear-text password) -and kerberos version 4 authentication are supported. -.TP -.B Search -Search the X.500 directory for entries that match a given filter. -The scope of the search can be base object, one level, or whole subtree. -Note that the X.500 read and list can be emulated using search. -.TP -.B Modify -Change the attributes and values of an existing X.500 entry. -.TP -.B Modify RDN -Change the Relative Distinguished Name of an X.500 entry. -.TP -.B Add -Add an entry to the X.500 directory. -.TP -.B Remove -Remove an entry from the X.500 directory. -.TP -.B Abandon -Abort an operation in progress. -.LP -See -.BR ldap (3) -for details on client-side access to the ldap server. See -.I RFC 1777: Lightweight Directory Access Protocol -and -.I RFC 1778: The String Representation of -.I Standard Attribute Syntaxes -for details of the protocol supporting the above operations. -.SH OPTIONS -.TP -.BI \-d " level" -Turn on debugging as defined by -.I level. -If this option is specified, -.I ldapd -will not fork or disassociate from the invoking terminal. Some general -operation and status messages are printed for any value of \fIlevel\fP. -\fIlevel\fP is taken as a bit string, with each bit corresponding to a -different kind of debugging information. See for details. -.TP -.B \-l -Enable logging of various status and errors to the LOG_LOCAL4 facility via -.BR syslog (8). -.TP -.RB \-c " dsaname" -Connect to the named DSA initially. The -.I dsaname -given should be a name found in the local dsaptailor file or an -actual presentation address. -.TP -.BI \-p " port" -Listen on port -.I port -instead of the default port. This is useful for debugging purposes. -.TP -.BI \-t " timeout" -Specify the timeout value after which idle connections from -clients are closed. -.TP -.BI \-r " referraltimeout" -Specify the timeout value after which idle connections to DSAs -are closed. -.TP -.B \-I -Run from -.BR inetd (8) -instead of as a stand-alone daemon. -.TP -.B \-U -Support Connectionless LDAP (CLDAP). In this mode, ldapd listens for -CLDAP search requests only on a UDP port, performs the search, and -returns the result. See -.BR udp (4) -for more information on UDP. -.SH EXAMPLES -To start ldapd and have it fork and detach from the terminal and connect -to the first DSA listed in the dsaptailor file, just type: -.LP -.nf -.ft tt - ETCDIR/ldapd -.ft -.fi -.LP -To connect to an alternate DSA and turn on voluminous debugging which -will be printed on standard error, type: -.LP -.nf -.ft tt - ETCDIR/ldapd -c dsanameoraddr -d 31 -.ft -.fi -.LP -where dsanameoraddr is a presentation address or a name that appears -in the local dsaptailor file. -.SH "SEE ALSO" -.BR ldap (3), -.BR udp (4), -.BR slapd (8) -.BR inetd (8) -.LP -Volume 5 of The ISODE Manual diff --git a/include/portable.h.in b/include/portable.h.in new file mode 100644 index 0000000000..cf43c3c1fb --- /dev/null +++ b/include/portable.h.in @@ -0,0 +1,822 @@ +/* include/portable.h.in. Generated automatically from configure.in by autoheader. */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +#ifndef _LDAP_PORTABLE_H +#define _LDAP_PORTABLE_H + +/* end of preamble */ + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to the type of elements in the array set by `getgroups'. + Usually this is either `int' or `gid_t'. */ +#undef GETGROUPS_T + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if your struct stat has st_blksize. */ +#undef HAVE_ST_BLKSIZE + +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME + +/* Define if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define to `int' if doesn't define. */ +#undef mode_t + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define to `int' if doesn't define. */ +#undef pid_t + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define to the type of arg1 for select(). */ +#undef SELECT_TYPE_ARG1 + +/* Define to the type of args 2, 3 and 4 for select(). */ +#undef SELECT_TYPE_ARG234 + +/* Define to the type of arg5 for select(). */ +#undef SELECT_TYPE_ARG5 + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define if your declares struct tm. */ +#undef TM_IN_SYS_TIME + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* define this if needed to get reentrant functions */ +#ifndef REENTRANT +#undef REENTRANT +#endif +#ifndef _REENTRANT +#undef _REENTRANT +#endif + +/* define this if needed to get threadsafe functions */ +#ifndef THREADSAFE +#undef THREADSAFE +#endif +#ifndef _THREADSAFE +#undef _THREADSAFE +#endif +#ifndef THREAD_SAFE +#undef THREAD_SAFE +#endif +#ifndef _THREAD_SAFE +#undef _THREAD_SAFE +#endif + +#ifndef _SGI_MP_SOURCE +#undef _SGI_MP_SOURCE +#endif + +/* These are defined in ldap_features.h */ +/* + LDAP_API_FEATURE_X_OPENLDAP_REENTRANT + LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE + LDAP_API_FEATURE_X_OPENLDAP_V2_DNS + LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS +*/ + +/* These are defined in lber_types.h */ +/* + LBER_INT_T + LBER_LEN_T + LBER_SOCKET_T + LBER_TAG_T +*/ + +/* The number of bytes in a int. */ +#undef SIZEOF_INT + +/* The number of bytes in a long. */ +#undef SIZEOF_LONG + +/* The number of bytes in a short. */ +#undef SIZEOF_SHORT + +/* Define if you have the bcopy function. */ +#undef HAVE_BCOPY + +/* Define if you have the closesocket function. */ +#undef HAVE_CLOSESOCKET + +/* Define if you have the ctime_r function. */ +#undef HAVE_CTIME_R + +/* Define if you have the endgrent function. */ +#undef HAVE_ENDGRENT + +/* Define if you have the endpwent function. */ +#undef HAVE_ENDPWENT + +/* Define if you have the flock function. */ +#undef HAVE_FLOCK + +/* Define if you have the getdtablesize function. */ +#undef HAVE_GETDTABLESIZE + +/* Define if you have the getgrgid function. */ +#undef HAVE_GETGRGID + +/* Define if you have the gethostbyaddr_r function. */ +#undef HAVE_GETHOSTBYADDR_R + +/* Define if you have the gethostbyname_r function. */ +#undef HAVE_GETHOSTBYNAME_R + +/* Define if you have the gethostname function. */ +#undef HAVE_GETHOSTNAME + +/* Define if you have the getopt function. */ +#undef HAVE_GETOPT + +/* Define if you have the getpass function. */ +#undef HAVE_GETPASS + +/* Define if you have the getpwnam function. */ +#undef HAVE_GETPWNAM + +/* Define if you have the getpwuid function. */ +#undef HAVE_GETPWUID + +/* Define if you have the getspnam function. */ +#undef HAVE_GETSPNAM + +/* Define if you have the gettimeofday function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have the initgroups function. */ +#undef HAVE_INITGROUPS + +/* Define if you have the lockf function. */ +#undef HAVE_LOCKF + +/* Define if you have the memcpy function. */ +#undef HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#undef HAVE_MEMMOVE + +/* Define if you have the mkstemp function. */ +#undef HAVE_MKSTEMP + +/* Define if you have the pthread_getconcurrency function. */ +#undef HAVE_PTHREAD_GETCONCURRENCY + +/* Define if you have the pthread_kill function. */ +#undef HAVE_PTHREAD_KILL + +/* Define if you have the pthread_setconcurrency function. */ +#undef HAVE_PTHREAD_SETCONCURRENCY + +/* Define if you have the pthread_yield function. */ +#undef HAVE_PTHREAD_YIELD + +/* Define if you have the read function. */ +#undef HAVE_READ + +/* Define if you have the recv function. */ +#undef HAVE_RECV + +/* Define if you have the recvfrom function. */ +#undef HAVE_RECVFROM + +/* Define if you have the sched_yield function. */ +#undef HAVE_SCHED_YIELD + +/* Define if you have the send function. */ +#undef HAVE_SEND + +/* Define if you have the sendto function. */ +#undef HAVE_SENDTO + +/* Define if you have the setegid function. */ +#undef HAVE_SETEGID + +/* Define if you have the seteuid function. */ +#undef HAVE_SETEUID + +/* Define if you have the setgid function. */ +#undef HAVE_SETGID + +/* Define if you have the setpwfile function. */ +#undef HAVE_SETPWFILE + +/* Define if you have the setsid function. */ +#undef HAVE_SETSID + +/* Define if you have the setuid function. */ +#undef HAVE_SETUID + +/* Define if you have the signal function. */ +#undef HAVE_SIGNAL + +/* Define if you have the sigset function. */ +#undef HAVE_SIGSET + +/* Define if you have the snprintf function. */ +#undef HAVE_SNPRINTF + +/* Define if you have the strdup function. */ +#undef HAVE_STRDUP + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the strpbrk function. */ +#undef HAVE_STRPBRK + +/* Define if you have the strrchr function. */ +#undef HAVE_STRRCHR + +/* Define if you have the strsep function. */ +#undef HAVE_STRSEP + +/* Define if you have the strspn function. */ +#undef HAVE_STRSPN + +/* Define if you have the strstr function. */ +#undef HAVE_STRSTR + +/* Define if you have the strtol function. */ +#undef HAVE_STRTOL + +/* Define if you have the strtoul function. */ +#undef HAVE_STRTOUL + +/* Define if you have the sysconf function. */ +#undef HAVE_SYSCONF + +/* Define if you have the tempnam function. */ +#undef HAVE_TEMPNAM + +/* Define if you have the thr_getconcurrency function. */ +#undef HAVE_THR_GETCONCURRENCY + +/* Define if you have the thr_setconcurrency function. */ +#undef HAVE_THR_SETCONCURRENCY + +/* Define if you have the thr_yield function. */ +#undef HAVE_THR_YIELD + +/* Define if you have the vsnprintf function. */ +#undef HAVE_VSNPRINTF + +/* Define if you have the vsprintf function. */ +#undef HAVE_VSPRINTF + +/* Define if you have the wait4 function. */ +#undef HAVE_WAIT4 + +/* Define if you have the waitpid function. */ +#undef HAVE_WAITPID + +/* Define if you have the write function. */ +#undef HAVE_WRITE + +/* Define if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define if you have the header file. */ +#undef HAVE_ARPA_NAMESER_H + +/* Define if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define if you have the header file. */ +#undef HAVE_CRYPT_H + +/* Define if you have the header file. */ +#undef HAVE_DB_H + +/* Define if you have the header file. */ +#undef HAVE_DB1_DB_H + +/* Define if you have the header file. */ +#undef HAVE_DB_185_H + +/* Define if you have the header file. */ +#undef HAVE_DES_H + +/* Define if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the header file. */ +#undef HAVE_DMALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_FILIO_H + +/* Define if you have the header file. */ +#undef HAVE_GDBM_H + +/* Define if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define if you have the header file. */ +#undef HAVE_GRP_H + +/* Define if you have the header file. */ +#undef HAVE_KERBEROSIV_DES_H + +/* Define if you have the header file. */ +#undef HAVE_KERBEROSIV_KRB_H + +/* Define if you have the header file. */ +#undef HAVE_KRB_H + +/* Define if you have the header file. */ +#undef HAVE_LIBUTIL_H + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the header file. */ +#undef HAVE_LWP_LWP_H + +/* Define if you have the header file. */ +#undef HAVE_MACH_CTHREADS_H + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_MDBM_H + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the header file. */ +#undef HAVE_NCURSES_H + +/* Define if you have the header file. */ +#undef HAVE_NDBM_H + +/* Define if you have the header file. */ +#undef HAVE_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_TCP_H + +/* Define if you have the header file. */ +#undef HAVE_OPENSSL_SSL_H + +/* Define if you have the header file. */ +#undef HAVE_PSAP_H + +/* Define if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define if you have the header file. */ +#undef HAVE_PWD_H + +/* Define if you have the header file. */ +#undef HAVE_READLINE_HISTORY_H + +/* Define if you have the header file. */ +#undef HAVE_READLINE_READLINE_H + +/* Define if you have the header file. */ +#undef HAVE_REGEX_H + +/* Define if you have the header file. */ +#undef HAVE_RESOLV_H + +/* Define if you have the header file. */ +#undef HAVE_SCHED_H + +/* Define if you have the header file. */ +#undef HAVE_SGTTY_H + +/* Define if you have the header file. */ +#undef HAVE_SHADOW_H + +/* Define if you have the header file. */ +#undef HAVE_SSL_H + +/* Define if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#undef HAVE_SYNCH_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_ERRNO_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FILIO_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SYSLOG_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_SYSEXITS_H + +/* Define if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define if you have the header file. */ +#undef HAVE_TCL_H + +/* Define if you have the header file. */ +#undef HAVE_TCPD_H + +/* Define if you have the header file. */ +#undef HAVE_TERMCAP_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the header file. */ +#undef HAVE_THREAD_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the V3 library (-lV3). */ +#undef HAVE_LIBV3 + +/* Define if you have the bind library (-lbind). */ +#undef HAVE_LIBBIND + +/* Define if you have the dmalloc library (-ldmalloc). */ +#undef HAVE_LIBDMALLOC + +/* Define if you have the gen library (-lgen). */ +#undef HAVE_LIBGEN + +/* Define if you have the inet library (-linet). */ +#undef HAVE_LIBINET + +/* Define if you have the net library (-lnet). */ +#undef HAVE_LIBNET + +/* Define if you have the nsl library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define if you have the nsl_s library (-lnsl_s). */ +#undef HAVE_LIBNSL_S + +/* Define if you have the resolv library (-lresolv). */ +#undef HAVE_LIBRESOLV + +/* Define if you have the socket library (-lsocket). */ +#undef HAVE_LIBSOCKET + +/* Package */ +#undef OPENLDAP_PACKAGE + +/* Version */ +#undef OPENLDAP_VERSION + +/* define this if you have mkversion */ +#undef HAVE_MKVERSION + +/* defined to be the EXE extension */ +#undef EXEEXT + +/* define if system uses EBCDIC instead of ASCII */ +#undef HAVE_EBCDIC + +/* Define if TIOCGWINSZ requires sys/ioctl.h */ +#undef GWINSZ_IN_SYS_IOCTL + +/* define if you have POSIX termios */ +#undef HAVE_POSIX_TERMIOS + +/* define if you have res_search() */ +#undef HAVE_RES_SEARCH + +/* define if you have Kerberos des_debug */ +#undef HAVE_DES_DEBUG + +/* define if you have Kerberos */ +#undef HAVE_KERBEROS + +/* define if you have SSLeay or OpenSSL */ +#undef HAVE_SSLEAY + +/* define if you have RSAref */ +#undef HAVE_RSAREF + +/* define if you have TLS */ +#undef HAVE_TLS + +/* set to the number of arguments ctime_r() expects */ +#undef CTIME_R_NARGS + +/* set to the number of arguments gethostbyname_r() expects */ +#undef GETHOSTBYNAME_R_NARGS + +/* set to the number of arguments gethostbyaddr_r() expects */ +#undef GETHOSTBYADDR_R_NARGS + +/* define if pthreads API compatible with final spec */ +#undef HAVE_PTHREADS_FINAL + +/* define if pthreads API compatible with draft4 spec */ +#undef HAVE_PTHREADS_D4 + +/* if you have LinuxThreads */ +#undef HAVE_LINUX_THREADS + +/* define if you have POSIX Threads */ +#undef HAVE_PTHREADS + +/* Define if you have the sched_yield function. */ +#undef HAVE_SCHED_YIELD + +/* define if you have pthread_detach function */ +#undef HAVE_PTHREAD_DETACH + +/* define if you have Mach Cthreads */ +#undef HAVE_MACH_CTHREADS + +/* if you have Solaris LWP (thr) package */ +#undef HAVE_THR + +/* if you have SunOS LWP package */ +#undef HAVE_LWP + +/* define if select implicitly yields */ +#undef HAVE_YIELDING_SELECT + +/* if you have LinuxThreads */ +#undef HAVE_LINUX_THREADS + +/* define if you have (or want) no threads */ +#undef NO_THREADS + +/* define if Berkeley DBv2 is available */ +#undef HAVE_BERKELEY_DB2 + +/* define this to use DBHASH w/ LDBM backend */ +#undef LDBM_USE_DBHASH + +/* define this to use DBBTREE w/ LDBM backend */ +#undef LDBM_USE_DBBTREE + +/* define if Berkeley DB is available */ +#undef HAVE_BERKELEY_DB + +/* define this to use DBHASH w/ LDBM backend */ +#undef LDBM_USE_DBHASH + +/* define this to use DBBTREE w/ LDBM backend */ +#undef LDBM_USE_DBBTREE + +/* define if MDBM is available */ +#undef HAVE_MDBM + +/* define if GNU DBM is available */ +#undef HAVE_GDBM + +/* define if NDBM is available */ +#undef HAVE_NDBM + +/* define if you have -lwrap */ +#undef HAVE_TCPD + +/* define if you have -ltermcap */ +#undef HAVE_TERMCAP + +/* define if you have -lncurses */ +#undef HAVE_NCURSES + +/* define if you have no termcap support */ +#undef NO_TERMCAP + +/* define if you have -lreadline */ +#undef HAVE_READLINE + +/* define if crypt(3) is available */ +#undef HAVE_CRYPT + +/* define if setproctitle(3) is available */ +#undef HAVE_SETPROCTITLE + +/* Define if system has ptrdiff_t type */ +#undef HAVE_PTRDIFF_T + +/* define to atomic type if sig_atomic_t is not available */ +#undef sig_atomic_t + +/* define to int if socklen_t is not available */ +#undef socklen_t + +/* define if struct passwd has pw_gecos */ +#undef HAVE_PW_GECOS + +/* define if struct passwd has pw_passwd */ +#undef HAVE_PW_PASSWD + +/* define if toupper() requires islower() */ +#undef C_UPPER_LOWER + +/* define as empty if volatile is not supported */ +#undef volatile + +/* define if cross compiling */ +#undef CROSS_COMPILING + +/* define if sys_errlist is not declared in stdio.h or errno.h */ +#undef DECL_SYS_ERRLIST + +/* define if you actually have sys_errlist in your libs */ +#undef HAVE_SYS_ERRLIST + +/* define this to add debugging code */ +#undef LDAP_DEBUG + +/* define this to add syslog code */ +#undef LDAP_SYSLOG + +/* define this for LDAP User Interface support */ +#undef LDAP_LIBUI + +/* define this to remove -lldap cache support */ +#undef LDAP_NOCACHE + +/* define this for LDAP process title support */ +#undef LDAP_PROCTITLE + +/* define to support CLDAP */ +#undef LDAP_CONNECTIONLESS + +/* define to support crypt(3) passwords */ +#undef SLAPD_CRYPT + +/* define to support cleartext passwords */ +#undef SLAPD_CLEARTEXT + +/* define to support phonetic */ +#undef SLAPD_PHONETIC + +/* define to support reverse lookups */ +#undef SLAPD_RLOOKUPS + +/* define to support modules */ +#undef SLAPD_MODULES + +/* define to support BDB2 backend */ +#undef SLAPD_BDB2 + +/* define to support dynamic BDB2 backend */ +#undef SLAPD_BDB2_DYNAMIC + +/* define to support LDAP backend */ +#undef SLAPD_LDAP + +/* define to support dynamic LDAP backend */ +#undef SLAPD_LDAP_DYNAMIC + +/* define to support LDBM backend */ +#undef SLAPD_LDBM + +/* define to support dynamic LDBM backend */ +#undef SLAPD_LDBM_DYNAMIC + +/* define to support PASSWD backend */ +#undef SLAPD_PASSWD + +/* define to support dynamic PASSWD backend */ +#undef SLAPD_PASSWD_DYNAMIC + +/* define to support PERL backend */ +#undef SLAPD_PERL + +/* define to support dynamic PERL backend */ +#undef SLAPD_PERL_DYNAMIC + +/* define to support SHELL backend */ +#undef SLAPD_SHELL + +/* define to support dynamic SHELL backend */ +#undef SLAPD_SHELL_DYNAMIC + +/* define to support TCL backend */ +#undef SLAPD_TCL + +/* define to support dynamic TCL backend */ +#undef SLAPD_TCL_DYNAMIC + +/* begin of postamble */ + +#ifdef HAVE_STDDEF_H +# include +#endif + +#if defined(LDAP_DEVEL) && !defined(LDAP_TEST) +#define LDAP_TEST +#endif +#if defined(LDAP_TEST) && !defined(LDAP_DEBUG) +#define LDAP_DEBUG +#endif + +#include "ldap_cdefs.h" +#include "ldap_features.h" + +#include "ac/assert.h" + +#endif /* _LDAP_PORTABLE_H */ diff --git a/servers/Makefile.in b/servers/Makefile.in new file mode 100644 index 0000000000..3fa1332f8b --- /dev/null +++ b/servers/Makefile.in @@ -0,0 +1,7 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, see COPYRIGHT file +## +## servers Makefile.in for OpenLDAP + +SUBDIRS= slapd slurpd + diff --git a/servers/ldapd/Version.c b/servers/ldapd/Version.c deleted file mode 100644 index 52afd69861..0000000000 --- a/servers/ldapd/Version.c +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 1991 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -char Versionstr[] = " ldapd %VERSION% (%WHEN%)\n\t%WHOANDWHERE%\n"; diff --git a/servers/ldapd/abandon.c b/servers/ldapd/abandon.c deleted file mode 100644 index 3e51192590..0000000000 --- a/servers/ldapd/abandon.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -do_abandon( - struct conn *dsaconn, - BerElement *ber, - int msgid -) -{ - int id; - struct ds_abandon_arg aa; - struct DAPindication di; - - Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0 ,0 ); - - /* - * Parse the abandon request. It looks like this: - * AbandonRequest := MessageID - */ - - if ( ber_scanf( ber, "i", &id ) == LBER_ERROR ) { - Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0 ,0 ); - return( 0 ); - } - - Debug( LDAP_DEBUG_ARGS, "do_abandin: id %d\n", id, 0 ,0 ); - - aa.aba_invokeid = id; - - Debug( LDAP_DEBUG_TRACE, "DapAbandon...\n", 0, 0 ,0 ); - if ( DapAbandon( dsaconn->c_ad, msgid, &aa, &di, ROS_ASYNC ) - == NOTOK ) { - Debug( LDAP_DEBUG_ANY, "DapAbandon failed\n", 0, 0 ,0 ); - return( 0 ); - } - Debug( LDAP_DEBUG_TRACE, "DapAbandon completed\n", 0, 0 ,0 ); - - return( 0 ); -} diff --git a/servers/ldapd/add.c b/servers/ldapd/add.c deleted file mode 100644 index cc76223a73..0000000000 --- a/servers/ldapd/add.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -#ifdef COMPAT20 -extern int ldap_compat; -#define ADDTAG (ldap_compat == 20 ? OLD_LDAP_RES_ADD : LDAP_RES_ADD) -#else -#define ADDTAG LDAP_RES_ADD -#endif - -int -do_add( - Sockbuf *clientsb, - struct msg *m, - BerElement *ber -) -{ - char *dn; - char *type, *last; - struct berval **bvals; - int rc; - unsigned long tag, len; - struct ds_addentry_arg aa; - static CommonArgs common = default_common_args; - extern DN ldap_str2dn(); - - Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 ); - - /* - * Parse the add request. It looks like this: - * AddRequest := [APPLICATION 14] SEQUENCE { - * name DistinguishedName, - * attrs SEQUENCE OF SEQUENCE { - * type AttributeType, - * values SET OF AttributeValue - * } - * } - */ - -#if ISODEPACKAGE == IC -#if ICRELEASE > 2 - DAS_AddEntryArgument_INIT ( &aa ); -#endif -#endif - - if ( ber_scanf( ber, "{a", &dn ) == LBER_ERROR ) { - Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, ADDTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "" ); - return( 0 ); - } - - Debug( LDAP_DEBUG_ARGS, "do_add: dn (%s)\n", dn, 0, 0 ); - - aa.ada_object = ldap_str2dn( dn ); - free( dn ); - if ( aa.ada_object == NULLDN ) { - Debug( LDAP_DEBUG_ANY, "ldap_str2dn failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, ADDTAG, m, - LDAP_INVALID_DN_SYNTAX, NULL, "" ); - return( 0 ); - } - - /* break out once we read them all, or return out on error */ - aa.ada_entry = NULLATTR; - for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; - tag = ber_next_element( ber, &len, last ) ) { - Attr_Sequence as, get_as(); - - if ( ber_scanf( ber, "{a{V}}", &type, &bvals ) == LBER_ERROR ) - break; - - if ( (as = get_as( clientsb, LDAP_RES_ADD, m, type, - bvals )) == NULLATTR ) - return( 0 ); - - aa.ada_entry = as_merge( aa.ada_entry, as ); - } - - aa.ada_common = common; /* struct copy */ - - rc = initiate_dap_operation( OP_ADDENTRY, m, &aa ); - - dn_free( aa.ada_object ); - as_free( aa.ada_entry ); - - if ( rc != 0 ) { - send_ldap_msgresult( clientsb, ADDTAG, m, rc, NULL, "" ); - return( 0 ); - } - - return( 1 ); -} - -void -add_result( - Sockbuf *sb, - struct msg *m -) -{ - send_ldap_msgresult( sb, ADDTAG, m, LDAP_SUCCESS, NULL, "" ); - - return; -} diff --git a/servers/ldapd/association.c b/servers/ldapd/association.c deleted file mode 100644 index ab15d0460a..0000000000 --- a/servers/ldapd/association.c +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#if ISODEPACKAGE == IC -#include -#else -#include -#endif -#include "common.h" -#ifdef SVR4 -#if !defined(_AIX) && !defined(__osf__) -#include -#endif -#endif - -#ifdef __hpux -#define FIOGETOWN FIOGSAIOOWN -#endif - -struct conn *conns; - -struct conn *conn_dup( struct conn *cn ) -{ - struct conn *new; - struct PSAPaddr *psap_cpy(); - - if ( (new = (struct conn *) malloc( sizeof(struct conn) )) == NULL ) - return( NULL ); - - *new = *cn; - new->c_next = NULL; - new->c_time = 0L; - new->c_paddr = psap_cpy( cn->c_paddr ); - new->c_dn = strdup( cn->c_dn ); - if ( new->c_credlen > 0 ) { - new->c_cred = (char *) malloc( cn->c_credlen ); - SAFEMEMCPY( new->c_cred, cn->c_cred, cn->c_credlen ); - } else { - new->c_cred = ""; - } - new->c_credlen = cn->c_credlen; - new->c_refcnt = 1; - - return( new ); -} - -int -conn_init() -{ - extern char *dsa_address; - struct PSAPaddr *addr, *psap_cpy(); - - if ( (conns = (struct conn *) malloc( sizeof(struct conn) )) == NULL ) { - Debug( LDAP_DEBUG_ANY, "conn_init: malloc failed\n", 0, 0, 0 ); - return( -1 ); - } - - conns->c_ad = -1; - conns->c_dn = NULL; - conns->c_cred = NULL; - conns->c_credlen = 0; - - if ( dsa_address == NULL || (addr = str2paddr( dsa_address )) - == NULLPA ) { - conns->c_paddr = NULLPA; - Debug( LDAP_DEBUG_ANY, "conn_init: bad DSA address (%s)\n", - dsa_address ? dsa_address : "NULL", 0, 0 ); - } else { - conns->c_paddr = psap_cpy( addr ); - } - - conns->c_refcnt = 1; /* this conn is never deleted */ - conns->c_next = NULL; - - return( 0 ); -} - -void -conn_free( struct conn *conn ) -{ - struct timeval tv; - extern int referral_connection_timeout; - - Debug( LDAP_DEBUG_TRACE, "conn_free (%s): refcnt is %d\n", - paddr2str( conn->c_paddr, NULLNA ), conn->c_refcnt, 0 ); - - if ( --conn->c_refcnt > 0 ) - return; - - gettimeofday( &tv, (struct timezone *)NULL ); - if ( conn->c_time != 0L && (tv.tv_sec - conn->c_time) - < referral_connection_timeout ) { - Debug( LDAP_DEBUG_TRACE, "conn_free: referral conn ttl is %d\n", - referral_connection_timeout - (tv.tv_sec - conn->c_time), - 0, 0 ); - return; - } - - - conn_del( conn ); - - if ( conn->c_paddr ) - free( (char *) conn->c_paddr ); - if ( conn->c_dn ) - free( conn->c_dn ); - if ( conn->c_credlen > 0 ) - free( conn->c_cred ); - free( conn ); -} - -void -conn_del( struct conn *conn ) -{ - struct conn *tmp, *prev; - - Debug( LDAP_DEBUG_TRACE, "conn_del (%s)\n", - paddr2str( conn->c_paddr, NULLNA ), 0, 0 ); - - prev = NULL; - for ( tmp = conns; tmp != NULL; tmp = tmp->c_next ) { - if ( tmp == conn ) - break; - prev = tmp; - } - - if ( tmp == NULL ) { - Debug( LDAP_DEBUG_ANY, "conn_del: cannot find conn\n", 0, 0, - 0 ); - return; - } - - if ( prev == NULL ) { - conns = conns->c_next; /* delete head of list */ - } else { - prev->c_next = tmp->c_next; - } -} - -void -conn_setfds( fd_set *fds ) -{ - struct conn *tmp; - - for ( tmp = conns; tmp != NULL; tmp = tmp->c_next ) { - if ( tmp->c_ad != -1 ) - FD_SET( tmp->c_ad, fds ); - } -} - -void -conn_badfds() -{ - struct conn *tmp; - - for ( tmp = conns; tmp != NULL; tmp = tmp->c_next ) { - if ( isclosed( tmp->c_ad ) ) { - Debug( LDAP_DEBUG_ANY, "conn_badfds: fd %d is bad\n", - tmp->c_ad, 0, 0 ); - tmp->c_ad = -1; - } - } -} - -struct conn *conn_getfd( fd_set *fds ) -{ - struct conn *tmp; - - for ( tmp = conns; tmp != NULL; tmp = tmp->c_next ) { - if ( tmp->c_ad != -1 ) - if ( FD_ISSET( tmp->c_ad, fds ) ) - return( tmp ); - } - - return( NULL ); -} - -void -conn_add( struct conn *new ) -{ - struct timeval tv; - -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_CONNS ) { - char *str; - - str = paddr2str( new->c_paddr, NULLNA ); - Debug( LDAP_DEBUG_CONNS, "conn_add: (%s)\n", str, 0, 0 ); - } -#endif - - gettimeofday( &tv, (struct timezone *)NULL ); - new->c_time = tv.tv_sec; - new->c_next = conns; - new->c_refcnt = 1; - conns = new; -} - -static psap_cmp( struct PSAPaddr *a, struct PSAPaddr *b ) -{ - return( bcmp( (char *) a, (char *) b, sizeof(struct PSAPaddr) ) ); -} - -struct conn *conn_find( struct conn *c ) -{ - struct conn *tmp; - -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_CONNS ) { - char *str; - - str = paddr2str( c->c_paddr, NULLNA ); - Debug( LDAP_DEBUG_CONNS, "conn_find: (%s)\n", str, 0, 0 ); - } -#endif - for ( tmp = conns; tmp != NULL; tmp = tmp->c_next ) { -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_CONNS ) { - char *str; - - str = paddr2str( tmp->c_paddr, NULLNA ); - Debug( LDAP_DEBUG_CONNS, "conn_find: compare to (%s)\n", - str, 0, 0 ); - } -#endif - if ( psap_cmp( tmp->c_paddr, c->c_paddr ) == 0 - && strcmp( tmp->c_dn, c->c_dn ) == 0 - && tmp->c_credlen == c->c_credlen - && bcmp( tmp->c_cred, c->c_cred, c->c_credlen ) == 0 ) { - Debug( LDAP_DEBUG_CONNS, "conn_find: found\n", 0, - 0, 0 ); - return( tmp ); - } - } - - Debug( LDAP_DEBUG_CONNS, "conn_find: not found\n", 0, 0, 0 ); - return( NULL ); -} - -void -conn_close() -{ - struct conn *tmp; - - for ( tmp = conns; tmp != NULL; tmp = tmp->c_next ) { - if ( tmp->c_ad != -1 ) - dap_unbind( tmp->c_ad ); - } -} - -int -isclosed( int ad ) -{ - int o; - extern int errno; - - if ( ioctl( ad, FIOGETOWN, &o ) < 0 ) - return( errno == EBADF ? 1 : 0 ); - else - return( 0 ); -} diff --git a/servers/ldapd/bind.c b/servers/ldapd/bind.c deleted file mode 100644 index db76ff0bf7..0000000000 --- a/servers/ldapd/bind.c +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -#ifdef COMPAT20 -extern int ldap_compat; -#define BINDTAG (ldap_compat == 20 ? OLD_LDAP_RES_BIND : LDAP_RES_BIND) -#else -#define BINDTAG LDAP_RES_BIND -#endif - -/* - * do_bind - perform an X.500 bind operation. Since we always respond - * to the request in here, always return 0 to signify the incoming message - * can be discarded. - */ - -int -do_bind( - Sockbuf *clientsb, - struct msg *m, - BerElement *ber, - int *bound -) -{ - int err; - unsigned long method; - unsigned long len; - char *dn, *pw; - char *matched; - struct PSAPaddr *addr, *psap_cpy(); - extern char *dsa_address; - extern int version; - - Debug( LDAP_DEBUG_TRACE, "do_bind\n", 0, 0, 0 ); - - /* - * Parse the bind request. It looks like this: - * BindRequest ::= SEQUENCE { - * version INTEGER, -- version - * name DistinguishedName, -- dn - * authentication CHOICE { - * simple [0] OCTET STRING -- passwd - * krbv42ldap [1] OCTET STRING - * krbv42dsa [1] OCTET STRING - * } - * } - */ - - if ( ber_scanf( ber, "{ia", &version, &dn ) == LBER_ERROR ) { - Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, BINDTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "Decoding error" ); - return( 0 ); - } -#ifdef COMPAT30 - if ( ldap_compat == 30 ) - method = ber_skip_tag( ber, &len ); - else -#endif - method = ber_peek_tag( ber, &len ); - - if ( ber_scanf( ber, "la}", &len, &pw ) == LBER_ERROR ) { - Debug( LDAP_DEBUG_ANY, "ber_scanf2 failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, BINDTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "Decoding error" ); - return( 0 ); - } - - if ( version != LDAP_VERSION1 && version != LDAP_VERSION2 ) { - Debug( LDAP_DEBUG_ANY, "unknown version %d\n", version, 0, 0 ); - send_ldap_msgresult( clientsb, BINDTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "Version not supported" ); - return( 0 ); - } - - Debug( LDAP_DEBUG_ARGS, "do_bind: version %d dn (%s) method %d\n", - version, dn, method ); - - if ( m->m_conn->c_paddr == NULLPA ) { - char buf[256]; - - sprintf( buf, "Bad DSA address (%s)", dsa_address ? - dsa_address : "NULL" ); - send_ldap_msgresult( clientsb, BINDTAG, m, - LDAP_OPERATIONS_ERROR, NULL, buf ); - return( 0 ); - } - - if ( m->m_conn->c_dn ) - free( m->m_conn->c_dn ); - if ( m->m_conn->c_cred ) - free( m->m_conn->c_cred ); - m->m_conn->c_dn = dn; - m->m_conn->c_cred = pw; - m->m_conn->c_credlen = len; - m->m_conn->c_method = method; - - err = do_bind_real( m->m_conn, bound, &matched ); - - send_ldap_msgresult( clientsb, BINDTAG, m, err, matched, "" ); - - if ( matched != NULL ) - free( matched ); - - return( 0 ); -} - -int -do_bind_real( - struct conn *dsaconn, - int *bound, - char **matched -) -{ - struct ds_bind_arg ba; - struct ds_bind_arg br; - struct ds_bind_error be; - struct DSError dse; - char *dn = dsaconn->c_dn; - int err; -#ifdef KERBEROS - u_long nonce; -#endif - extern DN ldap_str2dn(); - - Debug( LDAP_DEBUG_TRACE, "do_bind_real\n", 0, 0, 0 ); - - *matched = NULL; - if ( (ba.dba_dn = ldap_str2dn( dn )) == NULLDN && *dn != '\0' ) { - Debug( LDAP_DEBUG_ANY, "ldap_str2dn (%s) failed\n", dn, 0, 0 ); - return( LDAP_INVALID_DN_SYNTAX ); - } - - switch ( dsaconn->c_method ) { -#ifdef COMPAT20 - case OLD_LDAP_AUTH_SIMPLE: -#endif -#ifdef COMPAT30 - case LDAP_AUTH_SIMPLE_30: -#endif - case LDAP_AUTH_SIMPLE: /* x.500 simple authentication */ - if ( dsaconn->c_credlen > DBA_MAX_PASSWD_LEN ) { - Debug( LDAP_DEBUG_ANY, "Password too long\n", 0, 0, 0 ); - return( LDAP_INAPPROPRIATE_AUTH ); - } - if (( ba.dba_passwd_len = dsaconn->c_credlen ) > 0 ) { - SAFEMEMCPY( ba.dba_passwd, dsaconn->c_cred, - ba.dba_passwd_len ); - ba.dba_auth_type = DBA_AUTH_SIMPLE; - } else { - ba.dba_auth_type = DBA_AUTH_NONE; - } - ba.dba_version = DBA_VERSION_V1988; - break; - -#ifdef KERBEROS -#ifdef COMPAT20 - case OLD_LDAP_AUTH_KRBV4: -#endif -#ifdef COMPAT30 - case LDAP_AUTH_KRBV41_30: -#endif - case LDAP_AUTH_KRBV41: /* kerberos authentication to ldap server */ - return( kerberosv4_ldap_auth( dsaconn->c_cred, - dsaconn->c_credlen ) ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_AUTH_KRBV42: -#endif -#ifdef COMPAT30 - case LDAP_AUTH_KRBV42_30: -#endif - case LDAP_AUTH_KRBV42: /* kerberos authentication to x500 dsa */ - if ( (err = kerberosv4_bindarg( &ba, ba.dba_dn, dsaconn->c_cred, - dsaconn->c_credlen, &nonce )) != 0 ) - return( err ); - break; -#endif - - default: - return( LDAP_PROTOCOL_ERROR ); - break; - } - - if ( dsaconn->c_ad != -1 ) - dap_unbind( dsaconn->c_ad ); - - Debug( LDAP_DEBUG_TRACE, "dap_bind to dsa (%s)...\n", paddr2str( - dsaconn->c_paddr, NULLNA ), 0, 0 ); - - err = dap_bind( &dsaconn->c_ad, &ba, &be, &br, dsaconn->c_paddr ); - - if ( err != DS_OK && ba.dba_dn != NULLDN && ba.dba_auth_type - == DBA_AUTH_NONE && be.dbe_type == DBE_TYPE_SECURITY ) { - /* if doing a NULL bind, retry with a NULL dn */ - Debug( LDAP_DEBUG_TRACE, "retring NULL dap_bind\n", 0, 0, 0 ); - dn_free( ba.dba_dn ); - ba.dba_dn = NULLDN; - err = dap_bind( &dsaconn->c_ad, &ba, &be, &br, - dsaconn->c_paddr ); - } - - if ( err != DS_OK ) { - if ( ba.dba_dn != NULLDN ) - dn_free( ba.dba_dn ); - - if ( be.dbe_type == DBE_TYPE_SERVICE ) { - dse.dse_type = DSE_SERVICEERROR; - dse.ERR_SERVICE.DSE_sv_problem = be.dbe_value; - } else if ( be.dbe_type == DBE_TYPE_SECURITY ) { - dse.dse_type = DSE_SECURITYERROR; - dse.ERR_SECURITY.DSE_sc_problem = be.dbe_value; - } else { - dse.dse_type = DSE_REMOTEERROR; - } - err = x500err2ldaperr( &dse, matched ); - -#ifdef LDAP_DEBUG - if ( ldap_debug ) - print_error( &dse ); /* prints and then frees */ - else -#endif - ds_error_free( &dse ); - - dsaconn->c_ad = -1; - - return( err ); - } - bind_arg_free( &br ); - - Debug( LDAP_DEBUG_TRACE, "dap_bind successful\n", 0, 0, 0 ); - -#ifdef KERBEROS -/* XXX why doesn't this work?? - if ( dsaconn->c_method == LDAP_AUTH_KRBV42 && - kerberos_check_mutual( &br, nonce ) != 0 ) { - Debug( LDAP_DEBUG_ANY, "Mutual authentication failed\n", 0, 0, - 0 ); - return( LDAP_INVALID_CREDENTIALS ); - } -*/ -#endif - - *bound = 1; - - return( LDAP_SUCCESS ); -} diff --git a/servers/ldapd/certificate.c b/servers/ldapd/certificate.c deleted file mode 100644 index 228d65a6e8..0000000000 --- a/servers/ldapd/certificate.c +++ /dev/null @@ -1,316 +0,0 @@ -/* - * certificate.c - ldap version of quipu certificate syntax handler - * donated by Eric Rosenquist and BNR - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -int ldap_certif_print( PS ps, struct certificate *parm, int format ) -{ - Debug( LDAP_DEBUG_TRACE, "ldap_certif_print()\n", 0, 0, 0 ); - -/* - * An ldap certificate looks like this: - * - * ::= '#' '#' - * '#' '#' '#' - * '#' '#' - * ::= - * ::= - * ::= - * ::= an encoded Distinguished Name - * ::= '#' - * ::= - * ::= - * ::= | | - * '{ASN}' - * ::= an encoded Distinguished Name - * ::= '#' - * ::= | '-' - * ::= '#' - * ::= an encoded UTCTime value - * ::= | - */ - - ps_printf(ps, "%d#%d#", parm->version, parm->serial); - - ldap_print_algid(ps, &(parm->sig.alg), format); - - dn_print_real(ps, parm->issuer, format); - ps_printf(ps, "#"); - - utcprint(ps, parm->valid.not_before, format); - ps_printf(ps, "#"); - utcprint(ps, parm->valid.not_after, format); - ps_printf(ps, "#"); - - dn_print_real(ps, parm->subject, format); - ps_printf(ps, "#"); - - ldap_print_algid(ps, &(parm->key.alg), format); - print_encrypted(ps, parm->key.value, parm->key.n_bits, format); - - print_encrypted(ps, parm->sig.encrypted, parm->sig.n_bits, format); -} - -void -ldap_print_algid( PS ps, struct alg_id *parm, int format ) -{ - ps_printf(ps, "%s#", oid2name (parm->algorithm, OIDPART)); - - switch(parm->p_type) { - case ALG_PARM_ABSENT: - if(parm->asn != NULLPE) - pe_print(ps, parm->asn, format); - ps_printf(ps, "#"); - break; - case ALG_PARM_NUMERIC: - if (format == READOUT) - ps_printf(ps, "%d#", parm->un.numeric); - else - ps_printf(ps, "%d#", parm->un.numeric); - break; - default: - if (format == READOUT) - { - if ((parm->asn->pe_class == PE_CLASS_UNIV) - &&(parm->asn->pe_form == PE_FORM_PRIM) - &&(parm->asn->pe_id == PE_PRIM_INT)) - ps_printf(ps, "%d", prim2num(parm->asn)); - else if ((parm->asn->pe_class == PE_CLASS_UNIV) - &&(parm->asn->pe_form == PE_FORM_PRIM) - &&(parm->asn->pe_id == PE_PRIM_NULL)) - ps_printf(ps, "NULL"); - else - { - vpushquipu (ps); - vunknown(parm->asn); - vpopquipu (); - } - } - else - { - /* This routine will print a {ASN} prefix */ - pe_print(ps, parm->asn, format); - } - ps_printf(ps, "#"); - } -} - -struct certificate *ldap_str2cert( char *str ) -{ -struct certificate *result; -char *ptr; -OID oid; - - Debug( LDAP_DEBUG_TRACE, "ldap_str2cert(%s)\n", str, 0, 0 ); - - result = (struct certificate *) calloc(1, sizeof(*result)); - - /* version */ - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("version not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - result->version = atoi(str); - - /* serial number */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("serial number not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - result->serial = atoi(str); - - /* signature algorithm id - oid */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("signature algorithm id not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - oid = name2oid(SkipSpace(str)); - if (oid == NULLOID) - { - parse_error("Bad algorithm identifier (SIGNED Value)",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - result->sig.alg.algorithm = oid; - result->alg.algorithm = oid_cpy(oid); - - /* signature algorithm id - parameters */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("algorithm id parameters not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - ldap_str2alg(str, &(result->sig.alg)); - ldap_str2alg(str, &(result->alg)); - - /* issuer */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("Issuer not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - result->issuer = ldap_str2dn(str); - - /* validity - not before */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("Start time not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - result->valid.not_before = strdup(str); - - /* validity - not after */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("End time not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - result->valid.not_after = strdup(str); - - /* subject */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("Subject not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - result->subject = ldap_str2dn(str); - - /* public key info - algorithm id - oid */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("public key info algid oid not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - oid = name2oid(SkipSpace(str)); - if (oid == NULLOID) - { - free((char*)result); - return (struct certificate *) 0; - } - result->key.alg.algorithm = oid; - - /* public key info - algorithm id - parameters */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("Parameters not present (SIGNED Value)",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - ldap_str2alg(str, &(result->key.alg)); - - /* public key info - encrypted sign value */ - str = ptr; - ptr = strchr(str, '#'); - if (ptr == NULLCP) - { - parse_error("Signature not present",NULLCP); - cert_free(result); - return (struct certificate *) 0; - } - *ptr++ = '\0'; - str2encrypted(str, &(result->key.value), &(result->key.n_bits)); - - /* encrypted sign value */ - str = ptr; - str2encrypted(str, &(result->sig.encrypted), &(result->sig.n_bits)); - - return (result); -} - -void -ldap_str2alg( char *str, struct alg_id *alg ) -{ -PE asn2pe(); - - if ((str == NULLCP) || (*str == '\0')) - { - alg->asn = NULLPE; - alg->p_type = ALG_PARM_ABSENT; - } - else if (strncmp(str,"{ASN}", 5) == 0) - { - alg->asn = asn2pe((char*)str+5); - alg->p_type = ALG_PARM_UNKNOWN; - } - else if (strncmp(str, "NULL", 4) == 0) - { - alg->asn = asn2pe((char*)"0500"); - alg->p_type = ALG_PARM_UNKNOWN; - } - else - { - alg->asn=NULLPE; - alg->p_type = ALG_PARM_NUMERIC; - alg->un.numeric = atoi(str); - } -} - -void certif_init() -{ - extern short ldap_certif_syntax; - sntx_table *syntax_table; - extern sntx_table *get_syntax_table(); - - if (syntax_table = get_syntax_table(ldap_certif_syntax)) { - syntax_table->s_print = (void *) ldap_certif_print; - syntax_table->s_parse = (void *) ldap_str2cert; - } else - fprintf(stderr, "error getting sntx table in certif_init()\n"); -} diff --git a/servers/ldapd/common.h b/servers/ldapd/common.h deleted file mode 100644 index 9239a72f7d..0000000000 --- a/servers/ldapd/common.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -/* - * This structure represents an association to a dsa. There is one of - * these for each association open (a new association is made for each - * new dsa, and for each dn). - */ - -struct conn { - int c_ad; /* association descriptor */ - char *c_dn; /* the dn this asoc is bound as */ - char *c_cred; /* corresponding pw */ - long c_credlen; - unsigned long c_method; - struct PSAPaddr *c_paddr; /* the dsa address */ - int c_time; /* time this association inited */ - int c_refcnt; /* number of ops referencing this ad */ - struct conn *c_next; -}; - -/* - * This structure represents an outstanding request. There is one of - * these for each client request for which we have not yet received a - * response from a dsa. - */ - -struct msg { - int m_msgid; /* the message id */ - int m_uniqid; /* unique id for this message */ - int m_msgtype; /* the ldap operation type */ - LDAPMod *m_mods; /* for modify operations only */ - BerElement *m_ber; /* the unparsed ber for the op */ - struct conn *m_conn; /* connection structure */ -#ifdef CLDAP - int m_cldap; /* connectionless transport? (CLDAP) */ - struct sockaddr m_clientaddr; /* client address (if using CLDAP) */ - DN m_searchbase; /* base used in search */ -#endif /* CLDAP */ - struct msg *m_next; -}; - -#define DEFAULT_TIMEOUT 3600 /* idle client connections */ -#define DEFAULT_REFERRAL_TIMEOUT 900 /* DSA connections */ - -#ifdef NEEDPROTOS -#include "proto-ldapd.h" -#else -extern struct msg *add_msg(); -extern struct msg *get_msg(); -extern struct msg *get_cldap_msg(); -extern int del_msg(); - -extern struct conn *conn_getfd(); -extern struct conn *conn_find(); -extern struct conn *conn_dup(); -extern void conn_del(); - -extern AttributeValue ldap_str2AttrV(); -extern DN ldap_str2dn(); -extern void ldap_str2alg(); -extern void ldap_print_algid(); -#endif /* don't need protos */ diff --git a/servers/ldapd/compare.c b/servers/ldapd/compare.c deleted file mode 100644 index 88ac1604f7..0000000000 --- a/servers/ldapd/compare.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -#ifdef COMPAT20 -extern int ldap_compat; -#define COMPTAG (ldap_compat == 20 ? OLD_LDAP_RES_COMPARE : LDAP_RES_COMPARE) -#else -#define COMPTAG LDAP_RES_COMPARE -#endif - -int -do_compare( - Sockbuf *clientsb, - struct msg *m, - BerElement *ber -) -{ - char *dn, *attr, *value; - int rc; - struct ds_compare_arg ca; - AttributeType type; - static CommonArgs common = default_common_args; - extern short ldap_dn_syntax; - - Debug( LDAP_DEBUG_TRACE, "do_compare\n", 0, 0, 0 ); - - /* - * Parse the compare request. It looks like this: - * CompareRequest := [APPLICATION 14] SEQUENCE { - * entry DistinguishedName, - * ava SEQUENCE { - * type AttributeType, - * value AttributeValue - * } - * } - */ - -#if ISODEPACKAGE == IC -#if ICRELEASE > 2 - DAS_CompareArgument_INIT ( &ca ); -#endif -#endif - - if ( ber_scanf( ber, "{a{aa}}", &dn, &attr, &value ) == LBER_ERROR ) { - Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, COMPTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "" ); - return( 0 ); - } - - Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n", - dn, attr, value ); - - ca.cma_object = ldap_str2dn( dn ); - free( dn ); - if ( ca.cma_object == NULLDN ) { - Debug( LDAP_DEBUG_ANY, "ldap_str2dn failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, COMPTAG, m, - LDAP_INVALID_DN_SYNTAX, NULL, "" ); - return( 0 ); - } - - type = str2AttrT( attr ); - if ( type == NULLAttrT ) { - Debug( LDAP_DEBUG_ANY, "str2AttrT failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, COMPTAG, m, - LDAP_UNDEFINED_TYPE, NULL, attr ); - free( attr ); - return( 0 ); - } - free( attr ); - ca.cma_purported.ava_type = type; - - ca.cma_purported.ava_value = ldap_str2AttrV( value, type->oa_syntax ); - free( value ); - if ( ca.cma_purported.ava_value == NULLAttrV ) { - Debug( LDAP_DEBUG_ANY, "str2AttrV failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, COMPTAG, m, - LDAP_INVALID_SYNTAX, NULL, "" ); - return( 0 ); - } - - ca.cma_common = common; /* struct copy */ - - rc = initiate_dap_operation( OP_COMPARE, m, &ca ); - - dn_free( ca.cma_object ); - AttrV_free( ca.cma_purported.ava_value ); - - if ( rc != 0 ) { - send_ldap_msgresult( clientsb, COMPTAG, m, rc, NULL, "" ); - return( 0 ); - } - - return( 1 ); -} - -void -compare_result( - Sockbuf *sb, - struct msg *m, - struct ds_compare_result *cr -) -{ - send_ldap_msgresult( sb, COMPTAG, m, cr->cmr_matched ? - LDAP_COMPARE_TRUE : LDAP_COMPARE_FALSE, NULL, "" ); - - return; -} diff --git a/servers/ldapd/delete.c b/servers/ldapd/delete.c deleted file mode 100644 index 57fe76ec07..0000000000 --- a/servers/ldapd/delete.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -#ifdef COMPAT20 -extern int ldap_compat; -#define DELTAG (ldap_compat == 20 ? OLD_LDAP_RES_DELETE : LDAP_RES_DELETE) -#else -#define DELTAG LDAP_RES_DELETE -#endif - -/* - * do_delete - Initiate an X.500 remove entry operation. Returns 1 if - * the operation was initiated successfully, and thus a response will be - * coming back from the DSA. Returns 0 if there was trouble and thus no - * DSA response is expected. - */ - -int -do_delete( - Sockbuf *clientsb, - struct msg *m, - BerElement *ber -) -{ - char *dn; - int rc; - struct ds_removeentry_arg ra; - static CommonArgs common = default_common_args; - extern DN ldap_str2dn(); - - Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 ); - - /* - * Parse the delete request. It looks like this: - * DelRequest := DistinguishedName - */ - -#if ISODEPACKAGE == IC -#if ICRELEASE > 2 - DAS_RemoveEntryArgument_INIT( &ra ); -#endif -#endif - - if ( ber_scanf( ber, "a", &dn ) == LBER_ERROR ) { - Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, DELTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "" ); - return( 0 ); - } - - Debug( LDAP_DEBUG_ARGS, "do_delete: dn (%s)\n", dn, 0, 0 ); - - ra.rma_object = ldap_str2dn( dn ); - free( dn ); - if ( ra.rma_object == NULLDN ) { - Debug( LDAP_DEBUG_ANY, "ldap_str2dn failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, DELTAG, m, - LDAP_INVALID_DN_SYNTAX, NULL, "" ); - return( 0 ); - } - - ra.rma_common = common; /* struct copy */ - - rc = initiate_dap_operation( OP_REMOVEENTRY, m, &ra ); - - dn_free( ra.rma_object ); - - if ( rc != 0 ) { - send_ldap_msgresult( clientsb, DELTAG, m, rc, NULL, "" ); - return( 0 ); - } - - return( 1 ); -} - -void -delete_result( - Sockbuf *sb, - struct msg *m -) -{ - send_ldap_msgresult( sb, DELTAG, m, LDAP_SUCCESS, NULL, "" ); - - return; -} diff --git a/servers/ldapd/error.c b/servers/ldapd/error.c deleted file mode 100644 index e35448c3f1..0000000000 --- a/servers/ldapd/error.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" - -void -print_error( struct DSError *e ) -{ - PS ps; - - if ( (ps = ps_alloc( std_open )) == NULLPS ) { - fprintf( stderr, "error in ps_alloc\n" ); - return; - } - if ( std_setup( ps, stderr ) == NOTOK ) { - fprintf( stderr, "error in std_setup = %d", ps->ps_errno ); - return; - } - - ds_error( ps, e ); - - ps_flush( ps ); - ps_free( ps ); -} - -int -x500err2ldaperr( struct DSError *e, char **matched ) -{ - int ldaperr = LDAP_OTHER; - static PS ps; - - Debug( LDAP_DEBUG_TRACE, "x500err2ldaperr\n", 0, 0, 0 ); - - *matched = NULL; - switch ( e->dse_type ) { - case DSE_ATTRIBUTEERROR: -#if ISODEPACKAGE == IC || ISODEPACKAGE == XT - switch ( e->ERR_ATTRIBUTE.DSE_at_plist->DSE_at_what ) { -#else - switch ( e->ERR_ATTRIBUTE.DSE_at_plist.DSE_at_what ) { -#endif - case DSE_AT_NOSUCHATTRIBUTE: - ldaperr = LDAP_NO_SUCH_ATTRIBUTE; - break; - case DSE_AT_INVALIDATTRIBUTESYNTAX: - ldaperr = LDAP_INVALID_SYNTAX; - break; - case DSE_AT_UNDEFINEDATTRIBUTETYPE: - ldaperr = LDAP_UNDEFINED_TYPE; - break; - case DSE_AT_INAPPROPRIATEMATCHING: - ldaperr = LDAP_INAPPROPRIATE_MATCHING; - break; - case DSE_AT_CONSTRAINTVIOLATION: - ldaperr = LDAP_CONSTRAINT_VIOLATION; - break; - case DSE_AT_TYPEORVALUEEXISTS: - ldaperr = LDAP_TYPE_OR_VALUE_EXISTS; - break; - default: - break; - } - break; - - case DSE_NAMEERROR: - switch( e->ERR_NAME.DSE_na_problem ) { - case DSE_NA_NOSUCHOBJECT: - ldaperr = LDAP_NO_SUCH_OBJECT; - break; - case DSE_NA_ALIASPROBLEM: - ldaperr = LDAP_ALIAS_PROBLEM; - break; - case DSE_NA_INVALIDATTRIBUTESYNTAX: - ldaperr = LDAP_INVALID_SYNTAX; - break; - case DSE_NA_ALIASDEREFERENCE: - ldaperr = LDAP_ALIAS_DEREF_PROBLEM; - break; - default: - break; - } - - if ( e->ERR_NAME.DSE_na_matched == NULLDN ) { - break; - } - - if ( ps == NULL ) { - ps = ps_alloc( str_open ); - str_setup( ps, NULLCP, 0, 0 ); - } - ldap_dn_print( ps, e->ERR_NAME.DSE_na_matched, NULLDN, EDBOUT ); - *ps->ps_ptr = '\0'; - - *matched = (char *) strdup( ps->ps_base ); - - ps->ps_ptr = ps->ps_base; - ps->ps_cnt = ps->ps_bufsiz; - break; - - case DSE_SERVICEERROR: - switch( e->ERR_SERVICE.DSE_sv_problem ) { - case DSE_SV_BUSY: - ldaperr = LDAP_BUSY; - break; - case DSE_SV_UNAVAILABLE: - ldaperr = LDAP_UNAVAILABLE; - break; - case DSE_SV_UNWILLINGTOPERFORM: - ldaperr = LDAP_UNWILLING_TO_PERFORM; - break; - case DSE_SV_TIMELIMITEXCEEDED: - ldaperr = LDAP_TIMELIMIT_EXCEEDED; - break; - case DSE_SV_ADMINLIMITEXCEEDED: - ldaperr = LDAP_SIZELIMIT_EXCEEDED; - break; - case DSE_SV_LOOPDETECT: - ldaperr = LDAP_LOOP_DETECT; - break; - default: - break; - } - break; - - case DSE_SECURITYERROR: - switch( e->ERR_SECURITY.DSE_sc_problem ) { - case DSE_SC_AUTHENTICATION: - ldaperr = LDAP_INAPPROPRIATE_AUTH; - break; - case DSE_SC_INVALIDCREDENTIALS: - ldaperr = LDAP_INVALID_CREDENTIALS; - break; - case DSE_SC_ACCESSRIGHTS: - ldaperr = LDAP_INSUFFICIENT_ACCESS; - break; - default: - break; - } - break; - - case DSE_UPDATEERROR: - switch( e->ERR_UPDATE.DSE_up_problem ) { - case DSE_UP_NAMINGVIOLATION: - ldaperr = LDAP_NAMING_VIOLATION; - break; - case DSE_UP_OBJECTCLASSVIOLATION: - ldaperr = LDAP_OBJECT_CLASS_VIOLATION; - break; - case DSE_UP_NOTONNONLEAF: - ldaperr = LDAP_NOT_ALLOWED_ON_NONLEAF; - break; - case DSE_UP_NOTONRDN: - ldaperr = LDAP_NOT_ALLOWED_ON_RDN; - break; - case DSE_UP_ALREADYEXISTS: - ldaperr = LDAP_ALREADY_EXISTS; - break; - case DSE_UP_NOOBJECTCLASSMODS: - ldaperr = LDAP_NO_OBJECT_CLASS_MODS; - break; - default: - break; - } - break; - - default: - break; - } - - return( ldaperr ); -} diff --git a/servers/ldapd/kerberos.c b/servers/ldapd/kerberos.c deleted file mode 100644 index 937236e29a..0000000000 --- a/servers/ldapd/kerberos.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#ifdef KERBEROS - -#include -#include -#include "krb.h" -#include -#include -#include -#include -#if ISODEPACKAGE == IC -#include -#else -#include -#endif -#include "lber.h" -#include "ldap.h" -#include "common.h" - -int -kerberosv4_ldap_auth( char *cred, long len ) -{ - KTEXT_ST k; - KTEXT ktxt = &k; - char instance[INST_SZ]; - int err; - AUTH_DAT ad; - extern char *krb_ldap_service; - extern char *kerberos_keyfile; - - Debug( LDAP_DEBUG_TRACE, "kerberosv4_ldap_auth\n", 0, 0, 0 ); - - SAFEMEMCPY( ktxt->dat, cred, len ); - ktxt->length = len; - - strcpy( instance, "*" ); - if ( (err = krb_rd_req( ktxt, krb_ldap_service, instance, 0L, - &ad, kerberos_keyfile )) != KSUCCESS ) { - Debug( LDAP_DEBUG_ANY, "krb_rd_req failed (%s)\n", - krb_err_txt[err], 0, 0 ); - return( LDAP_INVALID_CREDENTIALS ); - } - - return( LDAP_SUCCESS ); -} - -int -kerberosv4_bindarg( - struct ds_bind_arg *ba, - DN dn, - char *cred, - long len, - u_long *nonce -) -{ - struct type_UNIV_EXTERNAL *e; - struct kerberos_parms kp; - PE pe; - struct timeval tv; - char realm[REALM_SZ]; - int err; - extern char *krb_x500_service; - extern char *krb_x500_instance; - - Debug( LDAP_DEBUG_TRACE, "kerberosv4_bindarg\n", 0, 0, 0 ); - - e = (struct type_UNIV_EXTERNAL *) calloc( 1, - sizeof(struct type_UNIV_EXTERNAL) ); - e->encoding = (struct choice_UNIV_0 *) calloc( 1, - sizeof(struct choice_UNIV_0) ); - ba->dba_external = e; - ba->dba_version = DBA_VERSION_V1988; - ba->dba_auth_type = DBA_AUTH_EXTERNAL; - - e->indirect__reference = AUTH_TYPE_KERBEROS_V4; - e->direct__reference = NULLOID; - e->data__value__descriptor = str2qb( "KRBv4 client credentials", - 24, 1 ); - - kp.kp_dn = dn; - kp.kp_version = AUTH_TYPE_KERBEROS_V4; - - if ( (err = krb_get_lrealm( realm, 1 )) != KSUCCESS ) { - Debug( LDAP_DEBUG_ANY, "krb_get_lrealm failed (%s)\n", - krb_err_txt[err], 0, 0 ); - return( LDAP_OPERATIONS_ERROR ); - } - - gettimeofday( &tv, NULL ); - *nonce = tv.tv_sec; - SAFEMEMCPY( kp.kp_ktxt.dat, cred, len ); - kp.kp_ktxt.length = len; - if ( encode_kerberos_parms( &pe, &kp ) == NOTOK ) { - Debug( LDAP_DEBUG_ANY, "kerberos parms encoding failed\n", 0, - 0, 0 ); - return( LDAP_OPERATIONS_ERROR ); - } - - e->encoding->offset = choice_UNIV_0_single__ASN1__type; - e->encoding->un.single__ASN1__type = pe; - - return( 0 ); -} - -int -kerberos_check_mutual( - struct ds_bind_arg *res, - u_long nonce -) -{ - struct type_UNIV_EXTERNAL *e = res->dba_external; - struct kerberos_parms *kp; - int ret; - - Debug( LDAP_DEBUG_TRACE, "kerberos_check_mutual\n", 0, 0, 0 ); - - if ( decode_kerberos_parms( e->encoding->un.single__ASN1__type, &kp ) - == NOTOK ) - return( NOTOK ); - ret = ((kp->kp_nonce == (nonce + 1)) ? OK : NOTOK ); - - Debug( LDAP_DEBUG_TRACE, "expecting %d got %d\n", nonce, kp->kp_nonce, - 0 ); - - pe_free( e->encoding->un.single__ASN1__type ); - dn_free( kp->kp_dn ); - free( (char *) kp ); - - return( ret ); -} - -#endif diff --git a/servers/ldapd/ldap.py b/servers/ldapd/ldap.py deleted file mode 100644 index c578caae06..0000000000 --- a/servers/ldapd/ldap.py +++ /dev/null @@ -1,231 +0,0 @@ -LDAP DEFINITIONS IMPLICIT TAGS ::= - -PREFIXES encode decode print - -BEGIN - -LDAPMessage ::= - SEQUENCE { - messageID MessageID, - -- unique id in request, - -- to be echoed in response(s) - protocolOp CHOICE { - searchRequest SearchRequest, - searchResponse SearchResponse, - modifyRequest ModifyRequest, - modifyResponse ModifyResponse, - addRequest AddRequest, - addResponse AddResponse, - delRequest DelRequest, - delResponse DelResponse, - modifyDNRequest ModifyRDNRequest, - modifyDNResponse ModifyRDNResponse, - compareDNRequest CompareRequest, - compareDNResponse CompareResponse, - bindRequest BindRequest, - bindResponse BindResponse, - abandonRequest AbandonRequest, - unbindRequest UnbindRequest - } - } - -BindRequest ::= - [APPLICATION 0] SEQUENCE { - version INTEGER (1 .. 127), - -- current version is 2 - name LDAPDN, - -- null name implies an anonymous bind - authentication CHOICE { - simple [0] OCTET STRING, - -- a zero length octet string - -- implies an unauthenticated - -- bind. - krbv42LDAP [1] OCTET STRING, - krbv42DSA [2] OCTET STRING - -- values as returned by - -- krb_mk_req() - -- Other values in later - -- versions of this protocol. - } - } - -BindResponse ::= [APPLICATION 1] LDAPResult - -UnbindRequest ::= [APPLICATION 2] NULL - -SearchRequest ::= - [APPLICATION 3] SEQUENCE { - baseObject LDAPDN, - scope ENUMERATED { - baseObject (0), - singleLevel (1), - wholeSubtree (2) - }, - derefAliases ENUMERATED { - neverDerefAliases (0), - derefInSearching (1), - derefFindingBaseObj (2), - alwaysDerefAliases (3) - }, - sizeLimit INTEGER (0 .. maxInt), - -- value of 0 implies no sizelimit - timeLimit INTEGER (0 .. maxInt), - -- value of 0 implies no timelimit - attrsOnly BOOLEAN, - -- TRUE, if only attributes (without values) - -- to be returned. - filter Filter, - attributes SEQUENCE OF AttributeType - } - -SearchResponse ::= - CHOICE { - entry [APPLICATION 4] SEQUENCE { - objectName LDAPDN, - attributes SEQUENCE OF SEQUENCE { - AttributeType, - SET OF - AttributeValue - } - }, - resultCode [APPLICATION 5] LDAPResult - } - -ModifyRequest ::= - [APPLICATION 6] SEQUENCE { - object LDAPDN, - modifications SEQUENCE OF SEQUENCE { - operation ENUMERATED { - add (0), - delete (1), - replace (2) - }, - modification SEQUENCE { - type AttributeType, - values SET OF - AttributeValue - } - } - } - - -ModifyResponse ::= [APPLICATION 7] LDAPResult - -AddRequest ::= - [APPLICATION 8] SEQUENCE { - entry LDAPDN, - attrs SEQUENCE OF SEQUENCE { - type AttributeType, - values SET OF AttributeValue - } - } - -AddResponse ::= [APPLICATION 9] LDAPResult - -DelRequest ::= [APPLICATION 10] LDAPDN - -DelResponse ::= [APPLICATION 11] LDAPResult - -ModifyRDNRequest ::= - [APPLICATION 12] SEQUENCE { - entry LDAPDN, - newrdn RelativeLDAPDN -- old RDN always deleted - } - -ModifyRDNResponse ::= [APPLICATION 13] LDAPResult - -CompareRequest ::= - [APPLICATION 14] SEQUENCE { - entry LDAPDN, - ava AttributeValueAssertion - } - -CompareResponse ::= [APPLICATION 15] LDAPResult - -AbandonRequest ::= [APPLICATION 16] MessageID - -MessageID ::= INTEGER (0 .. maxInt) - -LDAPDN ::= OCTET STRING - -RelativeLDAPDN ::= OCTET STRING - -Filter ::= - CHOICE { - and [0] SET OF Filter, - or [1] SET OF Filter, - not [2] Filter, - equalityMatch [3] AttributeValueAssertion, - substrings [4] SubstringFilter, - greaterOrEqual [5] AttributeValueAssertion, - lessOrEqual [6] AttributeValueAssertion, - present [7] AttributeType, - approxMatch [8] AttributeValueAssertion - } - -LDAPResult ::= - SEQUENCE { - resultCode ENUMERATED { - success (0), - operationsError (1), - protocolError (2), - timeLimitExceeded (3), - sizeLimitExceeded (4), - compareFalse (5), - compareTrue (6), - authMethodNotSupported (7), - strongAuthRequired (8), - noSuchAttribute (16), - undefinedAttributeType (17), - inappropriateMatching (18), - constraintViolation (19), - attributeOrValueExists (20), - invalidAttributeSyntax (21), - noSuchObject (32), - aliasProblem (33), - invalidDNSyntax (34), - isLeaf (35), - aliasDereferencingProblem (36), - inappropriateAuthentication (48), - invalidCredentials (49), - insufficientAccessRights (50), - busy (51), - unavailable (52), - unwillingToPerform (53), - loopDetect (54), - namingViolation (64), - objectClassViolation (65), - notAllowedOnNonLeaf (66), - notAllowedOnRDN (67), - entryAlreadyExists (68), - objectClassModsProhibited (69), - other (80) - }, - matchedDN LDAPDN, - errorMessage OCTET STRING - } - -AttributeType ::= OCTET STRING - -- text name of the attribute, or dotted - -- OID representation - -AttributeValue ::= OCTET STRING - -AttributeValueAssertion ::= - SEQUENCE { - attributeType AttributeType, - attributeValue AttributeValue - } - -SubstringFilter ::= - SEQUENCE { - type AttributeType, - SEQUENCE OF CHOICE { - initial [0] OCTET STRING, - any [1] OCTET STRING, - final [2] OCTET STRING - } - } - -maxInt INTEGER ::= 65535 -END diff --git a/servers/ldapd/main.c b/servers/ldapd/main.c deleted file mode 100644 index 5626a34c4f..0000000000 --- a/servers/ldapd/main.c +++ /dev/null @@ -1,691 +0,0 @@ -/* - * Copyright (c) 1990-1996 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ -/* - * Some code fragments to run from inetd stolen from the University - * of Minnesota gopher distribution, which had this copyright on it: - * - * Part of the Internet Gopher program, copyright (C) 1991 - * University of Minnesota Microcomputer Workstation and Networks Center - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef _AIX -#include -#endif -#include -#include -#include -#include "portable.h" -#include "lber.h" -#include "ldap.h" -#include "common.h" - -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ - -void log_and_exit(); -static set_socket(); -static do_queries(); -static SIG_FN wait4child(); -#ifdef CLDAP -static udp_init(); -#endif - -#ifdef LDAP_DEBUG -int ldap_debug; -#endif -int version; -#ifdef COMPAT -int ldap_compat; -#endif -int dosyslog; -int do_tcp = 1; -#ifdef CLDAP -int do_udp = 0; -#endif -int idletime = DEFAULT_TIMEOUT; -int referral_connection_timeout = DEFAULT_REFERRAL_TIMEOUT; -struct timeval conn_start_tv; -#ifdef KERBEROS -char *krb_ldap_service = "ldapserver"; -char *krb_x500_service = "x500dsa"; -char *krb_x500_instance; -char *krb_x500_nonce; -char *kerberos_keyfile; -#endif - -int dtblsize; -int RunFromInetd = 0; - -extern char Versionstr[]; - -static usage( name ) -char *name; -{ - fprintf( stderr, "usage: %s [-d debuglvl] [-p port] [-l] [-c dsa] [-r referraltimeout]", name ); -#ifdef CLDAP - fprintf( stderr, " [ -U | -t timeout ]" ); -#else - fprintf( stderr, " [ -t timeout ]" ); -#endif - fprintf( stderr, " [-I]" ); -#ifdef KERBEROS - fprintf( stderr, " [-i dsainstance]" ); -#endif - fprintf( stderr, "\n" ); -} - -main (argc, argv) -int argc; -char **argv; -{ - int tcps, ns; -#ifdef CLDAP - int udps; -#endif - int myport = LDAP_PORT; - int i, pid, socktype; - char *myname; - fd_set readfds; - struct hostent *hp; - struct sockaddr_in from; - int len; - int dsapargc; - char **dsapargv; - SIG_FN wait4child(); -#ifndef NOSETPROCTITLE - char title[80]; - extern char **Argv; - extern int Argc; -#endif - extern char *optarg; - extern int optind; - -#ifdef VMS - /* Pick up socket from inetd-type server on VMS */ - if ( (ns = socket_from_server( NULL )) > 0 ) - RunFromInetd = 1; -#else - /* Socket from inetd is usually 0 */ - ns = 0; -#endif - - /* for dsap_init */ - if ( (dsapargv = (char **) malloc( 4 * sizeof(char *) )) == NULL ) { - perror( "malloc" ); - exit( 1 ); - } - dsapargv[0] = argv[0]; - dsapargv[1] = 0; - dsapargv[2] = 0; - dsapargv[3] = 0; - dsapargc = 1; -#ifdef KERBEROS - kerberos_keyfile = ""; -#endif - - /* process command line arguments */ - while ( (i = getopt( argc, argv, "d:lp:f:i:c:r:t:IuU" )) != EOF ) { - switch ( i ) { - case 'c': /* specify dsa to contact */ - dsapargv[1] = "-call"; - dsapargv[2] = strdup( optarg ); - dsapargc = 3; - break; - - case 'd': /* turn on debugging */ -#ifdef LDAP_DEBUG - ldap_debug = atoi( optarg ); - if ( ldap_debug & LDAP_DEBUG_PACKETS ) - lber_debug = ldap_debug; -#else - fprintf( stderr, "Not compiled with -DLDAP_DEBUG!\n" ); -#endif - break; - - case 'l': /* do syslogging */ - dosyslog = 1; - break; - - case 'p': /* specify port number */ - myport = atoi( optarg ); - break; - - case 'r': /* timeout for referral connections */ - referral_connection_timeout = atoi( optarg ); - break; - - case 't': /* timeout for idle connections */ - idletime = atoi( optarg ); - break; - -#ifdef KERBEROS - case 'f': /* kerberos key file */ - kerberos_keyfile = strdup( optarg ); - break; - - case 'i': /* x500 dsa kerberos instance */ - if ( krb_x500_instance != NULL ) - free( krb_x500_instance ); - krb_x500_instance = strdup( optarg ); - break; -#endif - - case 'I': /* Run from inetd */ - RunFromInetd = 1; - break; - -#ifdef CLDAP - case 'U': /* UDP only (no TCP) */ - do_tcp = 0; - do_udp = 1; - break; - -#ifdef NOTYET - case 'u': /* allow UDP requests (CLDAP) */ - do_udp = 1; - break; -#endif /* NOTYET */ - -#endif /* CLDAP */ - - default: - usage( argv[0] ); - exit( 1 ); - } - } - - if ( optind < argc ) { - usage( argv[ 0 ] ); - exit( 1 ); - } - -#ifdef CLDAP - if ( do_udp && !do_tcp && idletime != DEFAULT_TIMEOUT ) { - usage( argv[ 0 ] ); - exit( 1 ); - } -#endif - - Debug( LDAP_DEBUG_TRACE, "%s", Versionstr, 0, 0 ); - -#ifdef USE_SYSCONF - dtblsize = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ - dtblsize = getdtablesize(); -#endif /* USE_SYSCONF */ - -#ifndef NOSETPROCTITLE - /* for setproctitle */ - Argv = argv; - Argc = argc; -#endif - - if ( (myname = strrchr( argv[0], '/' )) == NULL ) - myname = strdup( argv[0] ); - else - myname = strdup( myname + 1 ); - - /* - * detach from the terminal if stderr is redirected or no - * debugging is wanted, and then arrange to reap children - * that have exited - */ - if (!RunFromInetd) { -#ifndef NOSETPROCTITLE - setproctitle( "initializing" ); -#endif -#ifndef VMS - (void) detach(); -#endif - (void) SIGNAL( SIGCHLD, (void *) wait4child ); - (void) SIGNAL( SIGINT, (void *) log_and_exit ); - } - - /* - * set up syslogging (if desired) - */ - if ( dosyslog ) { -#ifdef LOG_LOCAL4 - openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL4 ); -#else - openlog( myname, OPENLOG_OPTIONS ); -#endif - } - - /* - * load the syntax handlers, oidtables, and initialize some stuff, - * then start listening - */ - - (void) quipu_syntaxes(); -#ifdef LDAP_USE_PP - (void) pp_quipu_init( argv[0] ); -#endif -#if ISODEPACKAGE == IC -#if ICRELEASE > 2 - dsa_operation_syntaxes(); -#endif -#endif - (void) dsap_init( &dsapargc, &dsapargv ); - (void) get_syntaxes(); - if (RunFromInetd) { - len = sizeof( socktype ); - getsockopt( ns, SOL_SOCKET, SO_TYPE, &socktype, &len ); - if ( socktype == SOCK_DGRAM ) { -#ifdef CLDAP - Debug( LDAP_DEBUG_ARGS, - "CLDAP request from unknown (%s)\n", - inet_ntoa( from.sin_addr ), 0, 0 ); - conn_start_tv.tv_sec = 0; - udp_init( 0, 0 ); - do_queries( ns, 1 ); -#else /* CLDAP */ - Debug( LDAP_DEBUG_ARGS, - "Compile with -DCLDAP for UDP support\n",0,0,0 ); -#endif /* CLDAP */ - exit( 0 ); - } - - len = sizeof(from); - if ( getpeername( ns, (struct sockaddr *) &from, &len ) - == 0 ) { - hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr), - sizeof(from.sin_addr.s_addr), AF_INET ); - Debug( LDAP_DEBUG_ARGS, "connection from %s (%s)\n", - (hp == NULL) ? "unknown" : hp->h_name, - inet_ntoa( from.sin_addr ), 0 ); - - if ( dosyslog ) { - syslog( LOG_INFO, "connection from %s (%s)", - (hp == NULL) ? "unknown" : hp->h_name, - inet_ntoa( from.sin_addr ) ); - } - -#ifndef NOSETPROCTITLE - sprintf( title, "%s %d\n", hp == NULL ? - inet_ntoa( from.sin_addr ) : hp->h_name, myport ); - setproctitle( title ); -#endif - } - gettimeofday( &conn_start_tv, (struct timezone *) NULL ); - do_queries( ns, 0 ); - - exit( 0 ); - } - - if ( do_tcp ) - tcps = set_socket( myport, 0 ); - -#ifdef CLDAP - if ( do_udp ) - udps = udp_init( myport, 1 ); -#endif - - /* - * loop, wait for a connection, then fork off a child to handle it - * if we are doing CLDAP as well, handle those requests on the fly - */ - -#ifndef NOSETPROCTITLE -#ifdef CLDAP - sprintf( title, "listening %s/%s %d", do_tcp ? "tcp" : "", - do_udp ? "udp" : "", myport ); -#else - sprintf( title, "listening %s %d", do_tcp ? "tcp" : "", myport ); -#endif - setproctitle( title ); -#endif - - for ( ;; ) { - FD_ZERO( &readfds ); - if ( do_tcp ) - FD_SET( tcps, &readfds ); -#ifdef CLDAP - if ( do_udp ) - FD_SET( udps, &readfds ); -#endif - - if ( select( dtblsize, &readfds, 0, 0, 0 ) < 1 ) { -#ifdef LDAP_DEBUG - if ( ldap_debug ) perror( "main select" ); -#endif - continue; - } - -#ifdef CLDAP - if ( do_udp && FD_ISSET( udps, &readfds ) ) { - do_queries( udps, 1 ); - } -#endif - - if ( !do_tcp || ! FD_ISSET( tcps, &readfds ) ) { - continue; - } - - len = sizeof(from); - if ( (ns = accept( tcps, (struct sockaddr *) &from, &len )) - == -1 ) { -#ifdef LDAP_DEBUG - if ( ldap_debug ) perror( "accept" ); -#endif - continue; - } - - hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr), - sizeof(from.sin_addr.s_addr), AF_INET ); - Debug( LDAP_DEBUG_ARGS, "connection from %s (%s)\n", - (hp == NULL) ? "unknown" : hp->h_name, - inet_ntoa( from.sin_addr ), 0 ); - - if ( dosyslog ) { - syslog( LOG_INFO, "connection from %s (%s)", - (hp == NULL) ? "unknown" : hp->h_name, - inet_ntoa( from.sin_addr ) ); - } - -#ifdef VMS - /* This is for debug on terminal on VMS */ - close( tcps ); -#ifndef NOSETPROCTITLE - setproctitle( hp == NULL ? inet_ntoa( from.sin_addr ) : - hp->h_name ); -#endif - gettimeofday( &conn_start_tv, (struct timezone *) NULL ); - (void) SIGNAL( SIGPIPE, (void *) log_and_exit ); - - do_queries( ns, 0 ); - /* NOT REACHED */ -#endif - - switch( pid = fork() ) { - case 0: /* child */ - close( tcps ); -#ifndef NOSETPROCTITLE - sprintf( title, "%s (%d)\n", hp == NULL ? - inet_ntoa( from.sin_addr ) : hp->h_name, - myport ); - setproctitle( title ); -#endif - gettimeofday( &conn_start_tv, (struct timezone *) NULL ); - (void) SIGNAL( SIGPIPE, (void *) log_and_exit ); - - do_queries( ns, 0 ); - break; - - case -1: /* failed */ -#ifdef LDAP_DEBUG - if ( ldap_debug ) perror( "fork" ); -#endif - close( ns ); - syslog( LOG_ERR, "fork failed %m" ); - /* let things cool off */ - sleep( 15 ); - break; - - default: /* parent */ - close( ns ); - Debug( LDAP_DEBUG_TRACE, "forked child %d\n", pid, 0, - 0 ); - break; - } - } - /* NOT REACHED */ -} - -static -do_queries( - int clientsock, - int udp /* is this a UDP (CLDAP) request? */ -) -{ - fd_set readfds; - int rc, i; - struct timeval timeout; - Sockbuf sb; -#ifdef CLDAP - struct sockaddr saddr, faddr; - struct sockaddr *saddrlist[ 1 ]; -#endif /* CLDAP */ - - Debug( LDAP_DEBUG_TRACE, "do_queries%s\n", - udp ? " udp" : "", 0, 0 ); - - /* - * Loop, wait for a request from the client or a response from - * a dsa, then handle it. Dsap_ad is always a connection to the - * "default" dsa. Other connections can be made as a result of - * a referral being chased down. These association descriptors - * are kept track of with the message that caused the referral. - * The set_dsa_fds() routine traverses the list of outstanding - * messages, setting the appropriate bits in readfds. - */ - - if ( !udp ) { - conn_init(); - } - - (void) memset( (void *) &sb, '\0', sizeof( sb ) ); - sb.sb_sd = clientsock; - sb.sb_naddr = ( udp ) ? 1 : 0; -#ifdef CLDAP - sb.sb_addrs = (void **)saddrlist; - sb.sb_fromaddr = &faddr; - sb.sb_useaddr = saddrlist[ 0 ] = &saddr; -#endif - sb.sb_ber.ber_buf = NULL; - sb.sb_ber.ber_ptr = NULL; - sb.sb_ber.ber_end = NULL; - - timeout.tv_sec = idletime; - timeout.tv_usec = 0; - for ( ;; ) { - struct conn *dsaconn; - extern struct conn *conns; - - FD_ZERO( &readfds ); - FD_SET( clientsock, &readfds ); - conn_setfds( &readfds ); - -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_CONNS ) { - Debug( LDAP_DEBUG_CONNS, "FDLIST:", 0, 0, 0 ); - for ( i = 0; i < dtblsize; i++ ) { - if ( FD_ISSET( i, &readfds ) ) { - Debug( LDAP_DEBUG_CONNS, " %d", i, 0, - 0); - } - } - Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 ); - } -#endif - - /* - * hack - because of lber buffering, there might be stuff - * already waiting for us on the client sock. - */ - - if ( sb.sb_ber.ber_ptr >= sb.sb_ber.ber_end ) { - if ( (rc = select( dtblsize, &readfds, 0, 0, - udp ? 0 : &timeout )) < 1 ) { -#ifdef LDAP_DEBUG - if ( ldap_debug ) perror( "do_queries select" ); -#endif - if ( rc == 0 ) - log_and_exit( 0 ); /* idle timeout */ - - Debug( LDAP_DEBUG_ANY, "select returns %d!\n", - rc, 0, 0 ); - - /* client gone away - we can too */ - if ( isclosed( clientsock ) ) - log_and_exit( 0 ); - - /* - * check if a dsa conn has gone away - - * mark it bad if so - */ - conn_badfds(); - - continue; - } - } - - if ( sb.sb_ber.ber_ptr < sb.sb_ber.ber_end || - FD_ISSET( clientsock, &readfds ) ) { - client_request( &sb, conns, udp ); - } else { - if ( (dsaconn = conn_getfd( &readfds )) == NULL ) { - Debug( LDAP_DEBUG_ANY, "No DSA activity!\n", - 0, 0, 0 ); - continue; - } - - dsa_response( dsaconn, &sb ); - } - } - /* NOT REACHED */ -} - -static set_socket( - int port, - int udp /* UDP port? */ -) -{ - int s, i; - struct sockaddr_in addr; - - if ( (s = socket( AF_INET, udp ? SOCK_DGRAM:SOCK_STREAM, 0 )) == -1 ) { - perror( "socket" ); - exit( 1 ); - } - - /* set option so clients can't keep us from coming back up */ - i = 1; - if ( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (void *) &i, sizeof(i) ) - < 0 ) { - perror( "setsockopt" ); - exit( 1 ); - } - - /* bind to a name */ - (void)memset( (void *)&addr, '\0', sizeof( addr )); - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = INADDR_ANY; - addr.sin_port = htons( port ); - if ( bind( s, (struct sockaddr *) &addr, sizeof(addr) ) ) { - perror( "bind" ); - exit( 1 ); - } - - if ( !udp ) { - /* listen for connections */ - if ( listen( s, 5 ) == -1 ) { - perror( "listen" ); - exit( 1 ); - } - } - - Debug( LDAP_DEBUG_TRACE, "listening on %s port %d\n", - udp ? "udp" : "tcp", port, 0 ); - - return( s ); -} - -static SIG_FN wait4child() -{ - WAITSTATUSTYPE status; - - Debug( LDAP_DEBUG_TRACE, "parent: catching child status\n", 0, 0, 0 ); - -#ifdef USE_WAITPID - while( waitpid( (pid_t) -1, 0, WAIT_FLAGS ) > 0 ) - ; /* NULL */ -#else - while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 ) - ; /* NULL */ -#endif - - (void) SIGNAL( SIGCHLD, (void *) wait4child ); -} - - -void -log_and_exit( int exitcode ) -{ - struct timeval tv; - - if ( dosyslog ) { - if ( conn_start_tv.tv_sec == 0 ) { - syslog( LOG_INFO, "UDP exit(%d)", exitcode ); - } else { - gettimeofday( &tv, (struct timezone *)NULL ); - syslog( LOG_INFO, "TCP closed %d seconds, exit(%d)", - tv.tv_sec - conn_start_tv.tv_sec, exitcode ); - } - } - - exit( exitcode ); -} - - -#ifdef CLDAP -static int -udp_init( - int port, - int createsocket -) -{ - int s, bound; - char *matched; - extern char *dsa_address; - extern struct PSAPaddr *psap_cpy(); - extern struct conn *conns; - - if ( createsocket ) - s = set_socket( port, 1 ); - - conn_init(); - conns->c_dn = strdup(""); - conns->c_cred = strdup(""); - conns->c_credlen = 0; - conns->c_method = LDAP_AUTH_SIMPLE; - - if ( dsa_address == NULL || (conns->c_paddr = str2paddr( dsa_address )) - == NULLPA ) { - fprintf(stderr, "Bad DSA address (%s)\n", dsa_address ? - dsa_address : "NULL" ); - exit( 1 ); - } else { - conns->c_paddr = psap_cpy(conns->c_paddr); - } - - if ( do_bind_real(conns, &bound, &matched) != LDAP_SUCCESS) { - fprintf(stderr, "Cannot bind to directory\n"); - exit( 1 ); - } - if ( matched != NULL ) - free( matched ); - - return( createsocket ? s : 0 ); -} -#endif diff --git a/servers/ldapd/message.c b/servers/ldapd/message.c deleted file mode 100644 index 19e07f64a4..0000000000 --- a/servers/ldapd/message.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -static struct msg *messages; - -struct msg *add_msg( - int msgid, - int msgtype, - BerElement *ber, - struct conn *dsaconn, - int udp, - struct sockaddr *clientaddr -) -{ - struct msg *new; - static int uniqid = 0; - - /* make a new message */ - if ( (new = (struct msg *) malloc( sizeof(struct msg) )) == NULL ) { - Debug( LDAP_DEBUG_ANY, "addmsg: malloc failed\n", 0, 0, 0 ); - return( NULL ); - } - new->m_msgid = msgid; - new->m_uniqid = ++uniqid; - new->m_msgtype = msgtype; - new->m_ber = ber; - new->m_mods = NULL; - new->m_conn = dsaconn; - new->m_conn->c_refcnt++; - new->m_next = NULL; - -#ifdef CLDAP - new->m_cldap = udp; - new->m_searchbase = NULLDN; - - if ( udp ) { - new->m_clientaddr = *clientaddr; - Debug( LDAP_DEBUG_TRACE, "udp message from %s port %d\n", - inet_ntoa( ((struct sockaddr_in *)clientaddr)->sin_addr ), - ((struct sockaddr_in *)clientaddr)->sin_port, 0 ); - } -#endif - - /* add it to the front of the queue */ - new->m_next = messages; - messages = new; - - return( new ); -} - -struct msg *get_msg( int uniqid ) -{ - struct msg *tmp; - - for ( tmp = messages; tmp != NULL; tmp = tmp->m_next ) { - if ( tmp->m_uniqid == uniqid ) - return( tmp ); - } - - return( NULL ); -} - -int -del_msg( struct msg *m ) -{ - struct msg *cur, *prev; - - prev = NULL; - for ( cur = messages; cur != NULL; cur = cur->m_next ) { - if ( cur == m ) - break; - prev = cur; - } - - if ( cur == NULL ) { - Debug( LDAP_DEBUG_ANY, "delmsg: cannot find msg %x\n", m, - 0, 0 ); - return( -1 ); - } - - if ( prev == NULL ) { - messages = cur->m_next; - } else { - prev->m_next = cur->m_next; - } - conn_free( cur->m_conn ); - modlist_free( cur->m_mods ); - ber_free( cur->m_ber, 1 ); -#ifdef CLDAP - if ( cur->m_searchbase != NULLDN ) { - dn_free( cur->m_searchbase ); - } -#endif /* CLDAP */ - free( (char *) cur ); - - return( 0 ); -} - -/* - * send_msg - Send a messge in response to every outstanding request on - * a given connection. This is used, for example, when an association to - * a dsa fails. It deletes messages to which it responds. - */ - -void -send_msg( - struct conn *conn, - Sockbuf *clientsb, - int err, - char *str -) -{ - struct msg *tmp, *next; - - next = NULL; - for ( tmp = messages; tmp != NULL; tmp = next ) { - next = tmp->m_next; - - if ( tmp->m_conn == conn ) { - send_ldap_msgresult( clientsb, tmp->m_msgtype, tmp, - err, NULL, str ); - } - - del_msg( tmp ); - } -} - - -#ifdef CLDAP -struct msg * -get_cldap_msg( - int msgid, - int msgtype, - struct sockaddr *fromaddr -) -{ - struct msg *tmp; - - for ( tmp = messages; tmp != NULL; tmp = tmp->m_next ) { - if ( tmp->m_cldap && tmp->m_msgid == msgid && - tmp->m_msgtype == msgtype && - ((struct sockaddr_in *)&tmp->m_clientaddr)->sin_port == - ((struct sockaddr_in *)fromaddr)->sin_port && - ((struct sockaddr_in *)&tmp->m_clientaddr)->sin_addr.s_addr - == ((struct sockaddr_in *)fromaddr)->sin_addr.s_addr ) { - break; - } - } - - return( tmp ); -} -#endif /* CLDAP */ diff --git a/servers/ldapd/modify.c b/servers/ldapd/modify.c deleted file mode 100644 index bbfd5ed82a..0000000000 --- a/servers/ldapd/modify.c +++ /dev/null @@ -1,645 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -static CommonArgs common = default_common_args; - -extern short ldap_photo_syntax; -extern short ldap_jpeg_syntax; -extern short ldap_jpeg_nonfile_syntax; -extern short ldap_audio_syntax; -extern short ldap_dn_syntax; -extern short ldap_postaladdress_syntax; -extern short ldap_acl_syntax; -extern short ldap_mtai_syntax; -extern short ldap_rts_cred_syntax; -extern short ldap_rtl_syntax; -extern short ldap_octetstring_syntax; - - -#ifdef COMPAT20 -extern int ldap_compat; -#define MODTAG (ldap_compat == 20 ? OLD_LDAP_RES_MODIFY : LDAP_RES_MODIFY) -#else -#define MODTAG LDAP_RES_MODIFY -#endif - -int -do_modify( - Sockbuf *clientsb, - struct msg *m, - BerElement *ber -) -{ - char *dn; - char *last; - int rc; - unsigned long tag, len; - LDAPMod *mods, *modtail; - struct ds_read_arg ra; - extern DN ldap_str2dn(); - - Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 ); - - /* - * Parse the modify request. It looks like this: - * ModifyRequest := [APPLICATION 6] SEQUENCE { - * name DistinguishedName, - * mods SEQUENCE OF SEQUENCE { - * operation ENUMERATED { - * add (0), - * delete (1), - * replace (2) - * }, - * modification SEQUENCE { - * type AttributeType, - * values SET OF AttributeValue - * } - * } - * } - * We then have to initiate a read of the entry to be modified. - * The actual modification is done by do_modify2(), after the - * read completes. - */ - -#if ISODEPACKAGE == IC -#if ICRELEASE > 2 - DAS_ReadArgument_INIT( &ra ); -#endif -#endif - - if ( ber_scanf( ber, "{a", &dn ) == LBER_ERROR ) { - Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, MODTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "" ); - return( 0 ); - } - - Debug( LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", dn, 0, 0 ); - - ra.rda_object = ldap_str2dn( dn ); - free( dn ); - if ( ra.rda_object == NULLDN ) { - Debug( LDAP_DEBUG_ANY, "ldap_str2dn failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, MODTAG, m, - LDAP_INVALID_DN_SYNTAX, NULL, "" ); - return( 0 ); - } - ra.rda_eis.eis_allattributes = TRUE; - ra.rda_eis.eis_infotypes = EIS_ATTRIBUTESANDVALUES; - ra.rda_eis.eis_select = NULLATTR; - - /* collect modifications & save for later */ - mods = modtail = NULL; - for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; - tag = ber_next_element( ber, &len, last ) ) { - LDAPMod *tmp; - - if ( (tmp = (LDAPMod *) calloc( 1, sizeof(LDAPMod) )) - == NULL ) { - send_ldap_msgresult( clientsb, MODTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "Malloc error" ); - return( 0 ); - } - - if ( ber_scanf( ber, "{i{a[V]}}", &tmp->mod_op, &tmp->mod_type, - &tmp->mod_bvalues ) == LBER_ERROR ) { - send_ldap_msgresult( clientsb, MODTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "" ); - return( 0 ); - } - - if ( mods == NULL ) { - mods = tmp; - } else { - modtail->mod_next = tmp; - } - modtail = tmp; - } - m->m_mods = mods; - - ra.rda_common = common; /* struct copy */ - - rc = initiate_dap_operation( OP_READ, m, &ra ); - - dn_free( ra.rda_object ); - - if ( rc != 0 ) { - send_ldap_msgresult( clientsb, MODTAG, m, rc, NULL, "" ); - return( 0 ); - } - - return( 1 ); -} - -int -do_modify2( - Sockbuf *clientsb, - struct msg *m, - struct ds_read_result *rr -) -{ - struct ds_modifyentry_arg ma; - struct entrymod *changetail = NULLMOD; - int rc; - LDAPMod *mods; - - Debug( LDAP_DEBUG_TRACE, "do_modify2\n", 0, 0, 0 ); - -#if ISODEPACKAGE == IC -#if ICRELEASE > 2 - DAS_ModifyEntryArgument_INIT( &ma ); -#endif -#endif - - ma.mea_changes = NULLMOD; - for ( mods = m->m_mods; mods != NULL; mods = mods->mod_next ) { - struct entrymod *em; - Attr_Sequence as, new, get_as(); - - if ( (em = (struct entrymod *) calloc( 1, - sizeof(struct entrymod) )) == NULLMOD ) { - send_ldap_msgresult( clientsb, MODTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "Malloc error" ); - return( 0 ); - } - em->em_next = NULLMOD; - - if ( (new = get_as( clientsb, MODTAG, m, - mods->mod_type, mods->mod_bvalues )) == NULLATTR ) - return( 0 ); - em->em_what = new; - - for ( as = rr->rdr_entry.ent_attr; as != NULLATTR; - as = as->attr_link ) { - if ( AttrT_cmp( new->attr_type, as->attr_type ) == 0 ) - break; - } - - if ( new->attr_value == NULLAV && - mods->mod_op != LDAP_MOD_DELETE ) { - send_ldap_msgresult( clientsb, MODTAG, m, - LDAP_INVALID_SYNTAX, NULL, "No values specified" ); - return( 0 ); - } - - switch ( mods->mod_op ) { - case LDAP_MOD_ADD: - Debug( LDAP_DEBUG_ARGS, "ADD:\n", 0, 0, 0 ); - - if ( as == NULLATTR ) { - Debug( LDAP_DEBUG_ARGS, "\tattribute\n", 0, 0, - 0 ); - em->em_type = EM_ADDATTRIBUTE; - } else { - Debug( LDAP_DEBUG_ARGS, "\tvalues\n", 0, 0, 0 ); - em->em_type = EM_ADDVALUES; - } - break; - - case LDAP_MOD_DELETE: - Debug( LDAP_DEBUG_ARGS, "DELETE:\n", 0, 0, 0 ); - - if ( as == NULLATTR ) { - Debug( LDAP_DEBUG_ARGS, - "\tno existing attribute\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, MODTAG, - m, LDAP_NO_SUCH_ATTRIBUTE, NULL, "" ); - ems_free( em ); - return( 0 ); - } else { - if ( new->attr_value == NULLAV ) { - Debug( LDAP_DEBUG_ARGS, "\tattribute\n", - 0, 0, 0 ); - em->em_type = EM_REMOVEATTRIBUTE; - } else { - if ( avs_cmp( new->attr_value, - as->attr_value ) == 0 ) { - Debug( LDAP_DEBUG_ARGS, - "\tattribute\n", 0, 0, 0 ); - em->em_type = - EM_REMOVEATTRIBUTE; - } else { - Debug( LDAP_DEBUG_ARGS, - "\tvalues\n", 0, 0, 0 ); - em->em_type = EM_REMOVEVALUES; - } - } - } - break; - - case LDAP_MOD_REPLACE: - Debug( LDAP_DEBUG_ARGS, "REPLACE:\n", 0, 0, 0 ); - - if ( as == NULLATTR ) { - Debug( LDAP_DEBUG_ARGS, "\tattribute\n", 0, 0, - 0 ); - em->em_type = EM_ADDATTRIBUTE; - } else { - if ( replace_mod( em, as, new ) < 0 ) { - return( 0 ); - } - } - break; - - default: - Debug( LDAP_DEBUG_ARGS, "UNKNOWN MOD:\n", 0, 0, 0 ); - - send_ldap_msgresult( clientsb, MODTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "" ); - return( 0 ); - break; - } - - if ( em->em_what == NULL ) { /* ignore this mod */ - free( em ); - } else { - if ( ma.mea_changes == NULLMOD ) { - ma.mea_changes = em; - } else { - changetail->em_next = em; - } - changetail = em->em_next == NULLMOD ? em : em->em_next; - } - } - -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - struct entrymod *e; - Attr_Sequence as; - AV_Sequence val; - PS ps; - - ps = ps_alloc( std_open ); - std_setup( ps, stderr ); - - fprintf( stderr, "Modify changes are:\n"); - for (e = ma.mea_changes; e; e = e->em_next) { - switch (e->em_type) { - case EM_ADDATTRIBUTE: - fprintf( stderr, "\tADD ATTRIBUTE\n"); - break; - case EM_REMOVEATTRIBUTE: - fprintf( stderr, "\tREMOVE ATTRIBUTE\n"); - break; - case EM_ADDVALUES: - fprintf( stderr, "\tADD VALUES\n"); - break; - case EM_REMOVEVALUES: - fprintf( stderr, "\tREMOVE VALUES\n"); - break; - default: - fprintf( stderr, "\tUNKNOWN\n"); - break; - } - - as = e->em_what; - fprintf( stderr, "\t\ttype (" ); - AttrT_print( ps, as->attr_type, EDBOUT ); - fprintf( stderr, ")" ); - if ( e->em_type == EM_REMOVEATTRIBUTE ) { - fprintf( stderr, "\n" ); - continue; - } - fprintf( stderr, " values" ); - for (val = as->attr_value; val; val = val->avseq_next) { - ps_print( ps, " (" ); - AttrV_print( ps, &val->avseq_av, EDBOUT ); - ps_print( ps, ")" ); - } - fprintf( stderr, "\n" ); - } - ps_free( ps ); - } -#endif - - if ( ma.mea_changes == NULLMOD ) { /* nothing to do */ - send_ldap_msgresult( clientsb, MODTAG, m, - LDAP_SUCCESS, NULL, "" ); - return( 0 ); - } - - ma.mea_object = rr->rdr_entry.ent_dn; - ma.mea_common = common; /* struct copy */ - - rc = initiate_dap_operation( OP_MODIFYENTRY, m, &ma ); - - ems_free( ma.mea_changes ); - - if ( rc != 0 ) { - send_ldap_msgresult( clientsb, MODTAG, m, rc, NULL, "" ); - return( 0 ); - } - - return( 1 ); -} - -Attr_Sequence -get_as( - Sockbuf *clientsb, - unsigned long op, - struct msg *m, - char *type, - struct berval **bvals -) -{ - Attr_Sequence as; - int i; - short syntax; - - Debug( LDAP_DEBUG_TRACE, "get_as\n", 0, 0, 0 ); - - if ( (as = as_comp_new( NULLAttrT, NULLAV, NULLACL_INFO )) - == NULLATTR ) { - send_ldap_msgresult( clientsb, op, m, - LDAP_OPERATIONS_ERROR, NULL, "Malloc error" ); - return( NULLATTR ); - } - as->attr_link = NULLATTR; - as->attr_value = NULLAV; - as->attr_acl = NULLACL_INFO; - - if ( (as->attr_type = str2AttrT( type )) == NULLAttrT ) { - send_ldap_msgresult( clientsb, op, m, LDAP_UNDEFINED_TYPE, - NULL, type ); - return( NULLATTR ); - } - - if ( bvals == NULL ) - return( as ); - - syntax = as->attr_type->oa_syntax; - for ( i = 0; bvals[i] != NULL; i++ ) { - AttributeValue av; - int t61str, ncomp; - char *sval, *s, *news, *n; - extern IFP merge_acl; - extern AttributeValue bv_asn2AttrV(), ldap_strdn2AttrV(); - extern AttributeValue ldap_str_at2AttrV(), bv_octet2AttrV(); - - if ( syntax == ldap_jpeg_syntax || - syntax == ldap_jpeg_nonfile_syntax || - syntax == ldap_octetstring_syntax || - syntax == ldap_audio_syntax ) { - if (( av = bv_octet2AttrV( bvals[i] )) == NULLAttrV ) { - send_ldap_msgresult( clientsb, op, m, - LDAP_INVALID_SYNTAX, NULL, type ); - as_free( as ); - return( NULLATTR ); - } - } else if ( syntax == ldap_photo_syntax ) { - if (( av = bv_asn2AttrV( bvals[i] )) == NULLAttrV ) { - send_ldap_msgresult( clientsb, op, m, - LDAP_INVALID_SYNTAX, NULL, type ); - as_free( as ); - return( NULLATTR ); - } - } else { - - if (( sval = malloc( bvals[i]->bv_len + 1 )) == NULL ) { - send_ldap_msgresult( clientsb, op, m, - LDAP_OPERATIONS_ERROR, NULL, - "Malloc error" ); - return( NULLATTR ); - } - SAFEMEMCPY( sval, bvals[i]->bv_val, bvals[i]->bv_len ); - sval[ bvals[i]->bv_len ] = '\0'; - - /* dang quipu - there's no need for this! */ - if ( syntax == ldap_postaladdress_syntax ) { - t61str = 0; - ncomp = 1; - for ( s = sval; *s; s++ ) { - if ( *s == '$' ) { - ncomp++; - continue; - } -#define ist61(c) (!isascii(c) || !isalnum(c) \ - && c != 047 && c != '(' && c != ')' \ - && c != '+' && c != '-' && c != '.' && c != ',' \ - && c != '/' && c != ':' && c != '=' && c != '?' \ - && c != ' ') - if ( ist61( *s ) ) - t61str = 1; - } -#define T61MARK "{T.61}" -#define T61MARKLEN 6 - if ( t61str ) { - news = malloc( strlen(sval) + - ncomp * T61MARKLEN + 1 ); - strcpy( news, T61MARK ); - for ( n = news + T61MARKLEN, s = sval; - *s; n++, s++ ) { - *n = *s; - if ( *s == '$' ) { - strcpy( ++n, T61MARK ); - n += T61MARKLEN - 1; - } - } - *n = '\0'; - free( sval ); - sval = news; - } - - av = str_at2AttrV( sval, as->attr_type ); - } else if ( syntax == ldap_dn_syntax ) { - av = ldap_strdn2AttrV( sval ); - } else if ( i != 0 && syntax == ldap_acl_syntax ) { - (void) (*merge_acl)( as->attr_value, sval ); - free( sval ); - continue; - } else { - av = ldap_str_at2AttrV( sval, as->attr_type ); - } - - if ( av == NULLAttrV ) { - send_ldap_msgresult( clientsb, op, m, - LDAP_INVALID_SYNTAX, NULL, sval ); - free( sval ); - as_free( as ); - return( NULLATTR ); - } - - free( sval ); - } - as->attr_value = avs_merge( as->attr_value, - avs_comp_new( av ) ); - } - - return( as ); -} - -void -modify_result( Sockbuf *sb, struct msg *m ) -{ - send_ldap_msgresult( sb, MODTAG, m, LDAP_SUCCESS, NULL, "" ); - - return; -} - -void -modlist_free( LDAPMod *mods ) -{ - LDAPMod *next = NULL; - - for ( ; mods != NULL; mods = next ) { - free( mods->mod_type ); - if ( mods->mod_bvalues != NULL ) - ber_bvecfree( mods->mod_bvalues ); - free( mods ); - } -} - -/* - * called when mod is replace to optimize by only deleting old values - * that are not in the new set and by only adding what isn't in old set - */ - -int -replace_mod( - struct entrymod *rem, - Attr_Sequence oas, - Attr_Sequence nas -) -{ - AV_Sequence oavs, navs, davs, prev_navs, tmp; -#ifdef LDAP_DEBUG - PS ps; - - ps = ps_alloc( std_open ); - std_setup( ps, stderr ); - - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - ps_print( ps, "replace_mod(" ); - AttrT_print( ps, oas->attr_type, EDBOUT ); - ps_print( ps, ")\n" ); - } -#endif - - davs = NULL; - for ( oavs = oas->attr_value; oavs != NULL; oavs = oavs->avseq_next ) { -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - ps_print( ps, "old value " ); - AttrV_print( ps, &oavs->avseq_av, EDBOUT ); - ps_print( ps, "\n" ); - } -#endif - - prev_navs = NULL; - for ( navs = nas->attr_value; navs != NULL; - prev_navs = navs, navs = navs->avseq_next ) { -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - ps_print( ps, "\tnew value " ); - AttrV_print( ps, &navs->avseq_av, EDBOUT ); - ps_print( ps, "\n" ); - } -#endif - if ( AttrV_cmp( &oavs->avseq_av, &navs->avseq_av) - == 0) { - break; - } - } - - if ( navs == NULL ) { /* value to delete */ -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - ps_print( ps, "value to delete " ); - AttrV_print( ps, &oavs->avseq_av, EDBOUT ); - ps_print( ps, "\n" ); - } -#endif - if ( davs == NULL ) { - davs = avs_comp_cpy( oavs ); - } else { - tmp = avs_comp_cpy( oavs ); - tmp->avseq_next = davs; - davs = tmp; - } - } else { /* value to keep */ -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - ps_print( ps, "value to leave alone " ); - AttrV_print( ps, &oavs->avseq_av, EDBOUT ); - ps_print( ps, "\n" ); - } -#endif - if ( prev_navs == NULL ) { - nas->attr_value = navs->avseq_next; - } else { - prev_navs->avseq_next = navs->avseq_next; - } - avs_comp_free( navs ); - } - } - - if ( davs == NULL && nas->attr_value == NULL ) { -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - ps_print( ps, " nothing to do" ); - } -#endif - rem->em_what = NULL; - } else { - /* Must add new values before removing old values. - * Otherwise, removing all existing values causes the - * attribute to be removed such that subsequent add values - * fail. - */ - if ( nas->attr_value != NULL ) { /* add new values */ -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - AttrT_print( ps, nas->attr_type, EDBOUT ); - ps_print( ps, ": some to add\n" ); - } -#endif - rem->em_type = EM_ADDVALUES; - rem->em_what = nas; - rem->em_next = NULLMOD; - } - - if ( davs != NULL ) { /* delete old values */ -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - AttrT_print( ps, nas->attr_type, EDBOUT ); - ps_print( ps, ": some to delete\n" ); - } -#endif - if ( nas->attr_value != NULL ) { - rem->em_next = (struct entrymod *) calloc( 1, - sizeof(struct entrymod) ); - rem = rem->em_next; - } - rem->em_type = EM_REMOVEVALUES; - rem->em_what = as_comp_new( NULLAttrT, NULLAV, - NULLACL_INFO ); - rem->em_what->attr_type = AttrT_cpy( nas->attr_type ); - rem->em_what->attr_value = davs; - } - } - - return( 0 ); -} diff --git a/servers/ldapd/modrdn.c b/servers/ldapd/modrdn.c deleted file mode 100644 index d3d939eeb5..0000000000 --- a/servers/ldapd/modrdn.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -#ifdef COMPAT20 -extern int ldap_compat; -#define MODRDNTAG (ldap_compat == 20 ? OLD_LDAP_RES_MODRDN : LDAP_RES_MODRDN) -#else -#define MODRDNTAG LDAP_RES_MODRDN -#endif - -int -do_modrdn( - Sockbuf *clientsb, - struct msg *m, - BerElement *ber -) -{ - char *dn, *newrdn; - int rc, deleteoldrdn; - struct ds_modifyrdn_arg ma; - static CommonArgs common = default_common_args; - extern DN ldap_str2dn(); - extern RDN ldap_str2rdn(); - - Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 ); - - /* - * Parse the modrdn request. It looks like this: - * ModifyRDNRequest := SEQUENCE { - * entry DistinguishedName, - * newrdn RelativeDistinguishedName - * } - */ - -#if ISODEPACKAGE == IC -#if ICRELEASE > 2 - DAS_ModifyDnArgument_INIT( &ma ); -#endif -#endif - - if ( ber_scanf( ber, "{aa", &dn, &newrdn ) == LBER_ERROR ) { - Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, MODRDNTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "" ); - return( 0 ); - } - - deleteoldrdn = 1; - if ( ber_scanf( ber, "b", &deleteoldrdn ) == LBER_ERROR ) { - Debug( LDAP_DEBUG_ANY, "found old modrdn\n", 0, 0, 0 ); - } - - Debug( LDAP_DEBUG_ARGS, - "do_modrdn: dn (%s) newrdn (%s) deleteoldrdn (%d)\n", dn, newrdn, - deleteoldrdn ); - - ma.mra_object = ldap_str2dn( dn ); - free( dn ); - if ( ma.mra_object == NULLDN ) { - Debug( LDAP_DEBUG_ANY, "ldap_str2dn failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, MODRDNTAG, m, - LDAP_INVALID_DN_SYNTAX, NULL, "" ); - return( 0 ); - } - - ma.mra_newrdn = ldap_str2rdn( newrdn ); - free( newrdn ); - if ( ma.mra_newrdn == NULLRDN ) { - Debug( LDAP_DEBUG_ANY, "str2rdn failed\n", 0, 0, 0 ); - send_ldap_msgresult( clientsb, MODRDNTAG, m, - LDAP_INVALID_DN_SYNTAX, NULL, "Bad RDN" ); - return( 0 ); - } - ma.deleterdn = (deleteoldrdn ? 1 : 0); - - ma.mra_common = common; /* struct copy */ - - rc = initiate_dap_operation( OP_MODIFYRDN, m, &ma ); - - dn_free( ma.mra_object ); - rdn_free( ma.mra_newrdn ); - - if ( rc != 0 ) { - send_ldap_msgresult( clientsb, MODRDNTAG, m, rc, NULL, "" ); - return( 0 ); - } - - return( 1 ); -} - -void -modrdn_result( Sockbuf *sb, struct msg *m ) -{ - send_ldap_msgresult( sb, MODRDNTAG, m, LDAP_SUCCESS, NULL, "" ); - - return; -} diff --git a/servers/ldapd/proto-ldapd.h b/servers/ldapd/proto-ldapd.h deleted file mode 100644 index 9556c84e3d..0000000000 --- a/servers/ldapd/proto-ldapd.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef _PROTO_LDAPD -#define _PROTO_LDAPD - -/* - * abandon.c - */ - -int do_abandon( struct conn *dsaconn, BerElement *ber, int msgid ); - -/* - * add.c - */ - -int do_add( Sockbuf *clientsb, struct msg *m, BerElement *ber ); - -/* - * association.c - */ - -struct conn *conn_dup( struct conn *cn ); -int conn_init(); -void conn_free( struct conn *conn ); -void conn_del( struct conn *conn ); -void conn_badfds(); -struct conn *conn_getfd( fd_set *fds ); -void conn_add( struct conn *new ); -struct conn *conn_find( struct conn *c ); -void conn_add( struct conn *new ); -void conn_close(); -int isclosed( int ad ); - -/* - * bind.c - */ - -int do_bind( Sockbuf *clientsb, struct msg *m, BerElement *ber, int *bound ); -int do_bind_real( struct conn *dsaconn, int *bound, char **matched ); - -/* - * certificate.c - */ - -int ldap_certif_print( PS ps, struct certificate *parm, int format ); -void ldap_print_algid( PS ps, struct alg_id *parm, int format ); -struct certificate *ldap_str2cert( char *str ); -void ldap_str2alg( char *str, struct alg_id *alg ); -void certif_init(); - -/* - * compare.c - */ - -int do_compare( Sockbuf *clientsb, struct msg *m, BerElement *ber ); - -/* - * delete.c - */ - -int do_delete( Sockbuf *clientsb, struct msg *m, BerElement *ber ); - -/* - * error.c - */ - -void print_error( struct DSError *e ); -int x500err2ldaperr( struct DSError *e, char **matched ); - -/* - * kerberos.c - */ - -int kerberosv4_ldap_auth( char *cred, long len ); - -/* - * main.c - */ - -void log_and_exit( int exitcode ); - -/* - * message.c - */ - -struct msg *add_msg( int msgid, int msgtype, BerElement *ber, - struct conn *dsaconn, int udp, struct sockaddr *clientaddr ); -struct msg *get_msg( int uniqid ); -int del_msg( struct msg *m ); -void send_msg( struct conn *conn, Sockbuf *clientsb, int err, char *str ); -struct msg * get_cldap_msg( int msgid, int msgtype, struct sockaddr *fromaddr ); - -/* - * modify.c - */ - -int do_modify( Sockbuf *clientsb, struct msg *m, BerElement *ber ); -Attr_Sequence get_as( Sockbuf *clientsb, unsigned long op, struct msg *m, - char *type, struct berval **bvals ); -void modlist_free( LDAPMod *mods ); - -/* - * modrdn.c - */ - -int do_modrdn( Sockbuf *clientsb, struct msg *m, BerElement *ber ); - -/* - * request.c - */ - -void client_request( Sockbuf *clientsb, struct conn *dsaconn, int udp ); -int do_request( Sockbuf *clientsb, struct msg *m, BerElement *ber, - int *bound ); -int initiate_dap_operation( int op, struct msg *m, void *arg ); - -/* - * result.c - */ - -void dsa_response( struct conn *dsaconn, Sockbuf *clientsb ); -int send_ldap_msgresult( Sockbuf *sb, unsigned long tag, struct msg *m, - int err, char *matched, char *text ); -int send_ldap_result( Sockbuf *sb, unsigned long tag, int msgid, int err, - char *matched, char *text ); - -/* - * search.c - */ - -int do_search( Sockbuf *clientsb, struct msg *m, BerElement *ber ); - -/* - * syntax.c - */ - -void get_syntaxes(); -int dn_print_real( PS ps, DN dn, int format); -void ldap_dn_print( PS ps, DN dn, DN base, int format); -int encode_dn( BerElement *ber, DN dn, DN base); -int encode_attrs( BerElement *ber, Attr_Sequence as ); -AttributeValue bv_octet2AttrV( struct berval *bv ); -AttributeValue bv_asn2AttrV( struct berval *bv ); -AttributeValue ldap_strdn2AttrV( char *dnstr ); -DN ldap_str2dn( char *str ); -RDN ldap_str2rdn( char *rdnstr ); -AttributeValue ldap_str_at2AttrV( char *str, AttributeType type ); -AttributeValue ldap_str2AttrV( char *value, short syntax ); - -/* - * util.c - */ - -void bprint( char *data, int len ); -void charlist_free( char **cl ); -int get_ava( BerElement *ber, AVA *tava ); -int chase_referral( Sockbuf *clientsb, struct msg *m, struct DSError *err, - char **matched ); - -#endif /* _proto_ldapd */ diff --git a/servers/ldapd/request.c b/servers/ldapd/request.c deleted file mode 100644 index 51b1d13fa1..0000000000 --- a/servers/ldapd/request.c +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef __hpux -#include -#else -#include -#endif -#include "lber.h" -#include "ldap.h" -#include "common.h" - -extern int dosyslog; - -#ifdef PEPSY_DUMP -#ifndef DEBUG -#define DEBUG -#endif -#include "LDAP-types.h" -#if ISODEPACKAGE == IC -#include -#else -#include -#endif -#endif - -/* - * client_request - called by do_queries() when there is activity on the - * client socket. It expects to be able to get an LDAP message from the - * client socket, parses the first couple of fields, and then calls - * do_request() to handle the request. If do_request() (or something - * called by it) returns a response to the client (e.g., in the case of - * an error), then client_request() is done. If the request is not - * responded to (and needs a response), it is added to the queue of - * outstanding requests. It will be responded to later via dsa_response(), - * once the DSA operation completes. - */ - -void -client_request( - Sockbuf *clientsb, - struct conn *dsaconn, - int udp -) -{ - unsigned long tag; - unsigned long len; - long msgid; - BerElement ber, *copyofber; - struct msg *m; - static int bound; - extern char *bound_dn, *bound_pw; - struct PSAPaddr *psap_cpy(); -#ifdef COMPAT - extern int ldap_compat; -#endif - - Debug( LDAP_DEBUG_TRACE, "client_request%s\n", - udp ? " udp" : "", 0, 0 ); - - /* - * Get the ldap message, which is a sequence of message id - * and then the actual request choice. - */ - - ber_init( &ber, 0 ); - if ( (tag = ber_get_next( clientsb, &len, &ber )) == LBER_DEFAULT ) { - Debug( LDAP_DEBUG_ANY, "ber_get_next failed\n", 0, 0, 0 ); - log_and_exit( 1 ); - } - -#ifdef CLDAP - if ( udp && dosyslog ) { - syslog( LOG_INFO, "UDP request from unknown (%s)", - inet_ntoa( ((struct sockaddr_in *) - clientsb->sb_fromaddr)->sin_addr )); - } -#endif - -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_BER ) - trace_ber( tag, len, ber.ber_buf, stderr, 1, 1 ); -#endif - -#ifdef COMPAT - /* - * This tag should be a normal SEQUENCE tag. In release 2.0 this - * tag is 0x10. In the new stuff this is 0x30. To distinguish - * between 3.0 and the "correct" stuff, we look for an extra - * sequence tag after the bind tag. - */ - - Debug( LDAP_DEBUG_ANY, "bound %d\n", bound, 0, 0 ); - if ( bound == 0 ) { - /* check for 2.0 */ - if ( tag == OLD_LDAP_TAG_MESSAGE ) { - Debug( LDAP_DEBUG_ANY, "version 2.0 detected\n", 0, - 0, 0 ); - if ( dosyslog ) { - syslog( LOG_INFO, "old version 2.0 detected" ); - } - ldap_compat = 20; - /* check for 3.0 */ - } else { - BerElement tber; - unsigned long tlen; - unsigned long ttag; - - tber = ber; /* struct copy */ - /* msgid */ - ttag = ber_skip_tag( &tber, &tlen ); - tber.ber_ptr += tlen; - /* bind sequence header */ - ttag = ber_skip_tag( &tber, &tlen ); - ttag = ber_peek_tag( &tber, &tlen ); - - Debug( LDAP_DEBUG_ANY, "checking for 3.0 tag 0x%x\n", - ttag, 0, 0 ); - if ( ttag == LBER_SEQUENCE ) { - Debug( LDAP_DEBUG_ANY, "version 3.0 detected\n", - 0, 0, 0 ); - if ( dosyslog ) { - syslog( LOG_INFO, - "old version 3.0 detected" ); - } - ldap_compat = 30; - } - } - } -#endif - - if ( ber_get_int( &ber, &msgid ) != LDAP_TAG_MSGID ) { - send_ldap_result( clientsb, LBER_DEFAULT, msgid, - LDAP_PROTOCOL_ERROR, NULL, "Not an LDAP message" ); - free( ber.ber_buf ); - return; - } - -#ifdef CLDAP - if ( udp ) { - char *logdn = NULL; - - ber_get_stringa( &ber, &logdn ); - if ( logdn != NULL ) { - if ( dosyslog ) { - syslog( LOG_INFO, "UDP requestor: %s", logdn ); - } - Debug( LDAP_DEBUG_ANY, "UDP requestor: %s\n", logdn, 0, 0 ); - free( logdn ); - } - } -#endif /* CLDAP */ - -#ifdef COMPAT30 - if ( ldap_compat == 30 ) - tag = ber_skip_tag( &ber, &len ); - else -#endif - tag = ber_peek_tag( &ber, &len ); - if ( !udp && bound == 0 && tag != LDAP_REQ_BIND -#ifdef COMPAT20 - && tag != OLD_LDAP_REQ_BIND -#endif - ) { - send_ldap_result( clientsb, tag, msgid, LDAP_OPERATIONS_ERROR, - NULL, "Bind operation must come first" ); - free( ber.ber_buf ); - return; - } - -#ifdef CLDAP - if (udp && tag != LDAP_REQ_SEARCH && tag != LDAP_REQ_ABANDON ) { - send_ldap_result( clientsb, tag, msgid, LDAP_OPERATIONS_ERROR, - NULL, "Only search is supported over UDP/CLDAP" ); - free( ber.ber_buf ); - return; - } - - if ( get_cldap_msg( msgid, tag, - (struct sockaddr *)clientsb->sb_fromaddr ) != NULL ) { - /* - * duplicate request: toss this one - */ - Debug( LDAP_DEBUG_TRACE, - "client_request tossing dup request id %d from %s\n", - msgid, inet_ntoa( ((struct sockaddr_in *) - clientsb->sb_fromaddr)->sin_addr ), 0 ); - free( ber.ber_buf ); - return; - } -#endif - - copyofber = ber_dup( &ber ); - - m = add_msg( msgid, tag, copyofber, dsaconn, udp, -#ifdef CLDAP - (struct sockaddr *)clientsb->sb_fromaddr ); -#else - NULL ); -#endif - - /* - * Call the appropriate routine to handle the request. If it - * returns a nonzero result, the message requires a response, and - * so it's left in the queue of outstanding requests, otherwise - * it's deleted. - */ - - if ( do_request( clientsb, m, &ber, &bound ) == 0 ) { - del_msg( m ); - } - - return; -} - -/* - * do_request - called when a client makes a request, or when a referral - * error is returned. In the latter case, a connection is made to the - * referred to DSA, and do_request() is called to retry the operation over - * that connection. In the former case, do_request() is called to try - * the operation over the default association. - */ - -int -do_request( - Sockbuf *clientsb, - struct msg *m, - BerElement *ber, - int *bound -) -{ - int resp_required = 0; - - Debug( LDAP_DEBUG_TRACE, "do_request\n", 0, 0, 0 ); - - switch ( m->m_msgtype ) { -#ifdef COMPAT20 - case OLD_LDAP_REQ_BIND: -#endif - case LDAP_REQ_BIND: - resp_required = do_bind( clientsb, m, ber, bound ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_REQ_UNBIND: -#endif -#ifdef COMPAT30 - case LDAP_REQ_UNBIND_30: -#endif - case LDAP_REQ_UNBIND: - conn_close(); - log_and_exit( 0 ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_REQ_ADD: -#endif - case LDAP_REQ_ADD: - resp_required = do_add( clientsb, m, ber ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_REQ_DELETE: -#endif -#ifdef COMPAT30 - case LDAP_REQ_DELETE_30: -#endif - case LDAP_REQ_DELETE: - resp_required = do_delete( clientsb, m, ber ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_REQ_MODRDN: -#endif - case LDAP_REQ_MODRDN: - resp_required = do_modrdn( clientsb, m, ber ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_REQ_MODIFY: -#endif - case LDAP_REQ_MODIFY: - resp_required = do_modify( clientsb, m, ber ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_REQ_COMPARE: -#endif - case LDAP_REQ_COMPARE: - resp_required = do_compare( clientsb, m, ber ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_REQ_SEARCH: -#endif - case LDAP_REQ_SEARCH: - resp_required = do_search( clientsb, m, ber ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_REQ_ABANDON: -#endif -#ifdef COMPAT30 - case LDAP_REQ_ABANDON_30: -#endif - case LDAP_REQ_ABANDON: - resp_required = do_abandon( m->m_conn, ber, m->m_uniqid ); - break; - - default: - Debug( LDAP_DEBUG_ANY, "unknown operation %d\n", m->m_msgtype, - 0, 0 ); - - send_ldap_msgresult( clientsb, m->m_msgtype, m, - LDAP_PROTOCOL_ERROR, NULL, "Unknown request type" ); - break; - } - - return( resp_required ); -} - -/* - * initiate_dap_operation - initiate a dap operation, rebinding and retrying - * the request if necessary. If the request is successfully initiated, 0 is - * returned. Otherwise, an indication of the error is returned. - */ - -int -initiate_dap_operation( - int op, - struct msg *m, - void *arg -) -{ - char *matched; - int i, rc, bound = 0; - struct DAPindication di; - - Debug( LDAP_DEBUG_TRACE, "initiate_dap_operation\n", 0, 0, 0 ); - - if ( m->m_conn->c_ad == -1 && do_bind_real( m->m_conn, &bound, - &matched ) != LDAP_SUCCESS ) - return( LDAP_UNAVAILABLE ); - - for ( i = 0; i < 2; i++ ) { - switch ( op ) { - case OP_COMPARE: - rc = DapCompare( m->m_conn->c_ad, m->m_uniqid, - (struct ds_compare_arg *) arg, &di, ROS_ASYNC ); - break; - - case OP_SEARCH: - rc = DapSearch( m->m_conn->c_ad, m->m_uniqid, - (struct ds_search_arg *) arg, &di, ROS_ASYNC ); - break; - - case OP_ADDENTRY: - rc = DapAddEntry( m->m_conn->c_ad, m->m_uniqid, - (struct ds_addentry_arg *) arg, &di, ROS_ASYNC ); - break; - - case OP_REMOVEENTRY: - rc = DapRemoveEntry( m->m_conn->c_ad, m->m_uniqid, - (struct ds_removeentry_arg *) arg, &di, ROS_ASYNC ); - break; - - case OP_MODIFYENTRY: - rc = DapModifyEntry( m->m_conn->c_ad, m->m_uniqid, - (struct ds_modifyentry_arg *) arg, &di, ROS_ASYNC ); - break; - - case OP_READ: - rc = DapRead( m->m_conn->c_ad, m->m_uniqid, - (struct ds_read_arg *) arg, &di, ROS_ASYNC ); - break; - - case OP_MODIFYRDN: - rc = DapModifyRDN( m->m_conn->c_ad, m->m_uniqid, - (struct ds_modifyrdn_arg *) arg, &di, ROS_ASYNC ); - break; - - default: - break; - } - - Debug( LDAP_DEBUG_TRACE, "operation initiated %d\n", rc, 0, - 0 ); - - if ( rc == OK ) - return( 0 ); - - /* - * the operation was not invoked - try rebinding, then - * try it again. - */ - - (void) dap_unbind( m->m_conn->c_ad ); - - if ( do_bind_real( m->m_conn, &bound, &matched ) - != LDAP_SUCCESS ) - break; - } - - m->m_conn->c_ad = -1; - - return( LDAP_UNAVAILABLE ); /* DSA was unreachable */ -} - -#ifdef LDAP_DEBUG -int -trace_ber( - int tag, - int len, - char *ber, - FILE *trace_file, - int prepend, - int read_pdu /* If non-zero, PDU was read from client. 0 == PDU is being written */ -) -{ - unsigned char *buf; - PS input_ps = NULLPS; - PE pe; - int result = -1; - - Debug( LDAP_DEBUG_TRACE, "trace_ber(tag=%#x, ber=%#lx, len=%d)\n", tag, - (unsigned long) ber, len ); - - if ( (buf = (unsigned char *) malloc( len + 6 )) == NULL ) { - fprintf( trace_file, "Unable to allocate memory\n" ); - } else { - if ( prepend ) { - buf[0] = tag; - buf[1] = 0x84; - buf[2] = len >> 24; - buf[3] = len >> 16; - buf[4] = len >> 8; - buf[5] = len; - SAFEMEMCPY( buf + 6, ber, len ); - } else { - SAFEMEMCPY( buf, ber, len ); - } - if ( (input_ps = ps_alloc( str_open )) == NULLPS ) - fprintf( trace_file, "ps_alloc failed\n" ); - else if ( str_setup( input_ps, (char *)buf, len + 6, 1 ) != OK ) - fprintf( trace_file, "str_setup\n" ); - else if ( (pe = ps2pe( input_ps )) == NULLPE ) { - fprintf(trace_file, "ps2pe: %s\n", - ps_error( input_ps->ps_errno ) ); - lber_bprint( (char *) buf, len + 6 ); - } else { -#ifdef PEPSY_DUMP - int failed = 0; - static LLog log = { - "-", NULLCP, NULLCP, LLOG_PDUS, - LLOG_NONE, -1, 0, NOTOK - }; - struct type_LDAP_LDAPMessage *ldap_msg = NULL; - - if ( decode_LDAP_LDAPMessage(pe, 1, 0, NULL, &ldap_msg) - == -1 ) { - failed = 1; - fprintf( trace_file, - "Error decoding LDAPMessage:\n [%s]\n", - PY_pepy ); - fprintf( trace_file, "Here is the PDU:\n" ); - vsetfp( trace_file, NULL ); - vunknown( pe ); - } - if (log.ll_events & LLOG_PDUS) { - pvpdu (&log, print_LDAP_LDAPMessage_P, pe, - failed ? - "" : "", - read_pdu); - } -/* - PLOGP(&log, LDAP_LDAPMessage, pe, failed ? "" : "", read_pdu); -*/ - if (ldap_msg) - free_LDAP_LDAPMessage(ldap_msg); -#else - vsetfp( trace_file, NULL ); - vunknown( pe ); -#endif - pe_free( pe ); - result = 0; - } - free( buf ); - } - - if ( input_ps ) - ps_free( input_ps ); - - return( result ); -} -#endif diff --git a/servers/ldapd/result.c b/servers/ldapd/result.c deleted file mode 100644 index 3f77032342..0000000000 --- a/servers/ldapd/result.c +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef __hpux -#include -#else -#include -#endif -#include "lber.h" -#include "ldap.h" -#include "common.h" - -extern int dosyslog; -#ifdef COMPAT -extern int ldap_compat; -#endif - -/* - * dsa_response - called by do_queries() when there is activity on one of - * the DSA associations. It is passed the association descriptor on which - * the activity occurred, and the client socket. It figures out what kind - * of activity it was (e.g., result of a previously initiated operation, - * error return, etc), and calls the appropriate routine to send a response - * to the client, or to continue the operation in some cases (e.g., modify), - * or to chase a referral and retry an operation. - * - * If the client is actually given a response, dsa_response() removes the - * corresponding request from the queue of outstanding requests. If the - * activity was an error referral, a connection is made to the referred to - * DSA (if possible), and do_request() is called to retry the request. - */ - -void -dsa_response( - struct conn *dsaconn, - Sockbuf *clientsb -) -{ - struct DAPindication di; - struct DSResult *dr; - struct DSError *de; - struct DAPpreject *dp; - struct DAPabort *da; - struct msg *m = NULL; - BerElement *bercopy; - char *matched; - int incr, delete, rc, ldaperr; - - Debug( LDAP_DEBUG_TRACE, "dsa_response on ad %d\n", dsaconn->c_ad, 0, - 0 ); - di.di_type = -1; - if ( (rc = DapInitWaitRequest( dsaconn->c_ad, OK, &di )) == DONE ) { - Debug( LDAP_DEBUG_ANY, "DapInitWaitRequest: DONE\n", 0, 0, 0 ); - return; - } - - Debug( LDAP_DEBUG_ARGS, "DapInitWaitRequest: result %d type %d\n", rc, - di.di_type, 0 ); - - delete = 1; - switch ( di.di_type ) { - case DI_RESULT: - dr = &di.di_result.dr_res; - if ( (m = get_msg( di.di_result.dr_id )) == NULL ) { - Debug( LDAP_DEBUG_ANY, "DI_RESULT: can't find msg %d\n", - di.di_result.dr_id, 0, 0 ); - return; - } - - Debug( LDAP_DEBUG_ARGS, "DI_RESULT: type %d\n", - dr->result_type, 0, 0 ); - - switch ( dr->result_type ) { - case OP_COMPARE: - compare_result( clientsb, m, &dr->res_cm ); - break; - - case OP_SEARCH: - search_result( clientsb, m, &dr->res_sr ); - break; - - case OP_ADDENTRY: - add_result( clientsb, m ); - break; - - case OP_REMOVEENTRY: - delete_result( clientsb, m ); - break; - - case OP_MODIFYENTRY: - modify_result( clientsb, m ); - break; - - case OP_READ: - if ( do_modify2( clientsb, m, &dr->res_rd ) != 0 ) - delete = 0; - break; - - case OP_MODIFYRDN: - modrdn_result( clientsb, m ); - break; - - default: - break; - } - ds_res_free( dr ); - break; - - case DI_ERROR: - de = &di.di_error.de_err; - if ( (m = get_msg( di.di_error.de_id )) == NULL ) { - Debug( LDAP_DEBUG_ANY, "DI_ERROR: can't find msg %d\n", - di.di_error.de_id, 0, 0 ); - return; - } - if ( m->m_msgtype == LDAP_REQ_SEARCH -#ifdef COMPAT20 - || m->m_msgtype == OLD_LDAP_REQ_SEARCH -#endif - ) - incr = 2; - else if ( m->m_msgtype == LDAP_REQ_DELETE ) - incr = (LDAP_RES_DELETE - LDAP_REQ_DELETE); - else - incr = 1; - - Debug( LDAP_DEBUG_ARGS, "DI_ERROR\n", 0, 0, 0 ); - - /* - * chase down referrals, retry operation there. only do - * this for modify-like operations, since we assume the - * dsa should have been able to chase anything else that - * wasn't really down. - */ - - if ( de->dse_type == DSE_REFERRAL ) { - int bound, rc; - - switch ( m->m_msgtype ) { -#ifdef COMPAT20 - case OLD_LDAP_REQ_ADD: - case OLD_LDAP_REQ_MODIFY: - case OLD_LDAP_REQ_MODRDN: - case OLD_LDAP_REQ_DELETE: - case OLD_LDAP_REQ_COMPARE: - case OLD_LDAP_REQ_SEARCH: -#endif -#ifdef COMPAT30 - case LDAP_REQ_DELETE_30: -#endif - case LDAP_REQ_ADD: - case LDAP_REQ_MODIFY: - case LDAP_REQ_MODRDN: - case LDAP_REQ_DELETE: - case LDAP_REQ_COMPARE: - case LDAP_REQ_SEARCH: - /* chase down the referral */ - if ( (rc = chase_referral( clientsb, m, de, - &matched )) != LDAP_SUCCESS ) { - send_ldap_msgresult( clientsb, - m->m_msgtype + incr, m, rc, - matched, "Can't chase referral" ); - free( matched ); - break; - } - - /* now retry the operation */ - bercopy = ber_dup( m->m_ber ); - if ( do_request( clientsb, m, bercopy, &bound ) - == 0 ) { - del_msg( m ); - } - ber_free( bercopy, 0 ); - return; - break; - - default: - send_ldap_msgresult( clientsb, m->m_msgtype + - incr, m, LDAP_UNAVAILABLE, NULL, "" ); - break; - } - break; - } else if ( de->dse_type == DSE_ABANDONED ) { - return; - } - - - /* not a referral - convert the error and return to client */ - ldaperr = x500err2ldaperr( de, &matched ); -#ifdef LDAP_DEBUG - if ( ldap_debug ) - print_error( de ); /* prints, then calls free */ - else -#endif - ds_error_free( de ); - - send_ldap_msgresult( clientsb, m->m_msgtype + incr, m, - ldaperr, matched, "" ); - free( matched ); - break; - - case DI_PREJECT: - dp = &di.di_preject; - if ( (m = get_msg( dp->dp_id )) == NULL ) { - Debug(LDAP_DEBUG_ANY, "DI_PREJECT: can't find msg %d\n", - dp->dp_id, 0, 0 ); - return; - } - - Debug( LDAP_DEBUG_ARGS, "DI_PREJECT src %d rson %d inf (%s)\n", - dp->dp_source, dp->dp_reason, dp->dp_cc ? dp->dp_data - : "" ); - - send_ldap_msgresult( clientsb, m->m_msgtype, m, - LDAP_UNAVAILABLE, NULL, "Got PREJECT from X.500" ); - - dsaconn->c_ad = -1; - break; - - case DI_ABORT: - da = &di.di_abort; - - Debug( LDAP_DEBUG_ARGS, "DI_ABORT src %d rson %d inf (%s)\n", - da->da_source, da->da_reason, da->da_cc ? da->da_data - : "" ); - - /* assume this always means more stuff coming... */ - if ( da->da_reason == DA_ROS ) - return; - - /* moby hack - but how else do you tell the difference? */ - if ( isclosed( dsaconn->c_ad ) ) { - send_msg( dsaconn, clientsb, LDAP_UNAVAILABLE, - "Got ABORT from X.500" ); - return; - } - - /* notify outstanding requests of the failure */ - send_msg( dsaconn, clientsb, LDAP_OPERATIONS_ERROR, - "Got unknown ABORT from X.500" ); - - dsaconn->c_ad = -1; - return; - break; - - default: - Debug( LDAP_DEBUG_ANY, "unknown result type %d\n", di.di_type, - 0, 0 ); - - dsaconn->c_ad = -1; /* better safe... */ - return; - break; - } - - if ( delete && m != NULL ) - del_msg( m ); -} - -int -send_ldap_msgresult( - Sockbuf *sb, - unsigned long tag, - struct msg *m, - int err, - char *matched, - char *text -) -{ -#ifdef CLDAP - if ( m->m_cldap ) { - SAFEMEMCPY( (char *)sb->sb_useaddr, &m->m_clientaddr, - sizeof( struct sockaddr )); - Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n", - inet_ntoa(((struct sockaddr_in *) - sb->sb_useaddr)->sin_addr ), - ((struct sockaddr_in *)sb->sb_useaddr)->sin_port, 0 ); - } -#endif - return( send_ldap_result( sb, tag, m->m_msgid, err, matched, text ) ); -} - -int -send_ldap_result( - Sockbuf *sb, - unsigned long tag, - int msgid, - int err, - char *matched, - char *text -) -{ - BerElement *ber; - int rc; -#ifdef CLDAP - int cldap; -#endif - extern int version; - -#ifdef CLDAP - cldap = ( sb->sb_naddr > 0 ); -#endif - - Debug( LDAP_DEBUG_TRACE, "send_ldap_result\n", 0, 0, 0 ); - - if ( tag == LBER_DEFAULT ) -#ifdef COMPAT20 - tag = ldap_compat == 20 ? OLD_LBER_SEQUENCE : LBER_SEQUENCE; -#else - tag = LBER_SEQUENCE; -#endif - - if ( (ber = der_alloc()) == NULLBER ) { - Debug( LDAP_DEBUG_ANY, "der_alloc failed\n", 0, 0, 0 ); - return( -1 ); - } - - if ( version != 1 ) { -#ifdef COMPAT20 - if ( ldap_compat == 20 ) { - rc = ber_printf( ber, "t{it{tess}}", OLD_LBER_SEQUENCE, - msgid, tag, LBER_INTEGER, err, - matched ? matched : "", text ); - } else -#endif -#ifdef COMPAT30 - if ( ldap_compat == 30 ) { - rc = ber_printf( ber, "{it{{ess}}}", msgid, tag, err, - matched ? matched : "", text ); - } else -#endif -#ifdef CLDAP - if ( cldap ) { - rc = ber_printf( ber, "{is{t{ess}}}", msgid, "", tag, - err, matched ? matched : "", text ); - } else -#endif - rc = ber_printf( ber, "{it{ess}}", msgid, tag, err, matched ? - matched : "", text ); - } else { - /* version 1 always uses the broken stuff */ - rc = ber_printf( ber, "t{it{is}}", OLD_LBER_SEQUENCE, msgid, - tag, err, text ); - } - - if ( rc == -1 ) { - Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); - return( -1 ); - } - -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_BER ) - trace_ber( 0, ber->ber_ptr - ber->ber_buf, ber->ber_buf, - stderr, 0, 0 ); -#endif - - if ( ber_flush( sb, ber, 1 ) != 0 ) { - Debug( LDAP_DEBUG_ANY, "ber_flush failed\n", 0, 0, 0 ); - return( -1 ); - } - - return( 0 ); -} diff --git a/servers/ldapd/search.c b/servers/ldapd/search.c deleted file mode 100644 index b250d6371a..0000000000 --- a/servers/ldapd/search.c +++ /dev/null @@ -1,710 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -static get_filter(); -static get_filter_list(); -static get_substring_filter(); - -#ifdef COMPAT -extern int version; -extern int ldap_compat; -#define SEARCHRESTAG (ldap_compat == 20 ? OLD_LDAP_RES_SEARCH_RESULT : LDAP_RES_SEARCH_RESULT) -#else -#define SEARCHRESTAG LDAP_RES_SEARCH_RESULT -#endif - -int -do_search( - Sockbuf *clientsb, - struct msg *m, - BerElement *ber -) -{ - int rc, err; - int deref, attrsonly; - int sizelimit, timelimit; - char *base; - char **attrs; - struct ds_search_arg sa; - static CommonArgs common = default_common_args; - extern DN ldap_str2dn(); - - Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 ); - - /* - * Parse the search request. It looks like this: - * SearchRequest := [APPLICATION 3] SEQUENCE { - * baseObject DistinguishedName, - * scope ENUMERATED { - * baseObject (0), - * singleLevel (1), - * wholeSubtree (2) - * }, - * derefAliases ENUMERATED { - * neverDerefaliases (0), - * derefInSearching (1), - * derefFindingBaseObj (2), - * alwaysDerefAliases (3) - * }, - * sizelimit INTEGER (0 .. 65535), - * timelimit INTEGER (0 .. 65535), - * attrsOnly BOOLEAN, - * filter Filter, - * attributes SEQUENCE OF AttributeType - * } - */ - -#if ISODEPACKAGE == IC -#if ICRELEASE > 2 - DAS_SearchArgument_INIT( &sa ); -#endif -#endif - - if ( ber_scanf( ber, "{aiiiib", &base, &sa.sra_subset, &deref, - &sizelimit, &timelimit, &attrsonly ) == LBER_ERROR ) { - send_ldap_msgresult( clientsb, SEARCHRESTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "" ); - return( 0 ); - } - - sa.sra_baseobject = ldap_str2dn( base ); - if ( sa.sra_baseobject == NULLDN && *base != '\0' ) { - free( base ); - send_ldap_msgresult( clientsb, SEARCHRESTAG, m, - LDAP_INVALID_DN_SYNTAX, NULL, "" ); - return( 0 ); - } - free( base ); - - sa.sra_common = common; /* struct copy */ - sa.sra_searchaliases = (deref == LDAP_DEREF_SEARCHING || - deref == LDAP_DEREF_ALWAYS); - if ( deref == LDAP_DEREF_NEVER || deref == LDAP_DEREF_SEARCHING ) - sa.sra_common.ca_servicecontrol.svc_options |= - SVC_OPT_DONTDEREFERENCEALIAS; - - sa.sra_common.ca_servicecontrol.svc_sizelimit = (sizelimit == 0 ? - SVC_NOSIZELIMIT : sizelimit); - - sa.sra_common.ca_servicecontrol.svc_timelimit = (timelimit == 0 ? - SVC_NOTIMELIMIT : timelimit); - - sa.sra_eis.eis_infotypes = (attrsonly ? EIS_ATTRIBUTETYPESONLY : - EIS_ATTRIBUTESANDVALUES); - - /* search filter */ - if ( (err = get_filter( ber, &sa.sra_filter )) != 0 ) { - send_ldap_msgresult( clientsb, SEARCHRESTAG, m, - err, NULL, "Bad search filter" ); - return( 0 ); - } - -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - PS ps; - - ps = ps_alloc( std_open ); - std_setup( ps, stderr ); - ps_print( ps, "Filter: " ); - fi_print( ps, sa.sra_filter, EDBOUT ); - ps_print( ps, "\n" ); - ps_free( ps ); - } -#endif - - /* attrs to return */ - attrs = NULL; - if ( ber_scanf( ber, "{v}}", &attrs ) == LBER_ERROR ) { - send_ldap_msgresult( clientsb, SEARCHRESTAG, m, - LDAP_PROTOCOL_ERROR, NULL, "" ); - return( 0 ); - } - sa.sra_eis.eis_select = NULLATTR; - if ( attrs == NULL ) { - sa.sra_eis.eis_allattributes = 1; - } else { - Attr_Sequence as; - int i; - - sa.sra_eis.eis_allattributes = 0; - for ( i = 0; attrs[i] != NULL; i++ ) { - AttributeType type; - - if ( (type = AttrT_new( attrs[i] )) == NULLAttrT ) { - Debug( LDAP_DEBUG_TRACE, "unknown attr (%s)\n", - attrs[i], 0, 0 ); - continue; - } - - as = as_comp_alloc(); - as->attr_type = type; - as->attr_acl = NULLACL_INFO; - as->attr_link = NULLATTR; - as->attr_value = NULLAV; - - sa.sra_eis.eis_select = as_merge( as, - sa.sra_eis.eis_select ); - } - - /* complain only if we know about none of the attrs */ - if ( sa.sra_eis.eis_select == NULLATTR ) { - send_ldap_msgresult( clientsb, SEARCHRESTAG, - m, LDAP_UNDEFINED_TYPE, NULL, attrs[0] ); - charlist_free( attrs ); - return( 0 ); - } - - charlist_free( attrs ); - } - - rc = initiate_dap_operation( OP_SEARCH, m, &sa ); - -#ifdef CLDAP - if ( m->m_cldap ) - m->m_searchbase = sa.sra_baseobject; - else -#endif /* CLDAP */ - dn_free( sa.sra_baseobject ); - - filter_free( sa.sra_filter ); - as_free( sa.sra_eis.eis_select ); - - if ( rc != 0 ) { - send_ldap_msgresult( clientsb, SEARCHRESTAG, m, - rc, NULL, "" ); - return( 0 ); - } - - return( 1 ); -} - -static get_filter( BerElement *ber, Filter *filt ) -{ - unsigned long tag, len; - int err; - char typestr[64]; - Filter f; - - Debug( LDAP_DEBUG_TRACE, "get_filter\n", 0, 0, 0 ); - - /* - * A filter looks like this coming in: - * Filter ::= CHOICE { - * and [0] SET OF Filter, - * or [1] SET OF Filter, - * not [2] Filter, - * equalityMatch [3] AttributeValueAssertion, - * substrings [4] SubstringFilter, - * greaterOrEqual [5] AttributeValueAssertion, - * lessOrEqual [6] AttributeValueAssertion, - * present [7] AttributeType,, - * approxMatch [8] AttributeValueAssertion - * } - * - * SubstringFilter ::= SEQUENCE { - * type AttributeType, - * SEQUENCE OF CHOICE { - * initial [0] IA5String, - * any [1] IA5String, - * final [2] IA5String - * } - * } - */ - - f = filter_alloc(); - *filt = f; - f->flt_next = NULLFILTER; - - err = 0; - switch (tag = ber_peek_tag( ber, &len )) { -#ifdef COMPAT20 - case OLD_LDAP_FILTER_EQUALITY: -#endif - case LDAP_FILTER_EQUALITY: - Debug( LDAP_DEBUG_ARGS, "EQUALITY\n", 0, 0, 0 ); - f->flt_type = FILTER_ITEM; - f->FUITEM.fi_type = FILTERITEM_EQUALITY; -#ifdef COMPAT30 - if ( ldap_compat == 30 ) - (void) ber_skip_tag( ber, &len ); -#endif - - if ( (err = get_ava( ber, &f->FUITEM.UNAVA )) != 0 ) { - free( f ); - return( err ); - } - break; - -#ifdef COMPAT20 - case OLD_LDAP_FILTER_SUBSTRINGS: -#endif - case LDAP_FILTER_SUBSTRINGS: - Debug( LDAP_DEBUG_ARGS, "SUBSTRINGS\n", 0, 0, 0 ); - err = get_substring_filter( ber, f ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_FILTER_GE: -#endif - case LDAP_FILTER_GE: - Debug( LDAP_DEBUG_ARGS, "GE\n", 0, 0, 0 ); - f->flt_type = FILTER_ITEM; - f->FUITEM.fi_type = FILTERITEM_GREATEROREQUAL; -#ifdef COMPAT30 - if ( ldap_compat == 30 ) - (void) ber_skip_tag( ber, &len ); -#endif - if ( (err = get_ava( ber, &f->FUITEM.UNAVA )) != 0 ) { - free( f ); - return( err ); - } - break; - -#ifdef COMPAT20 - case OLD_LDAP_FILTER_LE: -#endif - case LDAP_FILTER_LE: - Debug( LDAP_DEBUG_ARGS, "LE\n", 0, 0, 0 ); - f->flt_type = FILTER_ITEM; - f->FUITEM.fi_type = FILTERITEM_LESSOREQUAL; -#ifdef COMPAT30 - if ( ldap_compat == 30 ) - (void) ber_skip_tag( ber, &len ); -#endif - - if ( (err = get_ava( ber, &f->FUITEM.UNAVA )) != 0 ) { - free( f ); - return( err ); - } - break; - -#ifdef COMPAT20 - case OLD_LDAP_FILTER_PRESENT: -#endif -#ifdef COMPAT30 - case LDAP_FILTER_PRESENT_30: -#endif - case LDAP_FILTER_PRESENT: - Debug( LDAP_DEBUG_ARGS, "PRESENT\n", 0, 0, 0 ); - f->flt_type = FILTER_ITEM; - f->FUITEM.fi_type = FILTERITEM_PRESENT; - len = sizeof(typestr); -#ifdef COMPAT30 - if ( ldap_compat == 30 ) - (void) ber_skip_tag( ber, &len ); -#endif - - if ( ber_scanf( ber, "s", typestr, &len ) == LBER_ERROR ) - return( LDAP_PROTOCOL_ERROR ); - if ( (f->FUITEM.UNTYPE = str2AttrT( typestr )) == NULLAttrT ) - return( LDAP_UNDEFINED_TYPE ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_FILTER_APPROX: -#endif - case LDAP_FILTER_APPROX: - Debug( LDAP_DEBUG_ARGS, "APPROX\n", 0, 0, 0 ); - f->flt_type = FILTER_ITEM; - f->FUITEM.fi_type = FILTERITEM_APPROX; -#ifdef COMPAT30 - if ( ldap_compat == 30 ) - (void) ber_skip_tag( ber, &len ); -#endif - - if ( (err = get_ava( ber, &f->FUITEM.UNAVA )) != 0 ) { - free( f ); - return( err ); - } - break; - -#ifdef COMPAT20 - case OLD_LDAP_FILTER_AND: -#endif - case LDAP_FILTER_AND: - Debug( LDAP_DEBUG_ARGS, "AND\n", 0, 0, 0 ); - f->flt_type = FILTER_AND; - err = get_filter_list( ber, f ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_FILTER_OR: -#endif - case LDAP_FILTER_OR: - Debug( LDAP_DEBUG_ARGS, "OR\n", 0, 0, 0 ); - f->flt_type = FILTER_OR; - err = get_filter_list( ber, f ); - break; - -#ifdef COMPAT20 - case OLD_LDAP_FILTER_NOT: -#endif - case LDAP_FILTER_NOT: - Debug( LDAP_DEBUG_ARGS, "NOT\n", 0, 0, 0 ); - f->flt_type = FILTER_NOT; - (void) ber_skip_tag( ber, &len ); - err = get_filter( ber, &f->FUFILT ); - break; - - default: - Debug( LDAP_DEBUG_ANY, "unknown filter type %d\n", tag, 0, 0 ); - free( f ); - return( LDAP_PROTOCOL_ERROR ); - break; - } - - Debug( LDAP_DEBUG_TRACE, "end get_filter\n", 0, 0, 0 ); - return( err ); -} - -static get_filter_list( BerElement *ber, Filter f ) -{ - Filter new, tail; - int err; - unsigned long tag, len; - char *last; - - Debug( LDAP_DEBUG_TRACE, "get_filter_list\n", 0, 0, 0 ); - -#ifdef COMPAT30 - if ( ldap_compat == 30 ) - (void) ber_skip_tag( ber, &len ); -#endif - f->FUFILT = tail = NULLFILTER; - for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; - tag = ber_next_element( ber, &len, last ) ) { - if ( (err = get_filter( ber, &new )) != 0 ) - return( err ); - - if ( f->FUFILT == NULLFILTER ) { - f->FUFILT = new; - } else { - tail->flt_next = new; - } - tail = new; - } - - Debug( LDAP_DEBUG_TRACE, "end get_filter_list\n", 0, 0, 0 ); - return( 0 ); -} - -static get_substring_filter( BerElement *ber, Filter f ) -{ - unsigned long tag, len; - char typestr[64]; - AttributeType type; - char *valstr, *last; - AttributeValue value; - extern short ldap_dn_syntax; - - Debug( LDAP_DEBUG_TRACE, "get_substring_filter\n", 0, 0, 0 ); - -#ifdef COMPAT30 - if ( ldap_compat == 30 ) - (void) ber_skip_tag( ber, &len ); -#endif - - f->flt_type = FILTER_ITEM; - f->FUITEM.fi_type = FILTERITEM_SUBSTRINGS; - len = sizeof(typestr); - if ( ber_scanf( ber, "{s", typestr, &len ) == LBER_ERROR ) { - return( LDAP_PROTOCOL_ERROR ); - } - if ( (type = str2AttrT( typestr )) == NULLAttrT ) { - return( LDAP_UNDEFINED_TYPE ); - } - f->FUITEM.UNSUB.fi_sub_type = type; - f->FUITEM.UNSUB.fi_sub_initial = NULLAV; - f->FUITEM.UNSUB.fi_sub_any = NULLAV; - f->FUITEM.UNSUB.fi_sub_final = NULLAV; - for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; - tag = ber_next_element( ber, &len, last ) ) { - AV_Sequence avs, any_end; - -#ifdef COMPAT30 - if ( ldap_compat == 30 ) { - if ( ber_scanf( ber, "{a}", &valstr ) == LBER_ERROR ) { - return( LDAP_PROTOCOL_ERROR ); - } - } else -#endif - if ( ber_scanf( ber, "a", &valstr ) == LBER_ERROR ) { - return( LDAP_PROTOCOL_ERROR ); - } - - value = ldap_str2AttrV( valstr, type->oa_syntax ); - free( valstr ); - - if ( value == NULLAttrV ) { - return( LDAP_INVALID_SYNTAX ); - } - - if ( (avs = avs_comp_new( value )) == NULLAV ) - return( LDAP_OPERATIONS_ERROR ); - - switch ( tag ) { -#ifdef COMPAT20 - case OLD_LDAP_SUBSTRING_INITIAL: -#endif -#ifdef COMPAT30 - case LDAP_SUBSTRING_INITIAL_30: -#endif - case LDAP_SUBSTRING_INITIAL: - Debug( LDAP_DEBUG_ARGS, " INITIAL\n", 0, 0, 0 ); - if ( f->FUITEM.UNSUB.fi_sub_initial != NULLAV - && f->FUITEM.UNSUB.fi_sub_initial->avseq_next - != NULLAV ) { - return( LDAP_PROTOCOL_ERROR ); - } - f->FUITEM.UNSUB.fi_sub_initial = avs; - break; - -#ifdef COMPAT20 - case OLD_LDAP_SUBSTRING_ANY: -#endif -#ifdef COMPAT30 - case LDAP_SUBSTRING_ANY_30: -#endif - case LDAP_SUBSTRING_ANY: - Debug( LDAP_DEBUG_ARGS, " ANY\n", 0, 0, 0 ); - - if (f->FUITEM.UNSUB.fi_sub_any != NULLAV) { - any_end->avseq_next = avs; - } else { - f->FUITEM.UNSUB.fi_sub_any = avs; - } - - any_end = avs; - break; - -#ifdef COMPAT20 - case OLD_LDAP_SUBSTRING_FINAL: -#endif -#ifdef COMPAT30 - case LDAP_SUBSTRING_FINAL_30: -#endif - case LDAP_SUBSTRING_FINAL: - Debug( LDAP_DEBUG_ARGS, " FINAL\n", 0, 0, 0 ); - if ( f->FUITEM.UNSUB.fi_sub_final != NULLAV - && f->FUITEM.UNSUB.fi_sub_final->avseq_next - != NULLAV ) { - return( LDAP_PROTOCOL_ERROR ); - } - f->FUITEM.UNSUB.fi_sub_final = avs; - break; - - default: - Debug( LDAP_DEBUG_ARGS, " unknown type\n", tag, 0, 0 ); - return( LDAP_PROTOCOL_ERROR ); - } - } - - Debug( LDAP_DEBUG_TRACE, "end get_substring_filter\n", 0, 0, 0 ); - return( 0 ); -} - -void -search_result( - Sockbuf *sb, - struct msg *m, - struct ds_search_result *sr -) -{ - EntryInfo *e; - BerElement *ber; - int rc; - - Debug( LDAP_DEBUG_TRACE, "search_result\n", 0, 0, 0 ); - - ber = NULL; - - if ( ! sr->srr_correlated ) { - Debug( LDAP_DEBUG_ARGS, "correlating results\n", 0, 0, 0 ); - correlate_search_results( sr ); - } - -#ifdef CLDAP - if ( m->m_cldap ) { - if ((ber = der_alloc()) == NULLBER ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "der_alloc" ); - return; - } - if ( ber_printf( ber, "t{is{", LBER_SEQUENCE, m->m_msgid, - "" ) == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "ber_printf" ); - return; - } - } -#endif - - for ( e = sr->CSR_entries; e != NULLENTRYINFO; e = e->ent_next ) { - Debug( LDAP_DEBUG_ARGS, "\tentry:\n", 0, 0, 0 ); - -#ifdef CLDAP - if ( !m->m_cldap ) -#endif /* CLDAP */ - - if ( (ber = der_alloc()) == NULLBER ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "der_alloc" ); - return; - } - -#ifdef COMPAT20 - if ( version == 1 ) { - if ( ber_printf( ber, "t{it{", OLD_LBER_SEQUENCE, - m->m_msgid, OLD_LDAP_RES_SEARCH_ENTRY ) == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "ber_printf" ); - return; - } - } else -#endif -#ifdef COMPAT30 - if ( ldap_compat == 30 ) { - if ( ber_printf( ber, "{it{{", m->m_msgid, - LDAP_RES_SEARCH_ENTRY ) == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "ber_printf" ); - return; - } - } else -#endif -#ifdef CLDAP - if ( m->m_cldap ) - rc = ber_printf( ber, "t{", LDAP_RES_SEARCH_ENTRY ); - else -#endif /* CLDAP */ - rc = ber_printf( ber, "{it{", m->m_msgid, - LDAP_RES_SEARCH_ENTRY ); - - if ( rc == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "ber_printf" ); - return; - } - -#ifdef CLDAP - if ( m->m_cldap ) - rc = encode_dn( ber, e->ent_dn, m->m_searchbase ); -#endif /* CLDAP */ - else - rc = encode_dn( ber, e->ent_dn, NULLDN ); - - if ( rc == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "encode_dn" ); - return; - } - - if ( encode_attrs( ber, e->ent_attr ) == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "encode_attrs" ); - return; - } - -#ifdef COMPAT20 - if ( version == 1 ) { - if ( ber_printf( ber, "}}" ) == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, - "ber_printf 2" ); - return; - } - } else -#endif -#ifdef COMPAT30 - if ( ldap_compat == 30 ) { - if ( ber_printf( ber, "}}}" ) == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, - "ber_printf 2" ); - return; - } - } else -#endif -#ifdef CLDAP - if ( m->m_cldap ) - rc = ber_printf( ber, "}" ); - else -#endif /* CLDAP */ - rc = ber_printf( ber, "}}" ); - - if ( rc == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "ber_printf 2" ); - return; - } - -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_BER ) - trace_ber( 0, ber->ber_ptr - ber->ber_buf, - ber->ber_buf, stderr, 0, 0 ); -#endif - -#ifdef CLDAP - if ( !m->m_cldap ) -#endif - (void) ber_flush( sb, ber, 1 ); - } - - switch ( sr->CSR_limitproblem ) { - case LSR_NOLIMITPROBLEM: - rc = LDAP_SUCCESS; - break; - case LSR_TIMELIMITEXCEEDED: - rc = LDAP_TIMELIMIT_EXCEEDED; - break; - case LSR_SIZELIMITEXCEEDED: - case LSR_ADMINSIZEEXCEEDED: - rc = LDAP_SIZELIMIT_EXCEEDED; - break; - } - - Debug( LDAP_DEBUG_ARGS, "\tresult:\n", 0, 0, 0 ); - -#ifdef CLDAP - if ( m->m_cldap ) { - if ( ber_printf( ber, "t{ess}}}", SEARCHRESTAG, rc, "", "" ) - == -1 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_OPERATIONS_ERROR, NULL, "ber_printf" ); - return; - } - SAFEMEMCPY( (char *)sb->sb_useaddr, &m->m_clientaddr, - sizeof( struct sockaddr )); - if ( ber_flush( sb, ber, 1 ) != 0 ) { - send_ldap_msgresult( sb, SEARCHRESTAG, m, - LDAP_RESULTS_TOO_LARGE, NULL, "ber_flush" ); - } - } else -#endif - send_ldap_msgresult( sb, SEARCHRESTAG, m, rc, NULL, "" ); - - return; -} diff --git a/servers/ldapd/syntax.c b/servers/ldapd/syntax.c deleted file mode 100644 index 8569478eeb..0000000000 --- a/servers/ldapd/syntax.c +++ /dev/null @@ -1,1029 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -short ldap_photo_syntax; -short ldap_jpeg_syntax; -short ldap_jpeg_nonfile_syntax; -short ldap_audio_syntax; -short ldap_dn_syntax; -short ldap_postaladdress_syntax; -short ldap_acl_syntax; -short ldap_mtai_syntax; -short ldap_rts_cred_syntax; -short ldap_rtl_syntax; -short ldap_mailbox_syntax; -short ldap_caseignorelist_syntax; -short ldap_caseexactstring_syntax; -short ldap_certif_syntax; -short ldap_iattr_syntax; -short ldap_telex_syntax; -short ldap_octetstring_syntax; -short ldap_deliverymethod_syntax; -short ldap_facsimileTelephoneNumber_syntax; -short ldap_presentationAddress_syntax; -short ldap_teletexTerminalIdentifier_syntax; -short ldap_searchGuide_syntax; -short ldap_dLSubmitPermission_syntax; - -static void de_t61( char *s, int t61mark ); -static int syntax_is_string( short syntax ); - -static get_one_syntax( char *attrib, int required ) -{ - oid_table_attr *p, *name2attr(); - - if ( (p = name2attr( attrib )) != (oid_table_attr *) 0 ) - return( p->oa_syntax ); - - if ( !required ) - return( -1 ); - - Debug( LDAP_DEBUG_ANY, "name2attr (%s) failed - exiting\n", attrib, - 0, 0 ); - - log_and_exit( 1 ); -} - -void -get_syntaxes() -{ - oid_table_attr *name2attr(); - - Debug( LDAP_DEBUG_TRACE, "get_syntaxes\n", 0, 0, 0 ); - - ldap_photo_syntax = get_one_syntax( "photo", 0 ); - ldap_jpeg_syntax = get_one_syntax( "jpegPhoto", 0 ); - ldap_jpeg_nonfile_syntax = str2syntax( "jpeg" ); - ldap_audio_syntax = get_one_syntax( "audio", 0 ); - ldap_postaladdress_syntax = get_one_syntax( "postaladdress", 0 ); - ldap_dn_syntax = get_one_syntax( "aliasedObjectName", 1 ); - ldap_acl_syntax = get_one_syntax( "acl", 0 ); - ldap_mtai_syntax = get_one_syntax( "mTAInfo", 0 ); - ldap_rts_cred_syntax= get_one_syntax( "initiatingRTSCredentials", 0 ); - ldap_rtl_syntax= get_one_syntax( "routingTreeList", 0 ); - ldap_mailbox_syntax = get_one_syntax( "otherMailbox", 0 ); - ldap_caseignorelist_syntax = str2syntax( "CaseIgnoreList" ); - ldap_caseexactstring_syntax = str2syntax( "caseexactstring" ); - ldap_octetstring_syntax = str2syntax( "OctetString" ); - ldap_deliverymethod_syntax = str2syntax( "DeliveryMethod" ); - ldap_iattr_syntax = get_one_syntax( "inheritedAttribute", 0 ); - ldap_certif_syntax = get_one_syntax( "userCertificate", 0 ); - ldap_telex_syntax = get_one_syntax( "telexNumber", 0 ); - ldap_facsimileTelephoneNumber_syntax = - get_one_syntax( "facsimileTelephoneNumber", 0 ); - ldap_presentationAddress_syntax = - get_one_syntax( "presentationAddress", 0 ); - ldap_teletexTerminalIdentifier_syntax = - get_one_syntax( "teletexTerminalIdentifier", 0 ); - ldap_searchGuide_syntax = get_one_syntax( "searchGuide", 0 ); - ldap_dLSubmitPermission_syntax = - get_one_syntax( "mhsDLSubmitPermissions", 0 ); - - certif_init(); /* initialize certificate syntax handler */ -} - -/* - * From RFC 1779 "A String Representation of Distinguished Names" - * - * Key Attribute (X.520 keys) - * ------------------------------ - * CN CommonName - * L LocalityName - * ST StateOrProvinceName - * O OrganizationName - * OU OrganizationalUnitName - * C CountryName - * STREET StreetAddress - * - * - * Table 1: Standardised Keywords - * - * There is an escape mechanism from the normal user oriented form, so - * that this syntax may be used to print any valid distinguished name. - * - * 1. Attributes types are represented in a (big-endian) dotted - * notation. (e.g., OID.2.6.53). - * - */ -static void attr_key_rfc1779 ( - AttributeType at, - char *key /* return key, caller allocated */ -) -{ - char *x; - - x = attr2name_aux ( at ); - - if ( x == NULL ) { - x = "?"; - } else if ( isdigit ( *x ) ) { - sprintf ( key, "OID.%s", x ); - return; - } else if (strcasecmp(x,"commonName")==0) { - x = "CN"; - } else if (strcasecmp(x,"localityName")==0) { - x = "l"; - } else if (strcasecmp(x,"stateOrProvinceName")==0) { - x = "st"; - } else if (strcasecmp(x,"organizationName")==0) { - x = "o"; - } else if (strcasecmp(x,"organizationalUnitName")==0) { - x = "ou"; - } else if (strcasecmp(x,"countryName")==0) { - x = "c"; - } else if (strcasecmp(x,"streetAddress")==0) { - x = "street"; - } - - strcpy ( key, x ); -} - -#define SEPARATOR(c) (c == ',' || c == ';') -#define SPACE(c) (c == ' ' || c == '\n') - -int -dn_print_real( - PS ps, - DN dn, - int format -) -{ - RDN rdn; - int firstrdn; - char *value; - PS rps; - void ldap_dn_print(); - char key[512]; - - if ( dn == NULLDN ) - return( 0 ); - - if ( dn->dn_parent != NULLDN ) { - dn_print_real( ps, dn->dn_parent, format ); - ps_print( ps, ", " ); - } - - if ( (rps = ps_alloc( str_open )) == NULLPS ) - return( -1 ); - if ( str_setup( rps, NULLCP, 0, 0 ) == NOTOK ) - return( -1 ); - - firstrdn = 1; - for ( rdn = dn->dn_rdn; rdn != NULLRDN; rdn = rdn->rdn_next ) { - if ( firstrdn ) - firstrdn = 0; - else - ps_print( ps, " + " ); - - attr_key_rfc1779 ( rdn->rdn_at, key ); - - ps_print ( ps, key ); - ps_print( ps, "=" ); - - if ( rdn->rdn_at->oa_syntax == ldap_dn_syntax ) { - dn_print_real( rps, (DN) rdn->rdn_av.av_struct, - format ); - *rps->ps_ptr = '\0'; - value = rps->ps_base; - } else { - AttrV_print( rps, &rdn->rdn_av, EDBOUT ); - *rps->ps_ptr = '\0'; - if ( rps->ps_ptr - rps->ps_base >= 5 && - strncmp( rps->ps_base, "{ASN}", 5 ) == 0 ) { - *rps->ps_base = '#'; - SAFEMEMCPY( rps->ps_base + 1, rps->ps_base + 5, - rps->ps_ptr - rps->ps_base - 4 ); - } - value = rps->ps_base; - de_t61( value, 0 ); - } - - /* - * ,+="\\\n all go in quotes. " and \\ need to - * be preceeded by \\. - */ - - if ( strpbrk( value, ",+=\"\\\n" ) != NULL || SPACE( value[0] ) - || SPACE( value[max( strlen(value) - 1, (size_t) 0 )] ) ) { - char *p, *t, *tmp; - int specialcount; - - ps_print( ps, "\"" ); - - specialcount = 0; - for ( p = value; *p != '\0'; p++ ) { - if ( *p == '"' || *p == '\\' ) { - specialcount++; - } - } - if ( specialcount > 0 ) { - tmp = smalloc( strlen( value ) + specialcount - + 1 ); - for ( p = value, t = tmp; *p != '\0'; p++ ) { - switch ( *p ) { - case '"': - case '\\': - *t++ = '\\'; - /* FALL THROUGH */ - default: - *t++ = *p; - } - } - *t = '\0'; - ps_print( ps, tmp ); - free( tmp ); - } else { - ps_print( ps, value ); - } - - ps_print( ps, "\"" ); - } else { - ps_print( ps, value ); - } - - rps->ps_ptr = rps->ps_base; - } - - ps_free( rps ); - - return( 0 ); -} - -void -ldap_dn_print( - PS ps, - DN dn, - DN base, /* if non-NULL, subsitute '*' for base (for CLDAP) */ - int format -) -{ - DN tmpdn; - int addstar; - - Debug( LDAP_DEBUG_TRACE, "ldap_dn_print\n", 0, 0, 0 ); - - addstar = 0; - if ( base != NULLDN && dn != NULL ) { - for ( tmpdn = dn; base != NULLDN && tmpdn != NULLDN; - base = base->dn_parent, tmpdn = tmpdn->dn_parent ) { - if ( dn_comp_cmp( base, tmpdn ) == NOTOK ) { - break; - } - } - if (( addstar = ( base == NULLDN && tmpdn != NULL ))) { - dn = tmpdn; - } - } - - dn_print_real( ps, dn, format ); - if ( addstar ) { - ps_print( ps, ", *" ); - } -} - -int -encode_dn( - BerElement *ber, - DN dn, - DN base /* if non-NULL, subsitute '*' for base (for CLDAP) */ -) -{ - PS ps; - int rc; - - Debug( LDAP_DEBUG_TRACE, "encode_dn\n", 0, 0, 0 ); - - if ( (ps = ps_alloc( str_open )) == NULLPS ) - return( -1 ); - if ( str_setup( ps, NULLCP, 0, 0 ) == NOTOK ) - return( -1 ); - - ldap_dn_print( ps, dn, base, EDBOUT ); - *ps->ps_ptr = '\0'; - - rc = ber_printf( ber, "s", ps->ps_base ); - - ps_free( ps ); - - return( rc ); -} - -static put_jpeg_value( BerElement *ber, AttributeValue av ) -{ - PE pe; - int len; - - Debug( LDAP_DEBUG_TRACE, "put_jpeg_value\n", 0, 0, 0 ); - - if (av->av_syntax == AV_FILE) - pe = (PE) (((struct file_syntax *) av->av_struct)-> - fs_attr->av_struct); - else - pe = (PE) av->av_struct; - - Debug( LDAP_DEBUG_ARGS, - "put_jpeg_value: pe_class %x, pe_form %x, pe_id %x\n", - pe->pe_class, pe->pe_form, pe->pe_id ); - - if ( (pe->pe_class != PE_CLASS_UNIV && pe->pe_class != PE_CLASS_CONT) - || pe->pe_form != PE_FORM_PRIM || pe->pe_id != PE_PRIM_OCTS ) { - Debug( LDAP_DEBUG_ANY, "put_jpeg_value: unknown type\n", 0, - 0, 0 ); - return( -1 ); - } - - if ( pe_pullup( pe ) == NOTOK ) { - Debug( LDAP_DEBUG_ANY, "put_jpeg_value: cannot pullup\n", 0, - 0, 0 ); - return( -1 ); - } - - len = ps_get_abs( pe ); - - Debug( LDAP_DEBUG_ARGS, "put_jeg_value: ber_printf %d bytes\n", - len, 0, 0 ); - if ( ber_printf( ber, "o", (char *) pe->pe_prim, len ) == -1 ) { - Debug( LDAP_DEBUG_ANY, "put_jpeg_value: ber_printf failed\n", - 0, 0, 0 ); - return( -1 ); - } - - return( 0 ); -} - -static put_audio_value( BerElement *ber, AttributeValue av ) -{ - struct qbuf *qb, *p; - int rc, len; - char *buf; - - Debug( LDAP_DEBUG_TRACE, "put_audio_value\n", 0, 0, 0 ); - - qb = (struct qbuf *) (((struct file_syntax *) - av->av_struct)->fs_attr->av_struct); - - len = 0; - for ( p = qb->qb_forw; p != qb; p = p->qb_forw ) { - len += p->qb_len; - } - - if ( (buf = (char *) malloc( len )) == NULL ) - return( -1 ); - - len = 0; - for ( p = qb->qb_forw; p != qb; p = p->qb_forw ) { - SAFEMEMCPY( buf + len, p->qb_data, p->qb_len ); - len += p->qb_len; - } - - Debug( LDAP_DEBUG_ARGS, "put_audio_value: ber_printf %d bytes\n", - len, 0, 0 ); - - if ( (rc = ber_printf( ber, "o", buf, len )) == -1 ) - Debug( LDAP_DEBUG_ANY, "put_audio_value: ber_printf failed\n", - 0, 0, 0 ); - - free( buf ); - - return( rc ); -} - -static put_photo_value( BerElement *ber, AttributeValue av ) -{ - PE pe; - PS ps; - int len; - char *faxparamset = "\000\300\000\000"; - BerElement *phber; - - Debug( LDAP_DEBUG_TRACE, "put_photo_value\n", 0, 0, 0 ); - - pe = (PE) (((struct file_syntax *) av->av_struct)->fs_attr->av_struct); - - /* old bit string-like format - only handle this for now */ - if ( pe->pe_class == PE_CLASS_UNIV && pe->pe_form == PE_FORM_PRIM - && pe->pe_id == PE_PRIM_BITS ) { - len = ps_get_abs( pe ); - Debug( LDAP_DEBUG_ARGS, "put_photo_val: ber_printf %d bytes\n", - len, 0, 0 ); - if (( phber = der_alloc()) == NULLBER ) { - Debug( LDAP_DEBUG_ANY, "der_alloc failed\n", 0, 0, 0 ); - return( -1 ); - } - if ( ber_printf( phber, "t{[tB]{B}}", 0xA3, 0x81, faxparamset, - 31, (char *)pe->pe_prim, len * 8 ) == -1 ) { - Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); - ber_free( phber, 1 ); - return( -1 ); - } - if ( ber_printf( ber, "o", phber->ber_buf, phber->ber_ptr - - phber->ber_buf ) == -1 ) { - Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); - ber_free( phber, 1 ); - return( -1 ); - } - ber_free( phber, 1 ); - } else { - /* - * try just writing this into a PS and sending it along - */ - ps_len_strategy = PS_LEN_LONG; - if ( (ps = ps_alloc( str_open )) == NULLPS ) - return( -1 ); - if ( str_setup( ps, NULLCP, 0, 0 ) == NOTOK || - pe2ps( ps, pe ) == NOTOK ) { - ps_free( ps ); - return( -1 ); - } - - len = ps->ps_ptr - ps->ps_base; - Debug( LDAP_DEBUG_ARGS, "put_photo_val: ber_printf %d bytes\n", - len, 0, 0 ); - if ( ber_printf( ber, "o", (char *) ps->ps_base, len ) == -1 ) { - Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); - ps_free( ps ); - return( -1 ); - } - ps_free( ps ); - } - - return( 0 ); -} - -static put_values( - BerElement *ber, - PS ps, - short syntax, - AV_Sequence vals -) -{ - AV_Sequence av; - char *strvalue; - - Debug( LDAP_DEBUG_TRACE, "put_values\n", 0, 0, 0 ); - - for ( av = vals; av != NULLAV; av = av->avseq_next ) { - if ( syntax == ldap_jpeg_syntax || - syntax == ldap_jpeg_nonfile_syntax ) { - if ( put_jpeg_value( ber, &av->avseq_av ) == -1 ) - return( -1 ); - } else if ( syntax == ldap_photo_syntax ) { - if ( put_photo_value( ber, &av->avseq_av ) == -1 ) - return( -1 ); - } else if ( syntax == ldap_audio_syntax ) { - if ( put_audio_value( ber, &av->avseq_av ) == -1 ) - return( -1 ); - } else if ( syntax == ldap_dn_syntax ) { - if ( encode_dn( ber, (DN) av->avseq_av.av_struct, - NULLDN ) == -1 ) - return( -1 ); - } else if ( syntax > AV_WRITE_FILE ) { - struct file_syntax *fsyntax; - - fsyntax = (struct file_syntax *) av->avseq_av.av_struct; - - ps->ps_ptr = ps->ps_base; - AttrV_print( ps, fsyntax->fs_attr, EDBOUT ); - *ps->ps_ptr = '\0'; - - if ( ber_printf( ber, "o", ps->ps_base, - ps->ps_ptr - ps->ps_base ) == -1 ) - return( -1 ); - } else { - ps->ps_ptr = ps->ps_base; - AttrV_print( ps, &av->avseq_av, EDBOUT ); - *ps->ps_ptr = '\0'; - de_t61( ps->ps_base, 0 ); - - if ( syntax_is_string( av->avseq_av.av_syntax ) && - *ps->ps_base == '\0' ) { - /* - * If this is a zero-length string, make it - * a single blank (this is gross, but it works - * around a dsap library bug). - */ - Debug( LDAP_DEBUG_ANY, - "put_values: replaced zero-length string with single blank\n", 0, 0, 0 ); - strvalue = " "; - } else { - strvalue = ps->ps_base; - } - if ( ber_printf( ber, "s", strvalue ) == -1 ) - return( -1 ); - } - } - - return( 0 ); -} - -int -encode_attrs( BerElement *ber, Attr_Sequence as ) -{ - PS ps; -#ifdef COMPAT20 - extern int ldap_compat; -#endif - - Debug( LDAP_DEBUG_TRACE, "encode_attrs\n", 0, 0, 0 ); - - if ( (ps = ps_alloc( str_open )) == NULLPS ) - return( -1 ); - if ( str_setup( ps, NULLCP, 0, 0 ) == NOTOK ) - return( -1 ); - -#ifdef COMPAT20 - if ( ber_printf( ber, "t{", ldap_compat == 20 ? OLD_LBER_SEQUENCE : - LBER_SEQUENCE ) == -1 ) { -#else - if ( ber_printf( ber, "{" ) == -1 ) { -#endif - ps_free( ps ); - return( -1 ); - } - - while ( as != NULLATTR ) { - ps->ps_ptr = ps->ps_base; - AttrT_print( ps, as->attr_type, EDBOUT ); - *ps->ps_ptr = '\0'; - -#ifdef COMPAT20 - if ( ber_printf( ber, "t{st[", ldap_compat == 20 ? - OLD_LBER_SEQUENCE : LBER_SEQUENCE, ps->ps_base, - ldap_compat == 20 ? OLD_LBER_SET : LBER_SET ) == -1 ) { -#else - if ( ber_printf( ber, "{s[", ps->ps_base ) == -1 ) { -#endif - ps_free( ps ); - return( -1 ); - } - - put_values( ber, ps, as->attr_type->oa_syntax, as->attr_value ); - - if ( ber_printf( ber, "]}" ) == -1 ) { - ps_free( ps ); - return( -1 ); - } - - as = as->attr_link; - } - ps_free( ps ); - - if ( ber_printf( ber, "}" ) == -1 ) - return( -1 ); - - return( 0 ); -} - -static void -trim_trailing_spaces( char *s ) -{ - char *t; - - t = s + strlen( s ); - while ( --t > s ) { - if ( SPACE( *t ) ) { - *t = '\0'; - } else { - break; - } - } -} - -DN ldap_str2dn( char *str ) -{ - DN dn, save; - RDN rdn, newrdn, tmprdn; - AttributeType at; - AttributeValue av; - char *type, *value, *savestr; - int morerdncomps; - - Debug( LDAP_DEBUG_TRACE, "ldap_str2dn\n", 0, 0, 0 ); - - savestr = str = strdup( str ); - dn = NULLDN; - do { - char *r; - int state; - - rdn = NULLRDN; - morerdncomps = 1; - do { - /* get the type */ - while ( *str == ' ' || *str == '\n' ) - str++; - type = str; - while ( *str != '\0' && *str != '=' ) - str++; - if ( *str == '\0' ) { - free( savestr ); - Debug( LDAP_DEBUG_ARGS, "no =\n", 0, 0, 0 ); - return( NULLDN ); - } - *str++ = '\0'; - if ( strncmp( type, "OID.", 4 ) == 0 ) - type += 4; - -#define BEGINVALUE 1 -#define INVALUE 2 -#define INQUOTE 3 -#define ENDVALUE 4 - if ( *str == '#' ) { - ++str; - } - r = value = str; - state = BEGINVALUE; - /* break or return out */ - while ( state != ENDVALUE ) { - switch ( *str ) { - case '"': - if ( state == BEGINVALUE ) { - state = INQUOTE; - str++; - } else if ( state == INQUOTE ) { - state = ENDVALUE; - str++; - } else { - free( savestr ); - Debug( LDAP_DEBUG_ARGS, - "quote state %d\n", state, - 0, 0 ); - return( NULLDN ); - } - break; - - case ',': - case ';': - case '+': - if ( state == INVALUE ) { - state = ENDVALUE; - } else if ( state == INQUOTE ) { - *r++ = *str++; - } else { - free( savestr ); - Debug( LDAP_DEBUG_ARGS, - "comma state %d\n", state, - 0, 0 ); - return( NULLDN ); - } - break; - - case ' ': - case '\n': - if ( state == BEGINVALUE ) { - str++; - } else { - *r++ = *str++; - } - break; - - case '\\': - str++; - *r++ = *str++; - break; - - case '\0': - state = ENDVALUE; - break; - - default: - if ( state == BEGINVALUE ) - state = INVALUE; - *r++ = *str++; - break; - } - } - - while ( SPACE( *str ) ) - str++; - if ( *str == '+' ) { - morerdncomps = 1; - str++; - } else { - morerdncomps = 0; - if ( SEPARATOR( *str ) ) - str++; - } - *r = '\0'; - - /* type */ - trim_trailing_spaces( type ); - if ( (at = str2AttrT( type )) == NULLAttrT ) { - dn_free( dn ); - free( savestr ); - Debug( LDAP_DEBUG_ARGS, "bad type (%s)\n", - type, 0, 0 ); - return( NULLDN ); /* LDAP_UNDEFINED_TYPE */ - } - /* value */ - if ( (av = ldap_str2AttrV( value, at->oa_syntax )) - == NULLAttrV ) { - dn_free( dn ); - free( savestr ); - Debug( LDAP_DEBUG_ARGS, "bad val\n", 0, 0, 0 ); - return( NULLDN ); /* LDAP_INVALID_SYNTAX */ - } - /* make the rdn */ - newrdn = rdn_comp_new( at, av ); - - /* add it to the list */ - for ( tmprdn = rdn; tmprdn != NULLRDN && - tmprdn->rdn_next != NULLRDN; - tmprdn = tmprdn->rdn_next ) - ; /* NULL */ - if ( tmprdn != NULLRDN ) - tmprdn->rdn_next = newrdn; - else - rdn = newrdn; - - AttrV_free( av ); - } while ( morerdncomps ); - - save = dn; - dn = dn_comp_new( rdn ); - dn->dn_parent = save; - } while ( str != NULL && *str != '\0' ); - - free( savestr ); - Debug( LDAP_DEBUG_TRACE, "ldap_str2dn OK\n", 0, 0, 0 ); - return( dn ); -} - -#define T61 "{T.61}" -#define T61LEN 6 - -static void de_t61( char *s, int t61mark ) -{ - char *next = s; - int c, hex; - - while ( *s ) { - switch ( *s ) { - case '{' : - if ( strncasecmp( s, T61, T61LEN) == 0 ) { - s += T61LEN; - if ( t61mark ) - *next++ = '@'; - } else { - *next++ = *s++; - } - break; - - case '\\': - c = *(s + 1); - if ( c == '\n' ) { - s += 2; - if ( *s == '\t' ) - s++; - break; - } - if ( c == '\\' ) { - /* reverse solidus character itself */ - s += 2; - *next++ = c; - break; - } - if ( isdigit( c ) ) - hex = c - '0'; - else if ( c >= 'A' && c <= 'F' ) - hex = c - 'A' + 10; - else if ( c >= 'a' && c <= 'f' ) - hex = c - 'a' + 10; - else { - *next++ = *s++; - break; - } - hex <<= 4; - c = *(s + 2); - if ( isdigit( c ) ) - hex += c - '0'; - else if ( c >= 'A' && c <= 'F' ) - hex += c - 'A' + 10; - else if ( c >= 'a' && c <= 'f' ) - hex += c - 'a' + 10; - else { - *next++ = *s++; - *next++ = *s++; - break; - } - - *next++ = hex; - s += 3; - break; - - default: - *next++ = *s++; - break; - } - } - *next = '\0'; -} - - -static PE -bv_asn2pe( struct berval *bv ) -{ - PS ps; - PE pe; - - if (( ps = ps_alloc(str_open)) == NULLPS || str_setup( ps, bv->bv_val, - bv->bv_len, 0 ) == NOTOK ) { - Debug( LDAP_DEBUG_TRACE, "bv_asn2pe: ps_alloc failed\n", - 0, 0, 0 ); - return( NULLPE ); - } - - pe = ps2pe( ps ); - if ( ps->ps_errno != PS_ERR_NONE ) { - Debug( LDAP_DEBUG_TRACE, "bv_asn2pe: ps2pe failed %s\n", - ps_error(ps->ps_errno), 0, 0 ); - if ( pe != NULLPE ) { - pe_free( pe ); - } - return( NULLPE ); - } - - return( pe ); -} - - -AttributeValue -bv_octet2AttrV( struct berval *bv ) -{ - AttributeValue av; - - av = AttrV_alloc(); - if ( av == NULLAttrV ) { - return( NULLAttrV ); - } - - if (( av->av_struct = (caddr_t) str2prim( bv->bv_val, bv->bv_len, - PE_CLASS_UNIV, PE_PRIM_OCTS )) == NULL ) { - free((char *)av ); - return( NULLAttrV ); - } - - av->av_syntax = 0; - return( av ); -} - - -AttributeValue -bv_asn2AttrV( struct berval *bv ) -{ - AttributeValue av; - - av = AttrV_alloc(); - if ( av == NULLAttrV ) { - return( NULLAttrV ); - } - - if (( av->av_struct = (caddr_t) bv_asn2pe( bv )) == NULL ) { - free((char *)av ); - return( NULLAttrV ); - } - - av->av_syntax = 0; - return( av ); -} - - -AttributeValue -ldap_strdn2AttrV( char *dnstr ) -{ - DN dn; - AttributeValue av; - - if (( dn = ldap_str2dn( dnstr )) == NULL ) { - return( NULLAttrV ); - } - - av = AttrV_alloc(); - if ( av == NULLAttrV ) { - dn_free( dn ); - return( NULLAttrV ); - } - - av->av_struct = (caddr_t)dn; - av->av_syntax = ldap_dn_syntax; - return( av ); -} - -RDN -ldap_str2rdn( char *rdnstr ) -{ - DN dn; - RDN rdn; - - if ( (dn = ldap_str2dn( rdnstr )) == NULL ) { - return( NULL ); - } - - if ( (rdn = rdn_cpy( dn->dn_rdn )) == NULL ) { - return( NULL ); - } - - dn_free( dn ); - - return( rdn ); -} - -AttributeValue -ldap_str_at2AttrV( char *str, AttributeType type ) -{ - char *s, *res, *r; - AttributeValue str_at2AttrV(); - - Debug( LDAP_DEBUG_TRACE, "ldap_str_at2AttrV str (%s) type (%s)\n", str, - type->oa_ot.ot_name, 0 ); - - if ( type->oa_syntax == ldap_rts_cred_syntax || - type->oa_syntax == ldap_mtai_syntax || - type->oa_syntax == ldap_acl_syntax || - type->oa_syntax == ldap_mailbox_syntax || - type->oa_syntax == ldap_caseignorelist_syntax || - type->oa_syntax == ldap_certif_syntax || - type->oa_syntax == ldap_iattr_syntax || - type->oa_syntax == ldap_telex_syntax || - type->oa_syntax == ldap_deliverymethod_syntax || - type->oa_syntax == ldap_facsimileTelephoneNumber_syntax || - type->oa_syntax == ldap_presentationAddress_syntax || - type->oa_syntax == ldap_teletexTerminalIdentifier_syntax || - type->oa_syntax == ldap_searchGuide_syntax || - type->oa_syntax == ldap_dLSubmitPermission_syntax || - type->oa_syntax == ldap_rtl_syntax ) { - res = str; - } else { - res = (char *) malloc( max( 2 * strlen( str ), (size_t) 10 ) ); - - r = res; - for ( s = str; *s; s++ ) { - switch ( *s ) { - case '&': - case '#': - case '$': - case '%': - case '@': - case '\\': - sprintf( r, "\\%02x", *s & 0xff ); - r += 3; - break; - - default: - *r++ = *s; - } - } - *r = '\0'; - } - - Debug( LDAP_DEBUG_TRACE, "ldap_str_at2AttrV returning (%s)\n", res, - 0, 0 ); - - return( str_at2AttrV( res, type ) ); -} - -AttributeValue -ldap_str2AttrV( char *value, short syntax ) -{ - if ( syntax == ldap_dn_syntax ) { - return( ldap_strdn2AttrV( value ) ); - } else { - return( str2AttrV( value, syntax ) ); - } -} - - -static int -syntax_is_string( short syntax ) -{ -/* - * this code depends on the order and nunber of strings that are in - * the ISODE file lib/syntax/x500/string.c - */ - return ( syntax >= ldap_caseexactstring_syntax && - syntax <= ldap_caseexactstring_syntax + 8 ); -} diff --git a/servers/ldapd/util.c b/servers/ldapd/util.c deleted file mode 100644 index 27ecea9a5a..0000000000 --- a/servers/ldapd/util.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lber.h" -#include "ldap.h" -#include "common.h" - -/* - * Print arbitrary stuff, for debugging. - */ - - -#define BPLEN 48 - -void -bprint( char *data, int len ) -{ - static char hexdig[] = "0123456789abcdef"; - char out[ BPLEN ]; - int i = 0; - - (void) memset( out, 0, BPLEN ); - for ( ;; ) { - if ( len < 1 ) { - printf( "\t%s\n", ( i == 0 ) ? "(end)" : out ); - break; - } - - if ( isgraph( (unsigned char)*data )) { - out[ i ] = ' '; - out[ i+1 ] = *data; - } else { - out[ i ] = hexdig[ ( *data & 0xf0 ) >> 4 ]; - out[ i+1 ] = hexdig[ *data & 0x0f ]; - } - i += 2; - len--; - data++; - - if ( i > BPLEN - 2 ) { - printf( "\t%s\n", out ); - (void) memset( out, 0, BPLEN ); - i = 0; - continue; - } - out[ i++ ] = ' '; - } -} - -void charlist_free( char **cl ) -{ - int i; - - if ( cl == NULL ) - return; - - for ( i = 0; cl[i] != NULL; i++ ) - free( cl[i] ); - free( (char *) cl ); -} - -int -get_ava( BerElement *ber, AVA *tava ) -{ - char *type, *value; - extern short ldap_dn_syntax; - - Debug( LDAP_DEBUG_TRACE, "get_ava\n", 0, 0, 0 ); - - /* - * An AVA looks like this: - * AttributeValueAsertion ::= SEQUENCE { - * attributeType AttributeType, - * attributeValue AttributeValue - * } - */ - - if ( ber_scanf( ber, "{aa}", &type, &value ) == LBER_ERROR ) - return( LDAP_PROTOCOL_ERROR ); - - if ( (tava->ava_type = str2AttrT( type )) == NULLAttrT ) { - free( type ); - free( value ); - return( LDAP_UNDEFINED_TYPE ); - } - - if ( (tava->ava_value = ldap_str2AttrV( value, - tava->ava_type->oa_syntax )) == NULLAttrV ) { - free( type ); - free( value ); - return( LDAP_INVALID_SYNTAX ); - } - - free( type ); - free( value ); - - return( 0 ); -} - -int -chase_referral( - Sockbuf *clientsb, - struct msg *m, - struct DSError *err, - char **matched -) -{ - ContinuationRef cr; - struct access_point *ap; - int rc, bound; - struct conn *save, *dup, *found; - struct PSAPaddr *psap_cpy(); - - Debug( LDAP_DEBUG_TRACE, "chase_referral\n", 0, 0, 0 ); - - save = m->m_conn; - dup = conn_dup( m->m_conn ); - m->m_conn = dup; - m->m_conn->c_ad = -1; - - /* for each dsa candidate */ - rc = LDAP_OTHER; - for ( cr = err->ERR_REFERRAL.DSE_ref_candidates; - cr != NULLCONTINUATIONREF; cr = cr->cr_next ) { - - /* for each access point listed for the dsa */ - for ( ap = cr->cr_accesspoints; ap != NULLACCESSPOINT; - ap = ap->ap_next ) { -#ifdef LDAP_DEBUG - if ( ldap_debug & LDAP_DEBUG_ARGS ) { - char *str; - - str = paddr2str( ap->ap_address, NULLNA ); - fprintf( stderr, "Referring to (%s)...\n", - str ); - } -#endif - - if ( m->m_conn->c_paddr ) - free( (char *) m->m_conn->c_paddr ); - m->m_conn->c_paddr = psap_cpy( ap->ap_address ); - - if ( (found = conn_find( m->m_conn )) != NULL ) { - conn_free( m->m_conn ); - m->m_conn = found; - m->m_conn->c_refcnt++; - conn_free( save ); - return( LDAP_SUCCESS ); - } - - rc = do_bind_real( m->m_conn, &bound, matched ); - - if ( rc == LDAP_SUCCESS ) { - conn_free( save ); - conn_add( m->m_conn ); - return( LDAP_SUCCESS ); - } - } - - } - - /* so the conn can be found and freed later */ - conn_free( m->m_conn ); - m->m_conn = save; - - return( rc ); -} diff --git a/servers/slapd/tools/Vers-edb2.c b/servers/slapd/tools/Vers-edb2.c deleted file mode 100644 index 8484568eba..0000000000 --- a/servers/slapd/tools/Vers-edb2.c +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 1995 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -char Versionstr[] = " edb2ldif %VERSION% (%WHEN%)\n\t%WHOANDWHERE%\n"; -- 2.39.5