aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2015-11-27 02:28:17 +0000
committerJoão Valverde <j@v6e.pt>2016-01-28 18:13:48 +0000
commit265a41e14da6b3ebf1e49e726eee62d1372110bf (patch)
treef1a524f8e66ebd43691de84649f231f32ee125f6 /epan
parent97a1a50e200a6c50e0014dde7e8ec932c30190a1 (diff)
autotools: Don't use "user variables" to set build flags
GNU coding standards recommend against it and automake is designed around it. This allows overriding the global build flags using AM_CFLAGS, etc., or per object flags, something that is difficult or impossible currently because of automake precedence rules. Change-Id: I3f1ea12e560af5a46b2f04b342b1882bbf123f12 Reviewed-on: https://code.wireshark.org/review/13455 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan')
-rw-r--r--epan/Makefile.am34
-rw-r--r--epan/compress/Makefile.am8
-rw-r--r--epan/crypt/Makefile.am8
-rw-r--r--epan/dfilter/Makefile.am23
-rw-r--r--epan/dissectors/Makefile.am14
-rw-r--r--epan/dissectors/dcerpc/Makefile.am1
-rw-r--r--epan/ftypes/Makefile.am9
-rw-r--r--epan/nghttp2/Makefile.am9
-rw-r--r--epan/wmem/Makefile.am9
-rw-r--r--epan/wslua/Makefile.am6
10 files changed, 37 insertions, 84 deletions
diff --git a/epan/Makefile.am b/epan/Makefile.am
index 0749d60a99..302d650f46 100644
--- a/epan/Makefile.am
+++ b/epan/Makefile.am
@@ -21,7 +21,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-include ../Makefile.am.inc
+include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
if HAVE_LIBLUA
wslua_lib = wslua/libwslua.la
@@ -39,23 +40,14 @@ DIST_SUBDIRS = $(SUBDIRS) $(wslua_dist_dir)
ACLOCAL_AMFLAGS = `../aclocal-flags`
+AM_CPPFLAGS += -I$(builddir)/wslua $(LUA_CFLAGS) $(LIBGNUTLS_CFLAGS) \
+ $(LIBGCRYPT_CFLAGS) $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(KRB5_CFLAGS)
+
noinst_LTLIBRARIES = libwireshark_generated.la libwireshark_asmopt.la
lib_LTLIBRARIES = libwireshark.la
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
libwireshark_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
-include Makefile.common
-
-AM_CPPFLAGS = -I$(srcdir)/.. -I$(srcdir)/$(LEMON) -I$(builddir)/wslua \
- @LUA_CFLAGS@ $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) \
- $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(PY_CFLAGS)
-
-AM_NON_GENERATED_CFLAGS =-DWS_BUILD_DLL
-
-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
@@ -63,11 +55,12 @@ endif
libwireshark_la_SOURCES = \
$(LIBWIRESHARK_SRC) \
$(LIBWIRESHARK_INCLUDES)
-libwireshark_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)
+libwireshark_la_CPPFLAGS = $(AM_CPPFLAGS) -DWS_BUILD_DLL
libwireshark_generated_la_SOURCES = \
$(LIBWIRESHARK_GENERATED_C_FILES) \
$(LIBWIRESHARK_GENERATED_HEADER_FILES)
+libwireshark_generated_la_CFLAGS = $(GENERATED_CFLAGS)
nodist_libwireshark_generated_la_SOURCES = \
$(NODIST_LIBWIRESHARK_GENERATED_C_FILES) \
@@ -119,6 +112,9 @@ MAINTAINERCLEANFILES = \
$(LIBWIRESHARK_GENERATED_HEADER_FILES) \
Makefile.in
+BUILT_SOURCES = \
+ dtd_grammar.h
+
#
# Add the object files for missing routines, if any.
#
@@ -165,25 +161,19 @@ exntest: exntest.o except.o
test-programs: $(EXTRA_PROGRAMS) exntest
cd wmem && $(MAKE) $@
-RUNLEX=$(top_srcdir)/tools/runlex.sh
-
diam_dict_lex.h: diam_dict.c
dtd_parse_lex.h: dtd_parse.c
-dtd_parse.lo: dtd_grammar.h
-
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
- $(AM_V_LEMON)$(LEMON)/lemon$(EXEEXT) T=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/dtd_grammar.lemon
+dtd_grammar.c : $(LEMON) $(lemon_srcdir)/lempar.c $(srcdir)/dtd_grammar.lemon
+ $(AM_V_LEMON)$(LEMON) T=$(lemon_srcdir)/lempar.c $(srcdir)/dtd_grammar.lemon
tvbtest.o exntest.o oids_test.o: exceptions.h
diff --git a/epan/compress/Makefile.am b/epan/compress/Makefile.am
index 7ccf292a00..967334e826 100644
--- a/epan/compress/Makefile.am
+++ b/epan/compress/Makefile.am
@@ -20,13 +20,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
-AM_CPPFLAGS = \
- -I$(top_srcdir)
+include $(top_srcdir)/Makefile.am.inc
noinst_LTLIBRARIES = liblzxpress.la
diff --git a/epan/crypt/Makefile.am b/epan/crypt/Makefile.am
index 7c781114b3..ad0bad3803 100644
--- a/epan/crypt/Makefile.am
+++ b/epan/crypt/Makefile.am
@@ -20,13 +20,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
-AM_CPPFLAGS = \
- -I$(top_srcdir)
+include $(top_srcdir)/Makefile.am.inc
noinst_LTLIBRARIES = libairpdcap.la
diff --git a/epan/dfilter/Makefile.am b/epan/dfilter/Makefile.am
index 7db0fa2b46..9d54e2f973 100644
--- a/epan/dfilter/Makefile.am
+++ b/epan/dfilter/Makefile.am
@@ -19,13 +19,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-include ../../Makefile.am.inc
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_NON_GENERATED_CFLAGS = -Werror
-endif
-
include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
+
+AM_CPPFLAGS += -I$(top_srcdir)/epan -I$(lemon_srcdir)
noinst_LTLIBRARIES = libdfilter_generated.la libdfilter.la
@@ -45,18 +42,19 @@ MAINTAINERCLEANFILES = \
$(NODIST_GENERATED_FILES) \
Makefile.in
-AM_CPPFLAGS = -I$(srcdir)/../.. -I$(srcdir)/.. -I$(srcdir)/$(LEMON)
+BUILT_SOURCES = \
+ grammar.h
#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.
libdfilter_la_SOURCES = $(NONGENERATED_C_FILES) $(NONGENERATED_HEADER_FILES)
-libdfilter_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)
libdfilter_generated_la_SOURCES = \
$(GENERATED_C_FILES) \
$(GENERATED_HEADER_FILES)
+libdfilter_generated_la_CFLAGS = $(GENERATED_CFLAGS)
nodist_libdfilter_generated_la_SOURCES = \
$(NODIST_GENERATED_C_FILES) \
@@ -70,16 +68,11 @@ EXTRA_DIST = \
Makefile.common \
Makefile.nmake
-RUNLEX=$(top_srcdir)/tools/runlex.sh
-
scanner_lex.h : scanner.c
-scanner.lo: grammar.h
-
-LEMON=../../tools/lemon
grammar.h : grammar.c
-grammar.c : $(LEMON)/lemon$(EXEEXT) $(srcdir)/$(LEMON)/lempar.c $(srcdir)/grammar.lemon
- $(AM_V_LEMON)$(LEMON)/lemon$(EXEEXT) T=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/grammar.lemon || \
+grammar.c : $(LEMON) $(lemon_srcdir)/lempar.c $(srcdir)/grammar.lemon
+ $(AM_V_LEMON)$(LEMON) T=$(lemon_srcdir)/lempar.c $(srcdir)/grammar.lemon || \
(rm -f grammar.c grammar.h ; false)
checkapi:
diff --git a/epan/dissectors/Makefile.am b/epan/dissectors/Makefile.am
index ceee8e7583..3191391608 100644
--- a/epan/dissectors/Makefile.am
+++ b/epan/dissectors/Makefile.am
@@ -18,20 +18,17 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-noinst_LTLIBRARIES = libdirtydissectors.la libfiledissectors.la libdissectors.la
+include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
-AM_CPPFLAGS = -I$(srcdir)/../.. -I$(srcdir)/.. \
- $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS)
+AM_CPPFLAGS += -I$(top_srcdir)/epan $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS)
-include Makefile.common
+noinst_LTLIBRARIES = libdirtydissectors.la libfiledissectors.la libdissectors.la
libdirtydissectors_la_SOURCES = \
$(DIRTY_ASN1_DISSECTOR_SRC) \
$(DIRTY_CORBA_IDL_DISSECTOR_SRC)
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CLEAN_CFLAGS = -Werror
-endif
+libdirtydissectors_la_CFLAGS = $(GENERATED_CFLAGS)
libfiledissectors_la_SOURCES = \
$(FILE_DISSECTOR_SRC)
@@ -42,7 +39,6 @@ libdissectors_la_SOURCES = \
$(CORBA_IDL_DISSECTOR_SRC) \
$(PIDL_DISSECTOR_SRC) \
$(DISSECTOR_SUPPORT_SRC)
-libdissectors_la_CFLAGS = $(AM_CLEAN_CFLAGS)
# include pidl in the source tarball. But nothing to build...
DIST_SUBDIRS = pidl dcerpc
diff --git a/epan/dissectors/dcerpc/Makefile.am b/epan/dissectors/dcerpc/Makefile.am
index 33ffe04dc1..2333c4bb09 100644
--- a/epan/dissectors/dcerpc/Makefile.am
+++ b/epan/dissectors/dcerpc/Makefile.am
@@ -18,6 +18,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/Makefile.am.inc
EXTRA_DIST = \
CMakeLists.txt \
diff --git a/epan/ftypes/Makefile.am b/epan/ftypes/Makefile.am
index e0d5df40ed..1246769e9f 100644
--- a/epan/ftypes/Makefile.am
+++ b/epan/ftypes/Makefile.am
@@ -18,11 +18,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
+
+AM_CPPFLAGS += -I$(top_srcdir)/epan
noinst_LTLIBRARIES = libftypes.la
@@ -34,8 +33,6 @@ CLEANFILES = \
MAINTAINERCLEANFILES = \
Makefile.in
-AM_CPPFLAGS = -I$(srcdir)/../.. -I$(srcdir)/..
-
libftypes_la_SOURCES = $(NONGENERATED_C_FILES) $(NONGENERATED_HEADER_FILES)
libftypes_la_LIBADD = @GLIB_LIBS@
diff --git a/epan/nghttp2/Makefile.am b/epan/nghttp2/Makefile.am
index 8256a3dca4..54d964b7b0 100644
--- a/epan/nghttp2/Makefile.am
+++ b/epan/nghttp2/Makefile.am
@@ -19,15 +19,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- $(LIBNGHTTP2_CFLAGS)
+AM_CPPFLAGS += $(LIBNGHTTP2_CFLAGS)
noinst_LTLIBRARIES = libnghttp2.la
diff --git a/epan/wmem/Makefile.am b/epan/wmem/Makefile.am
index 8fd4960e79..0b46b6a5e0 100644
--- a/epan/wmem/Makefile.am
+++ b/epan/wmem/Makefile.am
@@ -19,15 +19,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- $(LIBWMEM_CFLAGS)
+AM_CPPFLAGS += $(LIBWMEM_CFLAGS)
noinst_LTLIBRARIES = libwmem.la
diff --git a/epan/wslua/Makefile.am b/epan/wslua/Makefile.am
index fcc15450d2..feb099890f 100644
--- a/epan/wslua/Makefile.am
+++ b/epan/wslua/Makefile.am
@@ -19,11 +19,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
-AM_CPPFLAGS = -I$(top_srcdir) @LUA_CFLAGS@
+AM_CPPFLAGS += $(LUA_CFLAGS)
noinst_LTLIBRARIES = libwslua.la