diff --git a/contrib/queryperf/Makefile.in b/contrib/queryperf/Makefile.in index abedba13b5..2ed19a4736 100644 --- a/contrib/queryperf/Makefile.in +++ b/contrib/queryperf/Makefile.in @@ -1,12 +1,14 @@ # Copyright (C) 2000, 2001 Nominum, Inc. All Rights Reserved. +CC = @CC@ LIBS = @LIBS@ +DEFS = @DEFS@ queryperf: queryperf.o - $(CC) $(CFLAGS) queryperf.o $(LIBS) -lm -o queryperf + $(CC) $(CFLAGS) $(DEFS) queryperf.o $(LIBS) -lm -o queryperf queryperf.o: queryperf.c - $(CC) $(CFLAGS) -c queryperf.c + $(CC) $(CFLAGS) $(DEFS) -c queryperf.c clean: rm -f *.o queryperf diff --git a/contrib/queryperf/configure b/contrib/queryperf/configure index c38bfa6042..05581eca37 100755 --- a/contrib/queryperf/configure +++ b/contrib/queryperf/configure @@ -748,15 +748,17 @@ fi + + echo $ac_n "checking for library containing res_mkquery""... $ac_c" 1>&6 -echo "configure:753: checking for library containing res_mkquery" >&5 +echo "configure:755: checking for library containing res_mkquery" >&5 if eval "test \"`echo '$''{'ac_cv_search_res_mkquery'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_res_mkquery="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_res_mkquery="none required" else @@ -778,7 +780,7 @@ rm -f conftest* test "$ac_cv_search_res_mkquery" = "no" && for i in resolv bind; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_res_mkquery="-l$i" break @@ -810,7 +812,7 @@ else : fi; echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:814: checking for socket in -lsocket" >&5 +echo "configure:816: 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 @@ -818,7 +820,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:835: \"$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 @@ -857,7 +859,7 @@ else fi echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6 -echo "configure:861: checking for inet_ntoa in -lnsl" >&5 +echo "configure:863: 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 @@ -865,7 +867,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:882: \"$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 @@ -903,6 +905,41 @@ else echo "$ac_t""no" 1>&6 fi +echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 +echo "configure:910: checking for socklen_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +int main() { +socklen_t len = 42; return len; +; return 0; } +EOF +if { (eval echo configure:923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_socklen_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_socklen_t=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_type_socklen_t" 1>&6 + if test $ac_cv_type_socklen_t != yes; then + cat >> confdefs.h <<\EOF +#define socklen_t int +EOF + + fi + trap '' 1 2 15 cat > confcache <<\EOF diff --git a/contrib/queryperf/configure.in b/contrib/queryperf/configure.in index 689442e6d0..74828f2ef5 100644 --- a/contrib/queryperf/configure.in +++ b/contrib/queryperf/configure.in @@ -21,8 +21,23 @@ AC_PREREQ(2.13) AC_PROG_CC +AC_DEFUN(AC_TYPE_SOCKLEN_T, +[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, +[ + AC_TRY_COMPILE( + [#include ], + [socklen_t len = 42; return len;], + ac_cv_type_socklen_t=yes, + ac_cv_type_socklen_t=no) +]) + if test $ac_cv_type_socklen_t != yes; then + AC_DEFINE(socklen_t, int) + fi +]) + AC_SEARCH_LIBS(res_mkquery, resolv bind); AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, inet_ntoa) +AC_TYPE_SOCKLEN_T AC_OUTPUT(Makefile) diff --git a/contrib/queryperf/queryperf.c b/contrib/queryperf/queryperf.c index acf32457e1..bcaa97ef73 100644 --- a/contrib/queryperf/queryperf.c +++ b/contrib/queryperf/queryperf.c @@ -18,7 +18,7 @@ /*** *** DNS Query Performance Testing Tool (queryperf.c) *** - *** Version $Id: queryperf.c,v 1.1.1.2 2001/07/18 23:33:04 gson Exp $ + *** Version $Id: queryperf.c,v 1.2 2001/09/26 22:35:06 gson Exp $ *** *** Stephen Jacob ***/ @@ -164,7 +164,7 @@ void show_startup_info(void) { printf("\n" "DNS Query Performance Testing Tool\n" -"Version: $Id: queryperf.c,v 1.1.1.2 2001/07/18 23:33:04 gson Exp $\n" +"Version: $Id: queryperf.c,v 1.2 2001/09/26 22:35:06 gson Exp $\n" "\n"); } @@ -582,12 +582,12 @@ open_socket(void) { bufsize = 1024 * socket_bufsize; ret = setsockopt(sock, SOL_SOCKET, SO_RCVBUF, - &bufsize, sizeof(bufsize)); + (char *) &bufsize, sizeof(bufsize)); if (ret < 0) fprintf(stderr, "Warning: setsockbuf(SO_RCVBUF) failed\n"); ret = setsockopt(sock, SOL_SOCKET, SO_SNDBUF, - &bufsize, sizeof(bufsize)); + (char *) &bufsize, sizeof(bufsize)); if (ret < 0) fprintf(stderr, "Warning: setsockbuf(SO_SNDBUF) failed\n");