diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-10-17 13:02:44 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2021-10-17 13:02:44 +0300 |
commit | f4c143fbdf31c59c84eaf1240c08dadda5ab4ef6 (patch) | |
tree | 7540746ad4d901423c630670b827abc71da01544 | |
parent | 1733320d47df1d18d622e6b3565d3d6c51b9deeb (diff) | |
download | gdbm-f4c143fbdf31c59c84eaf1240c08dadda5ab4ef6.tar.gz |
Change build process: explicitly require bison and flex
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/Makefile.am | 16 | ||||
-rw-r--r-- | src/gdbmtool.h | 3 | ||||
-rw-r--r-- | src/gram.y | 5 |
4 files changed, 17 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 73fbc71..43a240a 100644 --- a/configure.ac +++ b/configure.ac @@ -66,8 +66,8 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL LT_INIT -AC_PROG_YACC -AC_PROG_LEX([noyywrap]) +AC_PATH_PROG([BISON],[bison],[$(SHELL) $(top_srcdir)/build-aux/missing bison]) +AC_PATH_PROG([FLEX],[flex],[$(SHELL) $(top_srcdir)/build-aux/missing flex]) AC_ARG_VAR([GZIP_BIN],[Absolute filename of the gzip binary]) AC_PATH_PROG(GZIP_BIN,[gzip]) diff --git a/src/Makefile.am b/src/Makefile.am index 812d6d3..74103ee 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,10 +27,11 @@ noinst_HEADERS = \ proto.h\ systems.h -EXTRA_DIST = gdbm.h.in gdbm.magic -BUILT_SOURCES = gdbm.h gram.h +EXTRA_DIST = gdbm.h.in gdbm.magic gram.y lex.l +BUILT_SOURCES = gdbm.h gram.h gram.c lex.c -gram.h: gram.c +gram.c gram.h: gram.y +lex.c: lex.l # The libraries VI_CURRENT = 6 @@ -87,12 +88,12 @@ libgdbmapp_a_SOURCES =\ parseopt.c\ progname.c\ datconv.c\ - gram.y\ + gram.c\ input-argv.c\ input-file.c\ input-null.c\ input-std.c\ - lex.l\ + lex.c\ gdbmshell.c\ var.c\ util.c @@ -116,6 +117,11 @@ gdbmtool_SOURCES = \ AM_YFLAGS = -dv $(YFLAGS_DEBUG) AM_LFLAGS = $(LFLAGS_DEBUG) +.l.c: + $(AM_V_GEN)$(FLEX) -o $@ $(AM_LFLAGS) $< +.y.c: + $(AM_V_GEN)$(BISON) -o $@ $(AM_YFLAGS) $< + if COND_GDBMTOOL_DEBUG AM_CPPFLAGS += -DGDBMTOOL_DEBUG=1 endif diff --git a/src/gdbmtool.h b/src/gdbmtool.h index cd17e52..7462f8e 100644 --- a/src/gdbmtool.h +++ b/src/gdbmtool.h @@ -383,7 +383,8 @@ void end_def (void); int yylex (void); int yylex_destroy (void); -int yyerror (char const *s); +void yyerror (char const *s); +#define YYERROR_IS_DECLARED 1 int yyparse (void); void lex_trace (int n); @@ -22,7 +22,7 @@ struct dsegm *dsdef[DS_MAX]; %} -%error-verbose +%define parse.error verbose %locations %token <type> T_TYPE @@ -419,11 +419,10 @@ dberror (char const *fmt, ...) fputc ('\n', stderr); } -int +void yyerror (char const *s) { terror ("%s", s); - return 0; } void |