From b5134ee4f2abe7fbd76cc258aa45c6bc359ec76d Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Wed, 3 Oct 2012 13:35:49 +0200 Subject: [PATCH] Honor toplevel settings re: CC/FLAGS when building libdjvu. Define _GNU_SOURCE to fix build with CS/MG TC. Fixes #341 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ebda06394..10a3802e7 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ HOSTCXX:=g++ HOSTAR:=ar # Base CFLAGS, without arch. We'll need it for luajit, because its Makefiles do some tricky stuff to differentiate HOST/TARGET -BASE_CFLAGS:=-O2 -ffast-math -pipe -fomit-frame-pointer -fno-stack-protector -U_FORTIFY_SOURCE +BASE_CFLAGS:=-O2 -ffast-math -pipe -fomit-frame-pointer -fno-stack-protector -U_FORTIFY_SOURCE -D_GNU_SOURCE # Use this for debugging: #BASE_CFLAGS:=-O0 -g ARM_ARCH:=-march=armv6j -mtune=arm1136jf-s -mfpu=vfp @@ -213,9 +213,9 @@ $(MUPDFLIBS) $(THIRDPARTYLIBS): $(MUPDFDIR)/cmapdump.host $(MUPDFDIR)/fontdump.h $(DJVULIBS): mkdir -p $(DJVUDIR)/build ifdef EMULATE_READER - cd $(DJVUDIR)/build && ../configure --disable-desktopfiles --disable-shared --enable-static --disable-xmltools --disable-largefile + cd $(DJVUDIR)/build && CC="$(HOSTCC)" CXX="$(HOSTCXX)" CFLAGS="$(HOSTCFLAGS)" CXXFLAGS="$(HOSTCFLAGS)" LDFLAGS="$(LDFLAGS)" ../configure --disable-desktopfiles --disable-shared --enable-static --disable-xmltools --disable-largefile else - cd $(DJVUDIR)/build && ../configure --disable-desktopfiles --disable-shared --enable-static --host=$(CHOST) --disable-xmltools --disable-largefile + cd $(DJVUDIR)/build && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ../configure --disable-desktopfiles --disable-shared --enable-static --host=$(CHOST) --disable-xmltools --disable-largefile endif $(MAKE) -C $(DJVUDIR)/build