Remove iconv/libiconv checks from *NIX builds: GLIB-2 provides iconv replacements.
[obnox/wireshark/wip.git] / epan / Makefile.am
index 5340ac4d986ab53766603e5b2de4cd5df41fe0f8..a070bb87484fc97bf5c1bbc1c9d897cf48c5cab2 100644 (file)
 # Automake file for the EPAN library
 # (Ethereal Protocol ANalyzer Library)
 #
-# $Id: Makefile.am,v 1.41 2004/03/17 17:46:40 jmayer Exp $
+# $Id$
 #
-# Ethereal - Network traffic analyzer
-# By Gerald Combs <gerald@ethereal.com>
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
 # Copyright 1998 Gerald Combs
-# 
+#
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
 # as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-SUBDIRS = ftypes dfilter
+include ../Makefile.am.inc
+
+if HAVE_LIBLUA
+wslua_lib = wslua/libwslua.la
+wslua_dir = wslua
+wslua_dist_dir =
+else            # HAVE_LIBLUA
+wslua_lib =
+wslua_dir =
+wslua_dist_dir = wslua
+endif           # HAVE_LIBLUA
+
+
+SUBDIRS = crypt ftypes dfilter dissectors $(wslua_dir)
 
-# EPAN will eventually be a shared library. While I move source code around,
-# however, it is an archive library.
+DIST_SUBDIRS = $(SUBDIRS) $(wslua_dist_dir)
 
 ACLOCAL_AMFLAGS = `../aclocal-flags`
 
-lib_LTLIBRARIES = libethereal.la
-libethereal_la_LDFLAGS = -version-info 0:1:0
+noinst_LTLIBRARIES = libwireshark_generated.la libwireshark_asmopt.la
+lib_LTLIBRARIES = libwireshark.la
+libwireshark_la_LDFLAGS = -version-info 0:1:0 @LDFLAGS_SHAREDLIB@
 
 include Makefile.common
 
-INCLUDES = -I$(srcdir)/..
-
-libethereal_la_SOURCES = \
-       addr_and_mask.c         \
-       addr_and_mask.h         \
-       atalk-utils.c           \
-       atalk-utils.h           \
-       bitswap.c               \
-       bitswap.h               \
-       circuit.c               \
-       circuit.h               \
-       column_info.h           \
-       conversation.c          \
-       conversation.h          \
-       column-utils.c          \
-       column-utils.h          \
-       epan.c                  \
-       epan.h                  \
-       epan_dissect.h  \
-       except.c                \
-       except.h                \
-       exceptions.h            \
-       filesystem.c            \
-       filesystem.h            \
-       frame_data.c            \
-       frame_data.h            \
-       gdebug.h                \
-       int-64bit.c             \
-       int-64bit.h             \
-       ipv4.c                  \
-       ipv4.h                  \
-       ipv6-utils.h            \
-       nstime.h                \
-       osi-utils.c             \
-       osi-utils.h             \
-       packet.c                \
-       packet.h                \
-       packet_info.h           \
-       pint.h                  \
-       plugins.c               \
-       plugins.h               \
-       proto.c                 \
-       proto.h                 \
-       resolv.c                \
-       resolv.h                \
-       slab.h                  \
-       sna-utils.c             \
-       sna-utils.h             \
-       strutil.c               \
-       strutil.h               \
-       timestamp.h             \
-       to_str.c                \
-       to_str.h                \
-       tvbuff.c                \
-       tvbuff.h                \
-       value_string.c          \
-       value_string.h          \
-       $(DISSECTOR_SRC)        \
-       $(DISSECTOR_SUPPORT_SRC)
-
-EXTRA_libethereal_la_SOURCES = \
-        inet_aton.c            \
-       inet_pton.c             \
-       inet_ntop.c             \
-       inet_aton.h             \
-       inet_v6defs.h
+INCLUDES = -I$(srcdir)/.. -I$(srcdir)/$(LEMON) @LUA_INCLUDES@ \
+       $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) $(LIBSMI_CFLAGS)
+
+
+if HAVE_WARNINGS_AS_ERRORS
+AM_NON_GENERATED_CFLAGS = -Werror
+endif
+
+#Since code generated by lex may trigger gcc warnings, we are now generating two
+#libraries.  A single library is generated with the lex code without the barrier
+#"stop on warning". An other library is generated from the remaining source
+#files with the "stop on warning" barrier.
+libwireshark_la_SOURCES = \
+       $(LIBWIRESHARK_SRC)     \
+       $(LIBWIRESHARK_INCLUDES)
+libwireshark_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)
+
+libwireshark_generated_la_SOURCES = \
+       $(LIBWIRESHARK_GENERATED_SRC) \
+       $(LIBWIRESHARK_GENERATED_INCLUDES)
+
+# code optionally implemented in assembler
+# only C source available for platforms other than Win32
+libwireshark_asmopt_la_SOURCES = \
+       asm_utils.c             \
+       asm_utils.h             \
+       asm_utils_win32_x86.asm
+
+EXTRA_libwireshark_la_SOURCES =        \
+       inet_aton.c             \
+       inet_aton.h
 
 EXTRA_DIST = \
-       config.h.win32  \
-       Makefile.nmake  \
-       tvbtest.c
+       diam_dict.l             \
+       dtd_grammar.lemon       \
+       dtd_parse.l             \
+       dtd_parse.h             \
+       dtd_preparse.l          \
+       enterprise-numbers      \
+       libwireshark.def        \
+       Makefile.common         \
+       Makefile.nmake          \
+       make-sminmpec.pl        \
+       radius_dict.l           \
+       tvbtest.c               \
+       reassemble_test.c       \
+       uat_load.l              \
+       exntest.c               \
+       doxygen.cfg.in
 
 CLEANFILES = \
-       libethereal.a           \
-       x11-declarations.h      \
-       x11-register-info.h     \
+       libwireshark.a                  \
+       libwireshark.la                 \
+       libwireshark_generated.a        \
+       libwireshark_generated.la       \
+       libwireshark_asmopt.a           \
+       libwireshark_asmopt.la          \
+       inet_ntop.c                     \
+       inet_pton.c                     \
        *~
 
-MAINTAINERCLEANFILES = \
-       register.c      \
-       ../packet-ncp2222.c
+DISTCLEANFILES = \
+       $(LIBWIRESHARK_DISTCLEAN_GENERATED_SRC) \
+       $(LIBWIRESHARK_DISTCLEAN_GENERATED_INCLUDES) \
+       dtd_grammar.out
+
+MAINTAINERCLEANFILES = \
+       $(LIBWIRESHARK_NODISTCLEAN_GENERATED_SRC) \
+       $(LIBWIRESHARK_NODISTCLEAN_GENERATED_INCLUDES) \
+       Makefile.in             \
+       sminmpec.c
 
 #
 # Add the object files for missing routines, if any.
 #
-libethereal_la_LIBADD = @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@ dfilter/libdfilter.la ftypes/libftypes.la @KRB5_LIBS@
-libethereal_la_DEPENDENCIES = @INET_ATON_O@ @INET_PTON_O@ @INET_NTOP_O@ dfilter/libdfilter.la ftypes/libftypes.la
+libwireshark_la_LIBADD = \
+       @INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ libwireshark_generated.la \
+       libwireshark_asmopt.la crypt/libairpdcap.la ftypes/libftypes.la \
+       dfilter/libdfilter.la dissectors/libcleandissectors.la \
+       dissectors/libdissectors.la dissectors/libasndissectors.la \
+       dissectors/libpidldissectors.la $(wslua_lib) @SOCKET_LIBS@ @NSL_LIBS@ \
+       @ADNS_LIBS@ @LIBGCRYPT_LIBS@ @LIBGNUTLS_LIBS@ @KRB5_LIBS@ \
+       @SSL_LIBS@ @LIBSMI_LDFLAGS@ -lm
+libwireshark_la_DEPENDENCIES = \
+       @INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ libwireshark_generated.la \
+       libwireshark_asmopt.la crypt/libairpdcap.la ftypes/libftypes.la \
+       dfilter/libdfilter.la dissectors/libcleandissectors.la \
+       dissectors/libdissectors.la dissectors/libasndissectors.la \
+       dissectors/libpidldissectors.la $(wslua_lib)
 
-../packet-ncp2222.c : $(srcdir)/../ncp2222.py
-       $(PYTHON) $(srcdir)/../ncp2222.py -o $@
+#EXTRA_PROGRAMS = reassemble_test
+#reassemble_test_LDADD = $(GLIB_LIBS)
 
-tvbtest: tvbtest.o tvbuff.o except.o strutil.o
-       $(LINK) -o tvbtest tvbtest.o tvbuff.o except.o strutil.o `glib-config --libs`
+reassemble_test: reassemble_test.o tvbuff.o except.o strutil.o emem.o \
+                 reassemble.o
+       $(LINK) $^ $(GLIB_LIBS) -lz
 
-#
-# Build "register.c", which contains a function "register_all_protocols()"
-# that calls the register routines for all protocols.
-#
-# We do this by grepping through sources.  If that turns out to be too slow,
-# maybe we could just require every .o file to have an register routine
-# of a given name (packet-aarp.o -> proto_register_aarp, etc.).
-#
-# Formatting conventions:  The name of the proto_register_* routines must
-# start in column zero, or must be preceded only by "void " starting in
-# column zero, and must not be inside #if.
-#
-# We assume that all dissector routines are in "packet-XXX.c" files.
-#
-# For some unknown reason, having a big "for" loop in the Makefile
-# to scan all the "packet-XXX.c" files doesn't work with some "make"s;
-# they seem to pass only the first few names in the list to the shell,
-# for some reason.
-#
-# Therefore, we have a script to generate the "register.c" file.
-#
-# The first argument is the name of the file to write.
-# The second argument is the directory in which the source files live.
-# All subsequent arguments are the files to scan.
-#
-register.c: $(plugin_src) $(DISSECTOR_SRC) $(srcdir)/../make-reg-dotc
-       @if test -n $(PYTHON); then \
-               echo Making register.c with python ; \
-               $(PYTHON) $(srcdir)/../make-reg-dotc.py $(srcdir) $(DISSECTOR_SRC) ; \
-       else \
-               echo Making register.c with shell script ; \
-               $(srcdir)/../make-reg-dotc register.c $(srcdir) \
-                       $(plugin_src) $(DISSECTOR_SRC) ; \
-       fi
+tvbtest: tvbtest.o tvbuff.o except.o strutil.o emem.o
+       $(LINK) $^ $(GLIB_LIBS) -lz
 
-#
-# Currently register.c can be included in the distribution because
-# we always build all protocol dissectors. We used to have to check
-# whether or not to build the snmp dissector. If we again need to
-# variably build something, making register.c non-portable, uncomment
-# the dist-hook line below.
-#
-# Oh, yuk.  We don't want to include "register.c" in the distribution, as
-# its contents depend on the configuration, and therefore we want it
-# to be built when the first "make" is done; however, Automake insists
-# on putting *all* source into the distribution.
-#
-# We work around this by having a "dist-hook" rule that deletes
-# "register.c", so that "dist" won't pick it up.
-#
-#dist-hook:
-#      @rm -f $(distdir)/register.c
+exntest: exntest.o except.o
+       $(LINK) $^ $(GLIB_LIBS)
 
-#
-# Build various header files for the X11 dissector.
-#
-x11-declarations.h x11-register-info.h: ../x11-fields ../process-x11-fields.pl
-       $(PERL) $(srcdir)/../process-x11-fields.pl <$(srcdir)/../x11-fields
+RUNLEX=$(top_srcdir)/tools/runlex.sh
+
+diam_dict_lex.h: diam_dict.c
+
+dtd_parse_lex.h: dtd_parse.c
+
+dtd_preparse_lex.h: dtd_preparse.c
+
+radius_dict_lex.h: radius_dict.c
+
+uat_load_lex.h: uat_load.c
+
+LEMON=../tools/lemon
+
+dtd_grammar.h: dtd_grammar.c
+
+dtd_grammar.c: $(LEMON)/lemon$(EXEEXT) $(srcdir)/$(LEMON)/lempar.c $(srcdir)/dtd_grammar.lemon
+       $(LEMON)/lemon$(EXEEXT) t=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/dtd_grammar.lemon
+
+tvbtest.o exntest.o: exceptions.h
+
+sminmpec.c: enterprise-numbers make-sminmpec.pl
+       $(PERL) $(srcdir)/make-sminmpec.pl $(srcdir)/enterprise-numbers sminmpec.c
+
+inet_ntop.c:
+       ln -s $(srcdir)/../inet_ntop.c .
+
+inet_pton.c:
+       ln -s $(srcdir)/../inet_pton.c .
 
 if HAVE_PLUGINS
 
 if ENABLE_STATIC
 
 plugin_src = \
-       ../plugins/acn/packet-acn.c \
        ../plugins/artnet/packet-artnet.c \
        ../plugins/asn1/packet-asn1.c \
        ../plugins/docsis/packet-bpkmattr.c \
@@ -224,14 +216,67 @@ plugin_src = \
        ../plugins/giop/packet-cosnaming.c \
        ../plugins/giop/packet-coseventcomm.c \
        ../plugins/gryphon/packet-gryphon.c \
+       ../plugins/infiniband/packet-infiniband.c \
        ../plugins/irda/packet-irda.c \
        ../plugins/lwres/packet-lwres.c \
-       ../plugins/megaco/packet-megaco.c \
+       ../plugins/m2m/packet-m2m.c \
+       ../plugins/m2m/wimax_tlv.c \
        ../plugins/mgcp/packet-mgcp.c \
        ../plugins/pcli/packet-pcli.c \
        ../plugins/rdm/packet-rdm.c \
        ../plugins/rtnet/packet-rtnet.c \
-       ../plugins/v5ua/packet-v5ua.c
+       ../plugins/sercosiii/packet-sercosiii_1v1_at.c \
+       ../plugins/sercosiii/packet-sercosiii_1v1_at_devstat.c \
+       ../plugins/sercosiii/packet-sercosiii_1v1.c \
+       ../plugins/sercosiii/packet-sercosiii_1v1_hp.c \
+       ../plugins/sercosiii/packet-sercosiii_1v1_mdt.c \
+       ../plugins/sercosiii/packet-sercosiii_1v1_mdt_devctrl.c \
+       ../plugins/sercosiii/packet-sercosiii_1v1_mst.c \
+       ../plugins/sercosiii/packet-sercosiii_1v1_svc.c \
+       ../plugins/v5ua/packet-v5ua.c \
+        ../plugins/wimax/crc.c \
+        ../plugins/wimax/crc_data.c \
+        ../plugins/wimax/mac_hd_generic_decoder.c \
+        ../plugins/wimax/mac_hd_type1_decoder.c \
+        ../plugins/wimax/mac_hd_type2_decoder.c \
+        ../plugins/wimax/mac_mgmt_msg_decoder.c \
+        ../plugins/wimax/msg_aas_beam.c \
+        ../plugins/wimax/msg_aas_fbck.c \
+        ../plugins/wimax/msg_arq.c \
+        ../plugins/wimax/msg_clk_cmp.c \
+        ../plugins/wimax/msg_dcd.c \
+        ../plugins/wimax/msg_dlmap.c \
+        ../plugins/wimax/msg_dreg.c \
+        ../plugins/wimax/msg_dsa.c \
+        ../plugins/wimax/msg_dsc.c \
+        ../plugins/wimax/msg_dsd.c \
+        ../plugins/wimax/msg_dsx_rvd.c \
+        ../plugins/wimax/msg_fpc.c \
+        ../plugins/wimax/msg_pkm.c \
+        ../plugins/wimax/msg_pmc.c \
+        ../plugins/wimax/msg_prc_lt_ctrl.c \
+        ../plugins/wimax/msg_reg_req.c \
+        ../plugins/wimax/msg_reg_rsp.c \
+        ../plugins/wimax/msg_rep.c \
+        ../plugins/wimax/msg_res_cmd.c \
+        ../plugins/wimax/msg_rng_req.c \
+        ../plugins/wimax/msg_rng_rsp.c \
+        ../plugins/wimax/msg_sbc.c \
+        ../plugins/wimax/msg_ucd.c \
+        ../plugins/wimax/msg_ulmap.c \
+        ../plugins/wimax/packet-wmx.c \
+        ../plugins/wimax/wimax_cdma_code_decoder.c \
+        ../plugins/wimax/wimax_compact_dlmap_ie_decoder.c \
+        ../plugins/wimax/wimax_compact_ulmap_ie_decoder.c \
+        ../plugins/wimax/wimax_fch_decoder.c \
+        ../plugins/wimax/wimax_ffb_decoder.c \
+        ../plugins/wimax/wimax_hack_decoder.c \
+        ../plugins/wimax/wimax_harq_map_decoder.c \
+        ../plugins/wimax/wimax_pdu_decoder.c \
+        ../plugins/wimax/wimax_phy_attributes_decoder.c \
+        ../plugins/wimax/wimax_tlv.c \
+        ../plugins/wimax/wimax_utils.c
+
 
 else           # ENABLE_STATIC
 
@@ -244,3 +289,10 @@ plugin_src =
 
 endif          # HAVE_PLUGINS
 
+doxygen:
+if HAVE_DOXYGEN
+       $(DOXYGEN) doxygen.cfg
+endif          # HAVE_DOXYGEN
+
+checkapi:
+       $(PERL) ../tools/checkAPIs.pl -g termoutput $(LIBWIRESHARK_SRC)