File: 30-cross.patch

package info (click to toggle)
sqlite3 3.16.2-5+deb9u1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 88,416 kB
  • sloc: ansic: 195,593; tcl: 14,245; sh: 10,163; yacc: 1,246; makefile: 1,058; cs: 299; cpp: 128
file content (64 lines) | stat: -rw-r--r-- 1,977 bytes parent folder | download | duplicates (2)
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
Index: sqlite3-3.13.0/Makefile.in
===================================================================
--- sqlite3-3.13.0.orig/Makefile.in
+++ sqlite3-3.13.0/Makefile.in
@@ -662,10 +662,20 @@
 
 # Rules to build the LEMON compiler generator
 #
-lemon$(BEXE):	$(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
+lemon-for-build$(BEXE):	$(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
 	$(BCC) -o $@ $(TOP)/tool/lemon.c
 	cp $(TOP)/tool/lempar.c .
 
+lemon$(TEXE):	$(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
+	$(LTLINK) -o $@ $(TOP)/tool/lemon.c
+	cp $(TOP)/tool/lempar.c .
+
+ifeq ($(CROSS_BUILDING),yes)
+LEMON_FOR_BUILD = lemon-for-build$(BEXE)
+else
+LEMON_FOR_BUILD = lemon$(TEXE)
+endif
+
 # Rules to build individual *.o files from generated *.c files. This
 # applies to:
 #
@@ -924,10 +934,10 @@
 #
 parse.h:	parse.c
 
-parse.c:	$(TOP)/src/parse.y lemon$(BEXE) $(TOP)/tool/addopcodes.tcl
+parse.c:	$(TOP)/src/parse.y $(LEMON_FOR_BUILD) $(TOP)/tool/addopcodes.tcl
 	cp $(TOP)/src/parse.y .
 	rm -f parse.h
-	./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
+	./$(LEMON_FOR_BUILD) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
 	mv parse.h parse.h.temp
 	$(TCLSH_CMD) $(TOP)/tool/addopcodes.tcl parse.h.temp >parse.h
 
@@ -1030,10 +1040,10 @@
    $(TOP)/ext/fts5/fts5_varint.c \
    $(TOP)/ext/fts5/fts5_vocab.c  \
 
-fts5parse.c:	$(TOP)/ext/fts5/fts5parse.y lemon 
+fts5parse.c:	$(TOP)/ext/fts5/fts5parse.y $(LEMON_FOR_BUILD)
 	cp $(TOP)/ext/fts5/fts5parse.y .
 	rm -f fts5parse.h
-	./lemon$(BEXE) $(OPTS) fts5parse.y
+	./$(LEMON_FOR_BUILD)$(BEXE) $(OPTS) fts5parse.y
 
 fts5parse.h: fts5parse.c
 
@@ -1227,7 +1237,10 @@
 	rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
 	rm -f sqlite3.h opcodes.*
 	rm -rf .libs .deps
-	rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
+	rm -f $(LEMON_FOR_BUILD) lempar.c parse.* sqlite*.tar.gz
+ifeq ($(CROSS_BUILDING), yes)
+	rm -f lemon$(TEXE)
+endif
 	rm -f mkkeywordhash$(BEXE) keywordhash.h
 	rm -f *.da *.bb *.bbg gmon.out
 	rm -rf tsrc .target_source