summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-08-04 09:46:00 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-08-05 10:31:28 +0800
commit76591d5e727b35295ea238322f73515c8cc93945 (patch)
treecf443f56765a5e74e3f34a87229d9649a05bc38e
parentd1f814a1e310b5c1e6b32d5bdbf7b7450c221325 (diff)
downloadtalos-petitboot-76591d5e727b35295ea238322f73515c8cc93945.tar.gz
talos-petitboot-76591d5e727b35295ea238322f73515c8cc93945.zip
discover/grub2: distinguish parser.h from grub2/parser.h
'make distcheck' will do a 'make all' srcdir == objdir, then later a 'make check' sith srcdir != objdir. Since gcc's cpp always assumes that a source file's directory is first in the include paths, we may see discover/parser.h included when we wanted the generated discover/grub2/parser.h. This change renames the grub2 lexer and parser files, to work-around this behaviour, and fix 'make distcheck'. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--discover/grub2/Makefile.am32
-rw-r--r--discover/grub2/grub2-lexer.l (renamed from discover/grub2/lexer.l)2
-rw-r--r--discover/grub2/grub2-parser.y (renamed from discover/grub2/parser.y)2
-rw-r--r--test/parser/Makefile.am1
4 files changed, 19 insertions, 18 deletions
diff --git a/discover/grub2/Makefile.am b/discover/grub2/Makefile.am
index 0bff9fa..496dac3 100644
--- a/discover/grub2/Makefile.am
+++ b/discover/grub2/Makefile.am
@@ -19,21 +19,21 @@ discover_grub2_grub2_parser_ro_SOURCES = \
discover/grub2/env.c \
discover/grub2/grub2.h \
discover/grub2/grub2.c \
- discover/grub2/lexer.l \
- discover/grub2/parser.y \
+ discover/grub2/grub2-lexer.l \
+ discover/grub2/grub2-parser.y \
discover/grub2/script.c
BUILT_SOURCES += \
- discover/grub2/parser.c \
- discover/grub2/parser.h \
- discover/grub2/lexer.h \
- discover/grub2/lexer.c
+ discover/grub2/grub2-parser.c \
+ discover/grub2/grub2-parser.h \
+ discover/grub2/grub2-lexer.h \
+ discover/grub2/grub2-lexer.c
CLEANFILES += \
- discover/grub2/parser.c \
- discover/grub2/parser.h \
- discover/grub2/lexer.c \
- discover/grub2/lexer.h
+ discover/grub2/grub2-parser.c \
+ discover/grub2/grub2-parser.h \
+ discover/grub2/grub2-lexer.c \
+ discover/grub2/grub2-lexer.h
discover_grub2_grub2_parser_ro_CPPFLAGS = \
$(AM_CPPFLAGS) \
@@ -44,14 +44,14 @@ discover_grub2_grub2_parser_ro_LINK = \
$(LD) -r -o $@
# ylwrap doesn't handle flex header files well; use our own rule here.
-discover/grub2/lexer.h discover/grub2/lexer.c: \
- $(top_srcdir)/discover/grub2/lexer.l
- $(AM_V_LEX)$(LEXCOMPILE) --header-file=discover/grub2/lexer.h \
- -o discover/grub2/lexer.c $^
+discover/grub2/grub2-lexer.h discover/grub2/grub2-lexer.c: \
+ $(top_srcdir)/discover/grub2/grub2-lexer.l
+ $(AM_V_LEX)$(LEXCOMPILE) --header-file=discover/grub2/grub2-lexer.h \
+ -o discover/grub2/grub2-lexer.c $^
# We need to loosen our warnings for the generated lexer code.
-discover/grub2/%lexer.o discover/grub2/lexer.o: \
+discover/grub2/%grub2-lexer.o discover/grub2/grub2-lexer.o: \
AM_CFLAGS += -Wno-unused-parameter -Wno-missing-prototypes \
-Wno-missing-declarations
-$(discover_grub2_grub2_parser_ro_OBJECTS): discover/grub2/parser.h
+$(discover_grub2_grub2_parser_ro_OBJECTS): discover/grub2/grub2-parser.h
diff --git a/discover/grub2/lexer.l b/discover/grub2/grub2-lexer.l
index e557146..7c9fcfe 100644
--- a/discover/grub2/lexer.l
+++ b/discover/grub2/grub2-lexer.l
@@ -1,7 +1,7 @@
%{
#include "grub2.h"
-#include "parser.h"
+#include "grub2-parser.h"
#include <talloc/talloc.h>
void yyerror(struct grub2_parser *parser, const char *fmt, ...);
diff --git a/discover/grub2/parser.y b/discover/grub2/grub2-parser.y
index 9d79d9b..4d351d4 100644
--- a/discover/grub2/parser.y
+++ b/discover/grub2/grub2-parser.y
@@ -61,7 +61,7 @@ void yyerror(struct grub2_parser *parser, const char *fmt, ...);
%debug
%{
-#include "lexer.h"
+#include "grub2-lexer.h"
%}
%%
diff --git a/test/parser/Makefile.am b/test/parser/Makefile.am
index 7541149..95ee002 100644
--- a/test/parser/Makefile.am
+++ b/test/parser/Makefile.am
@@ -106,6 +106,7 @@ test_parser_libtest_ro_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/discover \
-I$(top_srcdir)/discover/grub2 \
+ -I$(top_builddir)/discover/grub2 \
-DPETITBOOT_TEST \
-DLOCAL_STATE_DIR='"$(localstatedir)"' \
-DTEST_CONF_BASE='"$(top_srcdir)/test/parser/data"'
OpenPOWER on IntegriCloud