From 9189f9e1e558b7febd740ea8fb6d448958d8f5de Mon Sep 17 00:00:00 2001 From: Randy Kunkee Date: Tue, 27 Jul 1999 07:29:27 +0000 Subject: [PATCH] Tcl package version 1.0 -> 1.1: Add timeout to control array. Add -lldap -llber when building shared library. Clean up pkgIndex.tcl creation and installation (should now support "package require" out of the box). --- contrib/ldaptcl/README | 31 ++-- contrib/ldaptcl/configure | 284 +++++++++++++++++++++++--------- contrib/ldaptcl/configure.in | 12 +- contrib/ldaptcl/ldap.n | 6 +- contrib/ldaptcl/neoXldap.c | 74 ++++++--- contrib/ldaptcl/pkgIndex.tcl.in | 2 +- 6 files changed, 283 insertions(+), 126 deletions(-) diff --git a/contrib/ldaptcl/README b/contrib/ldaptcl/README index 50c2930e00..31a6a42d8e 100644 --- a/contrib/ldaptcl/README +++ b/contrib/ldaptcl/README @@ -1,7 +1,7 @@ Copyright (c) 1998-1999 NeoSoft, Inc. -For licensing information, see the file neoXldap.c and the COPYRIGHT -file contains in the directory you found this file. +For licensing information, see the file neoXldap.c and/or the COPYRIGHT +file contained in the directory you found this file. This directory contains an extension to Tcl to interface with an LDAP server. While this software is being released to the OpenLDAP @@ -10,7 +10,8 @@ be added) for other client libraries as well. As time goes on, it is expected that code will converge rather than diverge. Support is provided for University of Michigan LDAP version 3.3, -OpenLDAP, and Netscape. +OpenLDAP, and Netscape. The default configuration supports +OpenLDAP 1.2.4. OpenLDAP 2.x is not yet supported. It uses GNU autoconf. It builds and installs without requiring parallel directories, but it does require that Tcl and Extended Tcl @@ -21,8 +22,8 @@ For further info, try "./configure --help". For example, I run: - ./configure --prefix=/opt/neosoft97 --enable-shared \ - --with-ldap=/usr/isp2000/ldap + ./configure --prefix=/opt/neotcl --enable-shared \ + --with-ldap=/usr/local/ldap Remember that --prefix must be the same prefix used when building and installint Tcl. @@ -36,30 +37,24 @@ This module will install a regular shell (ldaptclsh) a windowing shell (ldapwish) a library, a pkgIndex.tcl, and a manpage (ldap.n). If your Tcl installation has been configured with --enable-shared, -then it is highly recommended that you also use --enable-shared -here. +then you must also use --enable-shared here. Shared libraries and Tcl packages. -If Tcl is built with --enable-shared, and OpenLDAP (or another version +If Tcl is built with --enable-shared, AND OpenLDAP (or another version for that matter) has been build to create -llber and -lldap as shared -libaries, and you build ldaptcl with --enable-shared, it should be +libaries, AND you build ldaptcl with --enable-shared, it should be possible to run a plain Tcl interpreter (eg. tclsh8.0) and do package require Ldaptcl which will install the "ldap" command into the interpreter. -This may require that you set the LD_LIBRARY_PATH environment variable -appropriately, or use -R or -W,-rpath ld command options. -It also may require that you modify the -If you configure with --enable-shared, and you have shared libraries -for -lldap and -llber, then you might be able to -"package require Ldaptcl", provided that everything is set up -exactly right, ie. -R ld flags, LD_LIBRARY_PATH environment variables, -etc. +You may need to set the LD_LIBRARY_PATH environment variable appropriately, +or use -R or -W,-rpath ld command options to resolve the search for ldap +and lber libraries. -This package was test built on a Sparc Solaris 2.5 using the SUN Pro C +This package was test built on a Alpha OSF4.0e with the native C compiler. You may email comments or bug fixes to openldap-devel@OpenLDAP.org, diff --git a/contrib/ldaptcl/configure b/contrib/ldaptcl/configure index 5eaac3d2c9..2acc11f62e 100755 --- a/contrib/ldaptcl/configure +++ b/contrib/ldaptcl/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -67,6 +67,7 @@ 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 @@ -350,7 +351,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -520,9 +521,11 @@ 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 $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 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 @@ -536,11 +539,11 @@ else fi -# $Id: configure.in,v 1.15 1998/05/22 21:26:25 kunkee Exp $ +# $Id: configure.in,v 1.1 1999/02/10 22:56:49 kunkee Exp $ -NEO_VERSION=1.0 +NEO_VERSION=1.1 NEO_MAJOR_VERSION=1 -NEO_MINOR_VERSION=0 +NEO_MINOR_VERSION=1 VERSION=${NEO_VERSION} if test "${prefix}" = "NONE"; then @@ -562,15 +565,16 @@ if test "$neo_ok" = "yes"; then # 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:566: checking for $ac_word" >&5 +echo "configure:569: checking for $ac_word" >&5 if eval "test \"`echo '$''{'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="${IFS}:" - for ac_dir in $PATH; do + 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" @@ -591,16 +595,17 @@ 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:595: checking for $ac_word" >&5 +echo "configure:599: checking for $ac_word" >&5 if eval "test \"`echo '$''{'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="${IFS}:" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - for ac_dir in $PATH; do + 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 @@ -635,25 +640,61 @@ else echo "$ac_t""no" 1>&6 fi + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # 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:650: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'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 $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:643: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:682: checking whether the C compiler ($CC $CFLAGS $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 $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 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 < conftest.$ac_ext << EOF + +#line 693 "configure" #include "confdefs.h" + main(){return(0);} EOF -if { (eval echo configure:657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:698: \"$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 @@ -667,18 +708,24 @@ else 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 $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:677: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:724: checking whether the C compiler ($CC $CFLAGS $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:682: checking whether we are using GNU C" >&5 +echo "configure:729: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -687,7 +734,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -698,11 +745,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes - 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:706: checking whether ${CC-cc} accepts -g" >&5 +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:757: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -717,16 +768,20 @@ 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 "$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="-O2" + CFLAGS="-g" fi else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi else @@ -734,7 +789,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:738: checking how to run the C preprocessor" >&5 +echo "configure:793: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -749,14 +804,14 @@ else # 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:759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` +{ (eval echo configure:814: \"$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 @@ -766,14 +821,31 @@ else 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:776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` +{ (eval echo configure:831: \"$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:848: \"$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 @@ -785,6 +857,8 @@ else fi rm -f conftest* fi +rm -f conftest* +fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi @@ -807,15 +881,16 @@ if test "$neo_ok" = "yes"; then # 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:811: checking for $ac_word" >&5 +echo "configure:885: checking for $ac_word" >&5 if eval "test \"`echo '$''{'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="${IFS}:" - for ac_dir in $PATH; do + 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" @@ -836,16 +911,17 @@ 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:840: checking for $ac_word" >&5 +echo "configure:915: checking for $ac_word" >&5 if eval "test \"`echo '$''{'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="${IFS}:" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - for ac_dir in $PATH; do + 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 @@ -880,25 +956,61 @@ else echo "$ac_t""no" 1>&6 fi + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # 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:966: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'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 $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:888: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:998: checking whether the C compiler ($CC $CFLAGS $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 $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 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 < conftest.$ac_ext << EOF + +#line 1009 "configure" #include "confdefs.h" + main(){return(0);} EOF -if { (eval echo configure:902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1014: \"$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 @@ -912,18 +1024,24 @@ else 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 $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:922: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $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:927: checking whether we are using GNU C" >&5 +echo "configure:1045: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -932,7 +1050,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -943,11 +1061,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes - 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:951: checking whether ${CC-cc} accepts -g" >&5 +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:1073: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -962,16 +1084,20 @@ 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 "$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="-O2" + CFLAGS="-g" fi else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi else @@ -1005,28 +1131,30 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # 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:1013: checking for a BSD compatible install" >&5 +echo "configure:1140: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" + 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. - for ac_prog in ginstall installbsd scoinst install; do + # 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. - # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" @@ -1056,20 +1184,23 @@ echo "$ac_t""$INSTALL" 1>&6 # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # 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:1065: checking for $ac_word" >&5 +echo "configure:1195: checking for $ac_word" >&5 if eval "test \"`echo '$''{'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="${IFS}:" - for ac_dir in $PATH; do + 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" @@ -1170,8 +1301,8 @@ DL_LIBS=$TCL_DL_LIBS LD_FLAGS=$TCL_LD_FLAGS NEO_LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS -eval "NEO_SHARED_LIB_FILE=libldap${TCL_SHARED_LIB_SUFFIX}" -eval "NEO_UNSHARED_LIB_FILE=libldap${TCL_UNSHARED_LIB_SUFFIX}" +eval "NEO_SHARED_LIB_FILE=libldaptcl${TCL_SHARED_LIB_SUFFIX}" +eval "NEO_UNSHARED_LIB_FILE=libldaptcl${TCL_UNSHARED_LIB_SUFFIX}" #-------------------------------------------------------------------- # The statements below define a collection of symbols related to @@ -1192,7 +1323,7 @@ fi if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then NEO_SHLIB_CFLAGS="${SHLIB_CFLAGS}" eval "NEO_LIB_FILE=libldaptcl${TCL_SHARED_LIB_SUFFIX}" - MAKE_LIB="\${SHLIB_LD} $TCL_LIB_HNAME -o ${NEO_LIB_FILE} \${OBJS}" + MAKE_LIB="\${SHLIB_LD} $TCL_LIB_HNAME -o ${NEO_LIB_FILE} \${OBJS} \${LDAP_LIBFLAGS}" RANLIB=":" else NEO_SHLIB_CFLAGS="" @@ -1327,7 +1458,7 @@ EOF # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - case `(ac_space=' '; set) 2>&1` in + case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). @@ -1406,7 +1537,7 @@ do 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.12" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1426,9 +1557,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > 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 @@ -1450,6 +1583,7 @@ s%@mandir@%$mandir%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@RANLIB@%$RANLIB%g s%@TK_LIBS@%$TK_LIBS%g diff --git a/contrib/ldaptcl/configure.in b/contrib/ldaptcl/configure.in index 8b5d743a0c..7efa1aa14a 100644 --- a/contrib/ldaptcl/configure.in +++ b/contrib/ldaptcl/configure.in @@ -2,11 +2,11 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. AC_INIT(neoXldap.c) -# $Id: configure.in,v 1.15 1998/05/22 21:26:25 kunkee Exp $ +# $Id: configure.in,v 1.1 1999/02/10 22:56:49 kunkee Exp $ -NEO_VERSION=1.0 +NEO_VERSION=1.1 NEO_MAJOR_VERSION=1 -NEO_MINOR_VERSION=0 +NEO_MINOR_VERSION=1 VERSION=${NEO_VERSION} if test "${prefix}" = "NONE"; then @@ -109,8 +109,8 @@ DL_LIBS=$TCL_DL_LIBS LD_FLAGS=$TCL_LD_FLAGS NEO_LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS -eval "NEO_SHARED_LIB_FILE=libldap${TCL_SHARED_LIB_SUFFIX}" -eval "NEO_UNSHARED_LIB_FILE=libldap${TCL_UNSHARED_LIB_SUFFIX}" +eval "NEO_SHARED_LIB_FILE=libldaptcl${TCL_SHARED_LIB_SUFFIX}" +eval "NEO_UNSHARED_LIB_FILE=libldaptcl${TCL_UNSHARED_LIB_SUFFIX}" #-------------------------------------------------------------------- # The statements below define a collection of symbols related to @@ -126,7 +126,7 @@ AC_ARG_ENABLE(shared, if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then NEO_SHLIB_CFLAGS="${SHLIB_CFLAGS}" eval "NEO_LIB_FILE=libldaptcl${TCL_SHARED_LIB_SUFFIX}" - MAKE_LIB="\${SHLIB_LD} $TCL_LIB_HNAME -o ${NEO_LIB_FILE} \${OBJS}" + MAKE_LIB="\${SHLIB_LD} $TCL_LIB_HNAME -o ${NEO_LIB_FILE} \${OBJS} \${LDAP_LIBFLAGS}" RANLIB=":" else NEO_SHLIB_CFLAGS="" diff --git a/contrib/ldaptcl/ldap.n b/contrib/ldaptcl/ldap.n index b117bee9d5..c7b65f1701 100644 --- a/contrib/ldaptcl/ldap.n +++ b/contrib/ldaptcl/ldap.n @@ -219,6 +219,10 @@ search criteria. controlArray(attributes) is a list of attributes to be fetched. If not specified, all attributes are fetched. + controlArray(timeout) a timeout value in seconds (may contain + fractional values -- extremely very small values are useful + for forcing timeout conditions to test timeouts). + For each matching record, destArray is populated with none, some or all attribute-value pairs. @@ -241,7 +245,7 @@ To enable caching of data received from an LDAP connection, foo cache enable timeout maxmem ...where timeout is specified in seconds, and maxmem is the - maximum memory to be used fo caching, in bytes. + maximum memory to be used for caching, in bytes. If maxmem is 0, the cache size is restricted only by the timeout. diff --git a/contrib/ldaptcl/neoXldap.c b/contrib/ldaptcl/neoXldap.c index e8d386549e..88f55de555 100644 --- a/contrib/ldaptcl/neoXldap.c +++ b/contrib/ldaptcl/neoXldap.c @@ -23,7 +23,7 @@ * Requests for permission may be sent to NeoSoft Inc, 1770 St. James Place, * Suite 500, Houston, TX, 77056. * - * $Id: neoXldap.c,v 1.2 1999/04/29 22:14:57 hallvard Exp $ + * $Id$ * */ @@ -37,11 +37,18 @@ * Current support is by Randy Kunkee. */ +/* + * Add timeout to controlArray to set timeout for ldap_result. + * 4/14/99 - Randy + */ + #include "tclExtend.h" #include #include #include +#include +#include /* * Macros to do string compares. They pre-check the first character before @@ -58,8 +65,8 @@ * against the Netscape LDAP server and the much more reliable SDK, * and then again backported to the Umich-3.3 client code. */ - -#if defined(LDAP_API_VERSION) +#define OPEN_LDAP 1 +#if defined(OPEN_LDAP) /* LDAP_API_VERSION must be defined per the current draft spec ** it's value will be assigned RFC number. However, as ** no RFC is defined, it's value is currently implementation @@ -68,37 +75,26 @@ ** This section is for OPENLDAP. */ #define ldap_attributefree(p) ldap_memfree(p) +#define ldap_memfree(p) free(p) #define LDAP_ERR_STRING(ld) \ - ldap_err2string(ldap_get_lderrno(ld)) + ldap_err2string(ldap->ld_errno) #elif defined( LDAP_OPT_SIZELIMIT ) /* ** Netscape SDK w/ ldap_set_option, ldap_get_option */ #define ldap_attributefree(p) ldap_memfree(p) #define LDAP_ERR_STRING(ld) \ - ldap_err2string(ldap_get_lderrno(ld, (char**)NULL, (char**)NULL)) + ldap_err2string(ldap_get_lderrno(ldap)) #else /* U-Mich/OpenLDAP 1.x API */ /* RFC-1823 w/ changes */ -#define UMICH_LDAP +#define UMICH_LDAP 1 #define ldap_memfree(p) free(p) #define ldap_ber_free(p, n) ber_free(p, n) -#define ldap_get_lderrno(ld, dummy1, dummy2) ((ld)->ld_errno) #define ldap_value_free_len(bvals) ber_bvecfree(bvals) #define ldap_attributefree(p) #define LDAP_ERR_STRING(ld) \ - ldap_err2string(ldap_get_lderrno(ld)) -#endif - -#if defined(LDAP_API_VERSION) -#ifdef LDAP_OPT_ERROR_NUMBER -static int ldap_get_lderrno(LDAP *ld) -{ - int ld_errno = 0; - ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, (void*)&ld_errno); - return ld_errno; -} -#endif + ldap_err2string(ld->ld_errno) #endif @@ -214,7 +210,7 @@ LDAP_ProcessOneSearchResult (interp, ldap, entry, destArrayNameObj, evalCodeObj) *----------------------------------------------------------------------------- */ static int -LDAP_PerformSearch (interp, ldap, base, scope, attrs, filtpatt, value, destArrayNameObj, evalCodeObj) +LDAP_PerformSearch (interp, ldap, base, scope, attrs, filtpatt, value, destArrayNameObj, evalCodeObj, timeout_p) Tcl_Interp *interp; LDAP *ldap; char *base; @@ -224,6 +220,7 @@ LDAP_PerformSearch (interp, ldap, base, scope, attrs, filtpatt, value, destArray char *value; Tcl_Obj *destArrayNameObj; Tcl_Obj *evalCodeObj; + struct timeval *timeout_p; { char filter[BUFSIZ]; int resultCode; @@ -253,7 +250,7 @@ LDAP_PerformSearch (interp, ldap, base, scope, attrs, filtpatt, value, destArray while ((resultCode = ldap_result (ldap, msgid, 0, - NULL, + timeout_p, &resultMessage)) == LDAP_RES_SEARCH_ENTRY) { entryMessage = ldap_first_entry(ldap, resultMessage); @@ -284,9 +281,13 @@ LDAP_PerformSearch (interp, ldap, base, scope, attrs, filtpatt, value, destArray } } } - - if (abandon) { + if (abandon || resultCode == 0) { ldap_abandon(ldap, msgid); + if (resultCode == 0) { + Tcl_SetErrorCode (interp, "TIMEOUT", (char*) NULL); + Tcl_SetStringObj (resultObj, "LDAP timeout retrieving results", -1); + return TCL_ERROR; + } } else { if (resultCode == LDAP_RES_SEARCH_RESULT) { if ((errorCode = ldap_result2error (ldap, resultMessage, 0)) @@ -555,7 +556,7 @@ NeoX_LdapTargetObjCmd (clientData, interp, objc, objv) return TCL_ERROR; } - valPtrs = mod->mod_vals.modv_strvals = + valPtrs = mod->mod_vals.modv_strvals = \ (char **)ckalloc (sizeof (char *) * (valuesObjc + 1)); valPtrs[valuesObjc] = (char *)NULL; @@ -617,6 +618,10 @@ NeoX_LdapTargetObjCmd (clientData, interp, objc, objv) char *filterPatternString; + char *timeoutString; + double timeoutTime; + struct timeval timeout, *timeout_p; + Tcl_Obj *destArrayNameObj; Tcl_Obj *evalCodeObj; @@ -735,6 +740,24 @@ NeoX_LdapTargetObjCmd (clientData, interp, objc, objv) } } + /* Fetch timeout value if there is one + */ + timeoutString = Tcl_GetVar2 (interp, + controlArrayName, + "timeout", + 0); + timeout.tv_usec = 0; + if (timeoutString == (char *)NULL) { + timeout_p = NULL; + timeout.tv_sec = 0; + } else { + if (Tcl_GetDouble(interp, timeoutString, &timeoutTime) != TCL_OK) + return TCL_ERROR; + timeout.tv_sec = floor(timeoutTime); + timeout.tv_usec = (timeoutTime-timeout.tv_sec) * 1000000; + timeout_p = &timeout; + } + #ifdef UMICH_LDAP ldap->ld_deref = deref; ldap->ld_timelimit = 0; @@ -750,7 +773,8 @@ NeoX_LdapTargetObjCmd (clientData, interp, objc, objv) filterPatternString, "", destArrayNameObj, - evalCodeObj); + evalCodeObj, + timeout_p); } #if UMICH_LDAP diff --git a/contrib/ldaptcl/pkgIndex.tcl.in b/contrib/ldaptcl/pkgIndex.tcl.in index 8f67e31ef0..ab20f455e4 100644 --- a/contrib/ldaptcl/pkgIndex.tcl.in +++ b/contrib/ldaptcl/pkgIndex.tcl.in @@ -1 +1 @@ -package ifneeded Neo @NEO_VERSION@ "package require Tclx 8.0; load [file join $dir .. @NEO_SHARED_LIB_FILE@] Ldaptcl" +package ifneeded Ldaptcl @NEO_VERSION@ "load [file join $dir .. @NEO_SHARED_LIB_FILE@] Ldaptcl" -- 2.39.5