From db21cd1f702e18ac081b3d3d4ae13fd567a8d95e Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Mon, 17 Apr 2000 14:31:25 +0000 Subject: [PATCH] T/TCP now configurable by configure --- SRC/INSTALL | 10 +-- SRC/acconfig.h | 3 + SRC/config.h.in | 3 + SRC/configure | 170 ++++++++++++++++++++++++++++++----------------- SRC/configure.in | 24 +++++++ SRC/echoping.c | 4 +- SRC/echoping.h | 3 + 7 files changed, 148 insertions(+), 69 deletions(-) diff --git a/SRC/INSTALL b/SRC/INSTALL index ecd5afb..897a459 100644 --- a/SRC/INSTALL +++ b/SRC/INSTALL @@ -8,13 +8,9 @@ Just type "./configure", then "make", and then (as root if necessary), "configure" has some options: --disable-http (suppress the HTTP support) --enable-icp (add the ICP support, to monitor Web proxies like Squid) - - -Variables you may add in echoping.h: - -TTCP -T/TCP support if your system supports it (FreeBSD does). See - +--disable-ttcp (suppress the T/TCP support which is enabled only if + your system supports it - FreeBSD does. See + ) If 'echoping -h' fails with "tcp_open: unknown service: http/tcp", add diff --git a/SRC/acconfig.h b/SRC/acconfig.h index 545d627..13ee2fc 100644 --- a/SRC/acconfig.h +++ b/SRC/acconfig.h @@ -3,6 +3,9 @@ /* Do we have POSIX signals? */ #undef HAVE_SIGACTION +/* Do we have T/TCP? */ +#undef HAVE_TTCP + /* Is sys_errlist declared? */ #undef DECL_SYS_ERRLIST diff --git a/SRC/config.h.in b/SRC/config.h.in index a5a132c..424dde6 100644 --- a/SRC/config.h.in +++ b/SRC/config.h.in @@ -43,6 +43,9 @@ /* Do we have POSIX signals? */ #undef HAVE_SIGACTION +/* Do we have T/TCP? */ +#undef HAVE_TTCP + /* Is sys_errlist declared? */ #undef DECL_SYS_ERRLIST diff --git a/SRC/configure b/SRC/configure index e5d3ff3..489e10a 100755 --- a/SRC/configure +++ b/SRC/configure @@ -15,6 +15,8 @@ ac_help="$ac_help --enable-http HTTP (Web's main protocol) support" ac_help="$ac_help --enable-icp ICP (for testing Web proxies/caches) support" +ac_help="$ac_help +--enable-ttcp T/TCP (Transaction TCP) support" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -556,7 +558,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # 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:560: checking for a BSD compatible install" >&5 +echo "configure:562: 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 @@ -609,7 +611,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:613: checking whether build environment is sane" >&5 +echo "configure:615: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -666,7 +668,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:670: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:672: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -712,7 +714,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:716: checking for working aclocal" >&5 +echo "configure:718: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -725,7 +727,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:729: checking for working autoconf" >&5 +echo "configure:731: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -738,7 +740,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:742: checking for working automake" >&5 +echo "configure:744: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -751,7 +753,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:755: checking for working autoheader" >&5 +echo "configure:757: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -764,7 +766,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:768: checking for working makeinfo" >&5 +echo "configure:770: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -812,7 +814,7 @@ fi # 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:816: checking for $ac_word" >&5 +echo "configure:818: 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 @@ -842,7 +844,7 @@ 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:846: checking for $ac_word" >&5 +echo "configure:848: 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 @@ -893,7 +895,7 @@ fi # 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:897: checking for $ac_word" >&5 +echo "configure:899: 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 @@ -925,7 +927,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:929: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:931: 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. @@ -936,12 +938,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 940 "configure" +#line 942 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:947: \"$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 @@ -967,12 +969,12 @@ 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:971: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:973: 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:976: checking whether we are using GNU C" >&5 +echo "configure:978: 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 @@ -981,7 +983,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:985: \"$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:987: \"$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 @@ -1000,7 +1002,7 @@ 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:1004: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1006: 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 @@ -1046,7 +1048,7 @@ fi # 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:1050: checking for a BSD compatible install" >&5 +echo "configure:1052: 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 @@ -1101,7 +1103,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1105: checking how to run the C preprocessor" >&5 +echo "configure:1107: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1116,13 +1118,13 @@ 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:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1128: \"$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 : @@ -1133,13 +1135,13 @@ 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:1143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1145: \"$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 : @@ -1150,13 +1152,13 @@ else 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:1160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1162: \"$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 : @@ -1181,12 +1183,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1185: checking for ANSI C header files" >&5 +echo "configure:1187: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1194,7 +1196,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1200: \"$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* @@ -1211,7 +1213,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1229,7 +1231,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1250,7 +1252,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1261,7 +1263,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1288,17 +1290,17 @@ for ac_hdr in sys/time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1292: checking for $ac_hdr" >&5 +echo "configure:1294: 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:1302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1304: \"$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* @@ -1329,13 +1331,13 @@ for cf_name in sys_nerr sys_errlist do echo $ac_n "checking if external $cf_name is declared""... $ac_c" 1>&6 -echo "configure:1333: checking if external $cf_name is declared" >&5 +echo "configure:1335: checking if external $cf_name is declared" >&5 if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+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:1354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval 'cf_cv_dcl_'$cf_name'=yes' else @@ -1378,13 +1380,13 @@ fi # It's possible (for near-UNIX clones) that the data doesn't exist echo $ac_n "checking if external $cf_name exists""... $ac_c" 1>&6 -echo "configure:1382: checking if external $cf_name exists" >&5 +echo "configure:1384: checking if external $cf_name exists" >&5 if eval "test \"`echo '$''{'cf_cv_have_$cf_name'+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:1400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval 'cf_cv_have_'$cf_name'=yes' else @@ -1427,12 +1429,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1431: checking for working const" >&5 +echo "configure:1433: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1502,12 +1504,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1506: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1508: 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 @@ -1516,7 +1518,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1538,12 +1540,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1542: checking return type of signal handlers" >&5 +echo "configure:1544: 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 @@ -1560,7 +1562,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1579,12 +1581,12 @@ EOF echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:1583: checking for vprintf" >&5 +echo "configure:1585: 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${ac_exeext}; then +if { (eval echo configure:1613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -1631,12 +1633,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:1635: checking for _doprnt" >&5 +echo "configure:1637: 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${ac_exeext}; then +if { (eval echo configure:1665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -1686,12 +1688,12 @@ fi for ac_func in gettimeofday socket sigaction do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1690: checking for $ac_func" >&5 +echo "configure:1692: 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${ac_exeext}; then +if { (eval echo configure:1720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1739,6 +1741,54 @@ fi done +echo $ac_n "checking T/TCP""... $ac_c" 1>&6 +echo "configure:1746: checking T/TCP" >&5 +cat > conftest.$ac_ext < +int main() { +int foobar = MSG_EOF; +; return 0; } +EOF +if { (eval echo configure:1755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cat >> confdefs.h <<\EOF +#define TTCP 1 +EOF +,ac_have_ttcp=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_have_ttcp=no +fi +rm -f conftest* +echo "$ac_t""$ac_have_ttcp" 1>&6 +# Check whether --enable-ttcp or --disable-ttcp was given. +if test "${enable_ttcp+set}" = set; then + enableval="$enable_ttcp" + if test "$enableval" = "yes"; then + if test $ac_have_ttcp = "yes"; then + cat >> confdefs.h <<\EOF +#define TTCP 1 +EOF + + else + echo "configure: warning: No T/TCP support on this system, request ignored" 1>&2 + fi + fi +else + if test $ac_have_ttcp = "yes"; then + cat >> confdefs.h <<\EOF +#define TTCP 1 +EOF + + fi +fi + + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure diff --git a/SRC/configure.in b/SRC/configure.in index 1919c40..2376335 100644 --- a/SRC/configure.in +++ b/SRC/configure.in @@ -18,6 +18,7 @@ AC_ARG_ENABLE(icp, [if test "$enableval" = "yes"; then AC_DEFINE(ICP) fi]) +dnl See T/TCP later dnl Checks for programs. AC_PROG_CC @@ -42,4 +43,27 @@ AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(gettimeofday socket sigaction) +dnl T/TCP +AC_MSG_CHECKING([T/TCP]) +AC_TRY_COMPILE( + [#include ], + [int foobar = MSG_EOF;], + [AC_DEFINE(TTCP),ac_have_ttcp=yes], + ac_have_ttcp=no) +AC_MSG_RESULT($ac_have_ttcp) +AC_ARG_ENABLE(ttcp, + [--enable-ttcp T/TCP (Transaction TCP) support], + [if test "$enableval" = "yes"; then + if test $ac_have_ttcp = "yes"; then + AC_DEFINE(TTCP) + else + AC_MSG_WARN([No T/TCP support on this system, request ignored]) + fi + fi], + dnl Default: enable it if supported + if test $ac_have_ttcp = "yes"; then + AC_DEFINE(TTCP) + fi) + + AC_OUTPUT(Makefile) diff --git a/SRC/echoping.c b/SRC/echoping.c index 7f5c8f4..84e7f86 100644 --- a/SRC/echoping.c +++ b/SRC/echoping.c @@ -232,7 +232,7 @@ main (argc, argv) "%s: Filling incompatible with HTTP connections.\n", progname); exit (1); } -#ifndef TTCP +#ifndef USE_TTCP if (ttcp) { (void) fprintf (stderr, @@ -503,7 +503,7 @@ main (argc, argv) if ((port_to_use == USE_ECHO) || (port_to_use == USE_DISCARD) || (port_to_use == USE_HTTP) || (port_to_use == USE_ICP)) { -#ifdef TTCP +#ifdef USE_TTCP if (ttcp) { if (sendto (sockfd, sendline, n, MSG_EOF, diff --git a/SRC/echoping.h b/SRC/echoping.h index 65c7706..9afcfe2 100644 --- a/SRC/echoping.h +++ b/SRC/echoping.h @@ -60,6 +60,9 @@ extern int sys_nerr; #ifdef HAVE_SIGACTION #define USE_SIGACTION 1 #endif +#ifdef HAVE_TTCP +#define USE_TTCP 1 +#endif struct timeval null_timeval; struct timeval max_timeval;