From 9a09fa1899f431d98b98112854ee0182d11cca8f Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 24 Nov 1999 16:57:32 +0000 Subject: [PATCH] adnsresfilter needs tsearch --- INSTALL | 12 +++++ client/Makefile.in | 4 +- configure | 106 +++++++++++++++++++++++++++++++++++---------- configure.in | 9 ++++ 4 files changed, 106 insertions(+), 25 deletions(-) diff --git a/INSTALL b/INSTALL index 25a3e95..cbf164a 100644 --- a/INSTALL +++ b/INSTALL @@ -18,6 +18,14 @@ libtool. I'm not interested in supporting non-ELF shared libraries. However, if you send me an appropriate patch I'd be willing to make it easy or automatic to disable the ELF shared library arrangements. +The adnsresfilter utility uses `tsearch' from the C library (a la SVID +and X/Open). If your C library doesn't have tsearch you will find +that configure arranges for adnsresfilter not to be built. To rectify +this, install a C library containing tsearch, such as the GNU C +library. It is best if tsearch uses an automatically-balancing tree +algorithm, like the glibc version does. Simple binary trees may +perform badly. + You will probably find that GNU Make is required. @@ -44,3 +52,7 @@ You should have received a copy of the GNU General Public License along with userv as the file COPYING; if not, email me at the address above or write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Local variables: +# mode: text +# End: diff --git a/client/Makefile.in b/client/Makefile.in index ee00539..a7b3aaa 100644 --- a/client/Makefile.in +++ b/client/Makefile.in @@ -24,7 +24,9 @@ srcdir= @srcdir@ VPATH= @srcdir@ -PROGRAMS= adnstest adnslogres adnshost adnsresfilter +PROGS_SYSDEP= @PROGS_HAVE_TSEARCH@ + +PROGRAMS= adnstest adnslogres adnshost $(PROGS_SYSDEP) PROGRAMS_LOCAL= fanftest PROGRAMS_ALL= $(PROGRAMS) $(PROGRAMS_LOCAL) diff --git a/configure b/configure index 35b062d..64ce5f2 100755 --- a/configure +++ b/configure @@ -1040,14 +1040,71 @@ fi +PROGS_IF_TSEARCH=adnsresfilter + +echo $ac_n "checking for tsearch""... $ac_c" 1>&6 +echo "configure:1047: checking for tsearch" >&5 +if eval "test \"`echo '$''{'ac_cv_func_tsearch'+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 tsearch(); + +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_tsearch) || defined (__stub___tsearch) +choke me +#else +tsearch(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_tsearch=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_tsearch=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'tsearch`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + PROGS_HAVE_TSEARCH=$PROGS_IF_TSEARCH + +else + echo "$ac_t""no" 1>&6 + + PROGS_HAVE_TSEARCH=''; + echo "configure: warning: tsearch missing - not building client program(s) $PROGS_IF_TSEARCH" 1>&2 + +fi + + echo $ac_n "checking for INADDR_LOOPBACK""... $ac_c" 1>&6 -echo "configure:1045: checking for INADDR_LOOPBACK" >&5 +echo "configure:1102: checking for INADDR_LOOPBACK" >&5 if eval "test \"`echo '$''{'adns_cv_decl_inaddrloopback'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1060,7 +1117,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_decl_inaddrloopback=yes else @@ -1078,17 +1135,17 @@ else echo "$ac_t""not in standard headers, urgh..." 1>&6 ac_safe=`echo "rpc/types.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for rpc/types.h""... $ac_c" 1>&6 -echo "configure:1082: checking for rpc/types.h" >&5 +echo "configure:1139: checking for rpc/types.h" >&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:1092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1121,12 +1178,12 @@ fi echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:1125: checking for inet_aton" >&5 +echo "configure:1182: checking for inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+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:1210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_inet_aton=yes" else @@ -1168,7 +1225,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:1172: checking for inet_aton in -lresolv" >&5 +echo "configure:1229: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1176,7 +1233,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1248: \"$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 @@ -1221,20 +1278,20 @@ fi echo $ac_n "checking __attribute__((,,))""... $ac_c" 1>&6 -echo "configure:1225: checking __attribute__((,,))" >&5 +echo "configure:1282: checking __attribute__((,,))" >&5 if eval "test \"`echo '$''{'adns_cv_c_attribute_supported'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_c_attribute_supported=yes else @@ -1256,20 +1313,20 @@ EOF echo $ac_n "checking __attribute__((noreturn))""... $ac_c" 1>&6 -echo "configure:1260: checking __attribute__((noreturn))" >&5 +echo "configure:1317: checking __attribute__((noreturn))" >&5 if eval "test \"`echo '$''{'adns_cv_c_attribute_noreturn'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_c_attribute_noreturn=yes else @@ -1296,20 +1353,20 @@ EOF echo $ac_n "checking __attribute__((const))""... $ac_c" 1>&6 -echo "configure:1300: checking __attribute__((const))" >&5 +echo "configure:1357: checking __attribute__((const))" >&5 if eval "test \"`echo '$''{'adns_cv_c_attribute_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_c_attribute_const=yes else @@ -1336,20 +1393,20 @@ EOF echo $ac_n "checking __attribute__((format...))""... $ac_c" 1>&6 -echo "configure:1340: checking __attribute__((format...))" >&5 +echo "configure:1397: checking __attribute__((format...))" >&5 if eval "test \"`echo '$''{'adns_cv_attribute_format'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_attribute_format=yes else @@ -1542,6 +1599,7 @@ s%@mandir@%$mandir%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@RANLIB@%$RANLIB%g +s%@PROGS_HAVE_TSEARCH@%$PROGS_HAVE_TSEARCH%g s%@WARNS@%$WARNS%g s%@SHLIBCC@%$SHLIBCC%g s%@MKSHLIB_1@%$MKSHLIB_1%g diff --git a/configure.in b/configure.in index 12b2d18..a007af3 100644 --- a/configure.in +++ b/configure.in @@ -31,6 +31,15 @@ AC_CHECK_FUNCS(poll) ADNS_C_GETFUNC(socket,socket) ADNS_C_GETFUNC(inet_ntoa,nsl) +PROGS_IF_TSEARCH=adnsresfilter +AC_SUBST(PROGS_HAVE_TSEARCH) +AC_CHECK_FUNC(tsearch,[ + PROGS_HAVE_TSEARCH=$PROGS_IF_TSEARCH +],[ + PROGS_HAVE_TSEARCH=''; + AC_MSG_WARN([tsearch missing - not building client program(s) $PROGS_IF_TSEARCH]) +]) + AC_MSG_CHECKING(for INADDR_LOOPBACK) AC_CACHE_VAL(adns_cv_decl_inaddrloopback,[ AC_TRY_COMPILE([ -- 2.30.2