From 3f123dcc2fe5d2cd08ca91b732741d86a4036906 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Fri, 22 Sep 2000 18:52:39 +0000 Subject: [PATCH] 487. [port] flockfile() is not defined on all systems. Also check for libpthreads, if libpthread isn't found. --- CHANGES | 2 + acconfig.h | 5 +- config.h.in | 5 +- configure | 349 ++++++++++++++++++++++++++++++++------------------ configure.in | 11 +- lib/isc/lex.c | 13 +- 6 files changed, 253 insertions(+), 132 deletions(-) diff --git a/CHANGES b/CHANGES index 6e90401c24..789b2e2a4a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ + 487. [port] flockfile() is not defined on all systems. + 486. [bug] nslookup: "set all" and "server" commands showed the incorrect port number if a port other than 53 was specified. [RT #352] diff --git a/acconfig.h b/acconfig.h index f9049cdb3e..864eedccf2 100644 --- a/acconfig.h +++ b/acconfig.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: acconfig.h,v 1.28 2000/09/15 20:50:31 bwelling Exp $ */ +/* $Id: acconfig.h,v 1.29 2000/09/22 18:52:32 bwelling Exp $ */ /*** *** This file is not to be included by any public header files, because @@ -75,6 +75,9 @@ /* define if IPv6 is not disabled */ #undef WANT_IPV6 +/* define if flockfile() is available */ +#undef HAVE_FLOCKFILE + /* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */ #undef SHUTUP_SPUTAUX #ifdef SHUTUP_SPUTAUX diff --git a/config.h.in b/config.h.in index ea47e1a52b..fdd4e81039 100644 --- a/config.h.in +++ b/config.h.in @@ -16,7 +16,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.h.in,v 1.37 2000/09/15 20:50:32 bwelling Exp $ */ +/* $Id: config.h.in,v 1.38 2000/09/22 18:52:34 bwelling Exp $ */ /*** *** This file is not to be included by any public header files, because @@ -86,6 +86,9 @@ /* define if IPv6 is not disabled */ #undef WANT_IPV6 +/* define if flockfile() is available */ +#undef HAVE_FLOCKFILE + /* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */ #undef SHUTUP_SPUTAUX #ifdef SHUTUP_SPUTAUX diff --git a/configure b/configure index cfcf6ef0ae..3d5f240777 100755 --- a/configure +++ b/configure @@ -2204,6 +2204,53 @@ EOF LIBS="-lpthread $LIBS" +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 +echo "configure:2213: checking for pthread_create in -lpthreads" >&5 +ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthreads $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 pthreads | sed -e 's/^a-zA-Z0-9_/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 fi @@ -2217,7 +2264,7 @@ fi # We'd like to use sigwait() too # echo $ac_n "checking for sigwait in -lc""... $ac_c" 1>&6 -echo "configure:2221: checking for sigwait in -lc" >&5 +echo "configure:2268: checking for sigwait in -lc" >&5 ac_lib_var=`echo c'_'sigwait | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2225,7 +2272,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2258,7 +2305,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sigwait in -lpthread""... $ac_c" 1>&6 -echo "configure:2262: checking for sigwait in -lpthread" >&5 +echo "configure:2309: checking for sigwait in -lpthread" >&5 ac_lib_var=`echo pthread'_'sigwait | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2266,7 +2313,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2299,7 +2346,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for _Psigwait in -lpthread""... $ac_c" 1>&6 -echo "configure:2303: checking for _Psigwait in -lpthread" >&5 +echo "configure:2350: checking for _Psigwait in -lpthread" >&5 ac_lib_var=`echo pthread'_'_Psigwait | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2307,7 +2354,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2356,7 +2403,7 @@ fi # *-freebsd*) echo $ac_n "checking for sigwait in -lc_r""... $ac_c" 1>&6 -echo "configure:2360: checking for sigwait in -lc_r" >&5 +echo "configure:2407: checking for sigwait in -lc_r" >&5 ac_lib_var=`echo c_r'_'sigwait | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2364,7 +2411,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2430,12 +2477,12 @@ EOF EOF echo $ac_n "checking for pthread_setconcurrency""... $ac_c" 1>&6 -echo "configure:2434: checking for pthread_setconcurrency" >&5 +echo "configure:2481: checking for pthread_setconcurrency" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_setconcurrency'+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 +if { (eval echo configure:2509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_setconcurrency=yes" else @@ -2496,12 +2543,12 @@ EOF # Look for sysconf to allow detection of the number of processors. # echo $ac_n "checking for sysconf""... $ac_c" 1>&6 -echo "configure:2500: checking for sysconf" >&5 +echo "configure:2547: checking for sysconf" >&5 if eval "test \"`echo '$''{'ac_cv_func_sysconf'+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 +if { (eval echo configure:2575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sysconf=yes" else @@ -2600,16 +2647,72 @@ fi ISC_THREAD_DIR=$thread_dir +# +# flockfile is usually provided by pthreads, but we may want to use it +# even if compiled with --disable-threads. +# +echo $ac_n "checking for flockfile""... $ac_c" 1>&6 +echo "configure:2656: checking for flockfile" >&5 +if eval "test \"`echo '$''{'ac_cv_func_flockfile'+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 flockfile(); + +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_flockfile) || defined (__stub___flockfile) +choke me +#else +flockfile(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_flockfile=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_flockfile=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'flockfile`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_FLOCKFILE 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + # # NLS # echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:2608: checking for catgets" >&5 +echo "configure:2711: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+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 +if { (eval echo configure:2739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else @@ -2670,7 +2773,7 @@ case "$host" in ;; *) echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:2674: checking for socket in -lsocket" >&5 +echo "configure:2777: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2678,7 +2781,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2717,7 +2820,7 @@ else fi echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6 -echo "configure:2721: checking for inet_ntoa in -lnsl" >&5 +echo "configure:2824: checking for inet_ntoa in -lnsl" >&5 ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2725,7 +2828,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2888,7 +2991,7 @@ else fi echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:2892: checking build system type" >&5 +echo "configure:2995: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -2917,7 +3020,7 @@ 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:2921: checking for ld used by GCC" >&5 +echo "configure:3024: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -2941,10 +3044,10 @@ echo "configure:2921: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:2945: checking for GNU ld" >&5 +echo "configure:3048: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:2948: checking for non-GNU ld" >&5 +echo "configure:3051: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2980,7 +3083,7 @@ 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:2984: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:3087: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2996,7 +3099,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:3000: checking for BSD-compatible nm" >&5 +echo "configure:3103: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3033,7 +3136,7 @@ echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3037: checking whether ln -s works" >&5 +echo "configure:3140: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3077,8 +3180,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" case "$host" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 3081 "configure"' > conftest.$ac_ext - if { (eval echo configure:3082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 3184 "configure"' > conftest.$ac_ext + if { (eval echo configure:3185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -3099,19 +3202,19 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:3103: checking whether the C compiler needs -belf" >&5 +echo "configure:3206: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'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 +if { (eval echo configure:3218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -3262,9 +3365,9 @@ esac # the right suffix on the files. # echo $ac_n "checking for IPv6 structures""... $ac_c" 1>&6 -echo "configure:3266: checking for IPv6 structures" >&5 +echo "configure:3369: checking for IPv6 structures" >&5 cat > conftest.$ac_ext < @@ -3274,7 +3377,7 @@ int main() { struct sockaddr_in6 sin6; return (0); ; return 0; } EOF -if { (eval echo configure:3278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 found_ipv6=yes @@ -3292,7 +3395,7 @@ rm -f conftest* # This is done before other IPv6 linking tests to LIBS is properly set. # echo $ac_n "checking for Kame IPv6 support""... $ac_c" 1>&6 -echo "configure:3296: checking for Kame IPv6 support" >&5 +echo "configure:3399: checking for Kame IPv6 support" >&5 # Check whether --with-kame or --without-kame was given. if test "${with_kame+set}" = set; then withval="$with_kame" @@ -3380,9 +3483,9 @@ case "$found_ipv6" in LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1" echo $ac_n "checking for in6addr_any""... $ac_c" 1>&6 -echo "configure:3384: checking for in6addr_any" >&5 +echo "configure:3487: checking for in6addr_any" >&5 cat > conftest.$ac_ext < @@ -3393,7 +3496,7 @@ int main() { struct in6_addr in6; in6 = in6addr_any; return (0); ; return 0; } EOF -if { (eval echo configure:3397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY" @@ -3409,9 +3512,9 @@ fi rm -f conftest* echo $ac_n "checking for sin6_scope_id in struct sockaddr_in6""... $ac_c" 1>&6 -echo "configure:3413: checking for sin6_scope_id in struct sockaddr_in6" >&5 +echo "configure:3516: checking for sin6_scope_id in struct sockaddr_in6" >&5 cat > conftest.$ac_ext < @@ -3424,7 +3527,7 @@ int main() { struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0); ; return 0; } EOF -if { (eval echo configure:3428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1" @@ -3439,9 +3542,9 @@ rm -f conftest* LWRES_HAVE_SIN6_SCOPE_ID="$result" echo $ac_n "checking for in6_pktinfo""... $ac_c" 1>&6 -echo "configure:3443: checking for in6_pktinfo" >&5 +echo "configure:3546: checking for in6_pktinfo" >&5 cat > conftest.$ac_ext < @@ -3454,7 +3557,7 @@ int main() { struct in6_pktinfo xyzzy; return (0); ; return 0; } EOF -if { (eval echo configure:3458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1" @@ -3503,9 +3606,9 @@ esac # which provides some (all?) of the desired functions. # echo $ac_n "checking for inet_ntop""... $ac_c" 1>&6 -echo "configure:3507: checking for inet_ntop" >&5 +echo "configure:3610: checking for inet_ntop" >&5 cat > conftest.$ac_ext < @@ -3515,7 +3618,7 @@ int main() { inet_ntop(0, 0, 0, 0); return (0); ; return 0; } EOF -if { (eval echo configure:3519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP" @@ -3530,9 +3633,9 @@ else fi rm -f conftest* echo $ac_n "checking for inet_pton""... $ac_c" 1>&6 -echo "configure:3534: checking for inet_pton" >&5 +echo "configure:3637: checking for inet_pton" >&5 cat > conftest.$ac_ext < @@ -3542,7 +3645,7 @@ int main() { inet_pton(0, 0, 0); return (0); ; return 0; } EOF -if { (eval echo configure:3546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON" @@ -3557,9 +3660,9 @@ else fi rm -f conftest* echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:3561: checking for inet_aton" >&5 +echo "configure:3664: checking for inet_aton" >&5 cat > conftest.$ac_ext < @@ -3569,7 +3672,7 @@ int main() { struct in_addr in; inet_aton(0, &in); return (0); ; return 0; } EOF -if { (eval echo configure:3573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON" @@ -3602,9 +3705,9 @@ EOF esac echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6 -echo "configure:3606: checking for sa_len in struct sockaddr" >&5 +echo "configure:3709: checking for sa_len in struct sockaddr" >&5 cat > conftest.$ac_ext < @@ -3613,7 +3716,7 @@ int main() { struct sockaddr sa; sa.sa_len = 0; return (0); ; return 0; } EOF -if { (eval echo configure:3617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1" @@ -3634,9 +3737,9 @@ rm -f conftest* # Look for a 4.4BSD or 4.3BSD struct msghdr # echo $ac_n "checking for struct msghdr flavor""... $ac_c" 1>&6 -echo "configure:3638: checking for struct msghdr flavor" >&5 +echo "configure:3741: checking for struct msghdr flavor" >&5 cat > conftest.$ac_ext < @@ -3645,7 +3748,7 @@ int main() { struct msghdr msg; msg.msg_flags = 0; return (0); ; return 0; } EOF -if { (eval echo configure:3649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""4.4BSD" 1>&6 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1" @@ -3663,9 +3766,9 @@ rm -f conftest* # Look for in_port_t. # echo $ac_n "checking for type in_port_t""... $ac_c" 1>&6 -echo "configure:3667: checking for type in_port_t" >&5 +echo "configure:3770: checking for type in_port_t" >&5 cat > conftest.$ac_ext < @@ -3674,7 +3777,7 @@ int main() { in_port_t port = 25; return (0); ; return 0; } EOF -if { (eval echo configure:3678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT" @@ -3692,9 +3795,9 @@ rm -f conftest* # Check for addrinfo # echo $ac_n "checking for struct addrinfo""... $ac_c" 1>&6 -echo "configure:3696: checking for struct addrinfo" >&5 +echo "configure:3799: checking for struct addrinfo" >&5 cat > conftest.$ac_ext < @@ -3702,7 +3805,7 @@ int main() { struct addrinfo a; return (0); ; return 0; } EOF -if { (eval echo configure:3706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO" @@ -3721,9 +3824,9 @@ rm -f conftest* echo $ac_n "checking for int sethostent""... $ac_c" 1>&6 -echo "configure:3725: checking for int sethostent" >&5 +echo "configure:3828: checking for int sethostent" >&5 cat > conftest.$ac_ext < @@ -3731,7 +3834,7 @@ int main() { int i = sethostent(0); return(0); ; return 0; } EOF -if { (eval echo configure:3735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1" @@ -3746,9 +3849,9 @@ rm -f conftest* echo $ac_n "checking for int endhostent""... $ac_c" 1>&6 -echo "configure:3750: checking for int endhostent" >&5 +echo "configure:3853: checking for int endhostent" >&5 cat > conftest.$ac_ext < @@ -3756,7 +3859,7 @@ int main() { int i = endhostent(); return(0); ; return 0; } EOF -if { (eval echo configure:3760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1" @@ -3771,9 +3874,9 @@ rm -f conftest* echo $ac_n "checking for getnetbyaddr(in_addr_t, ...)""... $ac_c" 1>&6 -echo "configure:3775: checking for getnetbyaddr(in_addr_t, ...)" >&5 +echo "configure:3878: checking for getnetbyaddr(in_addr_t, ...)" >&5 cat > conftest.$ac_ext < @@ -3782,7 +3885,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1" @@ -3797,9 +3900,9 @@ rm -f conftest* echo $ac_n "checking for int setnetent""... $ac_c" 1>&6 -echo "configure:3801: checking for int setnetent" >&5 +echo "configure:3904: checking for int setnetent" >&5 cat > conftest.$ac_ext < @@ -3807,7 +3910,7 @@ int main() { int i = setnetent(0); return(0); ; return 0; } EOF -if { (eval echo configure:3811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1" @@ -3822,9 +3925,9 @@ rm -f conftest* echo $ac_n "checking for int endnetent""... $ac_c" 1>&6 -echo "configure:3826: checking for int endnetent" >&5 +echo "configure:3929: checking for int endnetent" >&5 cat > conftest.$ac_ext < @@ -3832,7 +3935,7 @@ int main() { int i = endnetent(); return(0); ; return 0; } EOF -if { (eval echo configure:3836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1" @@ -3847,9 +3950,9 @@ rm -f conftest* echo $ac_n "checking for gethostbyadd(const void *, size_t, ...)""... $ac_c" 1>&6 -echo "configure:3851: checking for gethostbyadd(const void *, size_t, ...)" >&5 +echo "configure:3954: checking for gethostbyadd(const void *, size_t, ...)" >&5 cat > conftest.$ac_ext < @@ -3858,7 +3961,7 @@ int main() { return(0); ; return 0; } EOF -if { (eval echo configure:3862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1" @@ -3873,9 +3976,9 @@ rm -f conftest* echo $ac_n "checking for h_errno in netdb.h""... $ac_c" 1>&6 -echo "configure:3877: checking for h_errno in netdb.h" >&5 +echo "configure:3980: checking for h_errno in netdb.h" >&5 cat > conftest.$ac_ext < @@ -3883,7 +3986,7 @@ int main() { h_errno = 1; return(0); ; return 0; } EOF -if { (eval echo configure:3887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO" @@ -3898,12 +4001,12 @@ rm -f conftest* echo $ac_n "checking for getipnodebyname""... $ac_c" 1>&6 -echo "configure:3902: checking for getipnodebyname" >&5 +echo "configure:4005: checking for getipnodebyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_getipnodebyname'+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 +if { (eval echo configure:4033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getipnodebyname=yes" else @@ -3947,12 +4050,12 @@ ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1" fi echo $ac_n "checking for getnameinfo""... $ac_c" 1>&6 -echo "configure:3951: checking for getnameinfo" >&5 +echo "configure:4054: checking for getnameinfo" >&5 if eval "test \"`echo '$''{'ac_cv_func_getnameinfo'+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 +if { (eval echo configure:4082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getnameinfo=yes" else @@ -3996,12 +4099,12 @@ ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1" fi echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6 -echo "configure:4000: checking for getaddrinfo" >&5 +echo "configure:4103: checking for getaddrinfo" >&5 if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+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 +if { (eval echo configure:4131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getaddrinfo=yes" else @@ -4056,9 +4159,9 @@ fi # Look for a sysctl call to get the list of network interfaces. # echo $ac_n "checking for interface list sysctl""... $ac_c" 1>&6 -echo "configure:4060: checking for interface list sysctl" >&5 +echo "configure:4163: checking for interface list sysctl" >&5 cat > conftest.$ac_ext < @@ -4088,12 +4191,12 @@ rm -f conftest* # Check for some other useful functions that are not ever-present. # echo $ac_n "checking for strsep""... $ac_c" 1>&6 -echo "configure:4092: checking for strsep" >&5 +echo "configure:4195: checking for strsep" >&5 if eval "test \"`echo '$''{'ac_cv_func_strsep'+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 +if { (eval echo configure:4223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strsep=yes" else @@ -4137,12 +4240,12 @@ ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1" fi echo $ac_n "checking for vsnprintf""... $ac_c" 1>&6 -echo "configure:4141: checking for vsnprintf" >&5 +echo "configure:4244: checking for vsnprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vsnprintf'+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 +if { (eval echo configure:4272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vsnprintf=yes" else @@ -4194,17 +4297,17 @@ fi echo $ac_n "checking for sizeof(long long int) == sizeof(long int)""... $ac_c" 1>&6 -echo "configure:4198: checking for sizeof(long long int) == sizeof(long int)" >&5 +echo "configure:4301: checking for sizeof(long long int) == sizeof(long int)" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""default yes" 1>&6 ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1" @@ -4224,12 +4327,12 @@ fi # Security Stuff # echo $ac_n "checking for chroot""... $ac_c" 1>&6 -echo "configure:4228: checking for chroot" >&5 +echo "configure:4331: checking for chroot" >&5 if eval "test \"`echo '$''{'ac_cv_func_chroot'+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 +if { (eval echo configure:4359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_chroot=yes" else @@ -4278,17 +4381,17 @@ for ac_hdr in linux/capability.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4282: checking for $ac_hdr" >&5 +echo "configure:4385: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'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:4292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4395: \"$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* @@ -4318,17 +4421,17 @@ for ac_hdr in linux/prctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4322: checking for $ac_hdr" >&5 +echo "configure:4425: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'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:4332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4435: \"$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* diff --git a/configure.in b/configure.in index b30649a220..712e2db99c 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.185 $) +AC_REVISION($Revision: 1.186 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.13) @@ -375,7 +375,8 @@ Please install the devel/unproven-pthreads package and rerun configure. *) AC_CHECK_LIB(pthread, pthread_create,, AC_CHECK_LIB(pthread, __pthread_create) - AC_CHECK_LIB(pthread, __pthread_create_system)) + AC_CHECK_LIB(pthread, __pthread_create_system) + AC_CHECK_LIB(pthreads, pthread_create)) ;; esac @@ -490,6 +491,12 @@ fi ISC_THREAD_DIR=$thread_dir AC_SUBST(ISC_THREAD_DIR) +# +# flockfile is usually provided by pthreads, but we may want to use it +# even if compiled with --disable-threads. +# +AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),) + # # NLS # diff --git a/lib/isc/lex.c b/lib/isc/lex.c index 2fa957241e..44710c4138 100644 --- a/lib/isc/lex.c +++ b/lib/isc/lex.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lex.c,v 1.37 2000/08/30 01:28:10 bwelling Exp $ */ +/* $Id: lex.c,v 1.38 2000/09/22 18:52:39 bwelling Exp $ */ #include @@ -228,8 +228,7 @@ isc_lex_openfile(isc_lex_t *lex, const char *filename) { if (result != ISC_R_SUCCESS) return (result); -#if 0 - /* XXX Anyone know why these are necessary? */ +#ifdef HAVE_FLOCKFILE flockfile(stream); #endif @@ -246,7 +245,7 @@ isc_lex_openstream(isc_lex_t *lex, FILE *stream) { REQUIRE(VALID_LEX(lex)); -#if 0 +#ifdef HAVE_FLOCKFILE flockfile(stream); #endif /* This is safe. */ @@ -287,7 +286,7 @@ isc_lex_close(isc_lex_t *lex) { UNLINK(lex->sources, source, link); if (source->is_file) { -#if 0 +#ifdef HAVE_FLOCKFILE funlockfile((FILE *)(source->input)); #endif if (source->need_close) @@ -389,7 +388,11 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { } else if (source->is_file) { stream = source->input; +#ifdef HAVE_FLOCKFILE c = getc_unlocked(stream); +#else + c = getc(stream); +#endif if (c == EOF) { if (ferror(stream)) { source->result = ISC_R_IOERROR;