Only in mtr-0.74: acconfig.h diff -x .deps -x autom4te.cache -ur mtr-0.74/config.h.in mtr-0.75/config.h.in --- mtr-0.74/config.h.in 2008-08-19 19:08:37.000000000 +0200 +++ mtr-0.75/config.h.in 2008-09-08 09:42:34.000000000 +0200 @@ -1,25 +1,5 @@ /* config.h.in. Generated from configure.in by autoheader. */ -/* Define if you don't have the GTK+ libraries available. */ -#undef NO_GTK - -/* Define if you don't have the curses libraries available. */ -#undef NO_CURSES - -/* Define if you don't have the herror() function available. */ -#undef NO_HERROR - -/* Define if you don't have the strerror() function available. */ -#undef NO_STRERROR - -/* Define the package name. ("mtr") */ -#undef PACKAGE - -/* Define the version string. */ -#undef VERSION - - - /* Define to enable IPv6 */ #undef ENABLE_IPV6 @@ -36,6 +16,12 @@ */ #undef HAVE_DECL_ERRNO +/* Define to 1 if you have the `fcntl' function. */ +#undef HAVE_FCNTL + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -155,32 +141,3 @@ /* Version number of package */ #undef VERSION - -/* Find the proper type for 8 bits */ -#if SIZEOF_UNSIGNED_CHAR == 1 -typedef unsigned char uint8; -#else -#error No 8 bit type -#endif - -/* Find the proper type for 16 bits */ -#if SIZEOF_UNSIGNED_SHORT == 2 -typedef unsigned short uint16; -#elif SIZEOF_UNSIGNED_INT == 2 -typedef unsigned int uint16; -#elif SIZEOF_UNSIGNED_LONG == 2 -typedef unsigned long uint16; -#else -#error No 16 bit type -#endif - -/* Find the proper type for 32 bits */ -#if SIZEOF_UNSIGNED_SHORT == 4 -typedef unsigned short uint32; -#elif SIZEOF_UNSIGNED_INT == 4 -typedef unsigned int uint32; -#elif SIZEOF_UNSIGNED_LONG == 4 -typedef unsigned long uint32; -#else -#error No 32 bit type -#endif diff -x .deps -x autom4te.cache -ur mtr-0.74/configure mtr-0.75/configure --- mtr-0.74/configure 2008-08-19 20:11:50.000000000 +0200 +++ mtr-0.75/configure 2008-09-19 11:38:58.000000000 +0200 @@ -2039,7 +2039,7 @@ # Define the identity of the package. PACKAGE=mtr - VERSION=0.74 + VERSION=0.75 cat >>confdefs.h <<_ACEOF @@ -5545,51 +5545,45 @@ -# Some doc I found somewhere. :-) -- REW -# - Macro: AC_CHECK_FUNC (FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -# - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) -# We don't refer to any symbols in termcap, but -lcurses on SunOS does. -# We have to trust the linker not to mess things up... (It should not -# pull in anything if we don't refer to anything in the lib). -{ echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 -echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6; } -if test "${ac_cv_lib_termcap_tgetent+set}" = set; then + + + + +for ac_header in ncurses.h ncurses/curses.h curses.h cursesX.h sys/types.h fcntl.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltermcap $LIBS" + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tgetent (); -int -main () -{ -return tgetent (); - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5598,154 +5592,138 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_termcap_tgetent=yes + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_termcap_tgetent=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6; } -if test $ac_cv_lib_termcap_tgetent = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBTERMCAP 1 -_ACEOF - - LIBS="-ltermcap $LIBS" - + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -{ echo "$as_me:$LINENO: checking for initscr" >&5 -echo $ECHO_N "checking for initscr... $ECHO_C" >&6; } -if test "${ac_cv_func_initscr+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define initscr to an innocuous variant, in case declares initscr. - For example, HP-UX 11i declares gettimeofday. */ -#define initscr innocuous_initscr - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char initscr (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef initscr - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char initscr (); -/* 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_initscr || defined __stub___initscr -choke me -#endif - -int -main () -{ -return initscr (); - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_initscr=yes + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_initscr=no + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_initscr" >&5 -echo "${ECHO_T}$ac_cv_func_initscr" >&6; } -if test $ac_cv_func_initscr = yes; then - : +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } -{ echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5 -echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6; } -if test "${ac_cv_lib_ncurses_initscr+set}" = set; then +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/xti.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lncurses $LIBS" + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char initscr (); -int -main () -{ -return initscr (); - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5754,108 +5732,120 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_ncurses_initscr=yes + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_ncurses_initscr=no + ac_header_compiler=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6; } -if test $ac_cv_lib_ncurses_initscr = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNCURSES 1 -_ACEOF - - LIBS="-lncurses $LIBS" - -else +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -{ echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5 -echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6; } -if test "${ac_cv_lib_curses_initscr+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcurses $LIBS" +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char initscr (); -int -main () -{ -return initscr (); - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_curses_initscr=yes + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_curses_initscr=no + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6; } -if test $ac_cv_lib_curses_initscr = yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCURSES 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - LIBS="-lcurses $LIBS" +fi -else +done -{ echo "$as_me:$LINENO: checking for initscr in -lcursesX" >&5 -echo $ECHO_N "checking for initscr in -lcursesX... $ECHO_C" >&6; } -if test "${ac_cv_lib_cursesX_initscr+set}" = set; then + +# Some doc I found somewhere. :-) -- REW +# - Macro: AC_CHECK_FUNC (FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +# - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) + +# We don't refer to any symbols in termcap, but -lcurses on SunOS does. +# We have to trust the linker not to mess things up... (It should not +# pull in anything if we don't refer to anything in the lib). + +{ echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 +echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_termcap_tgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lcursesX $LIBS" +LIBS="-ltermcap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5869,11 +5859,11 @@ #ifdef __cplusplus extern "C" #endif -char initscr (); +char tgetent (); int main () { -return initscr (); +return tgetent (); ; return 0; } @@ -5896,52 +5886,33 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_cursesX_initscr=yes + ac_cv_lib_termcap_tgetent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_cursesX_initscr=no + ac_cv_lib_termcap_tgetent=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cursesX_initscr" >&5 -echo "${ECHO_T}$ac_cv_lib_cursesX_initscr" >&6; } -if test $ac_cv_lib_cursesX_initscr = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 +echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6; } +if test $ac_cv_lib_termcap_tgetent = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCURSESX 1 -_ACEOF - - LIBS="-lcursesX $LIBS" - -else - { echo "$as_me:$LINENO: WARNING: Building without curses display support" >&5 -echo "$as_me: WARNING: Building without curses display support" >&2;} - -cat >>confdefs.h <<\_ACEOF -#define NO_CURSES 1 +#define HAVE_LIBTERMCAP 1 _ACEOF - CURSES_OBJ= -fi - -fi - -fi + LIBS="-ltermcap $LIBS" fi - -for ac_func in attron -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +{ echo "$as_me:$LINENO: checking for initscr" >&5 +echo $ECHO_N "checking for initscr... $ECHO_C" >&6; } +if test "${ac_cv_func_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5950,12 +5921,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. +/* Define initscr to an innocuous variant, in case declares initscr. For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func +#define initscr innocuous_initscr /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. + which can conflict with char initscr (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -5965,7 +5936,7 @@ # include #endif -#undef $ac_func +#undef initscr /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -5973,18 +5944,18 @@ #ifdef __cplusplus extern "C" #endif -char $ac_func (); +char initscr (); /* 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_$ac_func || defined __stub___$ac_func +#if defined __stub_initscr || defined __stub___initscr choke me #endif int main () { -return $ac_func (); +return initscr (); ; return 0; } @@ -6007,68 +5978,60 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + ac_cv_func_initscr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_func_initscr=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - - - +{ echo "$as_me:$LINENO: result: $ac_cv_func_initscr" >&5 +echo "${ECHO_T}$ac_cv_func_initscr" >&6; } +if test $ac_cv_func_initscr = yes; then + : +else -for ac_header in ncurses.h ncurses/curses.h curses.h cursesX.h sys/types.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5 +echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6; } +if test "${ac_cv_lib_ncurses_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char initscr (); +int +main () +{ +return initscr (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6077,138 +6040,138 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ncurses_initscr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_lib_ncurses_initscr=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6; } +if test $ac_cv_lib_ncurses_initscr = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNCURSES 1 +_ACEOF + + LIBS="-lncurses $LIBS" + +else + +{ echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5 +echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6; } +if test "${ac_cv_lib_curses_initscr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char initscr (); +int +main () +{ +return initscr (); + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_curses_initscr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" + ac_cv_lib_curses_initscr=no fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6; } +if test $ac_cv_lib_curses_initscr = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_LIBCURSES 1 _ACEOF -fi - -done + LIBS="-lcurses $LIBS" +else -for ac_header in sys/xti.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ echo "$as_me:$LINENO: checking for initscr in -lcursesX" >&5 +echo $ECHO_N "checking for initscr in -lcursesX... $ECHO_C" >&6; } +if test "${ac_cv_lib_cursesX_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcursesX $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char initscr (); +int +main () +{ +return initscr (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6217,102 +6180,140 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_cursesX_initscr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_lib_cursesX_initscr=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_cursesX_initscr" >&5 +echo "${ECHO_T}$ac_cv_lib_cursesX_initscr" >&6; } +if test $ac_cv_lib_cursesX_initscr = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCURSESX 1 +_ACEOF -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF + LIBS="-lcursesX $LIBS" + +else + { echo "$as_me:$LINENO: WARNING: Building without curses display support" >&5 +echo "$as_me: WARNING: Building without curses display support" >&2;} + +cat >>confdefs.h <<\_ACEOF +#define NO_CURSES 1 +_ACEOF + + CURSES_OBJ= +fi + +fi + +fi + +fi + + + + +for ac_func in attron fcntl +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` +ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi - done diff -x .deps -x autom4te.cache -ur mtr-0.74/configure.in mtr-0.75/configure.in --- mtr-0.74/configure.in 2008-08-19 19:07:33.000000000 +0200 +++ mtr-0.75/configure.in 2008-09-08 09:40:54.000000000 +0200 @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.74) +AM_INIT_AUTOMAKE(mtr, 0.75) AC_SUBST(GTK_OBJ) @@ -15,6 +15,9 @@ AC_CHECK_SIZEOF(unsigned int, 4) AC_CHECK_SIZEOF(unsigned long, 4) +AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h cursesX.h sys/types.h fcntl.h) +AC_CHECK_HEADERS(sys/xti.h) + # Some doc I found somewhere. :-) -- REW # - Macro: AC_CHECK_FUNC (FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) # - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) @@ -32,11 +35,7 @@ AC_DEFINE(NO_CURSES, 1, Define if you don't have the curses libraries available.) CURSES_OBJ=)))) -AC_CHECK_FUNCS(attron) - - -AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h cursesX.h sys/types.h) -AC_CHECK_HEADERS(sys/xti.h) +AC_CHECK_FUNCS(attron fcntl) AC_CHECK_LIB(m, floor, , AC_MSG_ERROR(No math library found)) diff -x .deps -x autom4te.cache -ur mtr-0.74/dns.c mtr-0.75/dns.c --- mtr-0.74/dns.c 2008-08-19 19:07:33.000000000 +0200 +++ mtr-0.75/dns.c 2008-09-18 14:36:50.000000000 +0200 @@ -893,7 +893,7 @@ if (type == T_A) { dorequest(rp->hostname,type,rp->id); if (debug) { - sprintf(tempstring,"Resolver: Sent reverse authentication request for \"%s\".", + snprintf(tempstring, sizeof(tempstring), "Resolver: Sent reverse authentication request for \"%s\".", rp->hostname); restell(tempstring); } @@ -914,7 +914,7 @@ } dorequest(tempstring,type,rp->id); if (debug) { - sprintf(tempstring,"Resolver: Sent domain lookup request for \"%s\".", + snprintf(tempstring, sizeof(tempstring), "Resolver: Sent domain lookup request for \"%s\".", strlongip( &(rp->ip) )); restell(tempstring); } @@ -950,7 +950,7 @@ rp->expiretime = sweeptime + (double)ttl; untieresolve(rp); if (debug) { - sprintf(tempstring,"Resolver: Lookup successful: %s\n",rp->hostname); + snprintf(tempstring, sizeof(tempstring), "Resolver: Lookup successful: %s\n",rp->hostname); restell(tempstring); } } @@ -1007,7 +1007,7 @@ case NOERROR: if (hp->ancount) { if (debug) { - sprintf(tempstring,"Resolver: Received nameserver reply. (qd:%u an:%u ns:%u ar:%u)", + snprintf(tempstring, sizeof(tempstring), "Resolver: Received nameserver reply. (qd:%u an:%u ns:%u ar:%u)", hp->qdcount,hp->ancount,hp->nscount,hp->arcount); restell(tempstring); } @@ -1047,14 +1047,14 @@ namestring[strlen(stackstring)] = '\0'; if (strcasecmp(stackstring,namestring)) { if (debug) { - sprintf(tempstring,"Resolver: Unknown query packet dropped. (\"%s\" does not match \"%s\")", + snprintf(tempstring, sizeof(tempstring), "Resolver: Unknown query packet dropped. (\"%s\" does not match \"%s\")", stackstring,namestring); restell(tempstring); } return; } if (debug) { - sprintf(tempstring,"Resolver: Queried domain name: \"%s\"",namestring); + snprintf(tempstring, sizeof(tempstring), "Resolver: Queried domain name: \"%s\"",namestring); restell(tempstring); } c+= r; @@ -1065,7 +1065,7 @@ qdatatype = sucknetword(c); qclass = sucknetword(c); if (qclass != C_IN) { - sprintf(tempstring,"Resolver error: Received unsupported query class: %u (%s)", + snprintf(tempstring, sizeof(tempstring), "Resolver error: Received unsupported query class: %u (%s)", qclass,qclass < ClasstypeCount ? classtypes[qclass] : classtypes[ClasstypeCount]); restell(tempstring); @@ -1079,7 +1079,7 @@ } break; default: - sprintf(tempstring,"Resolver error: Received unimplemented query type: %u (%s)", + snprintf(tempstring, sizeof(tempstring), "Resolver error: Received unimplemented query type: %u (%s)", qdatatype,qdatatype < ResourcetypeCount ? resourcetypes[qdatatype] : resourcetypes[ResourcetypeCount]); restell(tempstring); @@ -1101,7 +1101,7 @@ else usefulanswer = 1; if (debug) { - sprintf(tempstring,"Resolver: answered domain query: \"%s\"",namestring); + snprintf(tempstring, sizeof(tempstring), "Resolver: answered domain query: \"%s\"",namestring); restell(tempstring); } c+= r; @@ -1114,10 +1114,10 @@ ttl = sucknetlong(c); rdatalength = sucknetword(c); if (class != qclass) { - sprintf(tempstring,"query class: %u (%s)",qclass,qclass < ClasstypeCount ? + snprintf(tempstring, sizeof(tempstring), "query class: %u (%s)",qclass,qclass < ClasstypeCount ? classtypes[qclass] : classtypes[ClasstypeCount]); restell(tempstring); - sprintf(tempstring,"rr class: %u (%s)",class,class < ClasstypeCount ? + snprintf(tempstring, sizeof(tempstring), "rr class: %u (%s)",class,class < ClasstypeCount ? classtypes[class] : classtypes[ClasstypeCount]); restell(tempstring); restell("Resolver error: Answered class does not match queried class."); @@ -1133,20 +1133,20 @@ } if (datatype == qdatatype || datatype == T_CNAME) { if (debug) { - sprintf(tempstring,"Resolver: TTL: %s",strtdiff(sendstring,ttl)); + snprintf(tempstring, sizeof(tempstring), "Resolver: TTL: %s",strtdiff(sendstring,ttl)); restell(tempstring); } if (usefulanswer) switch (datatype) { case T_A: if (rdatalength != 4) { - sprintf(tempstring,"Resolver error: Unsupported rdata format for \"A\" type. (%u bytes)", + snprintf(tempstring, sizeof(tempstring), "Resolver error: Unsupported rdata format for \"A\" type. (%u bytes)", rdatalength); restell(tempstring); return; } if ( addrcmp( (void *) &(rp->ip), (void *) c, af ) == 0 ) { - sprintf(tempstring,"Resolver: Reverse authentication failed: %s != ", + snprintf(tempstring, sizeof(tempstring), "Resolver: Reverse authentication failed: %s != ", strlongip( &(rp->ip) )); addrcpy( (void *) &alignedip, (void *) c, af ); strcat(tempstring,strlongip( &alignedip )); @@ -1154,7 +1154,7 @@ res_hostipmismatch++; failrp(rp); } else { - sprintf(tempstring,"Resolver: Reverse authentication complete: %s == \"%s\".", + snprintf(tempstring, sizeof(tempstring), "Resolver: Reverse authentication complete: %s == \"%s\".", strlongip( &(rp->ip) ),nonull(rp->hostname)); restell(tempstring); res_reversesuccess++; @@ -1171,7 +1171,7 @@ return; } if (debug) { - sprintf(tempstring,"Resolver: Answered domain: \"%s\"",namestring); + snprintf(tempstring, sizeof(tempstring), "Resolver: Answered domain: \"%s\"",namestring); restell(tempstring); } if (r > HostnameLength) { @@ -1196,14 +1196,14 @@ } break; default: - sprintf(tempstring,"Resolver error: Received unimplemented data type: %u (%s)", + snprintf(tempstring, sizeof(tempstring), "Resolver error: Received unimplemented data type: %u (%s)", datatype,datatype < ResourcetypeCount ? resourcetypes[datatype] : resourcetypes[ResourcetypeCount]); restell(tempstring); } } else { if (debug) { - sprintf(tempstring,"Resolver: Ignoring resource type %u. (%s)", + snprintf(tempstring, sizeof(tempstring), "Resolver: Ignoring resource type %u. (%s)", datatype,datatype < ResourcetypeCount ? resourcetypes[datatype] : resourcetypes[ResourcetypeCount]); restell(tempstring); @@ -1221,7 +1221,7 @@ failrp(rp); break; default: - sprintf(tempstring,"Resolver: Received error response %u. (%s)", + snprintf(tempstring, sizeof(tempstring), "Resolver: Received error response %u. (%s)", getheader_rcode(hp),getheader_rcode(hp) < ResponsecodeCount ? responsecodes[getheader_rcode(hp)] : responsecodes[ResponsecodeCount]); restell(tempstring); @@ -1252,13 +1252,13 @@ (void *) &(from4->sin_addr), AF_INET ) == 0 ) break; if (i == _res.nscount) { - sprintf(tempstring,"Resolver error: Received reply from unknown source: %s", + snprintf(tempstring, sizeof(tempstring), "Resolver error: Received reply from unknown source: %s", inet_ntoa(from4->sin_addr )); restell(tempstring); } else parserespacket((byte *)resrecvbuf,r); } else { - sprintf(tempstring,"Resolver: Socket error: %s",strerror(errno)); + snprintf(tempstring, sizeof(tempstring), "Resolver: Socket error: %s",strerror(errno)); restell(tempstring); } } @@ -1287,7 +1287,7 @@ case STATE_FINISHED: /* TTL has expired */ case STATE_FAILED: /* Fake TTL has expired */ if (debug) { - sprintf(tempstring,"Resolver: Cache record for \"%s\" (%s) has expired. (state: %u) Marked for expire at: %g, time: %g.", + snprintf(tempstring, sizeof(tempstring), "Resolver: Cache record for \"%s\" (%s) has expired. (state: %u) Marked for expire at: %g, time: %g.", nonull(rp->hostname), strlongip( &(rp->ip) ), rp->state, rp->expiretime, sweeptime); restell(tempstring); @@ -1331,14 +1331,14 @@ if ((rp->state == STATE_FINISHED) || (rp->state == STATE_FAILED)) { if ((rp->state == STATE_FINISHED) && (rp->hostname)) { if (debug) { - sprintf(tempstring,"Resolver: Used cached record: %s == \"%s\".\n", + snprintf(tempstring, sizeof(tempstring), "Resolver: Used cached record: %s == \"%s\".\n", strlongip(ip),rp->hostname); restell(tempstring); } return rp->hostname; } else { if (debug) { - sprintf(tempstring,"Resolver: Used failed record: %s == ???\n", + snprintf(tempstring, sizeof(tempstring), "Resolver: Used failed record: %s == ???\n", strlongip(ip)); restell(tempstring); } diff -x .deps -x autom4te.cache -ur mtr-0.74/gtk.c mtr-0.75/gtk.c --- mtr-0.74/gtk.c 2008-08-19 19:07:33.000000000 +0200 +++ mtr-0.75/gtk.c 2008-09-19 09:41:53.000000000 +0200 @@ -42,6 +42,11 @@ #endif gint gtk_ping(gpointer data); +gint Copy_activate(GtkWidget *widget, gpointer data); +gint NewDestination_activate(GtkWidget *widget, gpointer data); +gboolean ReportTreeView_clicked(GtkWidget *Tree, GdkEventButton *event); +gchar* getSelectedHost(GtkTreePath *path); + extern char *Hostname; @@ -49,7 +54,7 @@ extern int af; static int tag; static GtkWidget *Pause_Button; - +static GtkWidget *Entry; void gtk_add_ping_timeout (void) { @@ -170,7 +175,6 @@ { GtkWidget *Button; GtkWidget *Label; - GtkWidget *Entry; GtkAdjustment *Adjustment; Button = gtk_button_new_from_stock(GTK_STOCK_QUIT); @@ -278,6 +282,9 @@ ReportTreeView = gtk_tree_view_new_with_model(GTK_TREE_MODEL(ReportStore)); + g_signal_connect(GTK_OBJECT(ReportTreeView), "button_press_event", + G_CALLBACK(ReportTreeView_clicked),NULL); + renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes ("Hostname", renderer, @@ -536,4 +543,91 @@ gtk_main(); } +gboolean NewDestination_activate(GtkWidget *widget, gpointer data) +{ + gchar *hostname; + GtkTreePath *path = (GtkTreePath*)data; + + hostname = getSelectedHost(path); + if (hostname) { + gtk_entry_set_text (GTK_ENTRY(Entry), hostname); + Host_activate(Entry, NULL); + g_free(hostname); + } + return TRUE; +} + + +gboolean Copy_activate(GtkWidget *widget, gpointer data) +{ + gchar *hostname; + GtkTreePath *path = (GtkTreePath*)data; + + hostname = getSelectedHost(path); + if (hostname != NULL) { + GtkClipboard *clipboard; + + clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); + gtk_clipboard_set_text(clipboard, hostname, -1); + + clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); + gtk_clipboard_set_text(clipboard, hostname, -1); + + g_free(hostname); + } + + return TRUE; +} + +gchar *getSelectedHost(GtkTreePath *path) +{ + GtkTreeIter iter; + gchar *name = NULL; + + if (gtk_tree_model_get_iter(GTK_TREE_MODEL(ReportStore), &iter, path)) { + gtk_tree_model_get (GTK_TREE_MODEL(ReportStore), &iter, COL_HOSTNAME, &name, -1); + } + gtk_tree_path_free(path); + return name; +} + + +gboolean ReportTreeView_clicked(GtkWidget *Tree, GdkEventButton *event) +{ + GtkWidget* popup_menu; + GtkWidget* copy_item; + GtkWidget* newdestination_item; + GtkTreePath *path; + + if (event->type != GDK_BUTTON_PRESS || event->button != 3) + return FALSE; + + if(!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(ReportTreeView), + event->x, event->y, &path, NULL, NULL, NULL)) + return FALSE; + + gtk_tree_view_set_cursor(GTK_TREE_VIEW(ReportTreeView), path, NULL, FALSE); + + // Single right click: prepare and show the popup menu + popup_menu = gtk_menu_new (); + + copy_item = gtk_menu_item_new_with_label ("Copy to clipboard"); + newdestination_item = gtk_menu_item_new_with_label ("Set as new destination"); + + gtk_menu_append (GTK_MENU (popup_menu), copy_item); + gtk_menu_append (GTK_MENU (popup_menu), newdestination_item); + + g_signal_connect(GTK_OBJECT(copy_item),"activate", + GTK_SIGNAL_FUNC(Copy_activate), path); + + g_signal_connect(GTK_OBJECT(newdestination_item),"activate", + GTK_SIGNAL_FUNC(NewDestination_activate), path); + + gtk_widget_show (copy_item); + gtk_widget_show (newdestination_item); + + gtk_menu_popup (GTK_MENU(popup_menu), NULL, NULL, NULL, NULL, + 0, event->time); + return TRUE; +} diff -x .deps -x autom4te.cache -ur mtr-0.74/Makefile mtr-0.75/Makefile --- mtr-0.74/Makefile 2008-09-19 11:38:44.000000000 +0200 +++ mtr-0.75/Makefile 2008-09-19 11:32:05.000000000 +0200 @@ -0,0 +1,16 @@ + +# +# This is an attempt on simplifying the compilation of mtr to a simple "make". +# + +firstrule: + ./configure + $(MAKE) + +clean: + rm -f *.o *~ core + +distclean: clean + rm -f mtr config.cache config.status config.log \ + stamp-h stamp-h[0-9]* TAGS ID + diff -x .deps -x autom4te.cache -ur mtr-0.74/Makefile.am mtr-0.75/Makefile.am --- mtr-0.74/Makefile.am 2008-08-19 18:55:48.000000000 +0200 +++ mtr-0.75/Makefile.am 2008-09-08 18:44:32.000000000 +0200 @@ -23,7 +23,7 @@ EXTRA_DIST = SECURITY mtr.8 Makefile Makefile.dist distclean-local: - cp Makefile.dist Makefile + (sleep 3; cp Makefile.dist Makefile) & rm -f *.orig DISTCLEANFILES = *~ diff -x .deps -x autom4te.cache -ur mtr-0.74/Makefile.dist mtr-0.75/Makefile.dist --- mtr-0.74/Makefile.dist 2008-08-19 18:55:48.000000000 +0200 +++ mtr-0.75/Makefile.dist 2008-09-08 21:32:50.000000000 +0200 @@ -4,7 +4,7 @@ # firstrule: - ./configure + ./configure $(MAKE) clean: diff -x .deps -x autom4te.cache -ur mtr-0.74/Makefile.in mtr-0.75/Makefile.in --- mtr-0.74/Makefile.in 2008-08-19 20:11:49.000000000 +0200 +++ mtr-0.75/Makefile.in 2008-09-19 11:38:58.000000000 +0200 @@ -39,8 +39,8 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ - TODO acconfig.h config.guess config.sub depcomp install-sh \ - missing mkinstalldirs + TODO config.guess config.sub depcomp install-sh missing \ + mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -243,7 +243,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) $(top_srcdir)/acconfig.h +$(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ @@ -741,7 +741,7 @@ install-exec-hook: chmod u+s $(DESTDIR)$(sbindir)/mtr distclean-local: - cp Makefile.dist Makefile + (sleep 3; cp Makefile.dist Makefile) & rm -f *.orig # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -x .deps -x autom4te.cache -ur mtr-0.74/mtr.8 mtr-0.75/mtr.8 --- mtr-0.74/mtr.8 2008-08-19 18:55:48.000000000 +0200 +++ mtr-0.75/mtr.8 2008-09-18 14:40:09.000000000 +0200 @@ -20,6 +20,9 @@ .B \-\-report\c ] [\c +.B \-\-report-wide\c +] +[\c .B \-\-report\-cycles\ COUNT\c ] [\c @@ -116,6 +119,19 @@ network performance. .TP +.B \-w +.TP +.B \-\-report-wide +.br +This option puts +.B mtr +into +.B wide report +mode. When in this mode, +.B mtr +will not cut hostnames in the report. + +.TP .B \-c\ COUNT .TP .B \-\-report\-cycles\ COUNT diff -x .deps -x autom4te.cache -ur mtr-0.74/mtr.c mtr-0.75/mtr.c --- mtr-0.74/mtr.c 2008-08-19 19:07:33.000000000 +0200 +++ mtr-0.75/mtr.c 2008-09-18 14:40:09.000000000 +0200 @@ -64,6 +64,7 @@ int cpacketsize = 64; /* default packet size */ int bitpattern = 0; int tos = 0; +int reportwide = 0; int af = DEFAULT_AF; int mtrtype = IPPROTO_ICMP; /* Use ICMP as default packet type */ @@ -125,6 +126,7 @@ { "help", 0, 0, 'h' }, { "report", 0, 0, 'r' }, + { "report-wide", 0, 0, 'w' }, { "xml", 0, 0, 'x' }, { "curses", 0, 0, 't' }, { "gtk", 0, 0, 'g' }, @@ -154,7 +156,7 @@ while(1) { /* added f:m:o: byMin */ opt = getopt_long(argc, argv, - "vhrxtglpo:i:c:s:b:Q:na:f:m:u46", long_options, NULL); + "vhrwxtglpo:i:c:s:b:Q:na:f:m:u46", long_options, NULL); if(opt == -1) break; @@ -169,6 +171,9 @@ case 'r': DisplayMode = DisplayReport; break; + case 'w': + reportwide = 1; + break; case 't': DisplayMode = DisplayCurses; break; @@ -371,8 +376,8 @@ } if (PrintHelp) { - printf("usage: %s [-hvrctglspniu46] [--help] [--version] [--report]\n" - "\t\t[--report-cycles=COUNT] [--curses] [--gtk]\n" + printf("usage: %s [-hvrwctglspniu46] [--help] [--version] [--report]\n" + "\t\t[--report-wide] [--report-cycles=COUNT] [--curses] [--gtk]\n" "\t\t[--raw] [--split] [--no-dns] [--address interface]\n" /* BL */ "\t\t[--psize=bytes/-s bytes]\n" /* ok */ "\t\t[--interval=SECONDS] HOSTNAME [PACKETSIZE]\n", argv[0]); @@ -395,7 +400,7 @@ bzero( &hints, sizeof hints ); hints.ai_family = af; hints.ai_socktype = SOCK_DGRAM; - error = getaddrinfo( Hostname, "0", &hints, &res ); + error = getaddrinfo( Hostname, NULL, &hints, &res ); if ( error ) { perror( gai_strerror(error) ); exit( EXIT_FAILURE ); diff -x .deps -x autom4te.cache -ur mtr-0.74/mtr.h mtr-0.75/mtr.h --- mtr-0.74/mtr.h 2008-08-19 19:10:02.000000000 +0200 +++ mtr-0.75/mtr.h 2008-09-08 09:40:54.000000000 +0200 @@ -20,11 +20,6 @@ /* Typedefs */ -#if 0 - -// Neat trick! However, on my system, "config.h" already defines these types -// so I get a compiler error if I leave this in. -- REW - /* Find the proper type for 8 bits */ #if SIZEOF_UNSIGNED_CHAR == 1 typedef unsigned char uint8; @@ -54,8 +49,6 @@ #error No 32 bit type #endif -#endif - typedef unsigned char byte; typedef unsigned short word; typedef unsigned long dword; diff -x .deps -x autom4te.cache -ur mtr-0.74/net.c mtr-0.75/net.c --- mtr-0.74/net.c 2008-08-19 18:55:48.000000000 +0200 +++ mtr-0.75/net.c 2008-09-19 11:37:57.000000000 +0200 @@ -32,6 +32,9 @@ #include #include #include +#ifdef HAVE_FCNTL_H +#include +#endif #include #include #include @@ -895,6 +898,20 @@ return 0; } +static void set_fd_flags(int fd) +{ +#if defined(HAVE_FCNTL) && defined(FD_CLOEXEC) + int oldflags; + + oldflags = fcntl(fd, F_GETFD); + if (oldflags == -1) { + perror("Couldn't get fd's flags"); + return; + } + if (fcntl(fd, F_SETFD, oldflags | FD_CLOEXEC)) + perror("Couldn't set fd's flags"); +#endif +} int net_preopen(void) { @@ -925,9 +942,11 @@ recvsock4 = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); if (recvsock4 < 0) return -1; + set_fd_flags(recvsock4); #ifdef ENABLE_IPV6 recvsock6 = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); #endif + set_fd_flags(recvsock6); return 0; } @@ -956,7 +975,7 @@ sendsock6 = sendsock6_udp; break; } - if (sendsock6 < 0) + if ((sendsock6 < 0) && (sendsock4 < 0)) return -1; #endif diff -x .deps -x autom4te.cache -ur mtr-0.74/NEWS mtr-0.75/NEWS --- mtr-0.74/NEWS 2008-08-19 19:59:25.000000000 +0200 +++ mtr-0.75/NEWS 2008-09-19 09:45:27.000000000 +0200 @@ -1,4 +1,8 @@ WHAT'S NEW? + v0.75 Feelgood patch to move sprintf to snprintf. People might think + that sprintf might cause a buffer overflow. Now it's clean. + cut-paste patches: you can now copy an intermediate host to the + clipboard. v0.74 Martin Pels' patch to allow UDP probes. KES reported a build problem. Turns out I need to install gtk-1.2 on my development sytem, otherwise my release script causes the diff -x .deps -x autom4te.cache -ur mtr-0.74/report.c mtr-0.75/report.c --- mtr-0.74/report.c 2008-08-19 18:55:48.000000000 +0200 +++ mtr-0.75/report.c 2008-09-18 14:40:09.000000000 +0200 @@ -41,6 +41,7 @@ extern int tos; extern int MaxPing; extern int af; +extern int reportwide; void report_open(void) @@ -56,15 +57,41 @@ char buf[1024]; char fmt[16]; int len=0; + int len_hosts = 33; struct hostent *host; - sprintf(buf, "HOST: %-33s", LocalHostname); + if (reportwide) + { + // get the longest hostname + len_hosts = strlen(LocalHostname); + max = net_max(); + at = net_min(); + for (; at < max; at++) { + addr = net_addr(at); + if( addrcmp( (void *) addr, (void *) &unspec_addr, af ) != 0 ) { + host = dns ? addr2host( (void *) addr, af ) : NULL; + if (host != NULL) { + strncpy( name, host->h_name, (sizeof name) - 1 ); + name[ (sizeof name) - 1 ] = '\0'; + } else { + snprintf(name, sizeof(name), "%s", strlongip( addr ) ); + } + if (len_hosts < strlen(name)) { + len_hosts = strlen(name); + } + } + } + } + + snprintf( fmt, sizeof(fmt), "HOST: %%-%ds", len_hosts); + snprintf(buf, sizeof(buf), fmt, LocalHostname); + len = reportwide ? strlen(buf) : len_hosts; for( i=0; ih_name, (sizeof name) - 1 ); - name[ (sizeof name) - 1 ] = '\0'; + strncpy( name, host->h_name, (sizeof name) - 1 ); + name[ (sizeof name) - 1 ] = '\0'; } else { - sprintf(name, "%s", strlongip( addr ) ); + snprintf(name, sizeof(name), "%s", strlongip( addr ) ); } } - len=0; - sprintf( buf, " %2d. %-33s", at+1, name); + snprintf( fmt, sizeof(fmt), " %%2d. %%-%ds", len_hosts); + snprintf(buf, sizeof(buf), fmt, at+1, name); + len = reportwide ? strlen(buf) : len_hosts; for( i=0; i