diff -ru -b -P tcptraceroute-1.5beta1/ChangeLog tcptraceroute-1.5beta2/ChangeLog --- tcptraceroute-1.5beta1/ChangeLog Sat May 24 21:14:02 2003 +++ tcptraceroute-1.5beta2/ChangeLog Mon May 26 04:24:20 2003 @@ -1,3 +1,12 @@ +Version 1.5beta2 (2003-05-25) + + Added an autoconf check to detect MacOS X systems by looking to + see if __APPLE__ and __MACH__ are defined. Also added an autoconf + configure command line argument --enable-noselect-default to control + the default behavior of the tcptraceroute --noselect command line + argument, and enabled it by default on MacOS X systems if not + otherwise specified. + Version 1.5beta1 (2003-05-24) Most substantially, support for both autoconf and libnet-1.1.x diff -ru -b -P tcptraceroute-1.5beta1/INSTALL tcptraceroute-1.5beta2/INSTALL --- tcptraceroute-1.5beta1/INSTALL Sat May 24 21:41:06 2003 +++ tcptraceroute-1.5beta2/INSTALL Mon May 26 04:29:39 2003 @@ -1,29 +1,8 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: +As of release 1.5beta1, tcptraceroute now uses GNU autoconf to ease the +task of installation and to provide better portability. As with all +programs utilizing autoconf, the simplest way to compile the package is +(quoting from the default INSTALL documentation that ships with +autoconf): 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're @@ -36,147 +15,26 @@ 2. Type `make' to compile the package. - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and + 3. Type `make install' to install the programs and any data files and documentation. - 5. You can remove the program binaries and object files from the + 4. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. + a different kind of computer), type `make distclean'. + +The configure scripts supports a number of command line options. The +ones you're most likely to use are: + + --prefix=PREFIX install architecture-independent files in + PREFIX [/usr/local] + --with-libpcap=DIR use libpcap in DIR + --with-libnet=DIR use libnet in DIR + --enable-noselect-default + default to not using select(2) + --enable-track-default=PORT|ID + default to tracking probes by PORT or ID + --enable-default-port=N default destination port + --enable-static compile staticly, if using gcc -`configure' also accepts some other, not widely useful, options. +-mct, Sun May 25 11:16:48 EDT 2003 diff -ru -b -P tcptraceroute-1.5beta1/VERSION tcptraceroute-1.5beta2/VERSION --- tcptraceroute-1.5beta1/VERSION Sun May 25 02:07:35 2003 +++ tcptraceroute-1.5beta2/VERSION Mon May 26 04:10:08 2003 @@ -1 +1 @@ -1.5beta1 +1.5beta2 diff -ru -b -P tcptraceroute-1.5beta1/aclocal.m4 tcptraceroute-1.5beta2/aclocal.m4 --- tcptraceroute-1.5beta1/aclocal.m4 Sun May 25 02:23:51 2003 +++ tcptraceroute-1.5beta2/aclocal.m4 Mon May 26 04:32:08 2003 @@ -1,4 +1,4 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p4 +dnl aclocal.m4t generated automatically by aclocal 1.4-p4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation diff -ru -b -P tcptraceroute-1.5beta1/config.h.in tcptraceroute-1.5beta2/config.h.in --- tcptraceroute-1.5beta1/config.h.in Sun May 25 02:06:51 2003 +++ tcptraceroute-1.5beta2/config.h.in Mon May 26 04:32:11 2003 @@ -27,6 +27,9 @@ /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET +/* Is this a MacOS X system? */ +#undef HAVE_MACOSX + /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC @@ -97,6 +100,9 @@ /* libnet API version */ #undef LIBNET_API_VERSION + +/* Use select(2) by default? */ +#undef NOSELECT_DEFAULT /* Name of package */ #undef PACKAGE diff -ru -b -P tcptraceroute-1.5beta1/configure tcptraceroute-1.5beta2/configure --- tcptraceroute-1.5beta1/configure Sun May 25 02:24:31 2003 +++ tcptraceroute-1.5beta2/configure Mon May 26 04:32:10 2003 @@ -845,6 +845,8 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-noselect-default + default to not using select(2) --enable-track-default=PORT|ID default to tracking probes by PORT or ID --enable-default-port=N default destination port @@ -3670,7 +3672,7 @@ echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF -#define HAVE_SOCKADDR_SA_LEN +#define HAVE_SOCKADDR_SA_LEN 1 _ACEOF @@ -4654,7 +4656,7 @@ echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF -#define HAVE_SOLARIS +#define HAVE_SOLARIS 1 _ACEOF HAVE_SOLARIS=yes @@ -4673,6 +4675,98 @@ rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +# Is this MacOS X? +echo "$as_me:$LINENO: checking for MacOS X" >&5 +echo $ECHO_N "checking for MacOS X... $ECHO_C" >&6 +if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + +#if defined (__APPLE__) && defined (__MACH__) + exit(0); +#else + exit(-1); +#endif + + ; + return 0; +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MACOSX 1 +_ACEOF + + HAVE_MACOSX=yes + +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +# Handle --enable-noselect-default +# Check whether --enable-noselect-default or --disable-noselect-default was given. +if test "${enable_noselect_default+set}" = set; then + enableval="$enable_noselect_default" + + NOSELECT_DEFAULT=$enable_noselect_default + +else + + if test "$HAVE_MACOSX" = "yes"; then + NOSELECT_DEFAULT=yes + else + NOSELECT_DEFAULT=no + fi + +fi; +if test "$NOSELECT_DEFAULT" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define NOSELECT_DEFAULT 1 +_ACEOF + +fi + # Handle --enable-track-default=IP|PORT # Check whether --enable-track-default or --disable-track-default was given. if test "${enable_track_default+set}" = set; then @@ -4700,13 +4794,13 @@ if test "$TRACK_DEFAULT" = "port"; then cat >>confdefs.h <<\_ACEOF -#define TRACK_PORT_DEFAULT +#define TRACK_PORT_DEFAULT 1 _ACEOF else cat >>confdefs.h <<\_ACEOF -#define TRACK_ID_DEFAULT +#define TRACK_ID_DEFAULT 1 _ACEOF fi diff -ru -b -P tcptraceroute-1.5beta1/configure.ac tcptraceroute-1.5beta2/configure.ac --- tcptraceroute-1.5beta1/configure.ac Sun May 25 02:21:11 2003 +++ tcptraceroute-1.5beta2/configure.ac Mon May 26 04:06:19 2003 @@ -87,7 +87,7 @@ [ unsigned int i = sizeof(((struct sockaddr *)0)->sa_len) ])], [ AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_SOCKADDR_SA_LEN], [], [Has socket.sa_len]) + AC_DEFINE([HAVE_SOCKADDR_SA_LEN], 1, [Has socket.sa_len]) ], [ AC_MSG_RESULT(no) ]) @@ -116,12 +116,45 @@ ]) ],[ AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_SOLARIS], [], [Is this a Solaris system?]) + AC_DEFINE([HAVE_SOLARIS], 1, [Is this a Solaris system?]) HAVE_SOLARIS=yes ],[ AC_MSG_RESULT(no) ]) +# Is this MacOS X? +AC_MSG_CHECKING(for MacOS X) +AC_RUN_IFELSE([AC_LANG_PROGRAM( [], [ +#if defined (__APPLE__) && defined (__MACH__) + exit(0); +#else + exit(-1); +#endif + ]) + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_MACOSX], 1, [Is this a MacOS X system?]) + HAVE_MACOSX=yes + ],[ + AC_MSG_RESULT(no) + ]) + +# Handle --enable-noselect-default +AC_ARG_ENABLE(noselect-default, + AC_HELP_STRING([--enable-noselect-default], [default to not using select(2)]), + [ + NOSELECT_DEFAULT=$enable_noselect_default + ], [ + if test "$HAVE_MACOSX" = "yes"; then + NOSELECT_DEFAULT=yes + else + NOSELECT_DEFAULT=no + fi + ]) +if test "$NOSELECT_DEFAULT" = "yes"; then + AC_DEFINE(NOSELECT_DEFAULT, 1, [Use select(2) by default?]) +fi + # Handle --enable-track-default=IP|PORT AC_ARG_ENABLE(track-default, AC_HELP_STRING([--enable-track-default=PORT|ID], [default to tracking probes by PORT or ID]), @@ -141,9 +174,9 @@ fi ]) if test "$TRACK_DEFAULT" = "port"; then - AC_DEFINE(TRACK_PORT_DEFAULT, [], [Track ports by default]) + AC_DEFINE(TRACK_PORT_DEFAULT, 1, [Track ports by default]) else - AC_DEFINE(TRACK_ID_DEFAULT, [], [Track IP IDs by default]) + AC_DEFINE(TRACK_ID_DEFAULT, 1, [Track IP IDs by default]) fi # Handle --enable-default-port=N diff -ru -b -P tcptraceroute-1.5beta1/stamp-h.in tcptraceroute-1.5beta2/stamp-h.in --- tcptraceroute-1.5beta1/stamp-h.in Sun May 25 02:24:30 2003 +++ tcptraceroute-1.5beta2/stamp-h.in Mon May 26 04:32:11 2003 @@ -1 +0,0 @@ -timestamp diff -ru -b -P tcptraceroute-1.5beta1/tcptraceroute.c tcptraceroute-1.5beta2/tcptraceroute.c --- tcptraceroute-1.5beta1/tcptraceroute.c Sun May 25 02:02:48 2003 +++ tcptraceroute-1.5beta2/tcptraceroute.c Mon May 26 03:59:16 2003 @@ -281,13 +281,13 @@ void usage(void) { - printf("\ntcptraceroute %s\n%s\n", VERSION, BANNER); + printf("\n%s %s\n%s\n", PACKAGE, VERSION, BANNER); fatal("Usage: %s [-nNFSAE] [-i ] [-f ]\n [-l ] [-q ] [-t ]\n [-m ] [-pP] ] [-s ]\n [-w ] [destination port] [packet length]\n\n", name); } void about(void) { - printf("\ntcptraceroute %s\n%s\n", VERSION, BANNER); + printf("\n%s %s\n%s\n", PACKAGE, VERSION, BANNER); exit(0); } @@ -1763,9 +1763,14 @@ o_dontfrag = 0; o_timeout = 3; o_nofilter = 0; - o_noselect = 0; o_nogetinterfaces = 0; +#ifdef NOSELECT_DEFAULT + o_noselect = 1; +#else + o_noselect = 0; +#endif + #ifdef TRACK_PORT_DEFAULT o_trackport = 1; #else @@ -1860,7 +1865,7 @@ case 'd': o_debug++; - debug("tcptraceroute %s\n", VERSION); + debug("%s %s\n", PACKAGE, VERSION); debug("Compiled with libpcap %s, libnet %s (API %d)\n", pcap_version, LIBNET_VERSION, LIBNET_API_VERSION); break;