From 3b07f4f4fb1df95d80afe757fd73bc9b74feaa6f Mon Sep 17 00:00:00 2001 From: Rutger Hofman Date: Sat, 9 May 2009 05:12:40 +0000 Subject: [PATCH] Add automake magic to avoid -Werror for flex-generated files git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1584 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 9 ++++++++- urjtag/configure.ac | 3 ++- urjtag/src/Makefile.am | 4 ++++ urjtag/src/apps/jtag/Makefile.am | 2 ++ urjtag/src/bsdl/Makefile.am | 19 +++++++++++++------ urjtag/src/bsdl/bsdl_flex.l | 15 --------------- urjtag/src/bsdl/vhdl_flex.l | 15 --------------- urjtag/src/bus/Makefile.am | 2 ++ urjtag/src/cmd/Makefile.am | 2 ++ urjtag/src/flash/Makefile.am | 1 + urjtag/src/global/Makefile.am | 2 ++ urjtag/src/jim/Makefile.am | 2 ++ urjtag/src/lib/Makefile.am | 2 ++ urjtag/src/part/Makefile.am | 2 ++ urjtag/src/svf/Makefile.am | 16 ++++++++++++---- urjtag/src/svf/svf_flex.l | 15 --------------- urjtag/src/tap/Makefile.am | 2 ++ 17 files changed, 56 insertions(+), 57 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 5ca6f8ba..02207dc1 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,10 @@ +2009-05-09 Rutger Hofman + + * configure.ac, **/Makefile.am: Add automake magic to have -Werror except + in the flex-generated files. See the automake FAQ: + http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html#Flag-Variables-Ordering + Only setting -Wno-error=unused-function doesn't work for some gcc-s. + 2009-05-09 Arnim Laeuger * src/bsdl/Makefile.am, src/svf/Makefile.am: avoid -Werror to bail out because @@ -7,7 +14,7 @@ src/svf/svf_bison.y, src/svf/svf.h, src/svf/svf_flex.l: replace print_progress with DETAIL log level -2009-05-05 Rutger Hofman +2009-05-07 Rutger Hofman * src/flash/, src/svf/, src/tap/*.c, src/tap/parallel/, src/tap/usbconn: replace calls to printf() with calls to urj_log() and urj_error_set() diff --git a/urjtag/configure.ac b/urjtag/configure.ac index 2e402711..93a75c6b 100644 --- a/urjtag/configure.ac +++ b/urjtag/configure.ac @@ -266,7 +266,8 @@ AS_IF([test "x$with_inpout32" = xyes], [ ]) -CFLAGS="$CFLAGS -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith" +WARNINGCFLAGS="-Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith" +AC_SUBST(WARNINGCFLAGS) CPPFLAGS="-I\$(top_srcdir) -I\$(top_srcdir)/include $CPPFLAGS" diff --git a/urjtag/src/Makefile.am b/urjtag/src/Makefile.am index c6736ff2..ce9c3430 100644 --- a/urjtag/src/Makefile.am +++ b/urjtag/src/Makefile.am @@ -66,10 +66,12 @@ liburjtag_la_LIBADD = \ if ENABLE_SVF liburjtag_la_LIBADD += svf/libsvf.la +liburjtag_la_LIBADD += svf/libsvf_flex.la endif if ENABLE_BSDL liburjtag_la_LIBADD += bsdl/libbsdl.la +liburjtag_la_LIBADD += bsdl/libbsdl_flex.la endif if ENABLE_JIM @@ -78,3 +80,5 @@ endif localedir = $(datadir)/locale INCLUDES = -DLOCALEDIR=\"$(localedir)\" + +AM_CFLAGS = $(WARNINGCFLAGS) diff --git a/urjtag/src/apps/jtag/Makefile.am b/urjtag/src/apps/jtag/Makefile.am index 6da29ef5..cdae8942 100644 --- a/urjtag/src/apps/jtag/Makefile.am +++ b/urjtag/src/apps/jtag/Makefile.am @@ -35,3 +35,5 @@ jtag_LDADD = \ localedir = $(datadir)/locale INCLUDES = -DLOCALEDIR=\"$(localedir)\" + +AM_CFLAGS = $(WARNINGCFLAGS) diff --git a/urjtag/src/bsdl/Makefile.am b/urjtag/src/bsdl/Makefile.am index 75a2dd82..668ac71d 100644 --- a/urjtag/src/bsdl/Makefile.am +++ b/urjtag/src/bsdl/Makefile.am @@ -22,16 +22,20 @@ include $(top_srcdir)/Makefile.rules OBJEXT = lo -noinst_LTLIBRARIES = libbsdl.la +noinst_LTLIBRARIES = \ + libbsdl.la \ + libbsdl_flex.la libbsdl_la_SOURCES = \ vhdl_bison.y \ - vhdl_flex.l \ bsdl_bison.y \ - bsdl_flex.l \ bsdl.c \ bsdl_sem.c +libbsdl_flex_la_SOURCES = \ + vhdl_flex.l \ + bsdl_flex.l + noinst_HEADERS = \ bsdl_bison.h \ bsdl_config.h \ @@ -42,9 +46,12 @@ noinst_HEADERS = \ vhdl_bison.h \ vhdl_parser.h -# avoid -Werror to bail out because of unused input() function -# in vhdl_flex.c and bsdl_flex.c -libbsdl_la_CFLAGS = -Wno-error=unused-function +AM_CFLAGS = $(WARNINGCFLAGS) + +libbsdl_flex_la_CFLAGS = \ + $(AM_CFLAGS) \ + -Wno-unused-function \ + -Werror=missing-prototypes -Wno-error=missing-prototypes # additional dependencies # - all files depend on bsdl_config.h which dynamically generated diff --git a/urjtag/src/bsdl/bsdl_flex.l b/urjtag/src/bsdl/bsdl_flex.l index a8d6d2d4..30b3431c 100644 --- a/urjtag/src/bsdl/bsdl_flex.l +++ b/urjtag/src/bsdl/bsdl_flex.l @@ -140,21 +140,6 @@ LEGAL NOTICES: #define YY_EXTRA_TYPE urj_bsdl_scan_extra_t * -// @@@@ RFHH: take these out after the refactor -// Prototypes that flex should have added, functions that flex should have -// called or not declared: -int urj_bsdl_get_column (yyscan_t yyscanner); -void urj_bsdl_set_column (int column_no , yyscan_t yyscanner); - -static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner); - -void urj_bsdl_use_yyunput (yyscan_t yyscanner); -void urj_bsdl_use_yyunput (yyscan_t yyscanner) -{ - yyunput (0, NULL, yyscanner); -} -// @@@@ RFHH: take these out after the refactor - static char *new_string (urj_bsdl_scan_extra_t *, const char *); #define BINARY 0 diff --git a/urjtag/src/bsdl/vhdl_flex.l b/urjtag/src/bsdl/vhdl_flex.l index e8bc76b9..fc2c3733 100644 --- a/urjtag/src/bsdl/vhdl_flex.l +++ b/urjtag/src/bsdl/vhdl_flex.l @@ -142,21 +142,6 @@ LEGAL NOTICES: #define YY_EXTRA_TYPE urj_bsdl_scan_extra_t * -// @@@@ RFHH: take these out after the refactor -// Prototypes that flex should have added, functions that flex should have -// called or not declared: -int urj_vhdl_get_column (yyscan_t yyscanner); -void urj_vhdl_set_column (int column_no , yyscan_t yyscanner); - -static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner); - -void urj_vhdl_use_yyunput (yyscan_t yyscanner); -void urj_vhdl_use_yyunput (yyscan_t yyscanner) -{ - yyunput (0, NULL, yyscanner); -} -// @@@@ RFHH: take these out after the refactor - static char *new_string (urj_bsdl_scan_extra_t *, const char *); #define BINARY 0 diff --git a/urjtag/src/bus/Makefile.am b/urjtag/src/bus/Makefile.am index eaa029d0..3bf7bd2e 100644 --- a/urjtag/src/bus/Makefile.am +++ b/urjtag/src/bus/Makefile.am @@ -177,3 +177,5 @@ endif if ENABLE_BUS_ZEFANT_XS3 libbus_la_SOURCES += zefant-xs3.c endif + +AM_CFLAGS = $(WARNINGCFLAGS) diff --git a/urjtag/src/cmd/Makefile.am b/urjtag/src/cmd/Makefile.am index b53bbf7a..fd8a8bb9 100644 --- a/urjtag/src/cmd/Makefile.am +++ b/urjtag/src/cmd/Makefile.am @@ -71,3 +71,5 @@ endif if ENABLE_BSDL libcmd_la_SOURCES += cmd_bsdl.c endif + +AM_CFLAGS = $(WARNINGCFLAGS) diff --git a/urjtag/src/flash/Makefile.am b/urjtag/src/flash/Makefile.am index 240a1f5d..ac1b09f2 100644 --- a/urjtag/src/flash/Makefile.am +++ b/urjtag/src/flash/Makefile.am @@ -39,3 +39,4 @@ libflash_la_SOURCES += \ jedec_exp.c endif +AM_CFLAGS = $(WARNINGCFLAGS) diff --git a/urjtag/src/global/Makefile.am b/urjtag/src/global/Makefile.am index 2fbccfd9..d1694f47 100644 --- a/urjtag/src/global/Makefile.am +++ b/urjtag/src/global/Makefile.am @@ -31,3 +31,5 @@ libglobal_la_SOURCES = \ data_dir.c AM_CPPFLAGS = -DJTAG_BIN_DIR=\"$(bindir)\" -DJTAG_DATA_DIR=\"$(pkgdatadir)\" + +AM_CFLAGS = $(WARNINGCFLAGS) diff --git a/urjtag/src/jim/Makefile.am b/urjtag/src/jim/Makefile.am index 9b31bcb1..d89abf32 100644 --- a/urjtag/src/jim/Makefile.am +++ b/urjtag/src/jim/Makefile.am @@ -29,3 +29,5 @@ libjim_la_SOURCES = \ jim_tap.c \ some_cpu.c \ intel_28f800b3.c + +AM_CFLAGS = $(WARNINGCFLAGS) diff --git a/urjtag/src/lib/Makefile.am b/urjtag/src/lib/Makefile.am index 006ab6a7..aa2b897c 100644 --- a/urjtag/src/lib/Makefile.am +++ b/urjtag/src/lib/Makefile.am @@ -42,3 +42,5 @@ endif libjtaglib_la_SOURCES = \ fclock.c \ $(libiberty_sources) + +AM_CFLAGS = $(WARNINGCFLAGS) diff --git a/urjtag/src/part/Makefile.am b/urjtag/src/part/Makefile.am index b2b622df..6663d1b1 100644 --- a/urjtag/src/part/Makefile.am +++ b/urjtag/src/part/Makefile.am @@ -31,3 +31,5 @@ libpart_la_SOURCES = \ data_register.c \ bsbit.c \ part.c + +AM_CFLAGS = $(WARNINGCFLAGS) diff --git a/urjtag/src/svf/Makefile.am b/urjtag/src/svf/Makefile.am index 0732f3b4..5695057e 100644 --- a/urjtag/src/svf/Makefile.am +++ b/urjtag/src/svf/Makefile.am @@ -24,19 +24,27 @@ include $(top_srcdir)/Makefile.rules AM_YFLAGS = -d OBJEXT = lo -noinst_LTLIBRARIES = libsvf.la +noinst_LTLIBRARIES = \ + libsvf.la \ + libsvf_flex.la libsvf_la_SOURCES = \ svf_bison.y \ - svf_flex.l \ svf.h \ svf.c -# avoid -Werror to bail out because of unused input() function in svf_flex.c -libsvf_la_CFLAGS = -Wno-error=unused-function +libsvf_flex_la_SOURCES = \ + svf_flex.l svf_flex.$(OBJEXT) svf.$(OBJEXT): svf_bison.$(OBJEXT) +AM_CFLAGS = $(WARNINGCFLAGS) + +libsvf_flex_la_CFLAGS = \ + $(AM_CFLAGS) \ + -Wno-unused-function \ + -Werror=missing-prototypes -Wno-error=missing-prototypes + svf_bison.h: svf_bison.c MAINTAINERCLEANFILES = \ diff --git a/urjtag/src/svf/svf_flex.l b/urjtag/src/svf/svf_flex.l index 9a98f853..edf9f810 100644 --- a/urjtag/src/svf/svf_flex.l +++ b/urjtag/src/svf/svf_flex.l @@ -55,26 +55,11 @@ static void fix_yylloc(YYLTYPE *, char *); static void fix_yylloc_nl(YYLTYPE *, char *, YY_EXTRA_TYPE); static void progress_nl(YYLTYPE *, YY_EXTRA_TYPE); -// @@@@ RFHH: take these out after the refactor -// Prototypes that flex should have added, functions that flex should have -// called or not declared: -int urj_svf_get_column (yyscan_t yyscanner); -void urj_svf_set_column (int column_no , yyscan_t yyscanner); - -static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner); - -void urj_svf_use_yyunput (yyscan_t yyscanner); -void urj_svf_use_yyunput (yyscan_t yyscanner) -{ - yyunput (0, NULL, yyscanner); -} - int yywrap(yyscan_t scanner); int yywrap(yyscan_t scanner) { return(1); } -// @@@@ RFHH: take these out after the refactor #define YY_USER_INIT \ do { \ diff --git a/urjtag/src/tap/Makefile.am b/urjtag/src/tap/Makefile.am index 90b5eceb..5923657f 100644 --- a/urjtag/src/tap/Makefile.am +++ b/urjtag/src/tap/Makefile.am @@ -162,3 +162,5 @@ if ENABLE_CABLE_EP9307 libtap_la_SOURCES += \ cable/vision_ep9307.c endif + +AM_CFLAGS = $(WARNINGCFLAGS)