Rewrite dissectors to use Libgcrypt functions.
[metze/wireshark/wip.git] / Makefile.am
1 # Makefile.am
2 # Automake file for Wireshark
3 #
4 # Wireshark - Network traffic analyzer
5 # By Gerald Combs <gerald@wireshark.org>
6 # Copyright 1998 Gerald Combs
7 #
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22 include ./Makefile.am.inc
23
24 AM_DISTCHECK_CONFIGURE_FLAGS=@GUI_CONFIGURE_FLAGS@
25 # Make sure to keep ACLOCAL_AMFLAGS in Makefile.am and AC_CONFIG_MACRO_DIRS
26 # in configure.ac in sync, otherwise there will be an error running autogen.sh.
27 ACLOCAL_AMFLAGS = -I m4
28
29 # Common headers
30 COMMONCPPFLAGS =
31
32 AM_CPPFLAGS = $(INCLUDEDIRS) $(WS_CPPFLAGS) $(COMMONCPPFLAGS)
33
34 bin_PROGRAMS = \
35         @wireshark_bin@         \
36         @tshark_bin@            \
37         @tfshark_bin@           \
38         @text2pcap_bin@         \
39         @mergecap_bin@          \
40         @capinfos_bin@          \
41         @captype_bin@           \
42         @editcap_bin@           \
43         @randpkt_bin@           \
44         @dftest_bin@            \
45         @dumpcap_bin@           \
46         @reordercap_bin@        \
47         @rawshark_bin@          \
48         @sharkd_bin@            \
49         @echld_test_bin@
50
51 EXTRA_PROGRAMS = wireshark-gtk wireshark tshark tfshark capinfos captype \
52         editcap mergecap dftest randpkt text2pcap dumpcap reordercap \
53         rawshark sharkd echld_test
54
55 #
56 # Wireshark configuration files are put in $(pkgdatadir).
57 #
58 dist_pkgdata_DATA = COPYING manuf services cfilters colorfilters dfilters \
59         smi_modules ipmap.html pdml2html.xsl
60
61 pkgconfigdir = $(libdir)/pkgconfig
62 pkgconfig_DATA = wireshark.pc
63
64 #
65 # Install global profiles in the "profiles" subdirectory
66 #
67 profilesdir = $(pkgdatadir)
68 nobase_dist_profiles_DATA = \
69         profiles/Bluetooth/colorfilters \
70         profiles/Classic/colorfilters
71
72 #
73 # Install the Diameter DTD and XML files in the "diameter" subdirectory
74 # of that directory.
75 #
76 diameterdir = $(pkgdatadir)/diameter
77 include diameter/Custom.make
78 dist_diameter_DATA = $(_CUSTOM_diameter_xml_files_) \
79         diameter/chargecontrol.xml \
80         diameter/Cisco.xml \
81         diameter/CiscoSystems.xml \
82         diameter/Custom.xml \
83         diameter/dictionary.dtd \
84         diameter/dictionary.xml \
85         diameter/eap.xml \
86         diameter/Ericsson.xml \
87         diameter/etsie2e4.xml \
88         diameter/mobileipv4.xml \
89         diameter/mobileipv6.xml \
90         diameter/nasreq.xml \
91         diameter/sip.xml \
92         diameter/Starent.xml \
93         diameter/sunping.xml \
94         diameter/TGPP.xml \
95         diameter/TGPP2.xml \
96         diameter/Vodafone.xml \
97         diameter/AlcatelLucent.xml \
98         diameter/Nokia.xml \
99         diameter/NokiaSolutionsAndNetworks.xml \
100         diameter/HP.xml \
101         diameter/Oracle.xml
102
103 #
104 # Install the DTDs directory files in the "dtds" subdirectory
105 # of that directory
106 #
107 dtdsdir = $(pkgdatadir)/dtds
108 dist_dtds_DATA = \
109         dtds/dc.dtd \
110         dtds/itunes.dtd \
111         dtds/mscml.dtd \
112         dtds/pocsettings.dtd \
113         dtds/presence.dtd \
114         dtds/reginfo.dtd \
115         dtds/rlmi.dtd \
116         dtds/rss.dtd \
117         dtds/smil.dtd \
118         dtds/xcap-caps.dtd \
119         dtds/xcap-error.dtd \
120         dtds/watcherinfo.dtd
121
122 #
123 # Install the RADIUS directory files in the "radius" subdirectory
124 # of that directory.
125 #
126 radiusdir = $(pkgdatadir)/radius
127 include radius/Custom.make
128 dist_radius_DATA = $(_CUSTOM_radius_dict_) \
129         radius/README.radius_dictionary \
130         radius/custom.includes \
131         radius/dictionary \
132         radius/dictionary.3com \
133         radius/dictionary.3gpp \
134         radius/dictionary.3gpp2 \
135         radius/dictionary.acc \
136         radius/dictionary.acme \
137         radius/dictionary.airespace \
138         radius/dictionary.actelis \
139         radius/dictionary.aerohive \
140         radius/dictionary.alcatel \
141         radius/dictionary.alcatel.esam \
142         radius/dictionary.alcatel.sr \
143         radius/dictionary.alcatel-lucent.aaa \
144         radius/dictionary.alteon \
145         radius/dictionary.altiga \
146         radius/dictionary.alvarion \
147         radius/dictionary.alvarion.wimax.v2_2 \
148         radius/dictionary.apc \
149         radius/dictionary.aptis \
150         radius/dictionary.arbor \
151         radius/dictionary.aruba \
152         radius/dictionary.ascend \
153         radius/dictionary.asn \
154         radius/dictionary.audiocodes \
155         radius/dictionary.avaya \
156         radius/dictionary.azaire \
157         radius/dictionary.bay \
158         radius/dictionary.bluecoat \
159         radius/dictionary.bintec \
160         radius/dictionary.broadsoft \
161         radius/dictionary.brocade \
162         radius/dictionary.bskyb \
163         radius/dictionary.bristol \
164         radius/dictionary.bt \
165         radius/dictionary.camiant \
166         radius/dictionary.cablelabs \
167         radius/dictionary.cabletron \
168         radius/dictionary.chillispot \
169         radius/dictionary.cisco \
170         radius/dictionary.cisco.asa \
171         radius/dictionary.cisco.bbsm \
172         radius/dictionary.cisco.vpn3000 \
173         radius/dictionary.cisco.vpn5000 \
174         radius/dictionary.citrix \
175         radius/dictionary.clavister \
176         radius/dictionary.cnergee \
177         radius/dictionary.colubris \
178         radius/dictionary.columbia_university \
179         radius/dictionary.compatible \
180         radius/dictionary.compat \
181         radius/dictionary.cosine \
182         radius/dictionary.dante \
183         radius/dictionary.dhcp \
184         radius/dictionary.dlink \
185         radius/dictionary.digium \
186         radius/dictionary.dragonwave \
187         radius/dictionary.efficientip \
188         radius/dictionary.eltex \
189         radius/dictionary.epygi \
190         radius/dictionary.equallogic \
191         radius/dictionary.ericsson \
192         radius/dictionary.ericsson.ab \
193         radius/dictionary.ericsson.packet.core.networks \
194         radius/dictionary.erx \
195         radius/dictionary.extreme \
196         radius/dictionary.f5 \
197         radius/dictionary.fdxtended \
198         radius/dictionary.fortinet \
199         radius/dictionary.foundry \
200         radius/dictionary.freedhcp \
201         radius/dictionary.freeradius \
202         radius/dictionary.freeradius.internal \
203         radius/dictionary.freeswitch \
204         radius/dictionary.gandalf \
205         radius/dictionary.garderos \
206         radius/dictionary.gemtek \
207         radius/dictionary.h3c \
208         radius/dictionary.hp \
209         radius/dictionary.huawei \
210         radius/dictionary.iana \
211         radius/dictionary.iea \
212         radius/dictionary.infoblox \
213         radius/dictionary.infonet \
214         radius/dictionary.ipunplugged \
215         radius/dictionary.issanni \
216         radius/dictionary.itk \
217         radius/dictionary.jradius \
218         radius/dictionary.juniper \
219         radius/dictionary.kineto \
220         radius/dictionary.karlnet \
221         radius/dictionary.lancom \
222         radius/dictionary.livingston \
223         radius/dictionary.localweb \
224         radius/dictionary.lucent \
225         radius/dictionary.manzara \
226         radius/dictionary.meinberg \
227         radius/dictionary.merit \
228         radius/dictionary.meru \
229         radius/dictionary.microsemi \
230         radius/dictionary.microsoft \
231         radius/dictionary.mikrotik \
232         radius/dictionary.motorola \
233         radius/dictionary.motorola.wimax \
234         radius/dictionary.navini \
235         radius/dictionary.netscreen \
236         radius/dictionary.networkphysics \
237         radius/dictionary.nexans \
238         radius/dictionary.nokia \
239         radius/dictionary.nokia.conflict \
240         radius/dictionary.nomadix \
241         radius/dictionary.nortel \
242         radius/dictionary.ntua \
243         radius/dictionary.openser \
244         radius/dictionary.packeteer \
245         radius/dictionary.paloalto \
246         radius/dictionary.patton \
247         radius/dictionary.perle \
248         radius/dictionary.propel \
249         radius/dictionary.prosoft \
250         radius/dictionary.proxim \
251         radius/dictionary.purewave \
252         radius/dictionary.quiconnect \
253         radius/dictionary.quintum \
254         radius/dictionary.redcreek \
255         radius/dictionary.rfc2865 \
256         radius/dictionary.rfc2866 \
257         radius/dictionary.rfc2867 \
258         radius/dictionary.rfc2868 \
259         radius/dictionary.rfc2869 \
260         radius/dictionary.rfc3162 \
261         radius/dictionary.rfc3576 \
262         radius/dictionary.rfc3580 \
263         radius/dictionary.rfc4072 \
264         radius/dictionary.rfc4372 \
265         radius/dictionary.rfc4603 \
266         radius/dictionary.rfc4675 \
267         radius/dictionary.rfc4679 \
268         radius/dictionary.rfc4818 \
269         radius/dictionary.rfc4849 \
270         radius/dictionary.rfc5090 \
271         radius/dictionary.rfc5176 \
272         radius/dictionary.rfc5447 \
273         radius/dictionary.rfc5580 \
274         radius/dictionary.rfc5607 \
275         radius/dictionary.rfc5904 \
276         radius/dictionary.rfc6519 \
277         radius/dictionary.rfc6572 \
278         radius/dictionary.rfc6677 \
279         radius/dictionary.rfc6911 \
280         radius/dictionary.rfc6929 \
281         radius/dictionary.rfc6930 \
282         radius/dictionary.rfc7055 \
283         radius/dictionary.rfc7155 \
284         radius/dictionary.rfc7268 \
285         radius/dictionary.rfc7499 \
286         radius/dictionary.rfc7930 \
287         radius/dictionary.riverbed \
288         radius/dictionary.riverstone \
289         radius/dictionary.roaringpenguin \
290         radius/dictionary.ruckus \
291         radius/dictionary.ruggedcom \
292         radius/dictionary.sangoma \
293         radius/dictionary.sg \
294         radius/dictionary.shasta \
295         radius/dictionary.shiva \
296         radius/dictionary.siemens \
297         radius/dictionary.slipstream \
298         radius/dictionary.sofaware \
299         radius/dictionary.sonicwall \
300         radius/dictionary.springtide \
301         radius/dictionary.starent \
302         radius/dictionary.starent.vsa1 \
303         radius/dictionary.surfnet \
304         radius/dictionary.symbol \
305         radius/dictionary.t_systems_nova \
306         radius/dictionary.telebit \
307         radius/dictionary.telkom \
308         radius/dictionary.terena \
309         radius/dictionary.trapeze \
310         radius/dictionary.travelping \
311         radius/dictionary.tropos \
312         radius/dictionary.ukerna \
313         radius/dictionary.unix \
314         radius/dictionary.usr \
315         radius/dictionary.utstarcom \
316         radius/dictionary.valemount \
317         radius/dictionary.versanet \
318         radius/dictionary.vqp \
319         radius/dictionary.walabi \
320         radius/dictionary.waverider \
321         radius/dictionary.wichorus \
322         radius/dictionary.wimax \
323         radius/dictionary.wimax.alvarion \
324         radius/dictionary.wimax.wichorus \
325         radius/dictionary.wispr \
326         radius/dictionary.xedia \
327         radius/dictionary.xylan \
328         radius/dictionary.yubico \
329         radius/dictionary.zeus \
330         radius/dictionary.zte \
331         radius/dictionary.zyxel
332
333 #
334 # Install the tpncp directory files in the "tpncp" subdirectory
335 # of that directory
336 #
337 tpncpdir = $(pkgdatadir)/tpncp
338 dist_tpncp_DATA = \
339         tpncp/tpncp.dat
340
341 #
342 # Install the wimaxasncp directory files in the "wimaxasncp" subdirectory
343 # of that directory
344 #
345 wimaxasncpdir = $(pkgdatadir)/wimaxasncp
346 dist_wimaxasncp_DATA = \
347         wimaxasncp/dictionary.xml \
348         wimaxasncp/dictionary.dtd
349
350 if HAVE_PLUGINS
351 -include plugins/Custom.make
352 plugin_ldadd = $(_CUSTOM_plugin_ldadd_) \
353         -dlopen plugins/docsis/docsis.la \
354         -dlopen plugins/ethercat/ethercat.la \
355         -dlopen plugins/gryphon/gryphon.la \
356         -dlopen plugins/irda/irda.la \
357         -dlopen plugins/m2m/m2m.la \
358         -dlopen plugins/mate/mate.la \
359         -dlopen plugins/opcua/opcua.la \
360         -dlopen plugins/profinet/profinet.la \
361         -dlopen plugins/stats_tree/stats_tree.la \
362         -dlopen plugins/unistim/unistim.la \
363         -dlopen plugins/wimax/wimax.la \
364         -dlopen plugins/wimaxmacphy/wimaxmacphy.la
365
366 else            # HAVE_PLUGINS
367
368 plugin_ldadd =
369
370 endif           # HAVE_PLUGINS
371
372 # "BUILT_SOURCES" are built before any "make all" or "make check" targets.
373 BUILT_HEADER_FILES = \
374         version.h
375
376 BUILT_C_FILES =
377
378 BUILT_SOURCES = $(BUILT_C_FILES) $(BUILT_HEADER_FILES)
379
380 # Header files generated from source files.
381 GENERATED_HEADER_FILES = \
382         text2pcap-scanner_lex.h \
383         $(BUILT_HEADER_FILES)
384
385 # C source files generated from source files.
386 GENERATED_C_FILES =
387
388 # All the generated files.
389 GENERATED_FILES = $(GENERATED_C_FILES) $(GENERATED_HEADER_FILES)
390
391 EXTCAP_COMMON_SRC = \
392         extcap.c                \
393         extcap_parser.c \
394         extcap_spawn.c
395
396 EXTCAP_COMMON_INCLUDES = \
397         extcap.h                \
398         extcap_parser.h \
399         extcap_spawn.h
400
401 # sources common for wireshark, tshark, and rawshark
402 SHARK_COMMON_SRC = \
403         cfile.c                 \
404         frame_tvbuff.c          \
405         sync_pipe_write.c
406
407 # corresponding headers
408 SHARK_COMMON_INCLUDES = \
409         cfile.h                 \
410         file.h                  \
411         fileset.h               \
412         frame_tvbuff.h          \
413         register.h              \
414         ws_symbol_export.h
415
416 # wireshark specifics
417 WIRESHARK_COMMON_SRC = \
418         $(SHARK_COMMON_SRC)     \
419         capture_info.c          \
420         capture_opts.c          \
421         file.c                  \
422         fileset.c               \
423         filter_files.c          \
424         summary.c               \
425         ws_version_info.c
426
427 # corresponding headers
428 WIRESHARK_COMMON_INCLUDES = \
429         capture_info.h          \
430         capture_opts.h          \
431         filter_files.h          \
432         globals.h               \
433         log.h                   \
434         summary.h               \
435         sync_pipe.h
436
437 if HAVE_EXTCAP
438 SHARK_COMMON_SRC += $(EXTCAP_COMMON_SRC)
439 endif
440
441 if ENABLE_STATIC
442 EXTRALINKFLAGS = -Wl,-static -all-static
443 else
444 EXTRALINKFLAGS = -export-dynamic
445 endif
446
447 EPAN_EXTRA_LIBS = \
448         @SSL_LIBS@                      \
449         @C_ARES_LIBS@                   \
450         @KRB5_LIBS@                     \
451         @LIBGCRYPT_LIBS@                \
452         @LIBGNUTLS_LIBS@                \
453         @LIBSMI_LDFLAGS@
454
455 # Libraries and plugin flags with which to link wireshark.
456 #
457 # GTK_CFLAGS/GTK_LIBS is a strict superset of GLIB_CFLAGS/GLIB_LIBS
458 # (see configure.ac for pkg-config modules used).
459 #
460 wireshark_common_ldadd = \
461         capchild/libcapchild.a          \
462         caputils/libcaputils.a          \
463         ui/libui.a                      \
464         ui/libui_dirty.a                \
465         codecs/libwscodecs.la           \
466         wiretap/libwiretap.la           \
467         epan/libwireshark.la            \
468         wsutil/libwsutil.la             \
469         $(plugin_ldadd)                 \
470         @PCAP_LIBS@                     \
471         @APPLICATIONSERVICES_FRAMEWORKS@        \
472         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
473         @COREFOUNDATION_FRAMEWORKS@     \
474         $(EPAN_EXTRA_LIBS)                      \
475         @LIBNL_LIBS@
476
477 if HAVE_Qt
478 wireshark_SOURCES = $(WIRESHARK_COMMON_SRC) wireshark-qt.cpp
479
480 wireshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(Qt_CFLAGS)
481
482 wireshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) $(Qt_LDFLAGS)
483
484 wireshark_LDADD = \
485         ui/qt/libqtui.a                 \
486         $(wireshark_common_ldadd)       \
487         $(GLIB_LIBS)                    \
488         $(Qt_LIBS)
489
490 if HAVE_SPEEXDSP
491 wireshark_LDADD += $(SPEEXDSP_LIBS)
492 endif
493 endif   # HAVE_Qt
494
495 if HAVE_GTK
496 wireshark_gtk_SOURCES = $(WIRESHARK_COMMON_SRC)
497
498 wireshark_gtk_CPPFLAGS = $(AM_CPPFLAGS) $(GTK_CFLAGS)
499
500 wireshark_gtk_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
501
502 wireshark_gtk_LDADD = \
503         ui/gtk/libgtkui.a               \
504         $(wireshark_common_ldadd)       \
505         $(GTK_LIBS)                     \
506         @PORTAUDIO_LIBS@
507 endif
508
509 tshark_SOURCES = \
510         $(SHARK_COMMON_SRC)     \
511         capture_opts.c          \
512         filter_files.c          \
513         tshark.c                \
514         ws_version_info.c
515
516 tshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
517
518 tshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
519
520 # Libraries and plugin flags with which to link tshark.
521 tshark_LDADD = \
522         capchild/libcapchild.a          \
523         caputils/libcaputils.a          \
524         ui/cli/libcliui.a               \
525         ui/libui.a                      \
526         wiretap/libwiretap.la           \
527         epan/libwireshark.la            \
528         wsutil/libwsutil.la             \
529         $(plugin_ldadd)                 \
530         @GLIB_LIBS@                     \
531         @PCAP_LIBS@                     \
532         ${EPAN_EXTRA_LIBS}      \
533         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
534         @COREFOUNDATION_FRAMEWORKS@
535
536 tfshark_SOURCES = \
537         $(SHARK_COMMON_SRC)     \
538         tfshark.c               \
539         ws_version_info.c
540
541 tfshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
542
543 tfshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
544
545 # Libraries and plugin flags with which to link tfshark.
546 tfshark_LDADD = \
547         ui/cli/libcliui.a               \
548         ui/libui.a                      \
549         wiretap/libwiretap.la           \
550         epan/libwireshark.la            \
551         wsutil/libwsutil.la             \
552         $(plugin_ldadd)                 \
553         @GLIB_LIBS@                     \
554         @PCAP_LIBS@                     \
555         ${EPAN_EXTRA_LIBS}      \
556         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
557         @COREFOUNDATION_FRAMEWORKS@
558
559 rawshark_SOURCES = \
560         $(SHARK_COMMON_SRC)     \
561         rawshark.c              \
562         ws_version_info.c
563
564 rawshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
565
566 rawshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
567
568 # Libraries and plugin flags with which to link rawshark.
569 rawshark_LDADD = \
570         caputils/libcaputils.a          \
571         ui/libui.a                      \
572         wiretap/libwiretap.la           \
573         epan/libwireshark.la            \
574         wsutil/libwsutil.la             \
575         $(plugin_ldadd)                 \
576         @GLIB_LIBS@                     \
577         @PCAP_LIBS@                     \
578         ${EPAN_EXTRA_LIBS}      \
579         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
580         @COREFOUNDATION_FRAMEWORKS@
581
582 sharkd_SOURCES = \
583         $(SHARK_COMMON_SRC)     \
584         filter_files.c          \
585         sharkd.c                \
586         sharkd.h                \
587         sharkd_daemon.c         \
588         sharkd_session.c        \
589         ws_version_info.c
590
591 sharkd_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
592
593 sharkd_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS)
594
595 # Libraries and plugin flags with which to link sharkd.
596 sharkd_LDADD = \
597         ui/cli/libcliui.a               \
598         ui/libui.a                      \
599         wiretap/libwiretap.la           \
600         epan/libwireshark.la            \
601         wsutil/libwsutil.la             \
602         $(plugin_ldadd)                 \
603         @GLIB_LIBS@                     \
604         @PCAP_LIBS@                     \
605         ${EPAN_EXTRA_LIBS}      \
606         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
607         @COREFOUNDATION_FRAMEWORKS@
608
609 text2pcap_SOURCES = \
610         text2pcap.c             \
611         text2pcap-scanner.l     \
612         ws_version_info.c
613
614 text2pcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
615
616 # Don't turn on -Werror for text2pcap: its source includes text2pcap-scanner.c
617 # which is generated (and therefore not always clean).
618 # We could generate text2pcap.o as a library with -Werror but for now it
619 # doesn't seem worth the effort.
620 text2pcap_CFLAGS = $(GENERATED_CFLAGS)
621
622 # Libraries with which to link text2pcap.
623 text2pcap_LDADD = \
624         writecap/libwritecap.a          \
625         wsutil/libwsutil.la             \
626         @GLIB_LIBS@
627
628 mergecap_SOURCES = \
629         mergecap.c      \
630         ws_version_info.c
631
632 mergecap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
633
634 # Libraries with which to link mergecap.
635 mergecap_LDADD = \
636         wiretap/libwiretap.la           \
637         wsutil/libwsutil.la             \
638         @GLIB_LIBS@
639
640 capinfos_SOURCES = \
641         capinfos.c      \
642         ws_version_info.c
643
644 capinfos_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
645
646 # Libraries with which to link capinfos.
647 capinfos_LDADD = \
648         wiretap/libwiretap.la           \
649         wsutil/libwsutil.la             \
650         @GLIB_LIBS@                     \
651         @LIBGCRYPT_LIBS@
652
653 captype_SOURCES = \
654         captype.c       \
655         ws_version_info.c
656
657 captype_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
658
659 # Libraries with which to link captype.
660 captype_LDADD = \
661         wiretap/libwiretap.la           \
662         wsutil/libwsutil.la             \
663         @GLIB_LIBS@
664
665 editcap_SOURCES = \
666         editcap.c       \
667         ws_version_info.c
668
669 editcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
670
671 # Libraries with which to link editcap.
672 editcap_LDADD = \
673         wiretap/libwiretap.la           \
674         wsutil/libwsutil.la             \
675         @GLIB_LIBS@                     \
676         @LIBGCRYPT_LIBS@
677
678 reordercap_SOURCES = \
679         reordercap.c    \
680         ws_version_info.c
681
682 reordercap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
683
684 # Libraries with which to link reordercap.
685 reordercap_LDADD = \
686         wiretap/libwiretap.la           \
687         wsutil/libwsutil.la             \
688         @GLIB_LIBS@
689
690 randpkt_SOURCES = \
691         randpkt.c       \
692         ws_version_info.c
693
694 randpkt_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
695
696 # Libraries with which to link randpkt.
697 randpkt_LDADD = \
698         randpkt_core/librandpkt_core.a  \
699         wiretap/libwiretap.la           \
700         wsutil/libwsutil.la             \
701         @GLIB_LIBS@                     \
702         @PCAP_LIBS@                     \
703         @C_ARES_LIBS@
704
705 dftest_SOURCES = \
706         dftest.c
707
708 dftest_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
709
710 # Libraries and plugin flags with which to link dftest.
711 dftest_LDADD = \
712         ui/libui.a                      \
713         wiretap/libwiretap.la           \
714         wsutil/libwsutil.la             \
715         epan/libwireshark.la            \
716         $(plugin_ldadd)                 \
717         @GLIB_LIBS@                     \
718         @PCAP_LIBS@                     \
719         ${EPAN_EXTRA_LIBS}
720
721 echld_test_SOURCES = \
722         echld_test.c                    \
723         capture_opts.c                  \
724         capture_stop_conditions.c       \
725         cfile.c                         \
726         conditions.c                    \
727         ringbuffer.c                    \
728         sync_pipe_write.c
729
730 echld_test_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
731
732 echld_test_LDADD = \
733         epan/libwireshark.la            \
734         echld/libechld.la               \
735         writecap/libwritecap.a          \
736         wsutil/libwsutil.la             \
737         @GLIB_LIBS@                     \
738         @PCAP_LIBS@                     \
739         @C_ARES_LIBS@
740
741 echld_test_DEPENDENCIES = \
742         echld/libechld.la       \
743         epan/libwireshark.la
744
745 dumpcap_SOURCES = \
746         capture_opts.c                  \
747         capture_stop_conditions.c       \
748         conditions.c                    \
749         dumpcap.c                       \
750         filter_files.c                  \
751         ringbuffer.c                    \
752         sync_pipe_write.c               \
753         ws_version_info.c
754
755 dumpcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
756
757 dumpcap_CFLAGS = $(AM_CFLAGS) $(PIE_CFLAGS)
758
759 dumpcap_LDFLAGS = $(AM_LDFLAGS) $(PIE_LDFLAGS)
760
761 # Libraries with which to link dumpcap.
762 dumpcap_LDADD = \
763         caputils/libcaputils.a          \
764         writecap/libwritecap.a          \
765         wsutil/libwsutil.la             \
766         @GLIB_LIBS@                     \
767         @PCAP_LIBS@                     \
768         @SYSTEMCONFIGURATION_FRAMEWORKS@        \
769         @COREFOUNDATION_FRAMEWORKS@     \
770         @LIBCAP_LIBS@                   \
771         @LIBNL_LIBS@
772
773 # this target needed for distribution only
774 noinst_HEADERS = \
775         $(SHARK_COMMON_INCLUDES)        \
776         $(EXTCAP_COMMON_INCLUDES)       \
777         $(WIRESHARK_COMMON_INCLUDES)    \
778         capture_stop_conditions.h       \
779         conditions.h                    \
780         ringbuffer.h                    \
781         ws_diag_control.h               \
782         ws_version_info.h
783
784 #
785 # Build the version string
786 #
787 # FORCE is the portable version of .PHONY
788 FORCE:
789
790 version.h: FORCE
791         $(AM_V_PERL)$(PERL) $(srcdir)/make-version.pl $(srcdir)
792
793 #
794 # Build shell scripts by doing variable substitution.
795 # Taken from autoconf 2.13.
796 #
797 editsh = sed -e 's,@''SHELL''@,$(SHELL),g'
798
799 SUFFIXES = .sh
800 .sh:
801         rm -f $@ $@.tmp
802         $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
803
804 services:
805         $(PYTHON) $(srcdir)/tools/make-services.py
806
807 CLEANFILES = \
808         *~              \
809         doxygen-core.tag        \
810         vgcore.*
811
812 #
813 # We have to remove version.h with "make distclean", as, otherwise,
814 # "make distcheck" fails.  We still need to make the tarballs work
815 # even if you do "make distclean" and try to rebuild; that's a work in
816 # progress.
817 #
818 # XXX - "ps.c" is distributed in the source tarballs; why is it in the
819 # list of files removed by "make distclean"?  (It's deliberately
820 # included in that list.)
821 #
822 DISTCLEANFILES = \
823         ps.c                    \
824         version.h
825
826 MAINTAINERCLEANFILES = \
827         $(GENERATED_FILES)      \
828         Makefile.in             \
829         aclocal.m4              \
830         compile                 \
831         config.h.in             \
832         configure               \
833         depcomp                 \
834         install-sh              \
835         ltmain.sh               \
836         missing                 \
837         ylwrap
838
839 EXTRA_DIST = \
840         .editorconfig           \
841         .mailmap                \
842         INSTALL.configure       \
843         Makefile.am.inc         \
844         README.aix              \
845         README.bsd              \
846         README.DECT             \
847         README.hpux             \
848         README.linux            \
849         README.macos            \
850         README.vmware           \
851         README.windows          \
852         abi-descriptor.template \
853         autogen.sh              \
854         cfilters                \
855         colorfilters            \
856         debian                  \
857         dfilters                \
858         doxygen_global.cfg      \
859         doxygen.cfg.in          \
860         fix                     \
861         idl                     \
862         image                   \
863         ipmap.html              \
864         m4                      \
865         macosx-setup.sh         \
866         macosx-support-lib-patches      \
867         make-version.pl         \
868         manuf                   \
869         manuf.tmpl              \
870         pdml2html.xsl           \
871         smi_modules             \
872         text2pcap-scanner.l     \
873         text2pcap.h             \
874         services                \
875         wireshark.desktop       \
876         wireshark-gtk.desktop   \
877         wireshark-mime-package.xml      \
878         wireshark.appdata.xml   \
879         wireshark.pc.in         \
880         wka.tmpl                \
881         CMakeLists.txt          \
882         CMakeListsCustom.txt.example    \
883         cmakeconfig.h.in        \
884         CMakeOptions.txt        \
885         README.cmake            \
886         ConfigureChecks.cmake   \
887         cmake                   \
888         CPackConfig.txt
889
890 install-exec-hook:
891 if HAVE_DUMPCAP_GROUP
892         chgrp $(DUMPCAP_GROUP) $(DESTDIR)$(bindir)/dumpcap
893 endif
894 if SETCAP_INSTALL
895         $(SETCAP) cap_net_raw,cap_net_admin+ep $(DESTDIR)$(bindir)/dumpcap
896         chmod o-rws $(DESTDIR)$(bindir)/dumpcap
897 else
898 if SETUID_INSTALL
899         chmod o-rws $(DESTDIR)$(bindir)/dumpcap
900         chmod +s $(DESTDIR)$(bindir)/dumpcap
901 endif
902 endif
903
904
905 DIST_SUBDIRS = \
906         capchild        \
907         caputils        \
908         codecs          \
909         doc             \
910         epan            \
911         echld           \
912         ui              \
913         ui/cli          \
914         ui/gtk          \
915         ui/qt           \
916         help            \
917         packaging       \
918         plugins         \
919         randpkt_core    \
920         tools           \
921         wiretap         \
922         writecap        \
923         wsutil          \
924         extcap          \
925         docbook
926
927 SUBDIRS = \
928         tools                   \
929         wsutil                  \
930         writecap                \
931         wiretap                 \
932         epan                    \
933         capchild                \
934         caputils                \
935         @echld_dir@             \
936         @plugins_dir@           \
937         packaging               \
938         help                    \
939         ui                      \
940         @wireshark_SUBDIRS@     \
941         ui/cli                  \
942         randpkt_core            \
943         @extcap_subdir@         \
944         .                       \
945         doc
946
947 help/faq.txt: $(srcdir)/help/faq.py
948         $(AM_V_GEN)(cd help ; \
949         $(MAKE) faq.txt ;)
950
951 libtool: $(LIBTOOL_DEPS)
952         $(SHELL) ./config.status --recheck
953
954
955 #
956 # Install icons and other desktop files for (for use with GNOME, KDE, or
957 # any other freedesktop.org-compliant desktops).
958 #
959 # We use $(datadir).  If the desktop doesn't look for them there,
960 # the desktop is broken; the latest XDG Base Directory Specification
961 # at
962 #
963 #    http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
964 #
965 # says
966 #
967 # $XDG_DATA_DIRS defines the preference-ordered set of base directories
968 # to search for data files in addition to the $XDG_DATA_HOME base
969 # directory. The directories in $XDG_DATA_DIRS should be seperated with a
970 # colon ':'.
971 #
972 # If $XDG_DATA_DIRS is either not set or empty, a value equal to
973 # /usr/local/share/:/usr/share/ should be used.
974 #
975 # so:
976 #
977 #    if this is configured to install under /usr, that should Just Work,
978 #    unless XDG_DATA_DIRS is set incorrectly or the desktop isn't
979 #    compliant with the latest version of the spec;
980 #
981 #    if this installs under the default /usr/share, that should Just Work,
982 #    unless XDG_DATA_DIRS is set incorrectly or the desktop isn't
983 #    compliant with the latest version of the spec;
984 #
985 #    if this is configured to install somewhere else, whoever configured
986 #    it should also have made sure that XDG_DATA_DIRS was set correctly
987 #    and, if that doesn't work, the desktop isn't compliant with the
988 #    latest version of the spec.
989 #
990 # We install these as part of the standard installation process, just
991 # as, for example, Inkscape does with its icons.  See bug 10737.
992 #
993 # Do not use the -T flag to the install command, as it's not portable.
994 # Some versions of install don't support a -T flag at all, and the
995 # FreeBSD install command has a -T flag that takes an argument and
996 # that has completely different semantics.
997 #
998 # We neither need nor want any of this on OS X, nor do we want it if
999 # we're not building Wireshark (that being the only desktop app).
1000 #
1001 install-data-local:
1002 if BUILDING_WIRESHARK
1003 if NOT_OS_X
1004         mkdir -p $(DESTDIR)$(datadir)/mime/packages
1005         install -m 644 $(srcdir)/wireshark-mime-package.xml $(DESTDIR)$(datadir)/mime/packages/wireshark.xml
1006         mkdir -p $(DESTDIR)$(datadir)/appdata
1007         install -m 644 $(srcdir)/wireshark.appdata.xml $(DESTDIR)$(datadir)/appdata/wireshark.appdata.xml
1008         mkdir -p $(DESTDIR)$(datadir)/applications
1009         if test x$(DESKTOP_FILE_INSTALL) != x ; then \
1010                 $(DESKTOP_FILE_INSTALL) --dir $(DESTDIR)$(datadir)/applications $(srcdir)/wireshark.desktop  $(srcdir)/wireshark-gtk.desktop ; \
1011         else \
1012                 install -m 644 $(srcdir)/wireshark.desktop $(srcdir)/wireshark-gtk.desktop $(DESTDIR)$(datadir)/applications; \
1013         fi
1014         for size in 16 24 32 48 64 128 256; \
1015         do \
1016                 mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps ; \
1017                 install -m 644 $(srcdir)/image/wsicon$${size}.png $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/wireshark.png ; \
1018                 mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/mimetypes ; \
1019                 install -m 644 $(srcdir)/image/WiresharkDoc-$${size}.png $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/mimetypes/application-wireshark-doc.png ; \
1020         done
1021         mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps
1022         install -m 644 $(srcdir)/image/wsicon.svg $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/wireshark.svg
1023 endif
1024 endif
1025
1026 uninstall-local:
1027 if BUILDING_WIRESHARK
1028 if NOT_OS_X
1029         rm -f $(DESTDIR)$(datadir)/appdata/wireshark.appdata.xml
1030         rm -f $(DESTDIR)$(datadir)/applications/wireshark.desktop
1031         rm -f $(DESTDIR)$(datadir)/applications/wireshark-gtk.desktop
1032         rm -f $(DESTDIR)$(datadir)/mime/packages/wireshark.xml
1033         for size in 16 24 32 48 64 128 256; \
1034         do \
1035                 rm -f $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/wireshark.png ; \
1036                 rm -f $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/mimetypes/application-wireshark-doc.png ; \
1037         done
1038         rm -f $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/wireshark.svg
1039 endif
1040 endif
1041
1042 install-data-hook: update-databases-and-caches-install
1043 uninstall-hook: update-databases-and-caches-uninstall
1044
1045 #
1046 # XXX - which of this stuff can, and should, we do ourselves?
1047 #
1048 # If we're "installing" under $(DESTDIR) as part of the process of
1049 # building a package, we probably don't need to, and shouldn't, do
1050 # any of this.
1051 #
1052 # If we're installing for use, we may need to do some of this; which
1053 # of them do we need to tell where to search, especially if we're
1054 # installing somewhere other than under /usr or /usr/local?
1055 #
1056 # What if we're installing in the user's home directory?
1057 #
1058 # What if we're installing under /opt?
1059 #
1060 # We only need to run ldconfig on systems where it's necessary in order
1061 # to update a shared library cache to know about our shared libraries.
1062 #
1063 # We only need to run update-desktop-database and update-mime-database
1064 # on freedesktop.org desktops.
1065 #
1066 # We only need to run gtk-update-icon-cache if we're installing a GTK+
1067 # version of Wireshark.
1068 #
1069 # We neither need nor want any of this on OS X, nor do we want it if
1070 # we're not building Wireshark (that being the only desktop app).
1071 #
1072 update-databases-and-caches-common:
1073 if BUILDING_WIRESHARK
1074 if NOT_OS_X
1075         @echo "You may need to run \"ldconfig\" as root"
1076         @echo "You may need to run \"update-desktop-database $(datadir)/applications\""
1077         @echo "You may need to run \"update-mime-database $(datadir)/mime\""
1078         @echo "You may need to run \"gtk-update-icon-cache -f -t $(datadir)/icons/hicolor\""
1079 endif
1080 endif
1081
1082 update-databases-and-caches-install: update-databases-and-caches-common
1083
1084 update-databases-and-caches-uninstall: update-databases-and-caches-common
1085
1086 # Used by svr4-package and osx-package
1087 # We load top_stagedir with an absolute path so that libtool doesn't freak.
1088 top_stagedir=$(abs_top_builddir)/packaging/staging
1089 stagedir=$(top_stagedir)/$(PACKAGE).inst
1090
1091 host_cpu=@host_cpu@
1092 host_os=@host_os@
1093
1094 solaris-package: svr4-package
1095
1096 svr4-package: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA)
1097         @if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
1098                 rm -rf $(stagedir) ; \
1099                 $(MAKE) DESTDIR=$(stagedir) install; \
1100                 $(srcdir)/packaging/svr4/mkpkg \
1101                         $(PACKAGE) \
1102                         $(PACKAGE)-$(VERSION)-$(host_os)-$(host_cpu)-local \
1103                         $(prefix) \
1104                         $(top_stagedir) ; \
1105         else \
1106                 echo "Error: SVR4 packaging tools not found." ; \
1107                 echo "Package build abandoned." ; \
1108         fi
1109
1110
1111 rpm_topdir=`cd $(top_builddir) && pwd`/packaging/rpm
1112 if HAVE_RPM
1113 rpm-package: dist
1114         @cd $(rpm_topdir) && \
1115           mkdir -p BUILD RPMS SOURCES SRPMS && \
1116           cd SOURCES && \
1117           ln -sf ../../../$(distdir).tar.xz && \
1118           cd .. && \
1119           $(RPMBUILD) --define "_topdir `cd . && pwd`" --define "_prefix $(prefix)" \
1120                 @RPMBUILD_WITH_ARGS@ --clean -ba SPECS/wireshark.spec && \
1121           echo "Package successfully built in `pwd`/RPMS." ; \
1122           rm -f SOURCES/$(distdir).tar.xz ../../$(distdir).tar.xz
1123 else
1124 rpm-package:
1125         @echo "'rpmbuild' executable not available." ; \
1126           false
1127 endif
1128
1129 # XXX - This assumes we're building from the source directory.
1130 osx-app: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) packaging/macosx/Info.plist
1131         @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
1132                 rm -rf $(stagedir) ; \
1133                 $(MAKE) DESTDIR=$(stagedir) install; \
1134                 cd $(srcdir)/packaging/macosx ; \
1135                 ./osx-app.sh @OSX_APP_FLAGS@ \
1136                         --create-bundle \
1137                         --binary-path ../staging/$(PACKAGE).inst$(bindir) \
1138                         --plugin-path ../staging/$(PACKAGE).inst$(plugindir) \
1139                         --extcap-path ../staging/$(PACKAGE).inst$(extcapdir) \
1140                         --library-path ../staging/$(PACKAGE).inst$(libdir) ; \
1141         else \
1142                 echo "Error: OS X packaging tools not found." ; \
1143                 echo "Package build abandoned." ; \
1144         fi
1145
1146 packaging/macosx/COPYING.txt: COPYING
1147         (cd packaging/macosx ; \
1148         $(MAKE) COPYING.txt ;)
1149
1150 osx-package: osx-app packaging/macosx/COPYING.txt
1151         @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
1152                 cd $(srcdir)/packaging/macosx ; \
1153                 chmod +x ./osx-dmg.sh ; \
1154                 ./osx-dmg.sh @OSX_DMG_FLAGS@ ; \
1155         fi
1156
1157 osx-install: osx-app
1158         @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
1159                 echo "Copying Wireshark.app to /Applications" ; \
1160                 cp -pr $(srcdir)/packaging/macosx/Wireshark.app /Applications ; \
1161         fi
1162
1163 test-programs:
1164         cd epan && $(MAKE) $@
1165
1166 clean-local:
1167         rm -rf $(top_stagedir)
1168
1169 dumpabi:
1170         $(MAKE) -C wiretap dumpabi-libwiretap
1171         $(MAKE) -C epan dumpabi-libwireshark
1172         $(MAKE) -C wsutil dumpabi-libwsutil
1173
1174 checkapi_local:
1175         $(PERL) $(top_srcdir)/tools/checkAPIs.pl -build \
1176         -sourcedir=$(srcdir) \
1177         $(TSHARK_TAP_SRC) \
1178         $(wireshark_gtk_SOURCES)
1179 #       $(EXTRA_wireshark_gtk_SOURCES)
1180
1181 checkapi: checkapi_local
1182         cd wiretap && $(MAKE) checkapi
1183         cd codecs && $(MAKE) checkapi
1184         cd capchild && $(MAKE) checkapi
1185         cd caputils && $(MAKE) checkapi
1186         cd ui && $(MAKE) checkapi
1187         cd ui/gtk && $(MAKE) checkapi
1188         cd ui/cli && $(MAKE) checkapi
1189         cd epan && $(MAKE) checkapi
1190         cd epan/crypt && $(MAKE) checkapi
1191         cd epan/dfilter && $(MAKE) checkapi
1192         cd epan/ftypes && $(MAKE) checkapi
1193         cd epan/wmem && $(MAKE) checkapi
1194         cd epan/wslua && $(MAKE) checkapi
1195         cd epan/dissectors && $(MAKE) checkapi
1196         cd plugins && $(MAKE) checkapi
1197         cd randpkt_core && $(MAKE) checkapi
1198         cd writecap && $(MAKE) checkapi
1199         cd wsutil && $(MAKE) checkapi
1200
1201 if HAVE_SHELLCHECK
1202 # --external-sources requires 0.4.0 or later.
1203 shellcheck:
1204         cd $(top_srcdir) && \
1205         shellcheck --external-sources \
1206           tools/fuzz-test.sh \
1207           tools/randpkt-test.sh \
1208           tools/runa2x.sh \
1209           tools/test-captures.sh \
1210           tools/valgrind-wireshark.sh
1211 else
1212 shellcheck:
1213         @echo "Shellcheck not available." ; \
1214           false
1215 endif
1216
1217 wsar_html: doxygen.cfg doxygen_global.cfg FORCE
1218 if HAVE_DOXYGEN
1219         rm -rf wsar_html
1220         cd epan && $(MAKE) $@
1221         cd capchild && $(MAKE) $@
1222         cd caputils && $(MAKE) $@
1223         cd randpkt_core && $(MAKE) $@
1224         cd ui && $(MAKE) $@
1225         (umask 022 ; $(DOXYGEN) doxygen.cfg)
1226 endif
1227
1228 wsar-zip: wsar_html
1229 if HAVE_DOXYGEN
1230         rm -f wsar_html.zip
1231         zip -rq wsar_html.zip wsar_html
1232 endif
1233
1234 # Update AUTHORS file with entries from git shortlog
1235 gen-authors:
1236         cd $(top_srcdir) && $(PERL) tools/generate_authors.pl AUTHORS.src > AUTHORS
1237
1238 dist-hook:
1239         printf "git_description=%s\n" "$$(git -C $(top_srcdir) describe --match 'v[1-9]*')" \
1240                 > $(top_distdir)/version.conf