deal with crap automake versions < 1.9 that do not run ylwrap on a single
authorChristos Zoulas <christos@zoulas.com>
Wed, 17 Sep 2008 21:57:06 +0000 (21:57 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 17 Sep 2008 21:57:06 +0000 (21:57 +0000)
yacc or lex file. Any better way to do this?

fsinfo/Makefile.am
fsinfo/fsinfo.h
fsinfo/null_gram.y [new file with mode: 0644]
fsinfo/null_lex.l [new file with mode: 0644]

index 609af5719c8c66f0c7daea5282c8fa9e8d65fd4a..d0b3fec7f73b551ff01c7d4fb0c10a54987fa12d 100644 (file)
@@ -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.
index 40082408b359f4a7c97ee2ba828597ddac319c08..4cc67c6c2d10b4d0ef56b0efc77f6ba69fd3a0ae 100644 (file)
@@ -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 (file)
index 0000000..1bee2b6
--- /dev/null
@@ -0,0 +1,4 @@
+
+%%
+
+token:
diff --git a/fsinfo/null_lex.l b/fsinfo/null_lex.l
new file mode 100644 (file)
index 0000000..7364481
--- /dev/null
@@ -0,0 +1,7 @@
+%{
+#include "null_gram.h"
+
+void yyerror(const char *fmt, ...) {}
+int yywrap(void) { return 0; }
+%}
+%%