aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/autofs/autofs/fix-the-YACC-rule-to-fix-a-building-failure.patch
blob: fd736296a5dcf9fd3c854455b0548eb35a1f6ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From 971d48a00ef82880c34e89778bf430a01360ebd5 Mon Sep 17 00:00:00 2001
From: Roy Li <rongqing.li@windriver.com>
Date: Mon, 18 May 2015 16:28:36 +0800
Subject: [PATCH] [PATCH] fix the YACC rule to fix a building failure

Upstream-Statu: Pending

The original rule will create the header file twice, one is that the header
file as the object file is created, other time is when create the C source file.
since YACC always has "-d" parameter.

This lead to a race when compile amd_tok.o, the header file maybe rewritten.
  |----------------------
  |amd_tok.l:359:10: error: 'RBRACKET' undeclared (first use in this function)
  |  ")" { return RBRACKET; }
  |          ^
  |../Makefile.rules:64: recipe for target 'amd_tok.o' failed
  |----------------------
Signed-off-by: Roy Li <rongqing.li@windriver.com>

---
Upstream-Status: Pending

 lib/Makefile     | 6 ++++--
 modules/Makefile | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

--- a/lib/Makefile
+++ b/lib/Makefile
@@ -53,7 +53,8 @@ mount_xdr.o: mount_xdr.c
 nss_tok.c: nss_tok.l
 	$(LEX) -o$@ -Pnss_ $?
 
-nss_parse.tab.c nss_parse.tab.h: nss_parse.y
+nss_parse.tab.h: nss_parse.tab.c
+nss_parse.tab.c: nss_parse.y
 	$(YACC) -v -d -p nss_ -b nss_parse $?
 
 nss_tok.o: nss_tok.c nss_parse.tab.h
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -103,7 +103,8 @@ amd_tok.c: amd_tok.l
 
 amd_tok.o: amd_tok.c amd_parse.tab.h
 
-amd_parse.tab.c amd_parse.tab.h: amd_parse.y
+amd_parse.tab.h: amd_parse.tab.c
+amd_parse.tab.c: amd_parse.y
 	$(YACC) -v -d -p amd_ -b amd_parse $?
 
 amd_parse.tab.o: amd_parse.tab.c amd_parse.tab.h
--- a/daemon/Makefile
+++ b/daemon/Makefile
@@ -16,7 +16,7 @@ YACCSRC = master_tok.c master_parse.tab.
 version := $(shell cat ../.version)
 
 CFLAGS += -rdynamic $(DAEMON_CFLAGS) -D_GNU_SOURCE -I../include
-CFLAGS += -DAUTOFS_LIB_DIR=\"$(autofslibdir)\" 
+CFLAGS += -DAUTOFS_LIB_DIR=\"$(autofslibdir)\"
 CFLAGS += -DAUTOFS_MAP_DIR=\"$(autofsmapdir)\"
 CFLAGS += -DAUTOFS_CONF_DIR=\"$(autofsconfdir)\"
 CFLAGS += -DAUTOFS_FIFO_DIR=\"$(autofsfifodir)\"
@@ -44,7 +44,8 @@ automount: $(OBJS) $(AUTOFS_LIB)
 master_tok.c: master_tok.l
 	$(LEX) -o$@ -Pmaster_ $?
 
-master_parse.tab.c master_parse.tab.h: master_parse.y
+master_parse.tab.h: master_parse.tab.c
+master_parse.tab.c: master_parse.y
 	$(YACC) -v -d -p master_ -b master_parse $?
 
 master_tok.o: master_tok.c master_parse.tab.h
@@ -57,5 +58,3 @@ clean:
 install: all
 	install -d -m 755 $(INSTALLROOT)$(sbindir)
 	install -c automount -m 755 $(INSTALLROOT)$(sbindir)
-
-