blob: 871cdfcb7db4323aa7078303ac3374a5b5e0b633 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001Fix for cross compiling
2
3Fixed:
4| ./dftables src/pcre2_chartables.c
5| make: ./dftables: Command not found
6| make: *** [src/pcre2_chartables.c] Error 127
7
8Upstream-Status: Pending
9
10Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
11
Brad Bishop316dfdd2018-06-25 12:45:53 -040012Index: pcre2-10.30/Makefile.am
13===================================================================
14--- pcre2-10.30.orig/Makefile.am
15+++ pcre2-10.30/Makefile.am
16@@ -325,9 +325,21 @@ bin_SCRIPTS = pcre2-config
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017 ## to copy a distributed set of tables that are defined for ASCII code. In this
18 ## case, dftables is not needed.
19
20+CC_FOR_BUILD = @CC_FOR_BUILD@
21+CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
22+CCLD_FOR_BUILD = @CCLD_FOR_BUILD@
23+LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
24+
25 if WITH_REBUILD_CHARTABLES
26 noinst_PROGRAMS += dftables
27 dftables_SOURCES = src/dftables.c
28+
29+dftables_LINK = $(CCLD_FOR_BUILD) -o $@
30+dftables_LDFLAGS = $(LDFLAGS_FOR_BUILD)
31+
32+src/dftables.o: $(srcdir)/src/dftables.c
33+ $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/src/dftables.c
34+
35 src/pcre2_chartables.c: dftables$(EXEEXT)
36 rm -f $@
37 ./dftables$(EXEEXT) $@
Brad Bishop316dfdd2018-06-25 12:45:53 -040038Index: pcre2-10.30/configure.ac
39===================================================================
40--- pcre2-10.30.orig/configure.ac
41+++ pcre2-10.30/configure.ac
42@@ -60,6 +60,23 @@ fi
43 # This is a new thing required to stop a warning from automake 1.12
44 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Brad Bishop6e60e8b2018-02-01 10:27:11 -050045
46+if test x"$cross_compiling" = xyes; then
47+ CC_FOR_BUILD="${CC_FOR_BUILD-gcc}"
48+ CCLD_FOR_BUILD="${CCLD_FOR_BUILD-gcc}"
49+ CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD}"
50+ LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD}"
51+else
52+ CC_FOR_BUILD="${CC_FOR_BUILD-\$(CC)}"
53+ CCLD_FOR_BUILD="${CCLD_FOR_BUILD-\$(CCLD)}"
54+ CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD-\$(CFLAGS)}"
55+ LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD-\$(LDFLAGS)}"
56+fi
57+AC_ARG_VAR(CC_FOR_BUILD, [build system C compiler])
58+AC_ARG_VAR(CCLD_FOR_BUILD, [build system C linker frontend])
59+AC_ARG_VAR(CFLAGS_FOR_BUILD, [build system C compiler arguments])
60+AC_ARG_VAR(LDFLAGS_FOR_BUILD, [build system C linker frontend arguments])
61+
62+
63 # Check for a 64-bit integer type
64 AC_TYPE_INT64_T
65