From 5e779d17d0e04fb64f564b0c6fc9e3259130a5da Mon Sep 17 00:00:00 2001 From: KITAGAWA Masahiro Date: Sun, 29 Apr 2018 22:40:28 +0900 Subject: [PATCH] Do not ignore given CFLAGS/LDFLAGS, fix #227 --- lightcrafts/jnisrc/jni.mk | 2 -- lightcrafts/mk/executable.mk | 4 +--- lightcrafts/mk/platform.mk | 9 +++++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lightcrafts/jnisrc/jni.mk b/lightcrafts/jnisrc/jni.mk index c4d5a60cbf..dcd673a837 100644 --- a/lightcrafts/jnisrc/jni.mk +++ b/lightcrafts/jnisrc/jni.mk @@ -49,10 +49,8 @@ ## # Undefine all this stuff so we don't get any defaults. ## -CFLAGS= DEFINES:= INCLUDES:= -LDFLAGS:= LINK:= COMMON_DIR:= $(ROOT)/lightcrafts diff --git a/lightcrafts/mk/executable.mk b/lightcrafts/mk/executable.mk index 140d22cad0..e7cb79058c 100644 --- a/lightcrafts/mk/executable.mk +++ b/lightcrafts/mk/executable.mk @@ -44,10 +44,8 @@ EXECUTABLE:=1 ## # Undefine all this stuff so we don't get any defaults. ## -CFLAGS:= DEFINES:= INCLUDES:= -LDFLAGS:= LINK:= COMMON_DIR:= $(ROOT)/lightcrafts @@ -61,7 +59,7 @@ else endif DEFINES:= $(EXEC_EXTRA_DEFINES) -INCLUDES:= $(EXEC_EXTRA_INCLUDES) +INCLUDES:= $(PLATFORM_INCLUDES) $(EXEC_EXTRA_INCLUDES) LDFLAGS:= $(PLATFORM_LDFLAGS) -L$(COMMON_DIR)/products \ $(EXEC_EXTRA_LDFLAGS) LINK:= $(EXEC_EXTRA_LINK) diff --git a/lightcrafts/mk/platform.mk b/lightcrafts/mk/platform.mk index e4bb319d0c..46f8410b3a 100644 --- a/lightcrafts/mk/platform.mk +++ b/lightcrafts/mk/platform.mk @@ -50,8 +50,9 @@ ifneq ($(USE_ICC),1) USE_ICC_HERE:= endif -# The initial set of CFLAGS. (Must not use := here!) -PLATFORM_CFLAGS= -g +# The initial set of CFLAGS and LDFLAGS. (Must not use := here!) +PLATFORM_CFLAGS= $(CFLAGS) -g +PLATFORM_LDFLAGS= $(LDFLAGS) # Default symlink command. This needs to be defined as a function variable # rather than just a simple variable because of the way it's overridden for @@ -103,7 +104,7 @@ ifeq ($(PLATFORM),MacOSX) MACOSX_ISYSROOT= MACOSX_SYSLIBROOT= endif - PLATFORM_LDFLAGS= $(MACOSX_SYSLIBROOT) + PLATFORM_LDFLAGS+= $(MACOSX_SYSLIBROOT) ## # These are to be only the bare minimum architecture-specific CFLAGS. High- @@ -305,7 +306,7 @@ ifeq ($(PLATFORM),$(filter $(PLATFORM),Linux FreeBSD SunOS)) JAVA_INCLUDES:= -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/freebsd NUM_PROCESSORS:= $(shell dmesg | grep '^cpu' | wc -l) PLATFORM_INCLUDES= -I/usr/local/include - PLATFORM_LDFLAGS= -L/usr/local/lib + PLATFORM_LDFLAGS+= -L/usr/local/lib else ifeq ($(PLATFORM),SunOS) JAVA_INCLUDES:= -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/solaris NUM_PROCESSORS:= $(shell psrinfo -p)