aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/codecs
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2018-01-19 21:20:38 +0100
committerMichael Mann <mmann78@netscape.net>2018-01-21 13:13:17 +0000
commit903c143769da90b78502971951e6a1d681b7f8b7 (patch)
tree3b211539938bbea95041383b5898b76b38fec74d /plugins/codecs
parent47351fb617aaa1be83d2b1db60dc31344c1d01d2 (diff)
autotools: Rework the plugin Makefiles
The plugin.c generation in an autotools build comes in from an included Makefile.am file. The various types of plugins need different parameters for the generation script. Put the plugin.c production rule is a seperate include file so each plugin type build can include its own variant. Also amend the README.plugins file with regards to the new directory structure and the fact that there are multiple types of plugins, not just dissector plugins. Change-Id: I3a815d0d767baa555356cf428861b18697401355 Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-on: https://code.wireshark.org/review/25398 Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins/codecs')
-rw-r--r--plugins/codecs/Makefile.am.inc42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/codecs/Makefile.am.inc b/plugins/codecs/Makefile.am.inc
new file mode 100644
index 0000000000..14ac941b08
--- /dev/null
+++ b/plugins/codecs/Makefile.am.inc
@@ -0,0 +1,42 @@
+# Makefile.am.inc
+# Include file with common automake definitions for codec plugins
+#
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
+# Copyright 1998 Gerald Combs
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+include $(top_srcdir)/plugins/Makefile.am.inc
+
+#
+# Build plugin.c, which contains the plugin_version[] and plugin_release[]
+# string, and a function plugin_register() that calls the register routines
+# for all codecs.
+#
+# We do this by scanning 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 codec_register_* routines must
+# start in column zero, or must be preceded only by "void " starting in
+# column zero, and must not be inside #if.
+#
+# REGISTER_SRC_FILES is assumed to have all the files that need to be scanned.
+#
+# For some unknown reason, having a big "for" loop in the Makefile
+# to scan all the 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 use a script to generate the register.c file.
+# The first argument is the directory in which the source files live.
+# The second argument is "plugin_codec", to indicate that we should build
+# a plugin.c file for a codec plugin.
+# All subsequent arguments are the files to scan.
+#
+plugin.c: $(REGISTER_SRC_FILES) $(top_srcdir)/tools/make-plugin-reg.py
+ @echo Making plugin.c
+ @$(PYTHON) $(top_srcdir)/tools/make-plugin-reg.py $(srcdir) \
+ plugin_codec $(REGISTER_SRC_FILES)