Import Upstream version 0.28
Samuel Henrique
5 years ago
0 | ||
0 | 1 | Matt Kimball <mkimball@xmission.com> is the primary author of mtr. |
2 | ||
3 | Roger Wolff <R.E.Wolff@BitWizard.nl> is currently maintaing mtr. | |
4 | ||
1 | 5 | |
2 | 6 | Bug reports and feature requests should be sent to the mtr |
3 | 7 | mailing list. See the README file for details. |
4 | 8 | |
5 | 9 | Thanks to everyone who has provided feedback on mtr. |
6 | 10 | |
7 | Thanks especially to those of you who have sent me code: | |
11 | Thanks especially to those of you who have sent code: | |
8 | 12 | |
9 | 13 | Brian Casey, Mircea Damian, Christophe Kalt, Simon Kirby, |
10 | Anand Kumria, Charles Levert, Russell Nelson, | |
11 | Aaron Scarisbrick, Andrew Stesin, Juha Takala, Rogier Wolff | |
14 | Anand Kumria, Bertrand Leconte, Charles Levert, Alexander | |
15 | V. Lukyanov, Russell Nelson, Aaron Scarisbrick, Andrew | |
16 | Stesin, Juha Takala. | |
12 | 17 | and anyone who has slipped through the cracks of my mail file. |
0 | ||
1 | The "split" format is for a separating the gui from the main program. | |
2 | The main program can be installed setuid, and you don't want to link a | |
3 | gui-library with a setuid program. | |
4 | ||
5 | ||
6 | The split format is: | |
7 | ||
8 | <pos> <host> <loss%> <rcvd pckts> <sent pckts> <best> <avg> <worst> | |
9 | ||
10 | ||
11 | The "raw" format is: | |
12 | ||
13 | hostline|pingline|dnsline|timestampline | |
14 | ||
15 | hostline: | |
16 | h <pos> <host IP> | |
17 | ||
18 | pingline: | |
19 | p <pos> <pingtime (ms)> | |
20 | ||
21 | dnsline: | |
22 | d <pos> <hostname> | |
23 | ||
24 | timestampline: | |
25 | t <pos> <pingtime> <timestamp> | |
26 | ||
27 | ||
28 | Timestampline is not yet implemented. Need to find out how to do | |
29 | ICMP timestamping first. :-) | |
30 |
7 | 7 | mtr_SOURCES = mtr.c \ |
8 | 8 | net.c net.h \ |
9 | 9 | dns.c dns.h \ |
10 | raw.c raw.h \ | |
11 | split.c split.h \ | |
10 | 12 | display.c display.h \ |
11 | 13 | report.c report.h \ |
12 | 14 | getopt.c getopt1.c getopt.h \ |
19 | 21 | mtr_LDFLAGS = $(GTK_OBJ) $(CURSES_OBJ) |
20 | 22 | |
21 | 23 | EXTRA_DIST = SECURITY mtr.8 |
24 | ||
25 | DISTCLEANFILES = *~ | |
26 |
0 | # Makefile.in generated automatically by automake 1.2d from Makefile.am | |
0 | # Makefile.in generated automatically by automake 1.2 from Makefile.am | |
1 | 1 | |
2 | 2 | # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. |
3 | 3 | # This Makefile.in is free software; the Free Software Foundation |
4 | # gives unlimited permission to copy and/or distribute it, | |
5 | # with or without modifications, as long as this notice is preserved. | |
6 | ||
7 | # This program is distributed in the hope that it will be useful, | |
8 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
9 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
10 | # PARTICULAR PURPOSE. | |
4 | # gives unlimited permission to copy, distribute and modify it. | |
11 | 5 | |
12 | 6 | |
13 | 7 | SHELL = /bin/sh |
48 | 42 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
49 | 43 | transform = @program_transform_name@ |
50 | 44 | |
51 | NORMAL_INSTALL = : | |
52 | PRE_INSTALL = : | |
53 | POST_INSTALL = : | |
54 | NORMAL_UNINSTALL = : | |
55 | PRE_UNINSTALL = : | |
56 | POST_UNINSTALL = : | |
45 | NORMAL_INSTALL = true | |
46 | PRE_INSTALL = true | |
47 | POST_INSTALL = true | |
48 | NORMAL_UNINSTALL = true | |
49 | PRE_UNINSTALL = true | |
50 | POST_UNINSTALL = true | |
57 | 51 | CC = @CC@ |
58 | 52 | CURSES_OBJ = @CURSES_OBJ@ |
59 | 53 | GTK_CFLAGS = @GTK_CFLAGS@ |
72 | 66 | mtr_SOURCES = mtr.c \ |
73 | 67 | net.c net.h \ |
74 | 68 | dns.c dns.h \ |
69 | raw.c raw.h \ | |
70 | split.c split.h \ | |
75 | 71 | display.c display.h \ |
76 | 72 | report.c report.h \ |
77 | 73 | getopt.c getopt1.c getopt.h \ |
84 | 80 | mtr_LDFLAGS = $(GTK_OBJ) $(CURSES_OBJ) |
85 | 81 | |
86 | 82 | EXTRA_DIST = SECURITY mtr.8 |
83 | ||
84 | DISTCLEANFILES = *~ | |
87 | 85 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
88 | 86 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
89 | 87 | CONFIG_HEADER = config.h |
95 | 93 | CPPFLAGS = @CPPFLAGS@ |
96 | 94 | LDFLAGS = @LDFLAGS@ |
97 | 95 | LIBS = @LIBS@ |
98 | mtr_OBJECTS = mtr.o net.o dns.o display.o report.o getopt.o getopt1.o \ | |
99 | select.o | |
96 | mtr_OBJECTS = mtr.o net.o dns.o raw.o split.o display.o report.o \ | |
97 | getopt.o getopt1.o select.o | |
100 | 98 | mtr_LDADD = $(LDADD) |
101 | 99 | CFLAGS = @CFLAGS@ |
102 | 100 | COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) |
105 | 103 | |
106 | 104 | NROFF = nroff |
107 | 105 | DIST_COMMON = README AUTHORS COPYING INSTALL Makefile.am Makefile.in \ |
108 | NEWS acconfig.h aclocal.m4 config.h.in configure configure.in \ | |
106 | NEWS TODO acconfig.h aclocal.m4 config.h.in configure configure.in \ | |
109 | 107 | install-sh missing mkinstalldirs stamp-h.in |
110 | 108 | |
111 | 109 | |
119 | 117 | default: all |
120 | 118 | |
121 | 119 | .SUFFIXES: |
122 | .SUFFIXES: .S .c .o .s | |
120 | .SUFFIXES: .c .o | |
123 | 121 | $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) |
124 | 122 | cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile |
125 | 123 | |
136 | 134 | cd $(srcdir) && $(AUTOCONF) |
137 | 135 | |
138 | 136 | config.h: stamp-h |
139 | @: | |
140 | 137 | stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status |
141 | 138 | cd $(top_builddir) \ |
142 | 139 | && CONFIG_FILES= CONFIG_HEADERS=config.h \ |
152 | 149 | clean-hdr: |
153 | 150 | |
154 | 151 | distclean-hdr: |
155 | -rm -f config.h | |
152 | rm -f config.h | |
156 | 153 | |
157 | 154 | maintainer-clean-hdr: |
158 | 155 | |
159 | 156 | mostlyclean-sbinPROGRAMS: |
160 | 157 | |
161 | 158 | clean-sbinPROGRAMS: |
162 | -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) | |
159 | test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) | |
163 | 160 | |
164 | 161 | distclean-sbinPROGRAMS: |
165 | 162 | |
184 | 181 | .c.o: |
185 | 182 | $(COMPILE) -c $< |
186 | 183 | |
187 | .s.o: | |
188 | $(COMPILE) -c $< | |
189 | ||
190 | .S.o: | |
191 | $(COMPILE) -c $< | |
192 | ||
193 | 184 | mostlyclean-compile: |
194 | -rm -f *.o core | |
185 | rm -f *.o core | |
195 | 186 | |
196 | 187 | clean-compile: |
197 | 188 | |
198 | 189 | distclean-compile: |
199 | -rm -f *.tab.c | |
190 | rm -f *.tab.c | |
200 | 191 | |
201 | 192 | maintainer-clean-compile: |
202 | 193 | |
216 | 207 | uninstall-man: |
217 | 208 | $(NORMAL_UNINSTALL) |
218 | 209 | inst=`echo "mtr" | sed '$(transform)'`.8; \ |
219 | -rm -f $(mandir)/man8/$$inst | |
210 | rm -f $(mandir)/man8/$$inst | |
220 | 211 | |
221 | 212 | |
222 | 213 | # This directory's subdirectories are mostly independent; you can cd |
232 | 223 | installdirs-recursive install-recursive uninstall-recursive \ |
233 | 224 | check-recursive installcheck-recursive info-recursive dvi-recursive: |
234 | 225 | @set fnord $(MAKEFLAGS); amf=$$2; \ |
235 | list='$(SUBDIRS)'; for subdir in $$list; do \ | |
226 | for subdir in $(SUBDIRS); do \ | |
236 | 227 | target=`echo $@ | sed s/-recursive//`; \ |
237 | 228 | echo "Making $$target in $$subdir"; \ |
238 | 229 | (cd $$subdir && $(MAKE) $$target) \ |
242 | 233 | mostlyclean-recursive clean-recursive distclean-recursive \ |
243 | 234 | maintainer-clean-recursive: |
244 | 235 | @set fnord $(MAKEFLAGS); amf=$$2; \ |
245 | rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ | |
246 | rev="$$subdir $$rev"; \ | |
247 | done; \ | |
236 | rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \ | |
248 | 237 | for subdir in $$rev; do \ |
249 | 238 | target=`echo $@ | sed s/-recursive//`; \ |
250 | 239 | echo "Making $$target in $$subdir"; \ |
258 | 247 | |
259 | 248 | tags: TAGS |
260 | 249 | |
261 | ID: $(HEADERS) $(SOURCES) $(LISP) | |
262 | here=`pwd` && cd $(srcdir) \ | |
263 | && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) | |
264 | ||
265 | TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) | |
250 | ID: $(HEADERS) $(SOURCES) | |
251 | here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS) | |
252 | ||
253 | TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) | |
266 | 254 | tags=; \ |
267 | 255 | here=`pwd`; \ |
268 | 256 | list='$(SUBDIRS)'; for subdir in $$list; do \ |
269 | 257 | test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ |
270 | 258 | done; \ |
271 | test -z "$(ETAGS_ARGS)config.h.in$(SOURCES)$(HEADERS)$(LISP)$$tags" \ | |
272 | || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $(SOURCES) $(HEADERS) $(LISP) -o $$here/TAGS) | |
259 | test -z "$(ETAGS_ARGS)config.h.in$(SOURCES)$(HEADERS)$$tags" \ | |
260 | || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $(SOURCES) $(HEADERS) -o $$here/TAGS) | |
273 | 261 | |
274 | 262 | mostlyclean-tags: |
275 | 263 | |
276 | 264 | clean-tags: |
277 | 265 | |
278 | 266 | distclean-tags: |
279 | -rm -f TAGS ID | |
267 | rm -f TAGS ID | |
280 | 268 | |
281 | 269 | maintainer-clean-tags: |
282 | 270 | |
287 | 275 | # it guarantees that the distribution is self-contained by making another |
288 | 276 | # tarfile. |
289 | 277 | distcheck: dist |
290 | -rm -rf $(distdir) | |
278 | rm -rf $(distdir) | |
291 | 279 | GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz |
292 | 280 | mkdir $(distdir)/=build |
293 | 281 | mkdir $(distdir)/=inst |
300 | 288 | && $(MAKE) install \ |
301 | 289 | && $(MAKE) installcheck \ |
302 | 290 | && $(MAKE) dist |
303 | -rm -rf $(distdir) | |
291 | rm -rf $(distdir) | |
304 | 292 | @echo "========================"; \ |
305 | 293 | echo "$(distdir).tar.gz is ready for distribution"; \ |
306 | 294 | echo "========================" |
307 | 295 | dist: distdir |
308 | 296 | -chmod -R a+r $(distdir) |
309 | 297 | GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) |
310 | -rm -rf $(distdir) | |
298 | rm -rf $(distdir) | |
311 | 299 | dist-all: distdir |
312 | 300 | -chmod -R a+r $(distdir) |
313 | 301 | GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) |
314 | -rm -rf $(distdir) | |
302 | rm -rf $(distdir) | |
315 | 303 | distdir: $(DISTFILES) |
316 | -rm -rf $(distdir) | |
304 | rm -rf $(distdir) | |
317 | 305 | mkdir $(distdir) |
318 | 306 | -chmod 777 $(distdir) |
319 | 307 | @for file in $(DISTFILES); do \ |
322 | 310 | || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ |
323 | 311 | || cp -p $$d/$$file $(distdir)/$$file; \ |
324 | 312 | done |
325 | for subdir in $(SUBDIRS); do \ | |
326 | test -d $(distdir)/$$subdir \ | |
327 | || mkdir $(distdir)/$$subdir \ | |
328 | || exit 1; \ | |
329 | chmod 777 $(distdir)/$$subdir; \ | |
330 | (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ | |
313 | for subdir in $(SUBDIRS); do \ | |
314 | test -d $(distdir)/$$subdir \ | |
315 | || mkdir $(distdir)/$$subdir \ | |
316 | || exit 1; \ | |
317 | chmod 777 $(distdir)/$$subdir; \ | |
318 | (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ | |
331 | 319 | || exit 1; \ |
332 | 320 | done |
333 | curses.o curses.lo: curses.c config.h mtr-curses.h display.h net.h dns.h | |
334 | display.o display.lo: display.c config.h display.h mtr-curses.h \ | |
335 | mtr-gtk.h report.h select.h | |
336 | dns.o dns.lo: dns.c config.h | |
337 | getopt.o getopt.lo: getopt.c config.h | |
338 | getopt1.o getopt1.lo: getopt1.c config.h getopt.h | |
339 | gtk.o gtk.lo: gtk.c config.h net.h dns.h mtr-gtk.h img/mtr_icon.xpm | |
340 | mtr.o mtr.lo: mtr.c config.h mtr-curses.h getopt.h display.h dns.h \ | |
341 | report.h net.h | |
342 | net.o net.lo: net.c config.h net.h | |
343 | report.o report.lo: report.c config.h report.h net.h | |
344 | select.o select.lo: select.c config.h display.h dns.h net.h | |
345 | ||
346 | 321 | info: info-recursive |
347 | 322 | dvi: dvi-recursive |
348 | 323 | check: all-am |
379 | 354 | |
380 | 355 | |
381 | 356 | mostlyclean-generic: |
382 | -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) | |
357 | test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) | |
383 | 358 | |
384 | 359 | clean-generic: |
385 | -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) | |
360 | test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) | |
386 | 361 | |
387 | 362 | distclean-generic: |
388 | -rm -f Makefile $(DISTCLEANFILES) | |
389 | -rm -f config.cache config.log stamp-h stamp-h[0-9]* | |
390 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | |
363 | rm -f Makefile $(DISTCLEANFILES) | |
364 | rm -f config.cache config.log stamp-h stamp-h[0-9]* | |
365 | test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | |
391 | 366 | |
392 | 367 | maintainer-clean-generic: |
393 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | |
394 | -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) | |
368 | test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | |
369 | test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) | |
395 | 370 | mostlyclean-am: mostlyclean-hdr mostlyclean-sbinPROGRAMS \ |
396 | 371 | mostlyclean-compile mostlyclean-tags \ |
397 | 372 | mostlyclean-generic |
411 | 386 | clean: clean-recursive clean-am |
412 | 387 | |
413 | 388 | distclean: distclean-recursive distclean-am |
414 | -rm -f config.status | |
389 | rm -f config.status | |
415 | 390 | |
416 | 391 | maintainer-clean: maintainer-clean-recursive maintainer-clean-am |
417 | 392 | @echo "This command is intended for maintainers to use;" |
418 | 393 | @echo "it deletes files that may require special tools to rebuild." |
419 | -rm -f config.status | |
394 | rm -f config.status | |
420 | 395 | |
421 | 396 | .PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \ |
422 | 397 | maintainer-clean-hdr mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS \ |
0 | 0 | WHAT'S NEW? |
1 | ||
2 | v0.27 | |
3 | Fixed bug that showed up on Solaris/x86. | |
4 | Gimp mainloop now runs as it's supposed to. | |
5 | ||
6 | v0.26 | |
7 | Added "-n" flag for numeric output. | |
8 | fixed IP numbers displaying backwards. | |
9 | GTK mainloop now runs at 10 packets per second. | |
10 | - That's too much if there are only 3 hosts | |
11 | - that's too little if there are 20 hosts. | |
12 | -> Someone tell me how to change the "ping-timeout" | |
13 | callback time in gtk. Can't find it in the docs. | |
14 | The default for "hostname" is now "localhost" so that | |
15 | you can start mtr without any arguments and later | |
16 | fill in the host you want to trace to. | |
17 | ||
18 | v0.25 | |
19 | Included two "raw" formats. One for separating GUI from | |
20 | the setuid program, and one suitable for later parsing and | |
21 | displaying. Volunteers wanted to separate the GTK | |
22 | backend. Thanks to Bertrand Leconte for contributing | |
23 | the format that's now called "split". | |
24 | ||
25 | v0.24 | |
26 | Fixed number of probes. Accidentally was counted per | |
27 | packet sent instead of per round of packets. | |
28 | ||
29 | v0.23 | |
30 | Fixed Sparc alignment problem with statmalloc | |
31 | ||
32 | v0.22 | |
33 | Roger has take over maintenance. | |
34 | mtr now uses an "int" to pass options to the kernel. | |
35 | Makes things work on Solaris and *BSD I'm told. | |
36 | mtr doesn't fire off a flurry of packets when a new | |
37 | second comes around. Instead they are spaced evenly | |
38 | around the whole second. This allows people with a | |
39 | relatively slow first link to do meaningful measurements | |
40 | of whatever is behind that. | |
1 | 41 | |
2 | 42 | v0.21 |
3 | 43 | mtr now drops root permissions after it acquires the raw |
31 | 31 | |
32 | 32 | WHERE CAN I GET THE LATEST VERSION OR MORE INFORMATION? |
33 | 33 | |
34 | See the mtr web page at 'http://www.mkimball.org/mtr.html'. | |
34 | See the mtr web page at | |
35 | http://www.BitWizard.nl/mtr/ | |
35 | 36 | |
36 | 37 | Subscribe to the mtr mailing list. All mtr related announcements |
37 | 38 | are posted to the mtr mailing list. To subscribe, send email to |
41 | 42 | |
42 | 43 | Bug reports and feature requests should be sent to the mtr |
43 | 44 | mailing list. |
45 |
0 | 0 | SECURITY ISSUES RELATED TO MTR |
1 | ||
2 | You can limit mtr usage to the root user by not putting a setuid bit | |
3 | on the mtr binary. In that case, the security implications are | |
4 | minimal. | |
5 | ||
6 | Or you can make mtr setuid-root, and the following applies to you.... | |
1 | 7 | |
2 | 8 | Since mtr is installed as suid-root, some concern over security is |
3 | 9 | justified. Since version 0.21 of mtr, does the following two things |
20 | 26 | permission to write to. The only priveledge gained is access to the |
21 | 27 | raw socket descriptors, which would allow the malicious user to listen |
22 | 28 | to all ICMP packets arriving at the system, and send forged packets |
23 | with arbitrary ncontents. | |
29 | with arbitrary contents. | |
24 | 30 | |
25 | 31 | If you have further questions or comments about security issues, |
26 | 32 | please direct them to the mtr mailing list. See README for details. |
0 | ||
1 | - Stuff to implement: | |
2 | ||
3 | - Allow mtr to log the return packets, for later analysis. | |
4 | Done: 0.25 . Todo: allow the userinterface(s) to work while | |
5 | still logging to a file. | |
6 | ||
7 | - Request timestamping at the remote site. | |
8 | Andreas Fasbender has an algorithm that will allow us to | |
9 | convert these measurements into one-way measurements, not just | |
10 | round-trip. | |
11 | ||
12 | - Allow mtr to also send larger packets. | |
13 | This will enable us to get a feel for the speed of the links | |
14 | we're traversing. (Van Jacobson was working on this His tool | |
15 | was slow, mtr will rock with this feature.... :-) | |
16 | (Anybody have the statistics experience to tell me how | |
17 | to do the data analysis?) | |
18 | ||
19 | - Allow MTR to keep on getting the icmp host unreachables, and | |
20 | work through that. Some hosts don't answer PINGs. | |
21 | - Auto-switch to that strategy if "host is known, but 10/10 | |
22 | pings got lost" | |
23 | ||
24 | - The "don't probe all hosts at once" strategy can be improved a bit. | |
25 | It should not probe more than 10 unknown hosts, but the counter need | |
26 | not be reset at the start of the "round". This way if you probe | |
27 | slowly (relative to the RTT time to the end host), it can probe | |
28 | all hosts in the first "round". | |
29 | ||
30 | ||
31 | - Bugs to fix? | |
32 | - ? | |
33 |
0 | dnl aclocal.m4 generated automatically by aclocal 1.2d | |
1 | ||
2 | dnl Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. | |
3 | dnl This Makefile.in is free software; the Free Software Foundation | |
4 | dnl gives unlimited permission to copy and/or distribute it, | |
5 | dnl with or without modifications, as long as this notice is preserved. | |
6 | ||
7 | dnl This program is distributed in the hope that it will be useful, | |
8 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
9 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
10 | dnl PARTICULAR PURPOSE. | |
0 | dnl aclocal.m4 generated automatically by aclocal 1.2 | |
11 | 1 | |
12 | 2 | # Do all the work for Automake. This macro actually does too much -- |
13 | 3 | # some checks are only needed if your package does certain things. |
31 | 21 | ifelse([$3],, |
32 | 22 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") |
33 | 23 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) |
34 | AC_REQUIRE([AM_SANITY_CHECK]) | |
35 | AC_REQUIRE([AC_ARG_PROGRAM]) | |
24 | AM_SANITY_CHECK | |
25 | AC_ARG_PROGRAM | |
36 | 26 | dnl FIXME This is truly gross. |
37 | 27 | missing_dir=`cd $ac_aux_dir && pwd` |
38 | 28 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
40 | 30 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
41 | 31 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
42 | 32 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
43 | AC_REQUIRE([AC_PROG_MAKE_SET])]) | |
33 | AC_PROG_MAKE_SET]) | |
44 | 34 | |
45 | 35 | |
46 | 36 | # serial 1 |
67 | 57 | # directory). |
68 | 58 | if ( |
69 | 59 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
70 | if test "[$]*" = "X"; then | |
60 | if test "$@" = "X"; then | |
71 | 61 | # -L didn't work. |
72 | 62 | set X `ls -t $srcdir/configure conftestfile` |
73 | 63 | fi |
74 | if test "[$]*" != "X $srcdir/configure conftestfile" \ | |
75 | && test "[$]*" != "X conftestfile $srcdir/configure"; then | |
76 | ||
77 | # If neither matched, then we have a broken ls. This can happen | |
78 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
79 | # broken ls alias from the environment. This has actually | |
80 | # happened. Such a system could not be considered "sane". | |
81 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
82 | alias in your environment]) | |
83 | fi | |
84 | ||
85 | 64 | test "[$]2" = conftestfile |
86 | 65 | ) |
87 | 66 | then |
173 | 152 | main () |
174 | 153 | { |
175 | 154 | int major, minor, micro; |
155 | char *tmp_version; | |
176 | 156 | |
177 | 157 | system ("touch conf.gtktest"); |
178 | 158 | |
179 | if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) { | |
159 | /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
160 | tmp_version = g_strdup("$min_gtk_version"); | |
161 | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
180 | 162 | printf("%s, bad version string\n", "$min_gtk_version"); |
181 | 163 | exit(1); |
182 | 164 | } |
605 | 605 | |
606 | 606 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' |
607 | 607 | |
608 | ||
609 | PACKAGE=mtr | |
610 | ||
611 | VERSION=0.28 | |
612 | ||
613 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
614 | { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } | |
615 | fi | |
616 | cat >> confdefs.h <<EOF | |
617 | #define PACKAGE "$PACKAGE" | |
618 | EOF | |
619 | ||
620 | cat >> confdefs.h <<EOF | |
621 | #define VERSION "$VERSION" | |
622 | EOF | |
623 | ||
608 | 624 | echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 |
609 | echo "configure:611: checking whether build environment is sane" >&5 | |
625 | echo "configure:627: checking whether build environment is sane" >&5 | |
610 | 626 | # Just in case |
611 | 627 | sleep 1 |
612 | 628 | echo timestamp > conftestfile |
617 | 633 | # directory). |
618 | 634 | if ( |
619 | 635 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
620 | if test "$*" = "X"; then | |
636 | if test "" = "X"; then | |
621 | 637 | # -L didn't work. |
622 | 638 | set X `ls -t $srcdir/configure conftestfile` |
623 | 639 | fi |
624 | if test "$*" != "X $srcdir/configure conftestfile" \ | |
625 | && test "$*" != "X conftestfile $srcdir/configure"; then | |
626 | ||
627 | # If neither matched, then we have a broken ls. This can happen | |
628 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
629 | # broken ls alias from the environment. This has actually | |
630 | # happened. Such a system could not be considered "sane". | |
631 | { echo "configure: error: ls -t appears to fail. Make sure there is not a broken | |
632 | alias in your environment" 1>&2; exit 1; } | |
633 | fi | |
634 | ||
635 | 640 | test "$2" = conftestfile |
636 | 641 | ) |
637 | 642 | then |
662 | 667 | # sed with no file args requires a program. |
663 | 668 | test "$program_transform_name" = "" && program_transform_name="s,x,x," |
664 | 669 | |
665 | echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 | |
666 | echo "configure:668: checking whether ${MAKE-make} sets \${MAKE}" >&5 | |
667 | set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` | |
668 | if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then | |
669 | echo $ac_n "(cached) $ac_c" 1>&6 | |
670 | else | |
671 | cat > conftestmake <<\EOF | |
672 | all: | |
673 | @echo 'ac_maketemp="${MAKE}"' | |
674 | EOF | |
675 | # GNU make sometimes prints "make[1]: Entering...", which would confuse us. | |
676 | eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` | |
677 | if test -n "$ac_maketemp"; then | |
678 | eval ac_cv_prog_make_${ac_make}_set=yes | |
679 | else | |
680 | eval ac_cv_prog_make_${ac_make}_set=no | |
681 | fi | |
682 | rm -f conftestmake | |
683 | fi | |
684 | if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then | |
685 | echo "$ac_t""yes" 1>&6 | |
686 | SET_MAKE= | |
687 | else | |
688 | echo "$ac_t""no" 1>&6 | |
689 | SET_MAKE="MAKE=${MAKE-make}" | |
690 | fi | |
691 | ||
692 | ||
693 | PACKAGE=mtr | |
694 | ||
695 | VERSION=0.21 | |
696 | ||
697 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
698 | { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } | |
699 | fi | |
700 | cat >> confdefs.h <<EOF | |
701 | #define PACKAGE "$PACKAGE" | |
702 | EOF | |
703 | ||
704 | cat >> confdefs.h <<EOF | |
705 | #define VERSION "$VERSION" | |
706 | EOF | |
707 | ||
708 | ||
709 | ||
710 | 670 | missing_dir=`cd $ac_aux_dir && pwd` |
711 | 671 | echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 |
712 | echo "configure:714: checking for working aclocal" >&5 | |
672 | echo "configure:674: checking for working aclocal" >&5 | |
713 | 673 | # Run test in a subshell; some versions of sh will print an error if |
714 | 674 | # an executable is not found, even if stderr is redirected. |
715 | 675 | # Redirect stdin to placate older versions of autoconf. Sigh. |
722 | 682 | fi |
723 | 683 | |
724 | 684 | echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 |
725 | echo "configure:727: checking for working autoconf" >&5 | |
685 | echo "configure:687: checking for working autoconf" >&5 | |
726 | 686 | # Run test in a subshell; some versions of sh will print an error if |
727 | 687 | # an executable is not found, even if stderr is redirected. |
728 | 688 | # Redirect stdin to placate older versions of autoconf. Sigh. |
735 | 695 | fi |
736 | 696 | |
737 | 697 | echo $ac_n "checking for working automake""... $ac_c" 1>&6 |
738 | echo "configure:740: checking for working automake" >&5 | |
698 | echo "configure:700: checking for working automake" >&5 | |
739 | 699 | # Run test in a subshell; some versions of sh will print an error if |
740 | 700 | # an executable is not found, even if stderr is redirected. |
741 | 701 | # Redirect stdin to placate older versions of autoconf. Sigh. |
748 | 708 | fi |
749 | 709 | |
750 | 710 | echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 |
751 | echo "configure:753: checking for working autoheader" >&5 | |
711 | echo "configure:713: checking for working autoheader" >&5 | |
752 | 712 | # Run test in a subshell; some versions of sh will print an error if |
753 | 713 | # an executable is not found, even if stderr is redirected. |
754 | 714 | # Redirect stdin to placate older versions of autoconf. Sigh. |
761 | 721 | fi |
762 | 722 | |
763 | 723 | echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 |
764 | echo "configure:766: checking for working makeinfo" >&5 | |
724 | echo "configure:726: checking for working makeinfo" >&5 | |
765 | 725 | # Run test in a subshell; some versions of sh will print an error if |
766 | 726 | # an executable is not found, even if stderr is redirected. |
767 | 727 | # Redirect stdin to placate older versions of autoconf. Sigh. |
773 | 733 | echo "$ac_t""missing" 1>&6 |
774 | 734 | fi |
775 | 735 | |
736 | echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 | |
737 | echo "configure:739: checking whether ${MAKE-make} sets \${MAKE}" >&5 | |
738 | set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` | |
739 | if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then | |
740 | echo $ac_n "(cached) $ac_c" 1>&6 | |
741 | else | |
742 | cat > conftestmake <<\EOF | |
743 | all: | |
744 | @echo 'ac_maketemp="${MAKE}"' | |
745 | EOF | |
746 | # GNU make sometimes prints "make[1]: Entering...", which would confuse us. | |
747 | eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` | |
748 | if test -n "$ac_maketemp"; then | |
749 | eval ac_cv_prog_make_${ac_make}_set=yes | |
750 | else | |
751 | eval ac_cv_prog_make_${ac_make}_set=no | |
752 | fi | |
753 | rm -f conftestmake | |
754 | fi | |
755 | if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then | |
756 | echo "$ac_t""yes" 1>&6 | |
757 | SET_MAKE= | |
758 | else | |
759 | echo "$ac_t""no" 1>&6 | |
760 | SET_MAKE="MAKE=${MAKE-make}" | |
761 | fi | |
776 | 762 | |
777 | 763 | |
778 | 764 | |
784 | 770 | # Extract the first word of "gcc", so it can be a program name with args. |
785 | 771 | set dummy gcc; ac_word=$2 |
786 | 772 | echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 |
787 | echo "configure:789: checking for $ac_word" >&5 | |
773 | echo "configure:775: checking for $ac_word" >&5 | |
788 | 774 | if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then |
789 | 775 | echo $ac_n "(cached) $ac_c" 1>&6 |
790 | 776 | else |
813 | 799 | # Extract the first word of "cc", so it can be a program name with args. |
814 | 800 | set dummy cc; ac_word=$2 |
815 | 801 | echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 |
816 | echo "configure:818: checking for $ac_word" >&5 | |
802 | echo "configure:804: checking for $ac_word" >&5 | |
817 | 803 | if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then |
818 | 804 | echo $ac_n "(cached) $ac_c" 1>&6 |
819 | 805 | else |
861 | 847 | fi |
862 | 848 | |
863 | 849 | echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 |
864 | echo "configure:866: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 | |
850 | echo "configure:852: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 | |
865 | 851 | |
866 | 852 | ac_ext=c |
867 | 853 | # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. |
871 | 857 | cross_compiling=$ac_cv_prog_cc_cross |
872 | 858 | |
873 | 859 | cat > conftest.$ac_ext <<EOF |
874 | #line 876 "configure" | |
860 | #line 862 "configure" | |
875 | 861 | #include "confdefs.h" |
876 | 862 | main(){return(0);} |
877 | 863 | EOF |
878 | if { (eval echo configure:880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
864 | if { (eval echo configure:866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
879 | 865 | ac_cv_prog_cc_works=yes |
880 | 866 | # If we can't run a trivial program, we are probably using a cross compiler. |
881 | 867 | if (./conftest; exit) 2>/dev/null; then |
895 | 881 | { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } |
896 | 882 | fi |
897 | 883 | echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 |
898 | echo "configure:900: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 | |
884 | echo "configure:886: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 | |
899 | 885 | echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 |
900 | 886 | cross_compiling=$ac_cv_prog_cc_cross |
901 | 887 | |
902 | 888 | echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 |
903 | echo "configure:905: checking whether we are using GNU C" >&5 | |
889 | echo "configure:891: checking whether we are using GNU C" >&5 | |
904 | 890 | if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then |
905 | 891 | echo $ac_n "(cached) $ac_c" 1>&6 |
906 | 892 | else |
909 | 895 | yes; |
910 | 896 | #endif |
911 | 897 | EOF |
912 | if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then | |
898 | if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then | |
913 | 899 | ac_cv_prog_gcc=yes |
914 | 900 | else |
915 | 901 | ac_cv_prog_gcc=no |
924 | 910 | ac_save_CFLAGS="$CFLAGS" |
925 | 911 | CFLAGS= |
926 | 912 | echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 |
927 | echo "configure:929: checking whether ${CC-cc} accepts -g" >&5 | |
913 | echo "configure:915: checking whether ${CC-cc} accepts -g" >&5 | |
928 | 914 | if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then |
929 | 915 | echo $ac_n "(cached) $ac_c" 1>&6 |
930 | 916 | else |
953 | 939 | |
954 | 940 | |
955 | 941 | echo $ac_n "checking size of unsigned char""... $ac_c" 1>&6 |
956 | echo "configure:958: checking size of unsigned char" >&5 | |
942 | echo "configure:944: checking size of unsigned char" >&5 | |
957 | 943 | if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_char'+set}'`\" = set"; then |
958 | 944 | echo $ac_n "(cached) $ac_c" 1>&6 |
959 | 945 | else |
961 | 947 | ac_cv_sizeof_unsigned_char=1 |
962 | 948 | else |
963 | 949 | cat > conftest.$ac_ext <<EOF |
964 | #line 966 "configure" | |
950 | #line 952 "configure" | |
965 | 951 | #include "confdefs.h" |
966 | 952 | #include <stdio.h> |
967 | 953 | main() |
972 | 958 | exit(0); |
973 | 959 | } |
974 | 960 | EOF |
975 | if { (eval echo configure:977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
961 | if { (eval echo configure:963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
976 | 962 | then |
977 | 963 | ac_cv_sizeof_unsigned_char=`cat conftestval` |
978 | 964 | else |
992 | 978 | |
993 | 979 | |
994 | 980 | echo $ac_n "checking size of unsigned short""... $ac_c" 1>&6 |
995 | echo "configure:997: checking size of unsigned short" >&5 | |
981 | echo "configure:983: checking size of unsigned short" >&5 | |
996 | 982 | if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_short'+set}'`\" = set"; then |
997 | 983 | echo $ac_n "(cached) $ac_c" 1>&6 |
998 | 984 | else |
1000 | 986 | ac_cv_sizeof_unsigned_short=2 |
1001 | 987 | else |
1002 | 988 | cat > conftest.$ac_ext <<EOF |
1003 | #line 1005 "configure" | |
989 | #line 991 "configure" | |
1004 | 990 | #include "confdefs.h" |
1005 | 991 | #include <stdio.h> |
1006 | 992 | main() |
1011 | 997 | exit(0); |
1012 | 998 | } |
1013 | 999 | EOF |
1014 | if { (eval echo configure:1016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
1000 | if { (eval echo configure:1002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
1015 | 1001 | then |
1016 | 1002 | ac_cv_sizeof_unsigned_short=`cat conftestval` |
1017 | 1003 | else |
1031 | 1017 | |
1032 | 1018 | |
1033 | 1019 | echo $ac_n "checking size of unsigned int""... $ac_c" 1>&6 |
1034 | echo "configure:1036: checking size of unsigned int" >&5 | |
1020 | echo "configure:1022: checking size of unsigned int" >&5 | |
1035 | 1021 | if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_int'+set}'`\" = set"; then |
1036 | 1022 | echo $ac_n "(cached) $ac_c" 1>&6 |
1037 | 1023 | else |
1039 | 1025 | ac_cv_sizeof_unsigned_int=4 |
1040 | 1026 | else |
1041 | 1027 | cat > conftest.$ac_ext <<EOF |
1042 | #line 1044 "configure" | |
1028 | #line 1030 "configure" | |
1043 | 1029 | #include "confdefs.h" |
1044 | 1030 | #include <stdio.h> |
1045 | 1031 | main() |
1050 | 1036 | exit(0); |
1051 | 1037 | } |
1052 | 1038 | EOF |
1053 | if { (eval echo configure:1055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
1039 | if { (eval echo configure:1041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
1054 | 1040 | then |
1055 | 1041 | ac_cv_sizeof_unsigned_int=`cat conftestval` |
1056 | 1042 | else |
1070 | 1056 | |
1071 | 1057 | |
1072 | 1058 | echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6 |
1073 | echo "configure:1075: checking size of unsigned long" >&5 | |
1059 | echo "configure:1061: checking size of unsigned long" >&5 | |
1074 | 1060 | if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long'+set}'`\" = set"; then |
1075 | 1061 | echo $ac_n "(cached) $ac_c" 1>&6 |
1076 | 1062 | else |
1078 | 1064 | ac_cv_sizeof_unsigned_long=4 |
1079 | 1065 | else |
1080 | 1066 | cat > conftest.$ac_ext <<EOF |
1081 | #line 1083 "configure" | |
1067 | #line 1069 "configure" | |
1082 | 1068 | #include "confdefs.h" |
1083 | 1069 | #include <stdio.h> |
1084 | 1070 | main() |
1089 | 1075 | exit(0); |
1090 | 1076 | } |
1091 | 1077 | EOF |
1092 | if { (eval echo configure:1094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
1078 | if { (eval echo configure:1080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
1093 | 1079 | then |
1094 | 1080 | ac_cv_sizeof_unsigned_long=`cat conftestval` |
1095 | 1081 | else |
1110 | 1096 | |
1111 | 1097 | |
1112 | 1098 | echo $ac_n "checking for initscr""... $ac_c" 1>&6 |
1113 | echo "configure:1115: checking for initscr" >&5 | |
1099 | echo "configure:1101: checking for initscr" >&5 | |
1114 | 1100 | if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then |
1115 | 1101 | echo $ac_n "(cached) $ac_c" 1>&6 |
1116 | 1102 | else |
1117 | 1103 | cat > conftest.$ac_ext <<EOF |
1118 | #line 1120 "configure" | |
1104 | #line 1106 "configure" | |
1119 | 1105 | #include "confdefs.h" |
1120 | 1106 | /* System header to define __stub macros and hopefully few prototypes, |
1121 | 1107 | which can conflict with char initscr(); below. */ |
1138 | 1124 | |
1139 | 1125 | ; return 0; } |
1140 | 1126 | EOF |
1141 | if { (eval echo configure:1143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1127 | if { (eval echo configure:1129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1142 | 1128 | rm -rf conftest* |
1143 | 1129 | eval "ac_cv_func_initscr=yes" |
1144 | 1130 | else |
1156 | 1142 | else |
1157 | 1143 | echo "$ac_t""no" 1>&6 |
1158 | 1144 | echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 |
1159 | echo "configure:1161: checking for initscr in -lncurses" >&5 | |
1145 | echo "configure:1147: checking for initscr in -lncurses" >&5 | |
1160 | 1146 | ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'` |
1161 | 1147 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then |
1162 | 1148 | echo $ac_n "(cached) $ac_c" 1>&6 |
1164 | 1150 | ac_save_LIBS="$LIBS" |
1165 | 1151 | LIBS="-lncurses $LIBS" |
1166 | 1152 | cat > conftest.$ac_ext <<EOF |
1167 | #line 1169 "configure" | |
1153 | #line 1155 "configure" | |
1168 | 1154 | #include "confdefs.h" |
1169 | 1155 | /* Override any gcc2 internal prototype to avoid an error. */ |
1170 | 1156 | /* We use char because int might match the return type of a gcc2 |
1175 | 1161 | initscr() |
1176 | 1162 | ; return 0; } |
1177 | 1163 | EOF |
1178 | if { (eval echo configure:1180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1164 | if { (eval echo configure:1166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1179 | 1165 | rm -rf conftest* |
1180 | 1166 | eval "ac_cv_lib_$ac_lib_var=yes" |
1181 | 1167 | else |
1201 | 1187 | else |
1202 | 1188 | echo "$ac_t""no" 1>&6 |
1203 | 1189 | echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 |
1204 | echo "configure:1206: checking for initscr in -lcurses" >&5 | |
1190 | echo "configure:1192: checking for initscr in -lcurses" >&5 | |
1205 | 1191 | ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'` |
1206 | 1192 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then |
1207 | 1193 | echo $ac_n "(cached) $ac_c" 1>&6 |
1209 | 1195 | ac_save_LIBS="$LIBS" |
1210 | 1196 | LIBS="-lcurses $LIBS" |
1211 | 1197 | cat > conftest.$ac_ext <<EOF |
1212 | #line 1214 "configure" | |
1198 | #line 1200 "configure" | |
1213 | 1199 | #include "confdefs.h" |
1214 | 1200 | /* Override any gcc2 internal prototype to avoid an error. */ |
1215 | 1201 | /* We use char because int might match the return type of a gcc2 |
1220 | 1206 | initscr() |
1221 | 1207 | ; return 0; } |
1222 | 1208 | EOF |
1223 | if { (eval echo configure:1225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1209 | if { (eval echo configure:1211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1224 | 1210 | rm -rf conftest* |
1225 | 1211 | eval "ac_cv_lib_$ac_lib_var=yes" |
1226 | 1212 | else |
1258 | 1244 | fi |
1259 | 1245 | |
1260 | 1246 | echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 |
1261 | echo "configure:1263: checking how to run the C preprocessor" >&5 | |
1247 | echo "configure:1249: checking how to run the C preprocessor" >&5 | |
1262 | 1248 | # On Suns, sometimes $CPP names a directory. |
1263 | 1249 | if test -n "$CPP" && test -d "$CPP"; then |
1264 | 1250 | CPP= |
1273 | 1259 | # On the NeXT, cc -E runs the code through the compiler's parser, |
1274 | 1260 | # not just through cpp. |
1275 | 1261 | cat > conftest.$ac_ext <<EOF |
1276 | #line 1278 "configure" | |
1262 | #line 1264 "configure" | |
1277 | 1263 | #include "confdefs.h" |
1278 | 1264 | #include <assert.h> |
1279 | 1265 | Syntax Error |
1280 | 1266 | EOF |
1281 | 1267 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" |
1282 | { (eval echo configure:1284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1268 | { (eval echo configure:1270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1283 | 1269 | ac_err=`grep -v '^ *+' conftest.out` |
1284 | 1270 | if test -z "$ac_err"; then |
1285 | 1271 | : |
1290 | 1276 | rm -rf conftest* |
1291 | 1277 | CPP="${CC-cc} -E -traditional-cpp" |
1292 | 1278 | cat > conftest.$ac_ext <<EOF |
1293 | #line 1295 "configure" | |
1279 | #line 1281 "configure" | |
1294 | 1280 | #include "confdefs.h" |
1295 | 1281 | #include <assert.h> |
1296 | 1282 | Syntax Error |
1297 | 1283 | EOF |
1298 | 1284 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" |
1299 | { (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1285 | { (eval echo configure:1287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1300 | 1286 | ac_err=`grep -v '^ *+' conftest.out` |
1301 | 1287 | if test -z "$ac_err"; then |
1302 | 1288 | : |
1322 | 1308 | do |
1323 | 1309 | ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` |
1324 | 1310 | echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 |
1325 | echo "configure:1327: checking for $ac_hdr" >&5 | |
1311 | echo "configure:1313: checking for $ac_hdr" >&5 | |
1326 | 1312 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then |
1327 | 1313 | echo $ac_n "(cached) $ac_c" 1>&6 |
1328 | 1314 | else |
1329 | 1315 | cat > conftest.$ac_ext <<EOF |
1330 | #line 1332 "configure" | |
1316 | #line 1318 "configure" | |
1331 | 1317 | #include "confdefs.h" |
1332 | 1318 | #include <$ac_hdr> |
1333 | 1319 | EOF |
1334 | 1320 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" |
1335 | { (eval echo configure:1337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1321 | { (eval echo configure:1323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1336 | 1322 | ac_err=`grep -v '^ *+' conftest.out` |
1337 | 1323 | if test -z "$ac_err"; then |
1338 | 1324 | rm -rf conftest* |
1362 | 1348 | do |
1363 | 1349 | ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` |
1364 | 1350 | echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 |
1365 | echo "configure:1367: checking for $ac_hdr" >&5 | |
1351 | echo "configure:1353: checking for $ac_hdr" >&5 | |
1366 | 1352 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then |
1367 | 1353 | echo $ac_n "(cached) $ac_c" 1>&6 |
1368 | 1354 | else |
1369 | 1355 | cat > conftest.$ac_ext <<EOF |
1370 | #line 1372 "configure" | |
1356 | #line 1358 "configure" | |
1371 | 1357 | #include "confdefs.h" |
1372 | 1358 | #include <$ac_hdr> |
1373 | 1359 | EOF |
1374 | 1360 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" |
1375 | { (eval echo configure:1377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1361 | { (eval echo configure:1363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1376 | 1362 | ac_err=`grep -v '^ *+' conftest.out` |
1377 | 1363 | if test -z "$ac_err"; then |
1378 | 1364 | rm -rf conftest* |
1400 | 1386 | |
1401 | 1387 | |
1402 | 1388 | echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6 |
1403 | echo "configure:1405: checking for floor in -lm" >&5 | |
1389 | echo "configure:1391: checking for floor in -lm" >&5 | |
1404 | 1390 | ac_lib_var=`echo m'_'floor | sed 'y%./+-%__p_%'` |
1405 | 1391 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then |
1406 | 1392 | echo $ac_n "(cached) $ac_c" 1>&6 |
1408 | 1394 | ac_save_LIBS="$LIBS" |
1409 | 1395 | LIBS="-lm $LIBS" |
1410 | 1396 | cat > conftest.$ac_ext <<EOF |
1411 | #line 1413 "configure" | |
1397 | #line 1399 "configure" | |
1412 | 1398 | #include "confdefs.h" |
1413 | 1399 | /* Override any gcc2 internal prototype to avoid an error. */ |
1414 | 1400 | /* We use char because int might match the return type of a gcc2 |
1419 | 1405 | floor() |
1420 | 1406 | ; return 0; } |
1421 | 1407 | EOF |
1422 | if { (eval echo configure:1424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1408 | if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1423 | 1409 | rm -rf conftest* |
1424 | 1410 | eval "ac_cv_lib_$ac_lib_var=yes" |
1425 | 1411 | else |
1489 | 1475 | # Extract the first word of "gtk-config", so it can be a program name with args. |
1490 | 1476 | set dummy gtk-config; ac_word=$2 |
1491 | 1477 | echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 |
1492 | echo "configure:1494: checking for $ac_word" >&5 | |
1478 | echo "configure:1480: checking for $ac_word" >&5 | |
1493 | 1479 | if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then |
1494 | 1480 | echo $ac_n "(cached) $ac_c" 1>&6 |
1495 | 1481 | else |
1520 | 1506 | |
1521 | 1507 | min_gtk_version=1.0.0 |
1522 | 1508 | echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 |
1523 | echo "configure:1525: checking for GTK - version >= $min_gtk_version" >&5 | |
1509 | echo "configure:1511: checking for GTK - version >= $min_gtk_version" >&5 | |
1524 | 1510 | no_gtk="" |
1525 | 1511 | if test "$GTK_CONFIG" = "no" ; then |
1526 | 1512 | no_gtk=yes |
1543 | 1529 | echo $ac_n "cross compiling; assumed OK... $ac_c" |
1544 | 1530 | else |
1545 | 1531 | cat > conftest.$ac_ext <<EOF |
1546 | #line 1548 "configure" | |
1532 | #line 1534 "configure" | |
1547 | 1533 | #include "confdefs.h" |
1548 | 1534 | |
1549 | 1535 | #include <gtk/gtk.h> |
1553 | 1539 | main () |
1554 | 1540 | { |
1555 | 1541 | int major, minor, micro; |
1542 | char *tmp_version; | |
1556 | 1543 | |
1557 | 1544 | system ("touch conf.gtktest"); |
1558 | 1545 | |
1559 | if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) { | |
1546 | /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
1547 | tmp_version = g_strdup("$min_gtk_version"); | |
1548 | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
1560 | 1549 | printf("%s, bad version string\n", "$min_gtk_version"); |
1561 | 1550 | exit(1); |
1562 | 1551 | } |
1606 | 1595 | } |
1607 | 1596 | |
1608 | 1597 | EOF |
1609 | if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
1598 | if { (eval echo configure:1600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null | |
1610 | 1599 | then |
1611 | 1600 | : |
1612 | 1601 | else |
1641 | 1630 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
1642 | 1631 | LIBS="$LIBS $GTK_LIBS" |
1643 | 1632 | cat > conftest.$ac_ext <<EOF |
1644 | #line 1646 "configure" | |
1633 | #line 1635 "configure" | |
1645 | 1634 | #include "confdefs.h" |
1646 | 1635 | |
1647 | 1636 | #include <gtk/gtk.h> |
1651 | 1640 | return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); |
1652 | 1641 | ; return 0; } |
1653 | 1642 | EOF |
1654 | if { (eval echo configure:1656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1643 | if { (eval echo configure:1645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1655 | 1644 | rm -rf conftest* |
1656 | 1645 | echo "*** The test program compiled, but did not run. This usually means" |
1657 | 1646 | echo "*** that the run-time linker is not finding GTK or finding the wrong" |
1696 | 1685 | |
1697 | 1686 | |
1698 | 1687 | echo $ac_n "checking for socket""... $ac_c" 1>&6 |
1699 | echo "configure:1701: checking for socket" >&5 | |
1688 | echo "configure:1690: checking for socket" >&5 | |
1700 | 1689 | if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then |
1701 | 1690 | echo $ac_n "(cached) $ac_c" 1>&6 |
1702 | 1691 | else |
1703 | 1692 | cat > conftest.$ac_ext <<EOF |
1704 | #line 1706 "configure" | |
1693 | #line 1695 "configure" | |
1705 | 1694 | #include "confdefs.h" |
1706 | 1695 | /* System header to define __stub macros and hopefully few prototypes, |
1707 | 1696 | which can conflict with char socket(); below. */ |
1724 | 1713 | |
1725 | 1714 | ; return 0; } |
1726 | 1715 | EOF |
1727 | if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1716 | if { (eval echo configure:1718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1728 | 1717 | rm -rf conftest* |
1729 | 1718 | eval "ac_cv_func_socket=yes" |
1730 | 1719 | else |
1742 | 1731 | else |
1743 | 1732 | echo "$ac_t""no" 1>&6 |
1744 | 1733 | echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 |
1745 | echo "configure:1747: checking for socket in -lsocket" >&5 | |
1734 | echo "configure:1736: checking for socket in -lsocket" >&5 | |
1746 | 1735 | ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` |
1747 | 1736 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then |
1748 | 1737 | echo $ac_n "(cached) $ac_c" 1>&6 |
1750 | 1739 | ac_save_LIBS="$LIBS" |
1751 | 1740 | LIBS="-lsocket $LIBS" |
1752 | 1741 | cat > conftest.$ac_ext <<EOF |
1753 | #line 1755 "configure" | |
1742 | #line 1744 "configure" | |
1754 | 1743 | #include "confdefs.h" |
1755 | 1744 | /* Override any gcc2 internal prototype to avoid an error. */ |
1756 | 1745 | /* We use char because int might match the return type of a gcc2 |
1761 | 1750 | socket() |
1762 | 1751 | ; return 0; } |
1763 | 1752 | EOF |
1764 | if { (eval echo configure:1766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1753 | if { (eval echo configure:1755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1765 | 1754 | rm -rf conftest* |
1766 | 1755 | eval "ac_cv_lib_$ac_lib_var=yes" |
1767 | 1756 | else |
1793 | 1782 | |
1794 | 1783 | |
1795 | 1784 | echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 |
1796 | echo "configure:1798: checking for gethostbyname" >&5 | |
1785 | echo "configure:1787: checking for gethostbyname" >&5 | |
1797 | 1786 | if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then |
1798 | 1787 | echo $ac_n "(cached) $ac_c" 1>&6 |
1799 | 1788 | else |
1800 | 1789 | cat > conftest.$ac_ext <<EOF |
1801 | #line 1803 "configure" | |
1790 | #line 1792 "configure" | |
1802 | 1791 | #include "confdefs.h" |
1803 | 1792 | /* System header to define __stub macros and hopefully few prototypes, |
1804 | 1793 | which can conflict with char gethostbyname(); below. */ |
1821 | 1810 | |
1822 | 1811 | ; return 0; } |
1823 | 1812 | EOF |
1824 | if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1813 | if { (eval echo configure:1815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1825 | 1814 | rm -rf conftest* |
1826 | 1815 | eval "ac_cv_func_gethostbyname=yes" |
1827 | 1816 | else |
1839 | 1828 | else |
1840 | 1829 | echo "$ac_t""no" 1>&6 |
1841 | 1830 | echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 |
1842 | echo "configure:1844: checking for gethostbyname in -lnsl" >&5 | |
1831 | echo "configure:1833: checking for gethostbyname in -lnsl" >&5 | |
1843 | 1832 | ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` |
1844 | 1833 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then |
1845 | 1834 | echo $ac_n "(cached) $ac_c" 1>&6 |
1847 | 1836 | ac_save_LIBS="$LIBS" |
1848 | 1837 | LIBS="-lnsl $LIBS" |
1849 | 1838 | cat > conftest.$ac_ext <<EOF |
1850 | #line 1852 "configure" | |
1839 | #line 1841 "configure" | |
1851 | 1840 | #include "confdefs.h" |
1852 | 1841 | /* Override any gcc2 internal prototype to avoid an error. */ |
1853 | 1842 | /* We use char because int might match the return type of a gcc2 |
1858 | 1847 | gethostbyname() |
1859 | 1848 | ; return 0; } |
1860 | 1849 | EOF |
1861 | if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1850 | if { (eval echo configure:1852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1862 | 1851 | rm -rf conftest* |
1863 | 1852 | eval "ac_cv_lib_$ac_lib_var=yes" |
1864 | 1853 | else |
1890 | 1879 | |
1891 | 1880 | |
1892 | 1881 | echo $ac_n "checking for res_mkquery""... $ac_c" 1>&6 |
1893 | echo "configure:1895: checking for res_mkquery" >&5 | |
1882 | echo "configure:1884: checking for res_mkquery" >&5 | |
1894 | 1883 | if eval "test \"`echo '$''{'ac_cv_func_res_mkquery'+set}'`\" = set"; then |
1895 | 1884 | echo $ac_n "(cached) $ac_c" 1>&6 |
1896 | 1885 | else |
1897 | 1886 | cat > conftest.$ac_ext <<EOF |
1898 | #line 1900 "configure" | |
1887 | #line 1889 "configure" | |
1899 | 1888 | #include "confdefs.h" |
1900 | 1889 | /* System header to define __stub macros and hopefully few prototypes, |
1901 | 1890 | which can conflict with char res_mkquery(); below. */ |
1918 | 1907 | |
1919 | 1908 | ; return 0; } |
1920 | 1909 | EOF |
1921 | if { (eval echo configure:1923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1910 | if { (eval echo configure:1912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1922 | 1911 | rm -rf conftest* |
1923 | 1912 | eval "ac_cv_func_res_mkquery=yes" |
1924 | 1913 | else |
1936 | 1925 | else |
1937 | 1926 | echo "$ac_t""no" 1>&6 |
1938 | 1927 | echo $ac_n "checking for res_mkquery in -lresolv""... $ac_c" 1>&6 |
1939 | echo "configure:1941: checking for res_mkquery in -lresolv" >&5 | |
1928 | echo "configure:1930: checking for res_mkquery in -lresolv" >&5 | |
1940 | 1929 | ac_lib_var=`echo resolv'_'res_mkquery | sed 'y%./+-%__p_%'` |
1941 | 1930 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then |
1942 | 1931 | echo $ac_n "(cached) $ac_c" 1>&6 |
1944 | 1933 | ac_save_LIBS="$LIBS" |
1945 | 1934 | LIBS="-lresolv $LIBS" |
1946 | 1935 | cat > conftest.$ac_ext <<EOF |
1947 | #line 1949 "configure" | |
1936 | #line 1938 "configure" | |
1948 | 1937 | #include "confdefs.h" |
1949 | 1938 | /* Override any gcc2 internal prototype to avoid an error. */ |
1950 | 1939 | /* We use char because int might match the return type of a gcc2 |
1955 | 1944 | res_mkquery() |
1956 | 1945 | ; return 0; } |
1957 | 1946 | EOF |
1958 | if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1947 | if { (eval echo configure:1949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
1959 | 1948 | rm -rf conftest* |
1960 | 1949 | eval "ac_cv_lib_$ac_lib_var=yes" |
1961 | 1950 | else |
1987 | 1976 | |
1988 | 1977 | |
1989 | 1978 | echo $ac_n "checking for herror""... $ac_c" 1>&6 |
1990 | echo "configure:1992: checking for herror" >&5 | |
1979 | echo "configure:1981: checking for herror" >&5 | |
1991 | 1980 | if eval "test \"`echo '$''{'ac_cv_func_herror'+set}'`\" = set"; then |
1992 | 1981 | echo $ac_n "(cached) $ac_c" 1>&6 |
1993 | 1982 | else |
1994 | 1983 | cat > conftest.$ac_ext <<EOF |
1995 | #line 1997 "configure" | |
1984 | #line 1986 "configure" | |
1996 | 1985 | #include "confdefs.h" |
1997 | 1986 | /* System header to define __stub macros and hopefully few prototypes, |
1998 | 1987 | which can conflict with char herror(); below. */ |
2015 | 2004 | |
2016 | 2005 | ; return 0; } |
2017 | 2006 | EOF |
2018 | if { (eval echo configure:2020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
2007 | if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
2019 | 2008 | rm -rf conftest* |
2020 | 2009 | eval "ac_cv_func_herror=yes" |
2021 | 2010 | else |
2039 | 2028 | fi |
2040 | 2029 | |
2041 | 2030 | echo $ac_n "checking for strerror""... $ac_c" 1>&6 |
2042 | echo "configure:2044: checking for strerror" >&5 | |
2031 | echo "configure:2033: checking for strerror" >&5 | |
2043 | 2032 | if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then |
2044 | 2033 | echo $ac_n "(cached) $ac_c" 1>&6 |
2045 | 2034 | else |
2046 | 2035 | cat > conftest.$ac_ext <<EOF |
2047 | #line 2049 "configure" | |
2036 | #line 2038 "configure" | |
2048 | 2037 | #include "confdefs.h" |
2049 | 2038 | /* System header to define __stub macros and hopefully few prototypes, |
2050 | 2039 | which can conflict with char strerror(); below. */ |
2067 | 2056 | |
2068 | 2057 | ; return 0; } |
2069 | 2058 | EOF |
2070 | if { (eval echo configure:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
2059 | if { (eval echo configure:2061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
2071 | 2060 | rm -rf conftest* |
2072 | 2061 | eval "ac_cv_func_strerror=yes" |
2073 | 2062 | else |
0 | 0 | AC_INIT(mtr.c) |
1 | AM_INIT_AUTOMAKE(mtr, 0.21) | |
1 | AM_INIT_AUTOMAKE(mtr, 0.28) | |
2 | 2 | |
3 | 3 | AC_SUBST(GTK_OBJ) |
4 | 4 | AC_SUBST(CURSES_OBJ) |
91 | 91 | getyx(stdscr, y, x); |
92 | 92 | move(y, startstat); |
93 | 93 | |
94 | printw(" %3d%% %4d%4d %5d%5d%7d", | |
94 | printw(" %3d%% %3d %3d %4d %4d %6d", | |
95 | 95 | net_percent(at), |
96 | 96 | net_returned(at), net_xmit(at), |
97 | 97 | net_best(at), net_avg(at), net_worst(at)); |
25 | 25 | |
26 | 26 | extern int DisplayMode; |
27 | 27 | |
28 | #ifdef NO_CURSES | |
29 | #define mtr_curses_open() | |
30 | #define mtr_curses_close() | |
31 | #define mtr_curses_redraw() | |
32 | #define mtr_curses_keyaction() | |
33 | #endif | |
34 | ||
35 | #ifdef NO_GTK | |
36 | #define gtk_open() | |
37 | #define gtk_close() | |
38 | #define gtk_redraw() | |
39 | #define gtk_keyaction() | |
40 | #define gtk_loop() | |
41 | #endif | |
42 | ||
28 | 43 | void display_detect(int *argc, char ***argv) { |
29 | 44 | DisplayMode = DisplayReport; |
30 | 45 | |
45 | 60 | report_open(); |
46 | 61 | break; |
47 | 62 | |
48 | #ifndef NO_CURSES | |
49 | 63 | case DisplayCurses: |
50 | 64 | mtr_curses_open(); |
51 | 65 | break; |
52 | #endif | |
53 | 66 | |
54 | #ifndef NO_GTK | |
67 | case DisplaySplit: /* BL */ | |
68 | split_open(); | |
69 | break; | |
70 | ||
55 | 71 | case DisplayGTK: |
56 | 72 | gtk_open(); |
57 | 73 | break; |
58 | #endif | |
59 | 74 | } |
60 | 75 | } |
61 | 76 | |
65 | 80 | report_close(); |
66 | 81 | break; |
67 | 82 | |
68 | #ifndef NO_CURSES | |
69 | 83 | case DisplayCurses: |
70 | 84 | mtr_curses_close(); |
71 | 85 | break; |
72 | #endif | |
73 | 86 | |
74 | #ifndef NO_GTK | |
87 | case DisplaySplit: /* BL */ | |
88 | split_close(); | |
89 | break; | |
90 | ||
75 | 91 | case DisplayGTK: |
76 | 92 | gtk_close(); |
77 | 93 | break; |
78 | #endif | |
79 | 94 | } |
80 | 95 | } |
81 | 96 | |
82 | 97 | void display_redraw() { |
83 | 98 | switch(DisplayMode) { |
84 | #ifndef NO_CURSES | |
99 | ||
85 | 100 | case DisplayCurses: |
86 | 101 | mtr_curses_redraw(); |
87 | 102 | break; |
88 | #endif | |
89 | 103 | |
90 | #ifndef NO_GTK | |
104 | case DisplaySplit: /* BL */ | |
105 | split_redraw(); | |
106 | break; | |
107 | ||
91 | 108 | case DisplayGTK: |
92 | 109 | gtk_redraw(); |
93 | 110 | break; |
94 | #endif | |
95 | 111 | } |
96 | 112 | } |
97 | 113 | |
98 | 114 | int display_keyaction() { |
99 | 115 | switch(DisplayMode) { |
100 | #ifndef NO_CURSES | |
101 | 116 | case DisplayCurses: |
102 | 117 | return mtr_curses_keyaction(); |
103 | #endif | |
104 | 118 | |
105 | #ifndef NO_GTK | |
119 | case DisplaySplit: /* BL */ | |
120 | return split_keyaction(); | |
121 | ||
106 | 122 | case DisplayGTK: |
107 | 123 | return gtk_keyaction(); |
108 | #endif | |
109 | 124 | } |
110 | 125 | return 0; |
111 | 126 | } |
127 | ||
128 | ||
129 | void display_rawping(int host, int msec) { | |
130 | switch(DisplayMode) { | |
131 | case DisplayReport: | |
132 | case DisplaySplit: /* BL */ | |
133 | case DisplayCurses: | |
134 | case DisplayGTK: | |
135 | break; | |
136 | case DisplayRaw: | |
137 | raw_rawping (host, msec); | |
138 | break; | |
139 | } | |
140 | } | |
141 | ||
142 | ||
143 | void display_rawhost(int host, int ip_addr) { | |
144 | switch(DisplayMode) { | |
145 | case DisplayReport: | |
146 | case DisplaySplit: /* BL */ | |
147 | case DisplayCurses: | |
148 | case DisplayGTK: | |
149 | break; | |
150 | case DisplayRaw: | |
151 | raw_rawhost (host, ip_addr); | |
152 | break; | |
153 | } | |
154 | } | |
155 | ||
112 | 156 | |
113 | 157 | void display_loop() { |
114 | 158 | switch(DisplayMode) { |
115 | 159 | case DisplayCurses: |
116 | 160 | case DisplayReport: |
161 | case DisplaySplit: /* BL */ | |
162 | case DisplayRaw: | |
117 | 163 | select_loop(); |
118 | 164 | break; |
119 | 165 | |
120 | #ifndef NO_GTK | |
121 | 166 | case DisplayGTK: |
122 | 167 | gtk_loop(); |
123 | 168 | break; |
124 | #endif | |
125 | 169 | } |
126 | 170 | } |
127 | 171 |
17 | 17 | */ |
18 | 18 | |
19 | 19 | enum { ActionNone, ActionQuit, ActionReset }; |
20 | enum { DisplayReport, DisplayCurses, DisplayGTK }; | |
20 | enum { DisplayReport, DisplayCurses, DisplayGTK, DisplaySplit, DisplayRaw }; | |
21 | 21 | |
22 | 22 | /* Prototypes for display.c */ |
23 | 23 | void display_detect(int *argc, char ***argv); |
24 | 24 | void display_open(); |
25 | 25 | void display_close(); |
26 | 26 | void display_redraw(); |
27 | void display_rawping(int hostnum, int msec); | |
28 | void display_rawhost(int hostnum, int ip_addr); | |
27 | 29 | int display_keyaction(); |
28 | 30 | void display_loop(); |
49 | 49 | |
50 | 50 | /* Hmm, it seems Irix requires this */ |
51 | 51 | extern int errno; |
52 | ||
53 | /* Defined in mtr.c */ | |
54 | extern int dns; | |
52 | 55 | |
53 | 56 | /* Defines */ |
54 | 57 | |
270 | 273 | |
271 | 274 | /* Code */ |
272 | 275 | |
276 | ||
277 | #ifdef CorruptCheck | |
278 | #define TOT_SLACK 2 | |
279 | #define HEAD_SLACK 1 | |
280 | /* Need an entry for sparc systems here too. | |
281 | Don't try this on Sparc for now. */ | |
282 | #else | |
283 | #ifdef sparc | |
284 | #define TOT_SLACK 2 | |
285 | #define HEAD_SLACK 2 | |
286 | #else | |
287 | #define TOT_SLACK 1 | |
288 | #define HEAD_SLACK 1 | |
289 | #endif | |
290 | #endif | |
291 | ||
292 | ||
273 | 293 | void *statmalloc(size_t size){ |
274 | 294 | void *p; |
275 | 295 | size_t mallocsize; |
276 | 296 | mem+= size; |
277 | #ifdef CorruptCheck | |
278 | mallocsize = size + (sizeof(dword)) + sizeof(dword); | |
279 | #else | |
280 | mallocsize = size + (sizeof(dword)); | |
281 | #endif | |
297 | mallocsize = size + TOT_SLACK * sizeof(dword); | |
298 | ||
282 | 299 | p = malloc(mallocsize); |
283 | 300 | if (!p){ |
284 | 301 | fprintf(stderr,"malloc() of %u bytes failed: %s\n",size,strerror(errno)); |
291 | 308 | *(byte *)((char *)p + size + sizeof(dword) + sizeof(byte) * 2) = 0xbe; |
292 | 309 | *(byte *)((char *)p + size + sizeof(dword) + sizeof(byte) * 3) = 0xef; |
293 | 310 | #endif |
294 | p = (void *)((dword *)p + 1); | |
311 | p = (void *)((dword *)p + HEAD_SLACK); | |
295 | 312 | #ifdef WipeMallocs |
296 | 313 | memset(p,0xf0,size); |
297 | 314 | #endif |
300 | 317 | |
301 | 318 | void statfree(void *p){ |
302 | 319 | if (p){ |
303 | if (*((dword *)p - 1) == 0){ | |
320 | if (*((dword *)p - HEAD_SLACK) == 0){ | |
304 | 321 | fprintf(stderr,"ERROR: Attempt to free pointer twice.\n"); |
305 | 322 | *(int*)0=0; |
306 | 323 | exit(-1); |
307 | 324 | } else { |
308 | if (*((dword *)p - 1) > 8192){ | |
325 | if (*((dword *)p - HEAD_SLACK) > 8192){ | |
309 | 326 | fprintf(stderr,"ERROR: Corrupted free() buffer. (header)\n"); |
310 | 327 | *(int*)0=0; |
311 | 328 | exit(-1); |
320 | 337 | exit(-1); |
321 | 338 | } |
322 | 339 | #endif |
323 | mem-= *((dword *)p - 1); | |
340 | mem-= *((dword *)p - HEAD_SLACK); | |
324 | 341 | #ifdef WipeFrees |
325 | memset(p,0xfe,*((dword *)p - 1)); | |
342 | memset(p,0xfe,*((dword *)p - HEAD_SLACK)); | |
326 | 343 | *((dword *)p - 1) = 0; |
327 | 344 | #endif |
328 | free((dword *)p - 1); | |
345 | free((dword *)p - HEAD_SLACK); | |
329 | 346 | } |
330 | 347 | } |
331 | 348 | } |
372 | 389 | |
373 | 390 | char *strlongip(ip_t ip){ |
374 | 391 | struct in_addr a; |
375 | a.s_addr = ip; | |
392 | a.s_addr = htonl(ip); | |
376 | 393 | return inet_ntoa(a); |
377 | 394 | } |
378 | 395 | |
429 | 446 | fprintf(stderr,"statmalloc() failed: %s\n",strerror(errno)); |
430 | 447 | exit(-1); |
431 | 448 | } |
432 | bzero(rp,sizeof(struct resolve)); | |
449 | memset(rp,0, sizeof(struct resolve)); | |
433 | 450 | return rp; |
434 | 451 | } |
435 | 452 | |
1119 | 1136 | (void)istime(expireresolves->expiretime,sinterval); |
1120 | 1137 | } |
1121 | 1138 | |
1122 | char *dns_lookup(ip_t ip){ | |
1139 | char *dns_lookup2(ip_t ip){ | |
1123 | 1140 | struct resolve *rp; |
1124 | 1141 | ip = htonl(ip); |
1125 | 1142 | if ((rp = findip(ip))){ |
1137 | 1154 | strlongip(ip)); |
1138 | 1155 | restell(tempstring); |
1139 | 1156 | } |
1140 | return strlongip(ip); | |
1157 | return NULL; | |
1141 | 1158 | } |
1142 | 1159 | } |
1143 | return strlongip(ip); | |
1160 | return NULL; | |
1144 | 1161 | } |
1145 | 1162 | if (debug) |
1146 | 1163 | fprintf(stderr,"Resolver: Added to new record.\n"); |
1152 | 1169 | rp->ip = ip; |
1153 | 1170 | linkresolveip(rp); |
1154 | 1171 | sendrequest(rp,T_PTR); |
1155 | return strlongip(ip); | |
1156 | } | |
1172 | return NULL; | |
1173 | } | |
1174 | ||
1175 | ||
1176 | char *dns_lookup(ip_t ip){ | |
1177 | char *t; | |
1178 | ||
1179 | if (!dns) return strlongip (ip); | |
1180 | t = dns_lookup2 (ip); | |
1181 | return t?t:strlongip(ip); | |
1182 | } |
23 | 23 | void dns_ack(); |
24 | 24 | void dns_events(double *sinterval); |
25 | 25 | char *dns_lookup(int address); |
26 | char *dns_lookup2(int address); | |
26 | 27 | int dns_forward(char *name); |
28 | char *strlongip (int address); |
0 | 0 | /* |
1 | 1 | mtr -- a network diagnostic tool |
2 | 2 | Copyright (C) 1997,1998 Matt Kimball |
3 | Changes/additions Copyright (C) 1998 R.E.Wolff@BitWizard.nl | |
3 | 4 | |
4 | 5 | This program is free software; you can redistribute it and/or modify |
5 | 6 | it under the terms of the GNU General Public License as published by |
17 | 18 | */ |
18 | 19 | |
19 | 20 | #include <config.h> |
21 | #include <sys/time.h> | |
20 | 22 | |
21 | 23 | #ifndef NO_GTK |
22 | 24 | #include <stdlib.h> |
31 | 33 | |
32 | 34 | extern char *Hostname; |
33 | 35 | extern float WaitTime; |
36 | extern float DeltaTime; | |
37 | ||
38 | static int tag; | |
34 | 39 | |
35 | 40 | void gtk_do_init(int *argc, char ***argv) { |
36 | 41 | static int done = 0; |
126 | 131 | if(addr != 0) { |
127 | 132 | name = dns_lookup(addr); |
128 | 133 | if(!name) { |
129 | sprintf(str, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, | |
130 | (addr >> 8) & 0xff, addr & 0xff); | |
131 | name = str; | |
134 | /* Actually this is not neccesary: | |
135 | dns_lookup always returns a printable string */ | |
136 | name = strlongip (addr); | |
132 | 137 | } |
133 | 138 | } |
134 | 139 | |
244 | 249 | GtkWidget *Toolbar; |
245 | 250 | GtkWidget *List; |
246 | 251 | |
247 | gtk_window_set_title(GTK_WINDOW(Window), "Matt's traceroute [v" VERSION "]"); | |
252 | gtk_window_set_title(GTK_WINDOW(Window), "My traceroute [v" VERSION "]"); | |
248 | 253 | gtk_widget_set_usize(Window, 540, 400); |
249 | 254 | gtk_container_border_width(GTK_CONTAINER(Window), 10); |
250 | 255 | VBox = gtk_vbox_new(FALSE, 10); |
301 | 306 | gint gtk_ping(gpointer data) { |
302 | 307 | gtk_redraw(); |
303 | 308 | net_send_batch(); |
304 | ||
309 | gtk_timeout_remove (tag); | |
310 | tag = gtk_timeout_add(DeltaTime*1000, gtk_ping, NULL); | |
305 | 311 | return TRUE; |
306 | 312 | } |
307 | 313 | |
315 | 321 | gtk_redraw(); |
316 | 322 | } |
317 | 323 | |
324 | ||
318 | 325 | void gtk_loop() { |
319 | gtk_timeout_add((int)(1000.0 * WaitTime), gtk_ping, NULL); | |
326 | DeltaTime = WaitTime/10; | |
327 | tag = gtk_timeout_add(DeltaTime*1000, gtk_ping, NULL); | |
320 | 328 | gdk_input_add(net_waitfd(), GDK_INPUT_READ, gtk_net_data, NULL); |
321 | 329 | gdk_input_add(dns_waitfd(), GDK_INPUT_READ, gtk_dns_data, NULL); |
322 | 330 |
0 | # Makefile.in generated automatically by automake 1.2d from Makefile.am | |
0 | # Makefile.in generated automatically by automake 1.2 from Makefile.am | |
1 | 1 | |
2 | 2 | # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. |
3 | 3 | # This Makefile.in is free software; the Free Software Foundation |
4 | # gives unlimited permission to copy and/or distribute it, | |
5 | # with or without modifications, as long as this notice is preserved. | |
6 | ||
7 | # This program is distributed in the hope that it will be useful, | |
8 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
9 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
10 | # PARTICULAR PURPOSE. | |
4 | # gives unlimited permission to copy, distribute and modify it. | |
11 | 5 | |
12 | 6 | |
13 | 7 | SHELL = /bin/sh |
48 | 42 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
49 | 43 | transform = @program_transform_name@ |
50 | 44 | |
51 | NORMAL_INSTALL = : | |
52 | PRE_INSTALL = : | |
53 | POST_INSTALL = : | |
54 | NORMAL_UNINSTALL = : | |
55 | PRE_UNINSTALL = : | |
56 | POST_UNINSTALL = : | |
45 | NORMAL_INSTALL = true | |
46 | PRE_INSTALL = true | |
47 | POST_INSTALL = true | |
48 | NORMAL_UNINSTALL = true | |
49 | PRE_UNINSTALL = true | |
50 | POST_UNINSTALL = true | |
57 | 51 | CC = @CC@ |
58 | 52 | CURSES_OBJ = @CURSES_OBJ@ |
59 | 53 | GTK_CFLAGS = @GTK_CFLAGS@ |
124 | 118 | |
125 | 119 | |
126 | 120 | mostlyclean-generic: |
127 | -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) | |
121 | test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) | |
128 | 122 | |
129 | 123 | clean-generic: |
130 | -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) | |
124 | test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) | |
131 | 125 | |
132 | 126 | distclean-generic: |
133 | -rm -f Makefile $(DISTCLEANFILES) | |
134 | -rm -f config.cache config.log stamp-h stamp-h[0-9]* | |
135 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | |
127 | rm -f Makefile $(DISTCLEANFILES) | |
128 | rm -f config.cache config.log stamp-h stamp-h[0-9]* | |
129 | test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | |
136 | 130 | |
137 | 131 | maintainer-clean-generic: |
138 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | |
139 | -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) | |
132 | test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | |
133 | test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) | |
140 | 134 | mostlyclean: mostlyclean-generic |
141 | 135 | |
142 | 136 | clean: clean-generic mostlyclean |
143 | 137 | |
144 | 138 | distclean: distclean-generic clean |
145 | -rm -f config.status | |
139 | rm -f config.status | |
146 | 140 | |
147 | 141 | maintainer-clean: maintainer-clean-generic distclean |
148 | 142 | @echo "This command is intended for maintainers to use;" |
23 | 23 | ] |
24 | 24 | [\c |
25 | 25 | .B \-\-curses\c |
26 | ] | |
27 | [\c | |
28 | .B \-\-split\c | |
29 | ] | |
30 | [\c | |
31 | .B \-\-raw\c | |
32 | ] | |
33 | [\c | |
34 | .B \-\-no-dns\c | |
26 | 35 | ] |
27 | 36 | [\c |
28 | 37 | .B \-\-gtk\c |
92 | 101 | .B mtr |
93 | 102 | generates a significant amount of network traffic. Using |
94 | 103 | .B mtr |
95 | at to measure the quality of your network may result in decreased | |
104 | to measure the quality of your network may result in decreased | |
96 | 105 | network performance. |
97 | 106 | |
98 | 107 | .TP |
117 | 126 | interface (if available). |
118 | 127 | |
119 | 128 | .TP |
129 | .B \-n | |
130 | .TP | |
131 | .B \-\-no-dns | |
132 | .br | |
133 | Use this option to force | |
134 | .B mtr | |
135 | to display numeric IP numbers and not try to resolve the | |
136 | host names. | |
137 | ||
138 | .TP | |
120 | 139 | .B \-g |
121 | 140 | .TP |
122 | 141 | .B \-\-gtk |
131 | 150 | for more information about GTK+. |
132 | 151 | |
133 | 152 | .TP |
153 | .B \-s | |
154 | .TP | |
155 | .B \-\-split | |
156 | .br | |
157 | Use this option to set | |
158 | .B mtr | |
159 | to spit out a format that is suitable for a split-user interface. | |
160 | ||
161 | .TP | |
162 | .B \-l | |
163 | .TP | |
164 | .B \-\-raw | |
165 | .br | |
166 | Use this option to tell | |
167 | .B mtr | |
168 | to use the raw output format. This format is better suited for | |
169 | archival of the measurement results. It could be parsed to | |
170 | be presented into any of the other display methods. | |
171 | ||
172 | .TP | |
134 | 173 | .B \-i\ SECONDS |
135 | 174 | .TP |
136 | 175 | .B \-\-interval\ SECONDS |
152 | 191 | |
153 | 192 | .PP |
154 | 193 | For the latest version, see the mtr web page at |
155 | .BR http://www.mkimball.org/mtr.html . | |
194 | .BR http://www.bitwizard.nl/mtr/ . | |
156 | 195 | |
157 | 196 | .PP |
158 | 197 | Subscribe to the mtr mailing list. All mtr related announcements |
36 | 36 | int MaxPing = 16; |
37 | 37 | float WaitTime = 1.0; |
38 | 38 | char *Hostname = NULL; |
39 | int dns = 1; | |
39 | 40 | |
40 | 41 | void parse_arg(int argc, char **argv) { |
41 | 42 | int opt; |
47 | 48 | { "curses", 0, 0, 't' }, |
48 | 49 | { "gtk", 0, 0, 'g' }, |
49 | 50 | { "interval", 1, 0, 'i' }, |
51 | { "no-dns", 0, 0, 'n' }, | |
52 | { "split", 0, 0, 's' }, /* BL */ | |
53 | { "raw", 0, 0, 'l' }, | |
50 | 54 | { 0, 0, 0, 0 } |
51 | 55 | }; |
52 | 56 | |
53 | 57 | opt = 0; |
54 | 58 | while(1) { |
55 | opt = getopt_long(argc, argv, "hvrc:tli:", long_options, NULL); | |
59 | opt = getopt_long(argc, argv, "hvrc:tklnsi:", long_options, NULL); | |
56 | 60 | if(opt == -1) |
57 | 61 | break; |
58 | 62 | |
75 | 79 | case 'g': |
76 | 80 | DisplayMode = DisplayGTK; |
77 | 81 | break; |
82 | case 's': /* BL */ | |
83 | DisplayMode = DisplaySplit; | |
84 | break; | |
85 | case 'l': | |
86 | DisplayMode = DisplayRaw; | |
87 | break; | |
88 | case 'n': | |
89 | dns = 0; | |
90 | break; | |
78 | 91 | case 'i': |
79 | 92 | WaitTime = atof(optarg); |
80 | 93 | if (WaitTime <= 0.0) { |
81 | 94 | fprintf (stderr, "mtr: wait time must be positive\n"); |
82 | exit (-1); | |
95 | exit (1); | |
83 | 96 | } |
84 | 97 | break; |
85 | 98 | } |
98 | 111 | int main(int argc, char **argv) { |
99 | 112 | int traddr; |
100 | 113 | struct hostent *host; |
114 | int net_preopen_result; | |
101 | 115 | |
102 | 116 | /* Get the raw sockets first thing, so we can drop to user euid immediately */ |
103 | if(net_preopen() != 0) { | |
104 | printf("mtr: Unable to get raw socket. (Executable not suid?)\n"); | |
105 | exit(0); | |
106 | } | |
117 | ||
118 | net_preopen_result = net_preopen (); | |
107 | 119 | |
108 | 120 | /* Now drop to user permissions */ |
109 | 121 | if(seteuid(getuid())) { |
110 | 122 | printf("mtr: Unable to drop permissions.\n"); |
111 | exit(0); | |
123 | exit(1); | |
112 | 124 | } |
113 | 125 | |
114 | 126 | /* Double check, just in case */ |
115 | 127 | if(geteuid() != getuid()) { |
116 | 128 | printf("mtr: Unable to drop permissions.\n"); |
117 | exit(0); | |
129 | exit(1); | |
118 | 130 | } |
119 | 131 | |
120 | 132 | display_detect(&argc, &argv); |
125 | 137 | exit(0); |
126 | 138 | } |
127 | 139 | |
128 | if(Hostname == NULL || PrintHelp) { | |
129 | printf("usage: %s [-hvrctli] [--help] [--version] [--report]\n" | |
140 | if(PrintHelp) { | |
141 | printf("usage: %s [-hvrctlis] [--help] [--version] [--report]\n" | |
130 | 142 | "\t\t[--report-cycles=COUNT] [--curses] [--gtk]\n" |
143 | "\t\t[--raw] [--split]\n" /* BL */ | |
131 | 144 | "\t\t[--interval=SECONDS] HOSTNAME\n", argv[0]); |
132 | 145 | exit(0); |
133 | 146 | } |
147 | if (Hostname == NULL) Hostname = "localhost"; | |
148 | ||
149 | if(net_preopen_result != 0) { | |
150 | printf("mtr: Unable to get raw socket. (Executable not suid?)\n"); | |
151 | exit(1); | |
152 | } | |
153 | ||
134 | 154 | |
135 | 155 | host = gethostbyname(Hostname); |
136 | 156 | if(host == NULL) { |
139 | 159 | #else |
140 | 160 | printf("mtr: error looking up \"%s\"\n", Hostname); |
141 | 161 | #endif |
142 | exit(0); | |
162 | exit(1); | |
143 | 163 | } |
144 | 164 | |
145 | 165 | traddr = *(int *)host->h_addr; |
146 | 166 | |
147 | 167 | if(net_open(traddr) != 0) { |
148 | 168 | printf("mtr: Unable to get raw socket. (Executable not suid?)\n"); |
149 | exit(0); | |
169 | exit(1); | |
150 | 170 | } |
151 | 171 | |
152 | 172 | display_open(); |
28 | 28 | #include <netinet/in.h> |
29 | 29 | #include <memory.h> |
30 | 30 | #include <unistd.h> |
31 | #include <stdio.h> | |
32 | #include <math.h> | |
31 | 33 | |
32 | 34 | #include "net.h" |
33 | 35 | |
34 | #define MaxHost 256 | |
36 | ||
37 | extern float WaitTime, DeltaTime; | |
38 | ||
35 | 39 | #define MaxTransit 4 |
36 | 40 | |
37 | 41 | /* We can't rely on header files to provide this information, because |
131 | 135 | |
132 | 136 | ip->version = 0x45; |
133 | 137 | ip->tos = 0; |
134 | ip->len = packetsize; | |
138 | ip->len = htons (packetsize); | |
135 | 139 | ip->id = 0; |
136 | 140 | ip->frag = 0; |
137 | 141 | ip->ttl = 127; |
173 | 177 | |
174 | 178 | ip->version = 0x45; |
175 | 179 | ip->tos = 0; |
176 | ip->len = packetsize; | |
180 | ip->len = htons (packetsize); | |
177 | 181 | ip->id = 0; |
178 | 182 | ip->frag = 0; |
179 | 183 | ip->ttl = hops; |
199 | 203 | int at; |
200 | 204 | struct timeval now; |
201 | 205 | int totmsec; |
202 | int msec; | |
203 | 206 | |
204 | 207 | if(data->index >= 0) { |
205 | 208 | gettimeofday(&now, NULL); |
209 | 212 | /* discard this data point, stats were reset after it was generated */ |
210 | 213 | return; |
211 | 214 | |
212 | totmsec = (now.tv_sec - data->sec) * 1000; | |
213 | msec = now.tv_usec / 1000 - data->msec; | |
214 | if(msec >= 0) | |
215 | totmsec += msec; | |
216 | else | |
217 | totmsec = totmsec - 1000 + 1000 - data->msec + now.tv_usec / 1000; | |
215 | totmsec = (now.tv_sec - data->sec) * 1000 + | |
216 | ((now.tv_usec/1000) - data->msec); | |
218 | 217 | |
219 | 218 | if(host[data->index].returned <= 0) { |
220 | 219 | host[data->index].best = host[data->index].worst = totmsec; |
225 | 224 | |
226 | 225 | if(totmsec > host[data->index].worst) |
227 | 226 | host[data->index].worst = totmsec; |
227 | ||
228 | display_rawping (data->index, totmsec); | |
228 | 229 | |
229 | 230 | host[data->index].total += totmsec; |
230 | 231 | host[data->index].returned++; |
235 | 236 | return; |
236 | 237 | |
237 | 238 | host[at].addr = addr->sin_addr.s_addr; |
239 | display_rawhost (at, host[at].addr); | |
238 | 240 | } |
239 | 241 | } |
240 | 242 | |
276 | 278 | return; |
277 | 279 | |
278 | 280 | host[at].addr = fromaddr.sin_addr.s_addr; |
281 | display_rawhost (at, net_addr(at)); | |
279 | 282 | } |
280 | 283 | } |
281 | 284 | |
341 | 344 | } |
342 | 345 | } |
343 | 346 | |
344 | void net_send_batch() { | |
345 | int at; | |
346 | int n_unknown = 10; | |
347 | ||
348 | for(at = 0;n_unknown && (at < MaxHost); at++) { | |
349 | if(host[at].addr == 0) { | |
350 | net_send_query(at + 1); | |
351 | n_unknown--; | |
352 | } else { | |
353 | net_send_ping(at); | |
354 | } | |
355 | ||
356 | if(host[at].addr == remoteaddress.sin_addr.s_addr) { | |
357 | break; | |
358 | } | |
359 | } | |
360 | } | |
347 | ||
348 | ||
349 | int net_send_batch() { | |
350 | static int n_unknown = 10; | |
351 | static int at; | |
352 | ||
353 | if(host[at].addr == 0) { | |
354 | net_send_query(at + 1); | |
355 | n_unknown--; | |
356 | } else { | |
357 | net_send_ping(at); | |
358 | } | |
359 | ||
360 | if ((host[at].addr == remoteaddress.sin_addr.s_addr) || | |
361 | (n_unknown == 0)) { | |
362 | DeltaTime = WaitTime / (float) (at+1); | |
363 | at = 0; | |
364 | n_unknown = 10; | |
365 | return 1; | |
366 | } | |
367 | ||
368 | at++; | |
369 | return 0; | |
370 | } | |
371 | ||
361 | 372 | |
362 | 373 | int net_preopen() { |
363 | char trueopt = 1; | |
374 | int trueopt = 1; | |
364 | 375 | |
365 | 376 | sendsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); |
366 | if(sendsock == -1) | |
377 | if(sendsock < 0) | |
367 | 378 | return -1; |
368 | 379 | |
369 | 380 | #ifdef IP_HDRINCL |
370 | 381 | /* FreeBSD wants this to avoid sending out packets with protocol type RAW |
371 | 382 | to the network. */ |
372 | if(setsockopt(sendsock, 0, IP_HDRINCL, &trueopt, sizeof(trueopt))) | |
383 | if(setsockopt(sendsock, SOL_IP, IP_HDRINCL, &trueopt, sizeof(trueopt))) | |
384 | { | |
385 | perror("setsockopt(IP_HDRINCL,1)"); | |
373 | 386 | return -1; |
387 | } | |
374 | 388 | #endif |
375 | 389 | |
376 | 390 | recvsock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); |
377 | if(recvsock == -1) | |
378 | return -1; | |
391 | if(recvsock < 0) | |
392 | return -1; | |
379 | 393 | |
380 | 394 | return 0; |
381 | 395 | } |
399 | 413 | remoteaddress.sin_family = AF_INET; |
400 | 414 | remoteaddress.sin_addr.s_addr = addr; |
401 | 415 | |
416 | net_reset (); | |
402 | 417 | net_send_batch(); |
403 | 418 | } |
404 | 419 |
31 | 31 | int net_best(int at); |
32 | 32 | int net_worst(int at); |
33 | 33 | int net_avg(int at); |
34 | void net_send_batch(); | |
34 | int net_send_batch(); | |
35 | 35 | void net_end_transit(); |
36 | 36 | |
37 | 37 | /* Added by Brian Casey, December 1997 bcasey@imagiware.com*/ |
40 | 40 | int net_transit(int at); |
41 | 41 | |
42 | 42 | |
43 | #define MaxHost 256 |
0 | /* | |
1 | mtr -- a network diagnostic tool | |
2 | Copyright (C) 1998 R.E.Wolff@BitWizard.nl | |
3 | ||
4 | raw.c -- raw output (for logging for later analysis) | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | */ | |
20 | ||
21 | #include <ctype.h> | |
22 | #include <stdlib.h> | |
23 | #include <stdio.h> | |
24 | ||
25 | ||
26 | #include "raw.h" | |
27 | #include "net.h" | |
28 | #include "dns.h" | |
29 | ||
30 | static int havename[MaxHost]; | |
31 | ||
32 | static char *addr_to_str(int addr) | |
33 | { | |
34 | static char buf[20]; | |
35 | ||
36 | sprintf (buf, "%d.%d.%d.%d", | |
37 | (addr >> 0) & 0xff, | |
38 | (addr >> 8) & 0xff, | |
39 | (addr >> 16) & 0xff, | |
40 | (addr >> 24) & 0xff); | |
41 | return buf; | |
42 | } | |
43 | ||
44 | ||
45 | void raw_rawping (int host, int msec) | |
46 | { | |
47 | char *name; | |
48 | ||
49 | if (!havename[host]) { | |
50 | name = dns_lookup2(net_addr(host)); | |
51 | if (name) { | |
52 | havename[host]++; | |
53 | printf ("d %d %s\n", host, name); | |
54 | } | |
55 | } | |
56 | printf ("p %d %d\n", host, msec); | |
57 | } | |
58 | ||
59 | ||
60 | void raw_rawhost (int host, int ip_addr) | |
61 | { | |
62 | printf ("h %d %s\n", host, addr_to_str (ip_addr)); | |
63 | } | |
64 | ||
65 | ||
66 | ||
67 |
0 | /* | |
1 | mtr -- a network diagnostic tool | |
2 | Copyright (C) 1998 R.E.Wolff@BitWizard.nl | |
3 | ||
4 | raw.h -- raw output (for logging for later analysis) | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | */ | |
20 | ||
21 | /* Prototypes for raw.c */ | |
22 | void raw_rawping(int host, int msec); | |
23 | void raw_rawhost(int host, int addr); |
27 | 27 | #include "report.h" |
28 | 28 | #include "net.h" |
29 | 29 | |
30 | extern int dns; | |
31 | ||
30 | 32 | void report_open() { |
31 | 33 | printf("%-40s LOSS RCVD SENT BEST AVG WORST\n", "HOST"); |
32 | 34 | fflush(stdout); |
48 | 50 | sprintf(name, "???"); |
49 | 51 | } else { |
50 | 52 | haddr = htonl(addr); |
51 | host = gethostbyaddr((char *)&haddr, sizeof(int), AF_INET); | |
53 | host = dns?gethostbyaddr((char *)&haddr, sizeof(int), AF_INET):NULL; | |
52 | 54 | |
53 | if(host != NULL) { | |
55 | if (host != NULL) { | |
54 | 56 | strncpy(name, host->h_name, 80); |
55 | 57 | name[80] = 0; |
56 | 58 | } else { |
31 | 31 | extern int Interactive; |
32 | 32 | extern int MaxPing; |
33 | 33 | extern float WaitTime; |
34 | float DeltaTime; | |
34 | 35 | double dnsinterval; |
36 | ||
37 | static struct timeval intervaltime; | |
35 | 38 | |
36 | 39 | void select_loop() { |
37 | 40 | fd_set readfd; |
39 | 42 | int action, maxfd; |
40 | 43 | int dnsfd, netfd; |
41 | 44 | int NumPing; |
42 | struct timeval lasttime, thistime, selecttime, intervaltime; | |
45 | struct timeval lasttime, thistime, selecttime; | |
46 | float wt; | |
43 | 47 | |
44 | 48 | NumPing = 0; |
45 | 49 | anyset = 0; |
46 | 50 | gettimeofday(&lasttime, NULL); |
47 | intervaltime.tv_sec = (int)WaitTime; | |
48 | intervaltime.tv_usec = 1000000.0 * (WaitTime - floor(WaitTime)); | |
51 | DeltaTime = WaitTime/10; | |
49 | 52 | |
50 | 53 | while(1) { |
54 | intervaltime.tv_sec = DeltaTime; | |
55 | intervaltime.tv_usec = 1000000 *( DeltaTime - floor (DeltaTime)); | |
56 | ||
51 | 57 | FD_ZERO(&readfd); |
52 | 58 | |
53 | 59 | maxfd = 0; |
84 | 90 | lasttime = thistime; |
85 | 91 | if(NumPing >= MaxPing && !Interactive) |
86 | 92 | break; |
87 | NumPing++; | |
88 | net_send_batch(); | |
93 | if (net_send_batch()) | |
94 | NumPing++; | |
89 | 95 | } |
90 | 96 | |
91 | 97 | selecttime.tv_usec = (thistime.tv_usec - lasttime.tv_usec); |
0 | /* | |
1 | mtr -- a network diagnostic tool | |
2 | Copyright (C) 1997 Matt Kimball | |
3 | ||
4 | split.c -- raw output (for inclusion in KDE Network Utilities or others | |
5 | GUI based tools) | |
6 | Copyright (C) 1998 Bertrand Leconte <B.Leconte@mail.dotcom.fr> | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
21 | */ | |
22 | ||
23 | #include <ctype.h> | |
24 | #include <stdlib.h> | |
25 | #include <stdio.h> | |
26 | ||
27 | #include "display.h" | |
28 | #include "dns.h" | |
29 | /* | |
30 | #include "net.h" | |
31 | #include "split.h" | |
32 | */ | |
33 | ||
34 | ||
35 | extern char *Hostname; | |
36 | extern int WaitTime; | |
37 | ||
38 | /* There is 256 hops max in the IP header (coded with a byte) */ | |
39 | #define MAX_LINE_COUNT 256 | |
40 | #define MAX_LINE_SIZE 256 | |
41 | ||
42 | char Lines[MAX_LINE_COUNT][MAX_LINE_SIZE]; | |
43 | int LineCount; | |
44 | ||
45 | ||
46 | #define DEBUG 0 | |
47 | ||
48 | void | |
49 | split_redraw() { | |
50 | int max; | |
51 | int at; | |
52 | int addr; | |
53 | char *name; | |
54 | char newLine[MAX_LINE_SIZE]; | |
55 | int i; | |
56 | ||
57 | #if DEBUG | |
58 | fprintf(stderr, "split_redraw()\n"); | |
59 | #endif | |
60 | ||
61 | /* | |
62 | * If there is less lines than last time, we delete them | |
63 | * TEST THIS PLEASE | |
64 | */ | |
65 | max = net_max(); | |
66 | for (i=LineCount; i>max; i--) { | |
67 | printf("-%d\n", i); | |
68 | LineCount--; | |
69 | } | |
70 | ||
71 | /* | |
72 | * For each line, we compute the new one and we compare it to the old one | |
73 | */ | |
74 | for(at = 0; at < max; at++) { | |
75 | addr = net_addr(at); | |
76 | ||
77 | if(addr != 0) { | |
78 | name = dns_lookup(addr); | |
79 | if(name != NULL) { | |
80 | /* May be we should test name's length */ | |
81 | sprintf(newLine, "%s %d %d %d %d %d %d", name, | |
82 | net_percent(at), | |
83 | net_returned(at), net_xmit(at), | |
84 | net_best(at), net_avg(at), net_worst(at)); | |
85 | } else { | |
86 | sprintf(newLine, "%d.%d.%d.%d %d %d %d %d %d %d", | |
87 | (addr >> 24) & 0xff, (addr >> 16) & 0xff, | |
88 | (addr >> 8) & 0xff, addr & 0xff, | |
89 | net_percent(at), | |
90 | net_returned(at), net_xmit(at), | |
91 | net_best(at), net_avg(at), net_worst(at)); | |
92 | } | |
93 | } else { | |
94 | sprintf(newLine, "???"); | |
95 | } | |
96 | ||
97 | if (strcmp(newLine, Lines[at]) == 0) { | |
98 | /* The same, so do nothing */ | |
99 | #if DEBUG | |
100 | printf("SAME LINE\n"); | |
101 | #endif | |
102 | } else { | |
103 | printf("%d %s\n", at+1, newLine); | |
104 | fflush(stdout); | |
105 | strcpy(Lines[at], newLine); | |
106 | if (LineCount < (at+1)) { | |
107 | LineCount = at+1; | |
108 | } | |
109 | } | |
110 | } | |
111 | } | |
112 | ||
113 | void | |
114 | split_open() { | |
115 | int i; | |
116 | #if DEBUG | |
117 | printf("split_open()\n"); | |
118 | #endif | |
119 | LineCount = -1; | |
120 | for (i=0; i<MAX_LINE_COUNT; i++) { | |
121 | strcpy(Lines[i], "???"); | |
122 | } | |
123 | } | |
124 | ||
125 | void | |
126 | split_close() { | |
127 | #if DEBUG | |
128 | printf("split_close()\n"); | |
129 | #endif | |
130 | } | |
131 | ||
132 | int | |
133 | split_keyaction() { | |
134 | char c = getch(); | |
135 | ||
136 | #if DEBUG | |
137 | printf("split_keyaction()\n"); | |
138 | #endif | |
139 | if(tolower(c) == 'q') | |
140 | return ActionQuit; | |
141 | if(c==3) | |
142 | return ActionQuit; | |
143 | if(tolower(c) == 'r') | |
144 | return ActionReset; | |
145 | ||
146 | return 0; | |
147 | } |
0 | /* | |
1 | mtr -- a network diagnostic tool | |
2 | ||
3 | split.h -- raw output (for inclusion in KDE Network Utilities) | |
4 | Copyright (C) 1998 Bertrand Leconte <B.Leconte@mail.dotcom.fr> | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | */ | |
20 | ||
21 | /* Prototypes for split.c */ | |
22 | void split_open(); | |
23 | void split_close(); | |
24 | void split_redraw(); | |
25 | int split_keyaction(); |