xref: /OK3568_Linux_fs/buildroot/package/mongrel2/0002-Fix-Makefiles-for-cross-compilation.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 298356c44a7df2b34c4e307c531d2010e2cb4b79 Mon Sep 17 00:00:00 2001
2From: Lionel Orry <lionel.orry@gmail.com>
3Date: Wed, 27 Mar 2013 15:56:56 +0100
4Subject: [PATCH] Fix Makefiles for cross-compilation
5
6The CFLAGS handling in mongrel2 is really messy and it is hard to make
7it behave correctly with cross-compiling environments. This patch
8restricts the Makefiles syntax to GNU Make, but help cross-compiling.
9
10This is not meant to be applied upstream.
11
12Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
13[Fabrice: refresh for 1.12.2]
14Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
15---
16 Makefile                      | 2 +-
17 tools/config_modules/Makefile | 2 +-
18 tools/filters/Makefile        | 2 +-
19 tools/m2sh/Makefile           | 2 +-
20 tools/procer/Makefile         | 2 +-
21 5 files changed, 5 insertions(+), 5 deletions(-)
22
23diff --git a/Makefile b/Makefile
24index 4e89c33..2f549a8 100644
25--- a/Makefile
26+++ b/Makefile
27@@ -1,5 +1,5 @@
28 CFLAGS?=-g -O2
29-CFLAGS += -Wall -Wextra -Wno-implicit-fallthrough -Wno-unused-const-variable -I./src -DNDEBUG -D_FILE_OFFSET_BITS=64 -pthread
30+override CFLAGS += -Wall -Wextra -Wno-implicit-fallthrough -Wno-unused-const-variable -I./src -DNDEBUG -D_FILE_OFFSET_BITS=64 -pthread
31 CFLAGS += ${OPTFLAGS}
32 LIBS+=-lzmq -ldl -lsqlite3 -lmbedtls -lmbedx509 -lmbedcrypto
33 PREFIX?=/usr/local
34diff --git a/tools/config_modules/Makefile b/tools/config_modules/Makefile
35index c2680d1..ada3169 100644
36--- a/tools/config_modules/Makefile
37+++ b/tools/config_modules/Makefile
38@@ -1,5 +1,5 @@
39 PREFIX?=/usr/local
40-CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
41+override CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
42 LDFLAGS=$(OPTLIBS)
43
44 MONGO_SRC = mongo-c-driver/src/bson.c \
45diff --git a/tools/filters/Makefile b/tools/filters/Makefile
46index 6505ad5..a968ef6 100644
47--- a/tools/filters/Makefile
48+++ b/tools/filters/Makefile
49@@ -1,5 +1,5 @@
50 PREFIX?=/usr/local
51-CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -g -fPIC -shared -nostartfiles -L../../build
52+override CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -g -fPIC -shared -nostartfiles -L../../build
53 LDFLAGS=$(OPTLIBS)
54
55 all: null.so rewrite.so sendfile.so
56diff --git a/tools/m2sh/Makefile b/tools/m2sh/Makefile
57index b50d8a0..cc00062 100644
58--- a/tools/m2sh/Makefile
59+++ b/tools/m2sh/Makefile
60@@ -1,4 +1,4 @@
61-CFLAGS=-DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall $(OPTFLAGS)
62+override CFLAGS=-DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall $(OPTFLAGS)
63 LIBS=-lzmq -lsqlite3 ../../build/libm2.a $(OPTLIBS)
64
65 PREFIX?=/usr/local
66diff --git a/tools/procer/Makefile b/tools/procer/Makefile
67index bb9aa31..d377f7f 100644
68--- a/tools/procer/Makefile
69+++ b/tools/procer/Makefile
70@@ -1,4 +1,4 @@
71-CFLAGS=-DNDEBUG -pthread -g -I../../src -Wall $(OPTFLAGS)
72+override CFLAGS=-DNDEBUG -pthread -g -I../../src -Wall $(OPTFLAGS)
73 PREFIX?=/usr/local
74 LIBS?=-lzmq
75 SOURCES=$(wildcard *.c)
76--
772.27.0
78
79