Patches to prevent problems under Windows when time formats are negative.
[obnox/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Ethereal
3 #
4 # $Id: Makefile.am,v 1.258 2000/12/13 02:24:21 guy Exp $
5 #
6 # Ethereal - Network traffic analyzer
7 # By Gerald Combs <gerald@zing.org>
8 # Copyright 1998 Gerald Combs
9 #
10
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24
25 ACLOCAL_AMFLAGS = `./aclocal-flags`
26
27 bin_PROGRAMS = @ethereal_bin@ @editcap_bin@ @tethereal_bin@
28 man_MANS = @ethereal_man@ @editcap_man@ @tethereal_man@
29
30 EXTRA_PROGRAMS = ethereal ethereal_static tethereal editcap
31 EXTRA_MANS = ethereal.1 tethereal.1 editcap.1
32
33 sysconf_DATA = manuf
34
35 DISSECTOR_SOURCES = \
36         packet-aarp.c  \
37         packet-afs.c   \
38         packet-aim.c   \
39         packet-arp.c   \
40         packet-ascend.c\
41         packet-atalk.c \
42         packet-atm.c   \
43         packet-auto_rp.c   \
44         packet-bgp.c   \
45         packet-bootp.c \
46         packet-bootparams.c \
47         packet-bpdu.c  \
48         packet-bxxp.c \
49         packet-cdp.c   \
50         packet-cgmp.c  \
51         packet-clip.c  \
52         packet-clnp.c  \
53         packet-cops.c  \
54         packet-data.c  \
55         packet-ddtp.c  \
56         packet-diameter.c \
57         packet-dns.c   \
58         packet-eigrp.c \
59         packet-esis.c  \
60         packet-eth.c   \
61         packet-ethertype.c   \
62         packet-fddi.c  \
63         packet-frame.c  \
64         packet-ftp.c   \
65         packet-giop.c  \
66         packet-gre.c   \
67         packet-gvrp.c  \
68         packet-h1.c    \
69         packet-h261.c  \
70         packet-hsrp.c  \
71         packet-http.c  \
72         packet-icmpv6.c\
73         packet-icp.c   \
74         packet-icq.c   \
75         packet-igrp.c  \
76         packet-imap.c   \
77         packet-ip.c    \
78         packet-ipp.c   \
79         packet-ipsec.c \
80         packet-ipv6.c  \
81         packet-ipx.c   \
82         packet-irc.c   \
83         packet-ieee80211.c \
84         packet-isakmp.c\
85         packet-isis.c  \
86         packet-isis-clv.c \
87         packet-isis-hello.c \
88         packet-isis-lsp.c \
89         packet-isis-snp.c \
90         packet-isl.c   \
91         packet-kerberos.c \
92         packet-l2tp.c  \
93         packet-lapb.c  \
94         packet-lapd.c  \
95         packet-ldap.c  \
96         packet-ldp.c   \
97         packet-llc.c   \
98         packet-lpd.c   \
99         packet-mapi.c  \
100         packet-mip.c  \
101         packet-mount.c \
102         packet-mpls.c \
103         packet-msproxy.c \
104         packet-nbipx.c \
105         packet-nbns.c  \
106         packet-ncp.c   \
107         packet-ncp2222.c   \
108         packet-netbios.c \
109         packet-nfs.c   \
110         packet-nlm.c   \
111         packet-nntp.c  \
112         packet-ntp.c  \
113         packet-null.c  \
114         packet-osi.c   \
115         packet-osi-options.c \
116         packet-ospf.c  \
117         packet-pim.c   \
118         packet-pop.c   \
119         packet-portmap.c   \
120         packet-ppp.c   \
121         packet-pppoe.c \
122         packet-pptp.c  \
123         packet-q2931.c \
124         packet-q931.c  \
125         packet-quake.c \
126         packet-radius.c\
127         packet-raw.c   \
128         packet-rip.c   \
129         packet-ripng.c \
130         packet-rlogin.c \
131         packet-rpc.c   \
132         packet-rsh.c   \
133         packet-rsvp.c  \
134         packet-rtcp.c  \
135         packet-rtp.c   \
136         packet-rtsp.c  \
137         packet-rx.c  \
138         packet-sap.c   \
139         packet-sctp.c   \
140         packet-sdp.c   \
141         packet-sip.c   \
142         packet-smb.c   \
143         packet-smb-browse.c \
144         packet-smb-common.c \
145         packet-smb-logon.c \
146         packet-smb-mailslot.c \
147         packet-smb-pipe.c \
148         packet-smtp.c \
149         packet-sna.c   \
150         packet-snmp.c   \
151         packet-socks.c \
152         packet-srvloc.c \
153         packet-sscop.c \
154         packet-stat.c   \
155         packet-syslog.c \
156         packet-tacacs.c \
157         packet-tcp.c   \
158         packet-telnet.c\
159         packet-tftp.c  \
160         packet-time.c  \
161         packet-tns.c \
162         packet-tpkt.c  \
163         packet-tr.c    \
164         packet-trmac.c \
165         packet-udp.c   \
166         packet-v120.c \
167         packet-vines.c \
168         packet-vlan.c \
169         packet-vrrp.c \
170         packet-vtp.c  \
171         packet-wccp.c \
172         packet-who.c  \
173         packet-wsp.c \
174         packet-wtp.c \
175         packet-x11.c   \
176         packet-x25.c   \
177         packet-yhoo.c  \
178         packet-ypbind.c \
179         packet-ypserv.c \
180         packet-ypxfr.c \
181         packet-zebra.c
182
183 noinst_HEADERS = \
184         packet-afs.h   \
185         packet-afs-macros.h \
186         packet-afs-register-info.h \
187         packet-afs-defs.h \
188         packet-arp.h   \
189         packet-atalk.h \
190         packet-bgp.h   \
191         packet-bootparams.h \
192         packet-cdp.h   \
193         packet-cgmp.h  \
194         packet-clip.h  \
195         packet-ddtp.h  \
196         packet-diameter.h \
197         packet-diameter-defs.h \
198         packet-dns.h   \
199         packet-esis.h  \
200         packet-eth.h   \
201         packet-fddi.h  \
202         packet-frame.h  \
203         packet-gvrp.h  \
204         packet-h261.h  \
205         packet-http.h  \
206         packet-ieee80211.h \
207         packet-ip.h    \
208         packet-ipsec.h \
209         packet-ipv6.h  \
210         packet-ipx.h   \
211         packet-isis.h  \
212         packet-isis-clv.h \
213         packet-isis-hello.h \
214         packet-isis-lsp.h \
215         packet-isis-snp.h \
216         packet-isl.h   \
217         packet-kerberos.h \
218         packet-ldap.h  \
219         packet-llc.h   \
220         packet-mount.h \
221         packet-ncp-int.h \
222         packet-netbios.h \
223         packet-nfs.h   \
224         packet-nlm.h   \
225         packet-ntp.h  \
226         packet-null.h  \
227         packet-osi.h   \
228         packet-osi-options.h \
229         packet-ospf.h  \
230         packet-portmap.h   \
231         packet-ppp.h   \
232         packet-q2931.h \
233         packet-q931.h  \
234         packet-raw.h   \
235         packet-rip.h   \
236         packet-ripng.h \
237         packet-rpc.h   \
238         packet-rtcp.h  \
239         packet-rtp.h   \
240         packet-rx.h  \
241         packet-smb.h   \
242         packet-smb-common.h \
243         packet-sna.h   \
244         packet-snmp.h   \
245         packet-sscop.h \
246         packet-stat.h   \
247         packet-tcp.h   \
248         packet-tns.h \
249         packet-tpkt.h  \
250         packet-tr.h    \
251         packet-trmac.h \
252         packet-udp.h   \
253         packet-vines.h \
254         packet-vlan.h \
255         packet-vtp.h  \
256         packet-wap.h \
257         packet-wccp.h \
258         packet-wsp.h \
259         packet-wtp.h \
260         packet-x11-declarations.h       \
261         packet-x11-register-info.h      \
262         packet-x11-keysym.h     \
263         packet-x25.h   \
264         packet-yhoo.h  \
265         packet-ypbind.h \
266         packet-ypserv.h \
267         packet-ypxfr.h 
268
269 ETHEREAL_COMMON_SOURCES = \
270         aftypes.h      \
271         alignment.h    \
272         asn1.c         \
273         asn1.h         \
274         column.c       \
275         column.h       \
276         color.h        \
277         etypes.h       \
278         follow.c       \
279         follow.h       \
280         in_cksum.c     \
281         in_cksum.h     \
282         ipproto.c      \
283         llcsaps.h      \
284         nlpid.h        \
285         oui.h          \
286         ppptypes.h     \
287         prefs.c        \
288         prefs.h        \
289         prefs-int.h    \
290         print.c        \
291         print.h        \
292         ps.c           \
293         ps.h           \
294         ptvcursor.c     \
295         ptvcursor.h     \
296         register.c     \
297         register.h     \
298         smb.h          \
299         timestamp.h    \
300         util.c         \
301         util.h         \
302         xdlc.c         \
303         xdlc.h
304
305 ethereal_SOURCES = \
306         $(DISSECTOR_SOURCES) \
307         $(ETHEREAL_COMMON_SOURCES) \
308         capture.c      \
309         capture.h      \
310         file.c         \
311         file.h         \
312         globals.h      \
313         menu.h         \
314         simple_dialog.h \
315         summary.c      \
316         summary.h      \
317         ui_util.h
318
319 ethereal_static_SOURCES = \
320         $(ethereal_SOURCES)
321
322 EXTRA_ethereal_SOURCES = \
323         snprintf.c      \
324         snprintf.h      \
325         snprintf-imp.h  \
326         strerror.c      \
327         strerror.h      \
328         strcasecmp.c    \
329         strncasecmp.c   \
330         mkstemp.c       \
331         mkstemp.h
332
333 # Optional objects that I know how to build. These will be
334 # linked into the ethereal executable.
335 # They will also be linked into the tethereal executable; if this
336 # list ever grows to include something that can't be linked with
337 # tethereal, or if tethereal needs something that ethereal doesn't,
338 # we should probably split this into stuff needed both
339 # by ethereal and tethereal and stuff needed only by one or the
340 # other.
341 ethereal_optional_objects = @SNPRINTF_O@ @STRERROR_O@ \
342         @STRCASECMP_O@ @STRNCASECMP_O@ @MKSTEMP_O@
343
344 # Additional libs that I know how to build. These will be
345 # linked into the ethereal executable.
346 ethereal_additional_libs = wiretap/libwiretap.a gtk/libui.a epan/libethereal.a
347
348 # This is the automake dependency variable for the executable
349 ethereal_DEPENDENCIES = \
350         $(ethereal_optional_objects)    \
351         $(ethereal_additional_libs)     \
352         plugins/gryphon/gryphon.la \
353         plugins/mgcp/mgcp.la
354
355 ethereal_static_DEPENDENCIES = \
356         $(ethereal_optional_objects)    \
357         $(ethereal_additional_libs)
358
359 # This automake variable adds to the link-line for the executable.
360 #
361 # Note that Ethereal doesn't have to be linked with @GLIB_LIBS@, as
362 # they are included in @GTK_LIBS@, and doesn't have to be linked with
363 # @SOCKET_LIBS@ or @NSL_LIBS@, as those should also be included in
364 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
365 # applications are X applications).
366 ethereal_LDADD = \
367         $(ethereal_optional_objects)    \
368         $(ethereal_additional_libs)     \
369         @SNMP_LIBS@                     \
370         "-dlopen" self  \
371         "-dlopen" plugins/gryphon/gryphon.la @PCAP_LIBS@ @GTK_LIBS@ \
372         "-dlopen" plugins/mgcp/mgcp.la @PCAP_LIBS@ @GTK_LIBS@
373
374 ethereal_static_LDADD = \
375         $(ethereal_optional_objects)    \
376         $(ethereal_additional_libs) \
377         @SNMP_LIBS@                     \
378         @PCAP_LIBS@ @GTK_LIBS@
379
380 ethereal_LDFLAGS = -export-dynamic
381 ethereal_static_LDFLAGS = -Wl,-static
382
383 tethereal_SOURCES = \
384         $(DISSECTOR_SOURCES) \
385         $(ETHEREAL_COMMON_SOURCES) \
386         tethereal.c
387
388 # Additional libs that I know how to build. These will be
389 # linked into the tethereal executable.
390 tethereal_additional_libs = wiretap/libwiretap.a epan/libethereal.a
391
392 # This is the automake dependency variable for the executable
393 tethereal_DEPENDENCIES = \
394         $(ethereal_optional_objects)    \
395         $(tethereal_additional_libs)    \
396         plugins/gryphon/gryphon.la      \
397         plugins/mgcp/mgcp.la
398
399 # This automake variable adds to the link-line for the executable
400 tethereal_LDADD = wiretap/libwiretap.a  \
401         $(ethereal_optional_objects)    \
402         $(tethereal_additional_libs)    \
403         @SNMP_LIBS@                     \
404         "-dlopen" self  \
405         "-dlopen" plugins/gryphon/gryphon.la @GLIB_LIBS@ -lm \
406         "-dlopen" plugins/mgcp/mgcp.la @GLIB_LIBS@ -lm \
407         @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@
408
409 tethereal_LDFLAGS = -export-dynamic
410
411 editcap_SOURCES = editcap.c
412
413 # This is the automake dependency variable for the executable
414 editcap_DEPENDENCIES = wiretap/libwiretap.a
415
416 # This automake variable adds to the link-line for the executable
417 editcap_LDADD = wiretap/libwiretap.a @GLIB_LIBS@
418
419 #
420 # Build "register.c", which contains a function "register_all_protocols()"
421 # that calls the register routines for all protocols.
422 #
423 # We do this by grepping through sources.  If that turns out to be too slow,
424 # maybe we could just require every .o file to have an register routine
425 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
426 #
427 # Formatting conventions:  The name of the proto_register_* routines must
428 # start in column zero, or must be preceded only by "void " starting in
429 # column zero, and must not be inside #if.
430 #
431 # We assume that all dissector routines are in "packet-XXX.c" files.
432 #
433 # For some unknown reason, having a big "for" loop in the Makefile
434 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
435 # they seem to pass only the first few names in the list to the shell,
436 # for some reason.
437 #
438 # Therefore, we have a script to generate the "register.c" file.
439 #
440 # The first argument is the directory in which the source files live.
441 # All subsequent arguments are the files to scan.
442 #
443 register.c: $(DISSECTOR_SOURCES) $(srcdir)/make-reg-dotc
444         @echo Making register.c
445         @$(srcdir)/make-reg-dotc $(srcdir) $(DISSECTOR_SOURCES)
446
447 ps.c: print.ps rdps
448         ./rdps $(srcdir)/print.ps ps.c
449
450 rdps: rdps.c
451         $(CC) $(CFLAGS) -o rdps $(srcdir)/rdps.c
452
453 randpkt.o: randpkt.c
454         $(CC) -DHAVE_CONFIG_H -I. `glib-config --cflags` -c $(srcdir)/randpkt.c
455
456 randpkt: randpkt.o wiretap/libwiretap.a
457         $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
458
459 DISTCLEANFILES =        \
460         register.c      \
461         rdps            \
462         ps.c            \
463         *~
464
465 EXTRA_DIST = \
466         aclocal-flags           \
467         config.h.win32          \
468         config.nmake            \
469         debian/README.debian    \
470         debian/changelog        \
471         debian/control          \
472         debian/copyright        \
473         debian/dirs             \
474         debian/docs             \
475         debian/menu             \
476         debian/postinst         \
477         debian/prerm            \
478         debian/rules            \
479         doc/README.developer    \
480         doc/Makefile.in         \
481         doc/Makefile.am         \
482         doc/README.regression   \
483         doc/README.tvbuff       \
484         doc/dfilter2pod.pl      \
485         doc/editcap.pod         \
486         doc/ethereal.pod.template \
487         doc/randpkt.txt         \
488         doc/tethereal.pod.template \
489         editcap.c               \
490         getopt.c                \
491         getopt.h                \
492         ieee-float.h            \
493         image/editcap.rc        \
494         image/ethereal48x48-trans.png  \
495         image/ethereal48x48.png \
496         image/ethereal.ico      \
497         image/ethereal.rc       \
498         image/icon-excl.xpm     \
499         image/icon-ethereal.xpm \
500         image/tethereal.rc      \
501         INSTALL.configure       \
502         libpcap-0.4.HPUX.HPUXPAC.patch \
503         libpcap-0.4.HPUX.LBL.patch \
504         libpcap-0.5.HPUX.tcpdump.org.patch \
505         Makefile.nmake          \
506         make-reg-dotc           \
507         manuf                   \
508         ncp2222.py              \
509         packet-ncp2222.inc      \
510         print.ps                \
511         README.aix              \
512         README.bsd              \
513         README.hpux             \
514         README.irix             \
515         README.linux            \
516         README.tru64            \
517         README.vmware           \
518         README.win32            \
519         randpkt.c               \
520         rdps.c                  \
521         TODO
522
523 if SETUID_INSTALL
524 install-exec-hook:
525         -chmod +s $(DESTDIR)$(bindir)/ethereal
526         -chmod +s $(DESTDIR)$(bindir)/tethereal
527         -chmod +s $(DESTDIR)$(bindir)/ethereal_static
528 else
529 install-exec-hook:
530 endif
531
532 #
533 # Currently register.c can be included in the distribution because
534 # we always build all protocol dissectors. We used to have to check
535 # whether or not to build the snmp dissector. If we again need to
536 # variably build something, making register.c non-portable, uncomment
537 # the dist-hook line below.
538 #
539 # Oh, yuk.  We don't want to include "register.c" in the distribution, as
540 # its contents depend on the configuration, and therefore we want it
541 # to be built when the first "make" is done; however, Automake insists
542 # on putting *all* source into the distribution.
543 #
544 # We work around this by having a "dist-hook" rule that deletes
545 # "register.c", so that "dist" won't pick it up.
546 #
547 #dist-hook:
548 #       @rm -f $(distdir)/register.c
549
550 SUBDIRS = wiretap epan plugins packaging @ethereal_SUBDIRS@
551
552 ethereal.1: ethereal doc/ethereal.pod.template
553         (cd doc ; \
554         $(MAKE) ../ethereal.1 )
555
556 tethereal.1: tethereal doc/tethereal.pod.template
557         (cd doc ; \
558         $(MAKE) ../tethereal.1 )
559
560 editcap.1: doc/editcap.pod
561         (cd doc ; \
562         $(MAKE) ../editcap.1 )
563
564 packet-ncp2222.c : ncp2222.py
565         $(PYTHON) $(srcdir)/ncp2222.py > $@
566
567 libtool: $(LIBTOOL_DEPS)
568         $(SHELL) ./config.status --recheck
569
570 # We load top_stagedir with an explicit path so that libtool doesn't freak.
571 top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
572 stagedir=$(top_stagedir)/$(PACKAGE).stage
573 host_cpu=@host_cpu@
574 host_os=@host_os@
575
576 svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
577         if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
578                 rm -rf $(stagedir) ; \
579                 $(MAKE) DESTDIR=$(stagedir) install-strip; \
580                 $(srcdir)/packaging/svr4/mkpkg \
581                         $(PACKAGE) \
582                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
583                         $(prefix) \
584                         $(top_stagedir) ; \
585         else \
586                 echo "Error: SVR4 packaging tools not found." ; \
587                 echo "Package build abandoned." ; \
588         fi
589
590 solaris-package: svr4-package
591
592 specfile=$(top_srcdir)/packaging/rpm/ethereal.spec
593
594 rpm-package: dist
595         if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
596                 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
597                 rpm -bb --clean --rmsource $(specfile) ; \
598         else \
599                 echo "Error: RPM executable and/or source directory not found." ; \
600                 echo "Package build abandoned." ; \
601         fi
602
603 srpm-package: dist
604         if test x$(HAVE_RPM_PACKAGING) = xyes ; then \
605                 cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \
606                 rpm -bs --clean --rmsource $(specfile) ; \
607         else \
608                 echo "Error: RPM executable and/or source directory not found." ; \
609                 echo "Package build abandoned." ; \
610         fi
611
612 debian-package: debian/rules
613         dpkg-buildpackage -rfakeroot -us -uc
614
615 clean-local:
616         rm -rf $(top_stagedir)