From e5b6526d1ec25b5268832dfd94ba2bcc17d80684 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Wed, 17 Sep 2008 21:57:06 +0000 Subject: [PATCH] deal with crap automake versions < 1.9 that do not run ylwrap on a single yacc or lex file. Any better way to do this? --- fsinfo/Makefile.am | 8 +++++++- fsinfo/fsinfo.h | 2 +- fsinfo/null_gram.y | 4 ++++ fsinfo/null_lex.l | 7 +++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 fsinfo/null_gram.y create mode 100644 fsinfo/null_lex.l diff --git a/fsinfo/Makefile.am b/fsinfo/Makefile.am index 609af57..d0b3fec 100644 --- a/fsinfo/Makefile.am +++ b/fsinfo/Makefile.am @@ -16,6 +16,8 @@ noinst_HEADERS = fsi_data.h fsinfo.h fsinfo_SOURCES = \ fsi_gram.y \ fsi_lex.l \ + null_lex.l \ + null_gram.y \ \ fsi_analyze.c \ fsi_dict.c \ @@ -27,13 +29,17 @@ fsinfo_SOURCES = \ wr_exportfs.c \ wr_fstab.c +# sources which get auto-built (from yacc/lex) +BUILT_SOURCES = fsi_gram.c fsi_gram.h fsi_lex.c \ + null_gram.c null_gram.h null_lex.c + EXTRA_DIST = $(man_MANS) # do not distribute files that should be generated by lex/yacc locally dist-hook: (cd $(distdir) && rm -f fsi_gram.c fsi_gram.h fsi_lex.c) # clean these files, which get automatically generated by yacc/lex -CLEANFILES = fsi_gram.c fsi_gram.h fsi_lex.c +CLEANFILES = $(BUILT_SOURCES) LDADD = $(EXTRA_fsinfo_OBJECTS) ../libamu/libamu.la # must manually add f/lex library to LIBS, and not to LDADD. diff --git a/fsinfo/fsinfo.h b/fsinfo/fsinfo.h index 4008240..4cc67c6 100644 --- a/fsinfo/fsinfo.h +++ b/fsinfo/fsinfo.h @@ -104,7 +104,7 @@ extern void show_area_being_processed(char *area, int n); extern void show_new(char *msg); extern void warning(void); -extern int yyerror(char *fmt, ...) +extern int yyerror(const char *fmt, ...) __attribute__((__format__(__printf__, 1, 2))); extern void domain_strip(char *otherdom, char *localdom); /* diff --git a/fsinfo/null_gram.y b/fsinfo/null_gram.y new file mode 100644 index 0000000..1bee2b6 --- /dev/null +++ b/fsinfo/null_gram.y @@ -0,0 +1,4 @@ + +%% + +token: diff --git a/fsinfo/null_lex.l b/fsinfo/null_lex.l new file mode 100644 index 0000000..7364481 --- /dev/null +++ b/fsinfo/null_lex.l @@ -0,0 +1,7 @@ +%{ +#include "null_gram.h" + +void yyerror(const char *fmt, ...) {} +int yywrap(void) { return 0; } +%} +%% -- 2.43.0