1 From 298356c44a7df2b34c4e307c531d2010e2cb4b79 Mon Sep 17 00:00:00 2001
2 From: Lionel Orry <lionel.orry@gmail.com>
3 Date: Wed, 27 Mar 2013 15:56:56 +0100
4 Subject: [PATCH 1/1] Fix Makefiles for cross-compilation
6 The CFLAGS handling in mongrel2 is really messy and it is hard to make
7 it behave correctly with cross-compiling environments. This patch
8 restricts the Makefiles syntax to GNU Make, but help cross-compiling.
10 This is not meant to be applied upstream.
12 Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
15 tools/config_modules/Makefile | 2 +-
16 tools/filters/Makefile | 2 +-
17 tools/m2sh/Makefile | 2 +-
18 tools/procer/Makefile | 2 +-
19 5 files changed, 5 insertions(+), 5 deletions(-)
21 diff --git a/Makefile b/Makefile
22 index 6dce4a6..d48e05e 100644
26 -CFLAGS=-g -O2 -Wall -Wextra -Isrc -Isrc/polarssl/include -pthread -rdynamic -DNDEBUG $(OPTFLAGS) -D_FILE_OFFSET_BITS=64
27 +override CFLAGS += -g -O2 -Wall -Wextra -Isrc -Isrc/polarssl/include -pthread -rdynamic -DNDEBUG $(OPTFLAGS) -D_FILE_OFFSET_BITS=64
28 LIBS=-lzmq -ldl -lsqlite3 $(OPTLIBS)
31 diff --git a/tools/config_modules/Makefile b/tools/config_modules/Makefile
32 index 398490c..53f2255 100644
33 --- a/tools/config_modules/Makefile
34 +++ b/tools/config_modules/Makefile
37 -CFLAGS=-I../../src -I../../src/polarssl/include $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
38 +override CFLAGS += -I../../src -I../../src/polarssl/include $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
41 MONGO_SRC = mongo-c-driver/src/bson.c \
42 diff --git a/tools/filters/Makefile b/tools/filters/Makefile
43 index f9f4556..6077b79 100644
44 --- a/tools/filters/Makefile
45 +++ b/tools/filters/Makefile
48 -CFLAGS=-I../../src -I../../src/polarssl/include $(OPTFLAGS) -g -fPIC -shared -nostartfiles -L../../build
49 + override CFLAGS += -I../../src -I../../src/polarssl/include $(OPTFLAGS) -g -fPIC -shared -nostartfiles -L../../build
53 diff --git a/tools/m2sh/Makefile b/tools/m2sh/Makefile
54 index b50d8a0..ba378c5 100644
55 --- a/tools/m2sh/Makefile
56 +++ b/tools/m2sh/Makefile
58 -CFLAGS=-DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall $(OPTFLAGS)
59 +override CFLAGS += -DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall $(OPTFLAGS)
60 LIBS=-lzmq -lsqlite3 ../../build/libm2.a $(OPTLIBS)
63 diff --git a/tools/procer/Makefile b/tools/procer/Makefile
64 index d0d7de0..629b2e9 100644
65 --- a/tools/procer/Makefile
66 +++ b/tools/procer/Makefile
68 -CFLAGS=-DNDEBUG -pthread -g -I../../src -Wall $(OPTFLAGS)
69 +override CFLAGS += -DNDEBUG -pthread -g -I../../src -Wall $(OPTFLAGS)
72 SOURCES=$(wildcard *.c)