Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: Install mtr via Fink UNIX
I really love Matt's traceroute (MTR) for troubleshooting network problems. The problem is I've had no luck compiling it from source ... I mean I only have three versions of gcc on my Mac. So here's how I did it. First I'm using the latest version of Fink, and I ran:
 % fink selfupdate
 % fink update-all
Then I copied this file:
/sw/fink/10.2-gcc3.3/unstable/main/finkinfo/net/mtr.info
into this directory:
/sw/fink/dists/unstable/main/finkinfo/net
and ran fink install mtr. Fink installed it like a champ. There's a section under the FAQ's on the Fink page that describes this, but the path to the mtr.info file above is slightly out of date.
    •    
  • Currently 2.86 / 5
  You rated: 4 / 5 (7 votes cast)
 
[11,040 views]  

10.3: Install mtr via Fink | 13 comments | Create New Account
Click here to return to the '10.3: Install mtr via Fink' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Install mtr via Fink
Authored by: blakers on Nov 28, '03 12:12:23PM

hi there,

i use MTR on Panther -- useful little utility!

for me, it builds/runs w/o a problem directly from source, not from fink ...

couple of questions: a simple:

./configure
make
make install
should do the trick!

if not, feel free to post any errors you get, and i'll take a stab ...

richard

[ Reply to This | # ]
10.3: Install mtr via Fink
Authored by: AaronAdams on Nov 28, '03 04:33:15PM
Using OS X 10.3.1 and the latest Xcode / developer tools update, no fink installed:

[PowerBook:~/Desktop/mtr-0.54] aaron% ./configure
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking size of unsigned char... 1
checking size of unsigned short... 2
checking size of unsigned int... 4
checking size of unsigned long... 4
checking for tgetent in -ltermcap... yes
checking for initscr... yes
checking for attron... yes
checking how to run the C preprocessor... gcc -E
checking for ncurses.h... yes
checking for ncurses/curses.h... no
checking for curses.h... yes
checking for cursesX.h... no
checking for sys/types.h... yes
checking for sys/xti.h... no
checking for floor in -lm... yes
checking for gtk-config... no
checking for GTK - version >= 1.0.0... no
*** The gtk-config script installed by GTK could not be found
*** If GTK was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GTK_CONFIG environment variable to the
*** full path to gtk-config.
configure: warning: Building without GTK+ display support
checking for socket... yes
checking for gethostbyname... yes
checking for seteuid... yes
checking for res_mkquery... yes
checking for herror... yes
checking for strerror... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
creating img/Makefile
creating config.h
[PowerBook:~/Desktop/mtr-0.54] aaron% make
make  all-recursive
Making all in img
make[2]: Nothing to be done for `all'.
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c mtr.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c net.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c dns.c
dns.c:242: error: `PACKETSZ' undeclared here (not in a function)
dns.c: In function `dorequest':
dns.c:746: error: `PACKETSZ' undeclared (first use in this function)
dns.c:746: error: (Each undeclared identifier is reported only once
dns.c:746: error: for each function it appears in.)
dns.c:747: error: `QUERY' undeclared (first use in this function)
dns.c:747: error: `C_IN' undeclared (first use in this function)
dns.c: In function `resendrequest':
dns.c:760: error: `T_A' undeclared (first use in this function)
dns.c:767: error: `T_PTR' undeclared (first use in this function)
dns.c: In function `parserespacket':
dns.c:857: error: `NOERROR' undeclared (first use in this function)
dns.c:884: error: `MAXDNAME' undeclared (first use in this function)
dns.c:909: error: `C_IN' undeclared (first use in this function)
dns.c:916: error: `T_PTR' undeclared (first use in this function)
dns.c:976: error: `T_CNAME' undeclared (first use in this function)
dns.c:983: error: `T_A' undeclared (first use in this function)
dns.c:1059: error: `NXDOMAIN' undeclared (first use in this function)
dns.c: In function `dns_ack':
dns.c:1076: error: `PACKETSZ' undeclared (first use in this function)
dns.c: In function `dns_events':
dns.c:1126: error: `T_PTR' undeclared (first use in this function)
dns.c: In function `dns_lookup2':
dns.c:1185: error: `T_PTR' undeclared (first use in this function)
/usr/include/ctype.h: At top level:
dns.c:242: error: storage size of `resrecvbuf' isn't known
make[2]: *** [dns.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2


[ Reply to This | # ]
10.3: Install mtr via Fink
Authored by: blakers on Nov 28, '03 05:25:28PM
aha! dns issues ...

NOTE: panther ships with BIND9, rather than BIND8 as 10.2.x did

many OpenSource packages still depend on the BIND8 libs/headers being around.

that said, Apple's provided a compatibiltiy header that helps
solve the problem. i've built BIND8 elsewhere in my system,
so it didn't obviously crop up ...

try the following:

% cd /usr/ports/mtr-0.54

% make distclean
% unsetenv CFLAGS CPPFLAGS CXX CXXFLAGS LDFLAGS LDDLFLAGS LD_PREBIND
% setenv LDFLAGS "-lresolv"

% vi /usr/ports/dns.c
ADD the following line ...

        #include <arpa/nameser.h>
+++     #include <arpa/nameser8_compat.h>
do a little clean up ...

% glibtoolize --force --copy
% aclocal
% autoconf


% ./configure \
--prefix=/usr/local

% make
% make install

that *should* do the trick ... let me know if not!

cheers,

richard

[ Reply to This | # ]
10.3: Install mtr via Fink
Authored by: AaronAdams on Nov 28, '03 06:12:57PM
Fantastic! That worked great. Thank you very much for your help.

For less experienced users, the only thing I would add to your instructions is that the make install will place the mtr executable in /usr/local/sbin, which is not in OS X's default path. You may want to adjust your path accordingly, or move the executable to a directory already in the path, such as /sbin or /usr/sbin, with a command like:

sudo mv /usr/local/sbin/mtr /sbin


[ Reply to This | # ]
10.3: Install mtr via Fink
Authored by: blakers on Nov 28, '03 07:40:31PM

its been so long since i used the *default* path that i forgot this ... thanks!

note that the /usr/local hierarchy is, in principle, protected in that it
*should not* be touched/overwritten/etc by any Apple updates,
where as the / & /usr hierarchies are at their mercy ...

so, imho, i'd in general recommend the 'add /usr/local/sbin to your
path' approach ... or be diligent about checking/restoring *your*
installs after any from Apple!

richard



[ Reply to This | # ]
10.3: Install mtr via Fink
Authored by: sighsigh on Nov 30, '03 04:13:59AM

It is generally better to declare
#define BIND_8_COMPAT 1
in config.h
or to extend configure to detect this
rather than to just include an extra header file.



[ Reply to This | # ]
10.3: Install mtr via Fink
Authored by: below on Dec 17, '03 06:03:40AM

As I am not an experience autoconfer, would there be someone to update the configure script for mtr?

Apparently quite a few people use it on OS X 10.3

Alex



[ Reply to This | # ]
oops ... correction
Authored by: blakers on Nov 28, '03 05:34:32PM
that's:

% vi /usr/ports/mtr-0.54/dns.c
NOT:

% vi /usr/ports/dns.c
richard

[ Reply to This | # ]
10.3: Install mtr via Fink
Authored by: macubergeek on Nov 29, '03 11:25:49AM

Heh,
yeh i had problems compiling from source myself, which is why I went the fink route



[ Reply to This | # ]
Try DarwinPorts instead
Authored by: mikerose on Nov 29, '03 06:09:27PM

mtr installs cleanly using DarwinPorts:

sudo port install mtr

leaves a lovely executable in /opt/local/sbin with no trouble 'tall.

(I like mtr for obvious reasons)...

--Michael T. Rose



[ Reply to This | # ]
10.3: Install mtr via Fink
Authored by: mule on Nov 30, '03 05:40:23PM

Just a side note. We, at Fink, really would like to see _you_ (our users) notifying the maintainers. This means that you are _of course_ allowed to do what is described in this hint, but the maintainer or fink-devel should be notified that a "move to 10.3" is being requested. That way your improvements (which you might have made) can be given back to everyone.

Thanks

(dmalloc)



[ Reply to This | # ]
10.3: Install mtr from Source
Authored by: vladimus on Nov 30, '03 05:40:31PM
To summarize an earlier discussion:
If you don't want to install Fink, or go through configuring DarwinPorts, here's how you can compile mtr from source in Panther:

1. Download mtr at ftp://ftp.bitwizard.nl/mtr/mtr-0.54.tar.gz (the latest version as of this writing). Decompress the downloaded file, if needed.

2. Inside the decompressed folder, open "config.h" inside your favorite text editor. Add the line
#define BIND_8_COMPAT 1

3. In terminal, cd to the decompressed folder, and type in the standard compilation commands:
./configure
make
make install

4. Type mtr in Terminal. If the program doesn't run, you'll need to make sure /usr/local/sbin is in your command path. If you don't know how, here's what you need to do:

In bash, create ".profile" in your home directory if it doesn't already exist, and add/change the following line:
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

For tcsh, add/change this line in ".tcshrc" in your home directory:
set path = ( /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin )

[ Reply to This | # ]

10.3: Install mtr from Source
Authored by: AaronAdams on Dec 01, '03 03:47:39PM
Should config.h be config.h.in?

[ Reply to This | # ]