aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorstandel <standel@f5534014-38df-0310-8fa8-9805f1628bb7>2007-05-17 18:02:22 +0000
committerstandel <standel@f5534014-38df-0310-8fa8-9805f1628bb7>2007-05-17 18:02:22 +0000
commit937bc8655415d01ff7a312195a6661bfb4cc7c95 (patch)
treeaf9350d515d317c06043dc357ffbb3246b125237 /wiretap
parent612d7f6299ad72928f043540ead77c1a21beb70f (diff)
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21817 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/Makefile.am27
-rw-r--r--wiretap/Makefile.common8
2 files changed, 25 insertions, 10 deletions
diff --git a/wiretap/Makefile.am b/wiretap/Makefile.am
index 08b465e64f..11d6a53c8c 100644
--- a/wiretap/Makefile.am
+++ b/wiretap/Makefile.am
@@ -25,12 +25,19 @@ ACLOCAL_AMFLAGS = `../aclocal-flags`
include Makefile.common
+noinst_LTLIBRARIES = libwiretap_generated.la
lib_LTLIBRARIES = libwiretap.la
libwiretap_la_LDFLAGS = -version-info 0:1:0 @LDFLAGS_SHAREDLIB@
+if HAVE_WARNINGS_AS_ERRORS
+AM_NON_GENERATED_CFLAGS = -Werror
+endif
+
CLEANFILES = \
libwiretap.a \
libwiretap.la \
+ libwiretap_generated.a \
+ libwiretap_generated.la \
*~
MAINTAINERCLEANFILES = \
@@ -40,10 +47,17 @@ MAINTAINERCLEANFILES = \
config.h.in \
configure
+#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.
libwiretap_la_SOURCES = \
$(NONGENERATED_C_FILES) \
- $(GENERATOR_SOURCES) \
$(NONGENERATED_HEADER_FILES)
+libwiretap_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)
+
+libwiretap_generated_la_SOURCES = \
+ $(GENERATED_C_FILES)
EXTRA_DIST = \
README.developer \
@@ -54,8 +68,15 @@ EXTRA_DIST = \
file_util.c \
$(GENERATED_FILES)
-# Any POSIX-compatible YACC should honor the -p flag
-AM_YFLAGS=-d -p ascend
+libwiretap_la_LIBADD = libwiretap_generated.la
+libwiretap_la_DEPENDENCIES = libwiretap_generated.la
+
+ascend-grammar.c : ascend-grammar.y
+ @if [ -z "$(YACC)" ]; then \
+ echo "Neither bison nor byacc has been found"; \
+ exit 1; \
+ fi
+ $(YACC) -d -p ascend -o ascend-grammar.c $(srcdir)/ascend-grammar.y
ascend-scanner.c : ascend-scanner.l
@if [ ! -x "$(LEX)" ]; then \
diff --git a/wiretap/Makefile.common b/wiretap/Makefile.common
index 22a919aa32..a988d22af2 100644
--- a/wiretap/Makefile.common
+++ b/wiretap/Makefile.common
@@ -110,16 +110,10 @@ NONGENERATED_HEADER_FILES = \
wtap-capture.h \
wtap-int.h
-# Files that generate compileable files
-GENERATOR_SOURCES = \
- ascend-grammar.y \
- ascend-scanner.l \
- k12text.l
-
# The C source files they generate.
GENERATED_C_FILES = \
ascend-grammar.c \
- ascend-scanner.c \
+ ascend-scanner.c \
k12text.c
# The header files that they generate.