From 114f2cc95033cc155443ae78a79c60e39bb1cfac Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 13 Aug 1998 20:23:30 +0000 Subject: [PATCH] more autoconf changes --- Makefile.in | 21 +- aclocal.m4 | 8 +- clients/ud/main.c | 25 +- clients/ud/util.c | 12 +- configure | 474 +++++++++++++++++++------ configure.in | 17 +- contrib/saucer/Make-template | 54 --- contrib/whois++/Makefile | 81 ----- include/bridge.h | 8 +- include/ldapconfig.h.in | 6 + include/portable.h.bot | 2 - include/portable.h.in | 15 +- libraries/liblber/decode.c | 26 +- libraries/liblber/encode.c | 16 +- servers/slapd/tools/Makefile.in | 7 +- servers/slapd/tools/centipede.c | 8 +- servers/slapd/tools/chlog2replog.c | 4 +- servers/slapd/tools/edb2ldif.c | 8 +- servers/slapd/tools/ldapsyntax.c | 6 +- servers/slapd/tools/ldbmcat.c | 5 +- servers/slapd/tools/ldbmtest.c | 12 +- servers/slapd/tools/ldif.c | 4 +- servers/slapd/tools/ldif2id2children.c | 11 +- servers/slapd/tools/ldif2id2entry.c | 10 +- servers/slapd/tools/ldif2index.c | 7 +- servers/slapd/tools/ldif2ldbm.c | 22 +- servers/slapd/tools/sizecount.c | 3 +- tests/Make-template | 35 -- 28 files changed, 541 insertions(+), 366 deletions(-) delete mode 100644 contrib/saucer/Make-template delete mode 100644 contrib/whois++/Makefile delete mode 100644 tests/Make-template diff --git a/Makefile.in b/Makefile.in index bebe3e52b4..d1e93e7ccc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,5 +2,24 @@ # Copyright 1998 Net Boolean Incorporated # COPYING RESTRICTIONS APPLY, See COPYING file -SUBDIRS= include libraries clients servers +SUBDIRS= include libraries clients contrib servers + +makefiles: FORCE + ./config.status + +configure: configure.in aclocal.m4 + autoconf + +# autoheader might not change config.h.in, so touch a stamp file +${srcdir}/include/portable.h.in: stamp-h.in +${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h + cd ${srcdir} && autoheader + @echo timestamp > ${srcdir}/stamp-h.in + +config.h: stamp-h +stamp-h: config.h.in config.status + ./config.status + +config.status: configure + ./config.status --recheck diff --git a/aclocal.m4 b/aclocal.m4 index 1c2d16438e..bc90b35598 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,3 +1,4 @@ +dnl -------------------------------------------------------------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus dnl values. dnl @@ -18,12 +19,7 @@ ifelse($3,,[ :]dnl $4 ])dnl ])])dnl -dnl -dnl Allow user to disable a normally-on option. -dnl -dnl AC_DEFUN([CF_ARG_DISABLE],[CF_ARG_OPTION($1,[$2 (default: on)],[$3],[$4],yes))dnl -dnl -dnl +dnl -------------------------------------------------------------------- dnl Check for declaration of sys_errlist in one of stdio.h and errno.h. dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration. dnl Reported by Keith Bostic. diff --git a/clients/ud/main.c b/clients/ud/main.c index cb2030c283..c0b70b2ceb 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -16,6 +16,8 @@ * Simon Fraser University, Academic Computing Services */ +#include "portable.h" + #include #include #if defined(NeXT) @@ -43,7 +45,9 @@ #include #include #include -#include "portable.h" + +#include "bridge.h" + #include "ud.h" #ifndef lint @@ -722,3 +726,22 @@ SIG_FN chwinsz() (void) signal(SIGWINCH, chwinsz); } #endif + +#if defined(NO_CACHE) + +void ldap_uncache_entry( LDAP *ld, char *dn ) +{ + +} + +int ldap_enable_cache( LDAP *ld, long timeout, long maxmem ) +{ + return 0; +} + +void ldap_flush_cache( LDAP *ld ) +{ + +} + +#endif /* NO_CACHE */ diff --git a/clients/ud/util.c b/clients/ud/util.c index 2edb5aa265..18b694b9c4 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -10,9 +10,11 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include #include -#include +#include "ldap_string.h" #ifdef DOS #include #endif @@ -25,10 +27,10 @@ #include #include #include -#if !defined(DOS) && !defined( VMS) +#if !defined(DOS) && !defined(VMS) #include #endif -#include "portable.h" + #ifdef USE_TERMIOS #include #else /* USE_TERMIOS */ @@ -36,6 +38,8 @@ #endif /* USE_TERMIOS */ #include "ud.h" +#include "bridge.h" + #if defined(VMS) #define getch getchar #endif @@ -226,8 +230,6 @@ FILE *where; fatal(s) char *s; { - void exit(); - if (errno != 0) perror(s); #ifdef KERBEROS diff --git a/configure b/configure index c31d728c02..1bf8c4f447 100755 --- a/configure +++ b/configure @@ -2122,122 +2122,151 @@ fi done -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2127: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then +echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 +echo "configure:2127: checking for uid_t in sys/types.h" >&5 +if eval "test \"`echo '$''{'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* -int main() { +fi -/* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x; -/* SunOS 4.1.1 cc rejects this. */ -char const *const *ccp; -char **p; -/* NEC SVR4.0.2 mips cc rejects this. */ -struct point {int x, y;}; -static struct point const zero = {0,0}; -/* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in an arm - of an if-expression whose if-part is not a constant expression */ -const char *g = "string"; -ccp = &g + (g ? g-g : 0); -/* HPUX 7.0 cc rejects these. */ -++ccp; -p = (char**) ccp; -ccp = (char const *const *) p; -{ /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; +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 - *t++ = 0; -} -{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; -} -{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; -} -{ /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; + 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:2161: checking type of array argument to getgroups" >&5 +if eval "test \"`echo '$''{'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); } -; return 0; } EOF -if { (eval echo configure:2181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes +if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./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_c_const=no + 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_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const +echo "$ac_t""$ac_cv_type_getgroups" 1>&6 +cat >> confdefs.h <&6 -echo "configure:2202: checking for uid_t in sys/types.h" >&5 -if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then +echo $ac_n "checking for mode_t""... $ac_c" 1>&6 +echo "configure:2232: checking for mode_t" >&5 +if eval "test \"`echo '$''{'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 "uid_t" >/dev/null 2>&1; then + egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* - ac_cv_type_uid_t=yes + ac_cv_type_mode_t=yes else rm -rf conftest* - ac_cv_type_uid_t=no + ac_cv_type_mode_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 +echo "$ac_t""$ac_cv_type_mode_t" 1>&6 +if test $ac_cv_type_mode_t = no; then cat >> confdefs.h <<\EOF -#define uid_t int -EOF - - cat >> confdefs.h <<\EOF -#define gid_t int +#define mode_t int EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2236: checking for off_t" >&5 +echo "configure:2265: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2265,12 +2294,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2269: checking for pid_t" >&5 +echo "configure:2298: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2297,13 +2326,54 @@ EOF fi +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:2331: checking return type of signal handlers" >&5 +if eval "test \"`echo '$''{'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:2353: \"$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:2302: checking for size_t" >&5 +echo "configure:2372: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2330,13 +2400,47 @@ EOF fi +echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 +echo "configure:2405: checking for uid_t in sys/types.h" >&5 +if eval "test \"`echo '$''{'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 for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:2335: checking for st_blksize in struct stat" >&5 +echo "configure:2439: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2344,7 +2448,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:2348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -2365,12 +2469,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2369: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2473: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2379,7 +2483,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2400,12 +2504,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:2404: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:2508: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2413,7 +2517,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:2417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -2434,8 +2538,84 @@ EOF fi +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:2543: checking for working const" >&5 +if eval "test \"`echo '$''{'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:2597: \"$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 for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2439: checking for 8-bit clean memcmp" >&5 +echo "configure:2619: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2443,7 +2623,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2471,12 +2651,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2475: checking return type of signal handlers" >&5 +echo "configure:2655: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2493,7 +2673,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2512,12 +2692,12 @@ EOF echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:2516: checking for strftime" >&5 +echo "configure:2696: checking for strftime" >&5 if eval "test \"`echo '$''{'ac_cv_func_strftime'+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; then +if { (eval echo configure:2724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -2562,7 +2742,7 @@ 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:2566: checking for strftime in -lintl" >&5 +echo "configure:2746: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2570,7 +2750,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2608,12 +2788,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2612: checking for vprintf" >&5 +echo "configure:2792: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+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; then +if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2660,12 +2840,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2664: checking for _doprnt" >&5 +echo "configure:2844: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+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; then +if { (eval echo configure:2872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2713,7 +2893,7 @@ fi fi echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 -echo "configure:2717: checking for wait3 that fills in rusage" >&5 +echo "configure:2897: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2721,7 +2901,7 @@ else ac_cv_func_wait3_rusage=no else cat > conftest.$ac_ext < #include @@ -2752,7 +2932,7 @@ main() { } } EOF -if { (eval echo configure:2756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes else @@ -2784,18 +2964,76 @@ for ac_func in \ strdup \ strerror \ strstr \ + strrchr \ strtod \ strtol \ strtoul \ + memcpy \ + +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2976: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'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(); + +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 +$ac_func(); +#endif +; return 0; } +EOF +if { (eval echo configure:3004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 strdup do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2794: checking for $ac_func" >&5 +echo "configure:3032: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+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; then +if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2839,20 +3077,22 @@ EOF else echo "$ac_t""no" 1>&6 +LIBOBJS="$LIBOBJS ${ac_func}.o" fi done + # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:2850: checking declaration of sys_errlist" >&5 +echo "configure:3090: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'cf_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2862,7 +3102,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:2866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_dcl_sys_errlist=yes else @@ -2883,20 +3123,20 @@ if test $cf_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:2887: checking existence of sys_errlist" >&5 +echo "configure:3127: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'cf_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:2900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_have_sys_errlist=yes else @@ -3030,6 +3270,9 @@ clients/finger/Makefile:etc/top.mk:clients/finger/Makefile.in:etc/rules.mk \ clients/gopher/Makefile:etc/top.mk:clients/gopher/Makefile.in:etc/rules.mk \ clients/mail500/Makefile:etc/top.mk:clients/mail500/Makefile.in:etc/rules.mk \ clients/rcpt500/Makefile:etc/top.mk:clients/rcpt500/Makefile.in:etc/rules.mk \ +contrib/Makefile:etc/top.mk:contrib/Makefile.in:etc/dir.mk \ +contrib/saucer/Makefile:etc/top.mk:contrib/saucer/Makefile.in:etc/rules.mk \ +contrib/whois++/Makefile:etc/top.mk:contrib/whois++/Makefile.in:etc/rules.mk \ libraries/Makefile:etc/top.mk:libraries/Makefile.in:etc/dir.mk \ libraries/libavl/Makefile:etc/top.mk:libraries/libavl/Makefile.in:etc/lib.mk \ libraries/liblber/Makefile:etc/top.mk:libraries/liblber/Makefile.in:etc/lib.mk \ @@ -3046,6 +3289,7 @@ servers/slapd/back-shell/Makefile:etc/top.mk:servers/slapd/back-shell/Makefile.i servers/slapd/tools/Makefile:etc/top.mk:servers/slapd/tools/Makefile.in \ servers/slapd/shell-backends/Makefile:etc/top.mk:servers/slapd/shell-backends/Makefile.in:etc/srv.mk \ servers/slurpd/Makefile:etc/top.mk:servers/slurpd/Makefile.in:etc/srv.mk \ +tests/Makefile:etc/top.mk:tests/Makefile.in \ Makefile:etc/top.mk:Makefile.in:etc/dir.mk include/portable.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF diff --git a/configure.in b/configure.in index b0782dd063..ff3cf94d08 100644 --- a/configure.in +++ b/configure.in @@ -238,15 +238,20 @@ AC_CHECK_HEADERS( \ ) dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_UID_T +AC_TYPE_GETGROUPS +AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T +AC_TYPE_SIGNAL AC_TYPE_SIZE_T +AC_TYPE_UID_T AC_STRUCT_ST_BLKSIZE AC_HEADER_TIME AC_STRUCT_TM +dnl AC_C_BIGENDIAN +AC_C_CONST + dnl Checks for library functions. AC_FUNC_MEMCMP AC_TYPE_SIGNAL @@ -263,11 +268,15 @@ AC_CHECK_FUNCS( \ strdup \ strerror \ strstr \ + strrchr \ strtod \ strtol \ strtoul \ + memcpy \ ) +AC_REPLACE_FUNCS(strdup) + # Check Configuration CF_SYS_ERRLIST @@ -289,6 +298,9 @@ clients/finger/Makefile:etc/top.mk:clients/finger/Makefile.in:etc/rules.mk \ clients/gopher/Makefile:etc/top.mk:clients/gopher/Makefile.in:etc/rules.mk \ clients/mail500/Makefile:etc/top.mk:clients/mail500/Makefile.in:etc/rules.mk \ clients/rcpt500/Makefile:etc/top.mk:clients/rcpt500/Makefile.in:etc/rules.mk \ +contrib/Makefile:etc/top.mk:contrib/Makefile.in:etc/dir.mk \ +contrib/saucer/Makefile:etc/top.mk:contrib/saucer/Makefile.in:etc/rules.mk \ +contrib/whois++/Makefile:etc/top.mk:contrib/whois++/Makefile.in:etc/rules.mk \ libraries/Makefile:etc/top.mk:libraries/Makefile.in:etc/dir.mk \ libraries/libavl/Makefile:etc/top.mk:libraries/libavl/Makefile.in:etc/lib.mk \ libraries/liblber/Makefile:etc/top.mk:libraries/liblber/Makefile.in:etc/lib.mk \ @@ -305,5 +317,6 @@ servers/slapd/back-shell/Makefile:etc/top.mk:servers/slapd/back-shell/Makefile.i servers/slapd/tools/Makefile:etc/top.mk:servers/slapd/tools/Makefile.in \ servers/slapd/shell-backends/Makefile:etc/top.mk:servers/slapd/shell-backends/Makefile.in:etc/srv.mk \ servers/slurpd/Makefile:etc/top.mk:servers/slurpd/Makefile.in:etc/srv.mk \ +tests/Makefile:etc/top.mk:tests/Makefile.in \ Makefile:etc/top.mk:Makefile.in:etc/dir.mk, \ [date > stamp-h]) diff --git a/contrib/saucer/Make-template b/contrib/saucer/Make-template deleted file mode 100644 index cdd9233dc5..0000000000 --- a/contrib/saucer/Make-template +++ /dev/null @@ -1,54 +0,0 @@ -# Makefile for LDAP "saucer" client - -HDIR = $(LDAPSRC)/include -INSTMAN = $(MANDIR)/man$(SECT) -LDAPSRC = ../.. -LDIR = $(LDAPSRC)/libraries -SECT = 1 -VERFILE = $(LDAPSRC)/build/version - -CFLAGS = -I$(HDIR) $(DEFINES) $(ACFLAGS) -SRCS = main.c -OBJS = $(SRCS:.c=.o) -LIBS = -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -all: saucer - -saucer: $(OBJS) - $(CC) $(ALDFLAGS) -o $@ $(OBJS) -L$(LDIR) $(LIBS) - -protoize: $(SRCS) - protoize -c "$(CFLAGS)" $(SRCS) - -unprotoize: $(SRCS) - unprotoize -c "$(CFLAGS)" $(SRCS) - -install: saucer FORCE - -$(MKDIR) -p $(BINDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 saucer $(BINDIR) - -$(MKDIR) -p $(INSTMAN) - @TMPMAN=/tmp/ldapman.$$$$; \ - VERSION=`$(CAT) $(VERFILE)`; \ - for page in *.$(SECT); do \ - $(SED) -e 's%ETCDIR%$(ETCDIR)%' -e "s%LDVERSION%$$VERSION%" \ - $$page > $$TMPMAN; \ - echo "installing $(INSTMAN)/$$page"; \ - $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTMAN)/$$page; \ - done; \ - $(RM) $$TMPMAN - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) *.o core a.out saucer - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/*.[ch] . - diff --git a/contrib/whois++/Makefile b/contrib/whois++/Makefile deleted file mode 100644 index a2f9b2eccc..0000000000 --- a/contrib/whois++/Makefile +++ /dev/null @@ -1,81 +0,0 @@ -# -# Configuration parameters, can be overridden in config file -# -LDAPSRC = ../.. -CONFIG_DIRECTORY = $(ETCDIR)/whois++ -HELP_DIRECTORY = /usr/local/isode/help/whois++ -LDAPHOST = "localhost" -# -# Where to stuff the man page -MANDIR = /usr/local/isode/man -MANSEC = 8 -# -# Syslog facility to log queries under, using info serverity level -# -FACILITY = LOG_LOCAL3 -# -# Additional system libraries -# Under Ultrix I use the 4.3 syslog, hence the additional syslog library -# -#SYSLIBS = -li -lsyslog -# -# If you want RFC931 logging you must have log_tcp source available -# -SRCS = whois++.c command.c config.c describe.c help.c output.c template.c \ - util.c version.c # /local/src/log_tcp/rfc931.c -HDRS = whois++.h -OBJS = ${SRCS:.c=.o} -HOST = `hostname` -# This returns a date such as "26 April 1993", unfortunately SunOS doesn't -# understand the %B abd %Y macros so you may need to change this. -#DATE = `date +'%d %B %Y'` -DATE = `date +'%D'` # this gives 4/26/93 format -REVISION = 2 - -DEFINES = -DETCDIR=\"$(ETCDIR)\" -DBUILD="\"$(USER)@$(HOST) on $(DATE)\"" \ - -DCONFIG_DIRECTORY=\"$(CONFIG_DIRECTORY)\" -DMAIN \ - -DHELP_DIRECTORY=\"$(HELP_DIRECTORY)\" -DREVISION="$(REVISION)" \ - -DPROTOCOL="\"[FIRST DRAFT - 15 April 1993]\"" -DRELEASE=\"BETA\" \ - -DFACILITY=$(FACILITY) -DDEFAULT_LDAPHOST=\"$(LDAPHOST)\" # -DRFC931 - -CFLAGS = -I$(LDAPSRC)/include -I/usr/local/include $(ACFLAGS) -LIBS = -L$(LDAPSRC)/libraries/libldap -lldap -L$(LDAPSRC)/libraries/liblber \ - -llber $(SYSLIBS) $(KRBLIBFLAG) $(KRBLIBS) - -all: whois++d - -whois++d: $(OBJS) $(LDAPSRC)/libraries/libldap/libldap.a - $(CC) $(ALDFLAGS) -o $@ $(OBJS) $(LIBS) - -whois++.o: whois++.c $(HDRS) - $(CC) $(CFLAGS) $(DEFINES) -c whois++.c - -install: inst-whois++ - -inst-whois++: $(ETCDIR)/whois++d - -mkdir -p $(CONFIG_DIRECTORY) - cp -r templates $(CONFIG_DIRECTORY) - -mkdir -p $(HELP_DIRECTORY) - cp -r helpfiles/* $(HELP_DIRECTORY) - sed -e 's#ETCDIR#$(ETCDIR)#' whois++d.man > $(MANDIR)/man$(MANSEC)/whois++d.$(MANSEC) - @echo "Don't forget to modify and install the tailor file" - -$(ETCDIR)/whois++d: whois++d - install -c -m 755 whois++d $(ETCDIR) - -lint:; - lint $(SRCS) - -5lint:; - /usr/5bin/lint $(SRCS) - -clean:; - rm -f *.o core a.out whois++d - -depend:; - ../mkdep $(CFLAGS) $(SRCS) - -# DO NOT DELETE THIS LINE -- mkdep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/include/bridge.h b/include/bridge.h index d6ad620cc1..c7c4a29a42 100644 --- a/include/bridge.h +++ b/include/bridge.h @@ -10,8 +10,10 @@ * is provided ``as is'' without express or implied warranty. */ -#ifndef _BRIDGE_H -#define _BRIDGE_H +/* This file SHOULD go away !!! */ + +#ifndef _LDAP_BRIDGE_H +#define _LDAP_BRIDGE_H /* * portable.h for LDAP -- this is where we define common stuff to make @@ -212,4 +214,4 @@ extern char *strdup(); #endif /* ultrix || nextstep */ -#endif /* _BRIDGE_H */ +#endif /* _LDAP_BRIDGE_H */ diff --git a/include/ldapconfig.h.in b/include/ldapconfig.h.in index 0e500aae61..5cc74cfe9c 100644 --- a/include/ldapconfig.h.in +++ b/include/ldapconfig.h.in @@ -27,6 +27,12 @@ /* default place to start searching */ #define DEFAULT_BASE "o=Your Organization Name, c=US" +#define EDITOR "@EDITOR@" + +#define DEFAULT_SCONFDIR "@SCONFDIR@/ldap" +#define DEFAULT_SBINDIR "@SBINDIR@" +#define DEFAULT_LIBEXECDIR "@LIBEXECDIR@" + /********************************************************************* * * * You probably do not need to edit anything below this point * diff --git a/include/portable.h.bot b/include/portable.h.bot index 5d96247e35..d60d10b32f 100644 --- a/include/portable.h.bot +++ b/include/portable.h.bot @@ -1,4 +1,2 @@ - -#include "bridge.h" #endif /* _LDAP_PORTABLE_H */ diff --git a/include/portable.h.in b/include/portable.h.in index 53f94ec756..03c7c7508d 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -18,6 +18,10 @@ /* 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 @@ -39,6 +43,9 @@ /* Define if you have the wait3 system call. */ #undef HAVE_WAIT3 +/* Define to `int' if doesn't define. */ +#undef mode_t + /* Define to `long' if doesn't define. */ #undef off_t @@ -108,6 +115,9 @@ /* Define if you have the gettimeofday function. */ #undef HAVE_GETTIMEOFDAY +/* Define if you have the memcpy function. */ +#undef HAVE_MEMCPY + /* Define if you have the mktime function. */ #undef HAVE_MKTIME @@ -123,6 +133,9 @@ /* Define if you have the strerror function. */ #undef HAVE_STRERROR +/* Define if you have the strrchr function. */ +#undef HAVE_STRRCHR + /* Define if you have the strstr function. */ #undef HAVE_STRSTR @@ -180,6 +193,4 @@ /* Define if you have the compat library (-lcompat). */ #undef HAVE_LIBCOMPAT - -#include "bridge.h" #endif /* _LDAP_PORTABLE_H */ diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index a722c9eb7a..b482e3351e 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -20,13 +20,15 @@ #if defined(NeXT) || defined(VMS) #include #else /* next || vms */ +#ifndef __FreeBSD__ #include +#endif #endif /* next || vms */ -#if defined(BC31) || defined(_WIN32) +#if defined(BC31) || defined(_WIN32) || defined(sunos5) #include -#else /* BC31 || _WIN32 */ +#else /* BC31 || _WIN32 || defined(sunos5) */ #include -#endif /* BC31 || _WIN32 */ +#endif /* BC31 || _WIN32 || defined(sunos5) */ #include #include #include @@ -155,6 +157,7 @@ ber_getnint( BerElement *ber, long *num, int len ) { int diff, sign, i; long netnum; + char *p; /* * The tag and length have already been stripped off. We should @@ -172,11 +175,12 @@ ber_getnint( BerElement *ber, long *num, int len ) if ( ber_read( ber, ((char *) &netnum) + diff, len ) != len ) return( -1 ); - /* sign extend if necessary */ - sign = ((0x80 << ((len - 1) * 8)) & netnum); - if ( sign && len < sizeof(long) ) { - for ( i = sizeof(long) - 1; i > len - 1; i-- ) { - netnum |= (0xffL << (i * 8)); + /* sign extend if necessary */ + p = (char *) &netnum; + sign = (0x80 & *(p+diff) ); + if ( sign && len < sizeof(long) ) { + for ( i = 0; i < diff; i++ ) { + *(p+i) = 0xff; } } *num = LBER_NTOHL( netnum ); @@ -383,7 +387,7 @@ ber_next_element( BerElement *ber, unsigned long *len, char *last ) /* VARARGS */ unsigned long ber_scanf( -#if defined( MACOS ) || defined( BC31 ) || defined( _WIN32 ) +#if defined( MACOS ) || defined( BC31 ) || defined( _WIN32 ) || defined(sunos5) BerElement *ber, char *fmt, ... ) #else va_alist ) @@ -391,7 +395,7 @@ va_dcl #endif { va_list ap; -#if !defined( MACOS ) && !defined( BC31 ) && !defined( _WIN32 ) +#if !defined( MACOS ) && !defined( BC31 ) && !defined( _WIN32 ) && !defined(sunos5) BerElement *ber; char *fmt; #endif @@ -402,7 +406,7 @@ va_dcl long *l, rc, tag; unsigned long len; -#if defined( MACOS ) || defined( BC31 ) || defined( _WIN32 ) +#if defined( MACOS ) || defined( BC31 ) || defined( _WIN32 ) || defined(sunos5) va_start( ap, fmt ); #else va_start( ap ); diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index cd95f8932b..0090cab852 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -20,9 +20,11 @@ #if defined(NeXT) || defined(VMS) #include #else /* next || vms */ +#ifndef __FreeBSD__ #include +#endif #endif /* next || vms */ -#if defined( BC31 ) || defined( _WIN32 ) +#if defined( BC31 ) || defined( _WIN32 ) || defined( sunos5 ) #include #else /* BC31 || _WIN32 */ #include @@ -520,7 +522,7 @@ ber_put_set( BerElement *ber ) /* VARARGS */ int ber_printf( -#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) +#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) || defined( sunos5 ) BerElement *ber, char *fmt, ... ) #else /* MACOS || _WIN32 || BC31 */ va_alist ) @@ -528,22 +530,22 @@ va_dcl #endif /* MACOS || _WIN32 || BC31 */ { va_list ap; -#if !defined( MACOS ) && !defined( _WIN32 ) && !defined( BC31 ) +#if !defined( MACOS ) && !defined( _WIN32 ) && !defined( BC31 ) && !defined( sunos5 ) BerElement *ber; char *fmt; -#endif /* !MACOS && !_WIN32 && !BC31 */ +#endif /* !MACOS && !_WIN32 && !BC31 && !sunos5 */ char *s, **ss; struct berval **bv; int rc, i; unsigned long len; -#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) +#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) || defined( sunos5 ) va_start( ap, fmt ); -#else /* MACOS || _WIN32 || BC31 */ +#else /* MACOS || _WIN32 || BC31 || defined( sunos5 ) */ va_start( ap ); ber = va_arg( ap, BerElement * ); fmt = va_arg( ap, char * ); -#endif /* MACOS || _WIN32 || BC31 */ +#endif /* MACOS || _WIN32 || BC31 || defined( sunos5 ) */ for ( rc = 0; *fmt && rc != -1; fmt++ ) { switch ( *fmt ) { diff --git a/servers/slapd/tools/Makefile.in b/servers/slapd/tools/Makefile.in index 7ebfa52011..d4dfc3af60 100644 --- a/servers/slapd/tools/Makefile.in +++ b/servers/slapd/tools/Makefile.in @@ -60,11 +60,8 @@ chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o ldif2index: ldif2index.o ../libbackends.a $(OBJS2) $(CC) $(LDFLAGS) -o $@ ldif2index.o $(OBJS2) ../libbackends.a $(LIBS) -ldif2ldbm: ldif2ldbm.sed.o ../libbackends.a $(OBJS2) - $(CC) $(LDFLAGS) -o $@ ldif2ldbm.sed.o $(OBJS2) ../libbackends.a $(LIBS) - -ldif2ldbm.sed.c: ldif2ldbm.c - $(SED) -e 's;%ETCDIR%;$(sysconfdir)/ldap;' ldif2ldbm.c > ldif2ldbm.sed.c +ldif2ldbm: ldif2ldbm.o ../libbackends.a $(OBJS2) + $(CC) $(LDFLAGS) -o $@ ldif2ldbm.o $(OBJS2) ../libbackends.a $(LIBS) ldif2id2entry: ldif2id2entry.o ../libbackends.a $(OBJS2) $(CC) $(LDFLAGS) -o $@ ldif2id2entry.o $(OBJS2) ../libbackends.a $(LIBS) diff --git a/servers/slapd/tools/centipede.c b/servers/slapd/tools/centipede.c index e6a28999cc..4f0546d171 100644 --- a/servers/slapd/tools/centipede.c +++ b/servers/slapd/tools/centipede.c @@ -1,10 +1,12 @@ /* centipede.c - generate and install indexing information (view w/tabstop=4) */ -#include #include "portable.h" -#include + +#include +#include "ldap_string.h" #include -#include +#include "ldap_time.h" + #include #include #include diff --git a/servers/slapd/tools/chlog2replog.c b/servers/slapd/tools/chlog2replog.c index f9f3b3c5d7..0b053af506 100644 --- a/servers/slapd/tools/chlog2replog.c +++ b/servers/slapd/tools/chlog2replog.c @@ -16,8 +16,10 @@ * slapd/slurpd locking conventions. */ +#include "portable.h" + #include -#include +#include "ldap_string.h" #include #include diff --git a/servers/slapd/tools/edb2ldif.c b/servers/slapd/tools/edb2ldif.c index d46be1edfd..4ffd7168be 100644 --- a/servers/slapd/tools/edb2ldif.c +++ b/servers/slapd/tools/edb2ldif.c @@ -10,9 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include + +#include "ldap_string.h" +#include "ldap_dirent.h" + #include #include #include diff --git a/servers/slapd/tools/ldapsyntax.c b/servers/slapd/tools/ldapsyntax.c index 4fa12c407a..bb66c7facd 100644 --- a/servers/slapd/tools/ldapsyntax.c +++ b/servers/slapd/tools/ldapsyntax.c @@ -10,15 +10,19 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include +#include "ldap_string.h" #include + #include #include #include #include /* #include */ #include + #include #include "lber.h" diff --git a/servers/slapd/tools/ldbmcat.c b/servers/slapd/tools/ldbmcat.c index e947b807d7..e9d70ba5bd 100644 --- a/servers/slapd/tools/ldbmcat.c +++ b/servers/slapd/tools/ldbmcat.c @@ -1,9 +1,10 @@ +#include "portable.h" + #include -#include +#include "ldap_string.h" #include #include #include -#include "portable.h" #include "ldbm.h" #include "../slap.h" diff --git a/servers/slapd/tools/ldbmtest.c b/servers/slapd/tools/ldbmtest.c index 56513ab5b8..5dd55f392f 100644 --- a/servers/slapd/tools/ldbmtest.c +++ b/servers/slapd/tools/ldbmtest.c @@ -1,22 +1,24 @@ +#include "portable.h" + #include #include #include #include #include #include -#include +#include "ldap_time.h" #include -#include +#include "ldap_wait.h" #include #include #include -#include "portable.h" + +#include "bridge.h" + #include "ldapconfig.h" #include "../slap.h" #include "../back-ldbm/back-ldbm.h" -#define EDITOR "/usr/ucb/vi" - extern IDList *idl_fetch(); extern Backend *select_backend(); extern struct dbcache *ldbm_cache_open(); diff --git a/servers/slapd/tools/ldif.c b/servers/slapd/tools/ldif.c index 283d494571..456433bdf4 100644 --- a/servers/slapd/tools/ldif.c +++ b/servers/slapd/tools/ldif.c @@ -1,5 +1,7 @@ +#include "portable.h" + #include -#include +#include "ldap_string.h" #include #include #include diff --git a/servers/slapd/tools/ldif2id2children.c b/servers/slapd/tools/ldif2id2children.c index 2fb2aaf603..f8a1aef52b 100644 --- a/servers/slapd/tools/ldif2id2children.c +++ b/servers/slapd/tools/ldif2id2children.c @@ -1,11 +1,14 @@ +#include "portable.h" + #include -#include +#include "ldap_string.h" #include #include #include "../slap.h" #include "../back-ldbm/back-ldbm.h" -#define DEFAULT_CONFIGFILE "/usr/local/etc/slapd.conf" +#include "ldapconfig.h" + #define MAXARGS 100 extern struct dbcache *ldbm_cache_open(); @@ -69,7 +72,7 @@ main( int argc, char **argv ) Avlnode *avltypes = NULL; extern char *optarg; - tailorfile = DEFAULT_CONFIGFILE; + tailorfile = SLAPD_DEFAULT_CONFIGFILE; dbnum = -1; while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) { switch ( i ) { @@ -121,7 +124,7 @@ main( int argc, char **argv ) fprintf( stderr, "No ldbm database found in config file\n" ); exit( 1 ); } - } else if ( dbnum < 1 || dbnum > nbackends ) { + } else if ( dbnum < 0 || dbnum > (nbackends-1) ) { fprintf( stderr, "Database number selected via -n is out of range\n" ); fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends ); exit( 1 ); diff --git a/servers/slapd/tools/ldif2id2entry.c b/servers/slapd/tools/ldif2id2entry.c index 5c8874c513..3010d1d58c 100644 --- a/servers/slapd/tools/ldif2id2entry.c +++ b/servers/slapd/tools/ldif2id2entry.c @@ -1,11 +1,13 @@ +#include "portable.h" + #include -#include +#include "ldap_string.h" #include #include #include "../slap.h" #include "../back-ldbm/back-ldbm.h" +#include "ldapconfig.h" -#define DEFAULT_CONFIGFILE "/usr/local/etc/slapd.conf" #define MAXARGS 100 extern struct dbcache *ldbm_cache_open(); @@ -65,7 +67,7 @@ main( int argc, char **argv ) FILE *fp; extern char *optarg; - tailorfile = DEFAULT_CONFIGFILE; + tailorfile = SLAPD_DEFAULT_CONFIGFILE; dbnum = -1; while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) { switch ( i ) { @@ -117,7 +119,7 @@ main( int argc, char **argv ) fprintf( stderr, "No ldbm database found in config file\n" ); exit( 1 ); } - } else if ( dbnum < 1 || dbnum > nbackends ) { + } else if ( dbnum < 0 || dbnum > (nbackends-1) ) { fprintf( stderr, "Database number selected via -n is out of range\n" ); fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends ); exit( 1 ); diff --git a/servers/slapd/tools/ldif2index.c b/servers/slapd/tools/ldif2index.c index 8f80d3c6b2..71318e0292 100644 --- a/servers/slapd/tools/ldif2index.c +++ b/servers/slapd/tools/ldif2index.c @@ -1,12 +1,13 @@ #include "portable.h" #include -#include +#include "ldap_string.h" #include #include #include "../slap.h" -#define DEFAULT_CONFIGFILE "/usr/local/etc/slapd.conf" +#include "ldapconfig.h" + #define MAXARGS 100 extern void attr_index_config(); @@ -61,7 +62,7 @@ main( int argc, char **argv ) extern char *optarg; inputfile = NULL; - tailorfile = DEFAULT_CONFIGFILE; + tailorfile = SLAPD_DEFAULT_CONFIGFILE; dbnum = -1; while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) { switch ( i ) { diff --git a/servers/slapd/tools/ldif2ldbm.c b/servers/slapd/tools/ldif2ldbm.c index b2caa7b3cc..56531b4fbc 100644 --- a/servers/slapd/tools/ldif2ldbm.c +++ b/servers/slapd/tools/ldif2ldbm.c @@ -1,17 +1,17 @@ +#include "portable.h" #include -#include +#include "ldap_string.h" #include #include #include #include "../slap.h" #include "../back-ldbm/back-ldbm.h" +#include "ldapconfig.h" -#define DEFAULT_CONFIGFILE "%ETCDIR%/slapd.conf" -#define DEFAULT_ETCDIR "%ETCDIR%" #define INDEXCMD "ldif2index" #define ID2ENTRYCMD "ldif2id2entry" -#define ID2CHILDRENCMD "ldif2id2children" -#define MAXARGS 100 +#define ID2CHILDRENCMD "ldif2id2children" +#define MAXARGS 100 extern void attr_index_config(); extern char *str_getline(); @@ -74,8 +74,8 @@ main( int argc, char **argv ) Avlnode *avltypes = NULL; extern char *optarg; - etcdir = DEFAULT_ETCDIR; - tailorfile = DEFAULT_CONFIGFILE; + etcdir = DEFAULT_SBINDIR; + tailorfile = SLAPD_DEFAULT_CONFIGFILE; dbnum = -1; while ( (i = getopt( argc, argv, "d:e:f:i:j:n:" )) != EOF ) { switch ( i ) { @@ -135,7 +135,7 @@ main( int argc, char **argv ) fprintf( stderr, "No ldbm database found in config file\n" ); exit( 1 ); } - } else if ( dbnum < 0 || dbnum > nbackends ) { + } else if ( dbnum < 0 || dbnum > (nbackends-1) ) { fprintf( stderr, "Database number selected via -n is out of range\n" ); fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends ); exit( 1 ); @@ -157,7 +157,7 @@ main( int argc, char **argv ) args[i++] = "-f"; args[i++] = tailorfile; args[i++] = "-n"; - sprintf( buf2, "%d", dbnum ); + sprintf( buf2, "%d", dbnum+1 ); args[i++] = buf2; if ( ldap_debug ) { sprintf( buf3, "%d", ldap_debug ); @@ -179,7 +179,7 @@ main( int argc, char **argv ) args[i++] = "-f"; args[i++] = tailorfile; args[i++] = "-n"; - sprintf( buf2, "%d", dbnum ); + sprintf( buf2, "%d", dbnum+1 ); args[i++] = buf2; if ( ldap_debug ) { sprintf( buf3, "%d", ldap_debug ); @@ -201,7 +201,7 @@ main( int argc, char **argv ) args[i++] = "-f"; args[i++] = tailorfile; args[i++] = "-n"; - sprintf( buf2, "%d", dbnum ); + sprintf( buf2, "%d", dbnum+1 ); args[i++] = buf2; if ( ldap_debug ) { sprintf( buf3, "%d", ldap_debug ); diff --git a/servers/slapd/tools/sizecount.c b/servers/slapd/tools/sizecount.c index 45d8230100..d2daa7a2ee 100644 --- a/servers/slapd/tools/sizecount.c +++ b/servers/slapd/tools/sizecount.c @@ -1,8 +1,9 @@ +#include "portable.h" + #include #include #include #include -#include "portable.h" #define CACHE_SIZE 1000000 #define MODE 0600 diff --git a/tests/Make-template b/tests/Make-template deleted file mode 100644 index f8cae98bf0..0000000000 --- a/tests/Make-template +++ /dev/null @@ -1,35 +0,0 @@ -#----------------------------------------------------------------------------- -# Copyright (c) 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. -# -# LDAP tests Make template file -# -#----------------------------------------------------------------------------- - -SCRIPTSDIR=./scripts - -all: FORCE - @echo "Initiating LDAP tests..."; \ - $(SCRIPTSDIR)/all $(SCRIPTSDIR) - -install: FORCE - -depend: FORCE - -clean: FORCE - $(RM) test-db/* test-repl/* - -veryclean: clean - -links: - @echo "making links in `$(PWD)`"; \ - $(LN) .src/scripts . ; \ - $(LN) .src/data . ; \ - $(MKDIR) test-db test-repl -- 2.47.2