diff --git a/configure b/configure index 3ab71f762f2..f4cac4cbe85 100755 --- a/configure +++ b/configure @@ -223,6 +223,30 @@ opt() { fi } +envopt() { + local NAME=$1 + local V="CFG_${NAME}" + eval VV=\$$V + + # If configure didn't set a value already, then check environment. + # + # (It is recommended that the configure script always check the + # environment before setting any values to envopt variables; see + # e.g. how CFG_CC is handled, where it first checks `-z "$CC"`, + # and issues msg if it ends up employing that provided value.) + if [ -z "$VV" ] + then + eval $V=\$$NAME + eval VV=\$$V + fi + + # If script or environment provided a value, save it. + if [ ! -z "$VV" ] + then + putvar $V + fi +} + msg "looking for configure programs" need_cmd cmp need_cmd mkdir @@ -621,7 +645,7 @@ then if !((chk_cc gcc clang && chk_cc g++ clang) || (chk_cc gcc gcc &&( chk_cc g++ g++ || chk g++ gcc))) then err "the gcc and g++ in your path point to different compilers. - Check which versions are in your path with cc --version and g++ --version. + Check which versions are in your path with gcc --version and g++ --version. To resolve this problem, either fix your PATH or run configure with --enable-clang" fi @@ -646,41 +670,101 @@ then esac fi +# Even when the user overrides the choice of CC, still try to detect +# clang to disable some clang-specific warnings. We here draw a +# distinction between: +# +# CFG_ENABLE_CLANG : passed --enable-clang, or host "requires" clang, +# CFG_USING_CLANG : compiler (clang / gcc / $CC) looks like clang. +# +# This distinction is important because there are some safeguards we +# would prefer to skip when merely CFG_USING_CLANG is set; but when +# CFG_ENABLE_CLANG is set, that indicates that we are opting into +# running such safeguards. + +if [ ! -z "$CC" ] +then + msg "skipping compiler inference steps; using provided CC=$CC" + CFG_CC="$CC" + + CFG_OSX_CC_VERSION=$("$CFG_CC" --version 2>&1 | grep "clang") + if [ $? -eq 0 ] + then + step_msg "note, user-provided CC looks like clang; CC=$CC." + CFG_USING_CLANG=1 + putvar CFG_USING_CLANG + fi +else + if [ ! -z "$CFG_ENABLE_CLANG" ] + then + if [ -z "$CFG_CLANG" ] + then + err "clang requested but not found" + fi + CFG_CC="$CFG_CLANG" + CFG_USING_CLANG=1 + putvar CFG_USING_CLANG + else + CFG_CC="gcc" + fi +fi + if [ ! -z "$CFG_ENABLE_CLANG" ] then - if [ -z "$CFG_CLANG" ] + if [ -z "$CC" ] || [[ $CC == *clang ]] then - err "clang requested but not found" - fi - CFG_CLANG_VERSION=$("$CFG_CLANG" \ - --version \ - | grep version \ - | sed 's/.*\(version .*\)/\1/; s/.*based on \(LLVM .*\))/\1/' \ - | cut -d ' ' -f 2) + CFG_CLANG_VERSION=$($CFG_CC \ + --version \ + | grep version \ + | sed 's/.*\(version .*\)/\1/; s/.*based on \(LLVM .*\))/\1/' \ + | cut -d ' ' -f 2) - case $CFG_CLANG_VERSION in - (3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* | 3.5* ) - step_msg "found ok version of CLANG: $CFG_CLANG_VERSION" - CFG_C_COMPILER="clang" - ;; - (*) - err "bad CLANG version: $CFG_CLANG_VERSION, need >=3.0svn" - ;; - esac -else - CFG_C_COMPILER="gcc" + case $CFG_CLANG_VERSION in + (3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* | 3.5* ) + step_msg "found ok version of CLANG: $CFG_CLANG_VERSION" + if [ -z "$CC" ] + then + CFG_CC="clang" + fi + ;; + (*) + err "bad CLANG version: $CFG_CLANG_VERSION, need >=3.0svn" + ;; + esac + else + msg "skipping CFG_ENABLE_CLANG version check; provided CC=$CC" + fi fi if [ ! -z "$CFG_ENABLE_CCACHE" ] then - if [ -z "$CFG_CCACHE" ] + if [ -z "$CC" ] then - err "ccache requested but not found" - fi + if [ -z "$CFG_CCACHE" ] + then + err "ccache requested but not found" + fi - CFG_C_COMPILER="ccache $CFG_C_COMPILER" + CFG_CC="ccache $CFG_CC" + fi fi +if [ -z "$CC" -a -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ] +then + err "either clang or gcc is required" +fi + +# All safeguards based on $CFG_ENABLE_CLANG should occur before this +# point in the script; after this point, script logic should inspect +# $CFG_USING_CLANG rather than $CFG_ENABLE_CLANG. + +# Set CFG_{CC,CXX,CPP,CFLAGS,CXXFLAGS} +envopt CC +envopt CXX +envopt CPP +envopt CFLAGS +envopt CXXFLAGS + # a little post-processing of various config values CFG_PREFIX=${CFG_PREFIX%/} CFG_MANDIR=${CFG_MANDIR%/} @@ -742,11 +826,6 @@ do esac done -if [ -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ] -then - err "either clang or gcc is required" -fi - if [ ! -z "$CFG_PERF" ] then HAVE_PERF_LOGFD=`$CFG_PERF stat --log-fd 2>&1 | grep 'unknown option'` @@ -961,7 +1040,7 @@ do ;; esac - case "$CFG_C_COMPILER" in + case "$CFG_CC" in ("ccache clang") LLVM_CXX_32="ccache clang++ -m32 -Qunused-arguments" LLVM_CC_32="ccache clang -m32 -Qunused-arguments" @@ -991,6 +1070,16 @@ do LLVM_CXX_64="g++" LLVM_CC_64="gcc" + ;; + + (*) + msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC" + LLVM_CXX_32="$CXX -m32" + LLVM_CC_32="$CC -m32" + + LLVM_CXX_64="$CXX" + LLVM_CC_64="$CC" + ;; esac LLVM_CFLAGS_32="-m32" @@ -1073,7 +1162,6 @@ putvar CFG_PREFIX putvar CFG_BUILD putvar CFG_HOST putvar CFG_TARGET -putvar CFG_C_COMPILER putvar CFG_LIBDIR putvar CFG_LIBDIR_RELATIVE putvar CFG_DISABLE_MANAGE_SUBMODULES @@ -1084,7 +1172,7 @@ putvar CFG_DISABLE_INJECT_STD_VERSION # Avoid spurious warnings from clang by feeding it original source on # ccache-miss rather than preprocessed input. -if [ ! -z "$CFG_ENABLE_CCACHE" ] && [ ! -z "$CFG_ENABLE_CLANG" ] +if [ ! -z "$CFG_ENABLE_CCACHE" ] && [ ! -z "$CFG_USING_CLANG" ] then CFG_CCACHE_CPP2=1 putvar CFG_CCACHE_CPP2 diff --git a/mk/platform.mk b/mk/platform.mk index 76c9debba80..ecc4c33d154 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -81,57 +81,27 @@ CFG_DEPEND_FLAGS = -MMD -MP -MT $(1) -MF $(1:%.o=%.d) AR := ar -CFG_INFO := $(info cfg: using $(CFG_C_COMPILER)) -ifeq ($(CFG_C_COMPILER),clang) +define SET_FROM_CFG + ifdef CFG_$(1) + ifeq ($(origin $(1)),undefined) + $$(info cfg: using $(1)=$(CFG_$(1)) (CFG_$(1))) + $(1)=$(CFG_$(1)) + endif + ifeq ($(origin $(1)),default) + $$(info cfg: using $(1)=$(CFG_$(1)) (CFG_$(1))) + $(1)=$(CFG_$(1)) + endif + endif +endef + +$(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS,\ + $(eval $(call SET_FROM_CFG,$(cvar)))) + +ifeq ($(CFG_USING_CLANG),1) # The -Qunused-arguments sidesteps spurious warnings from clang - ifeq ($(origin CC),default) - CC=clang -Qunused-arguments - endif - ifeq ($(origin CXX),default) - CXX=clang++ -Qunused-arguments - endif - ifeq ($(origin CPP),default) - CPP=clang -Qunused-arguments - endif -else -ifeq ($(CFG_C_COMPILER),gcc) - ifeq ($(origin CC),default) - CC=gcc - endif - ifeq ($(origin CXX),default) - CXX=g++ - endif - ifeq ($(origin CPP),default) - CPP=gcc - endif -else -ifeq ($(CFG_C_COMPILER),ccache clang) - # The -Qunused-arguments sidesteps spurious warnings from clang - ifeq ($(origin CC),default) - CC=ccache clang -Qunused-arguments - endif - ifeq ($(origin CXX),default) - CXX=ccache clang++ -Qunused-arguments - endif - ifeq ($(origin CPP),default) - CPP=ccache clang -Qunused-arguments - endif -else -ifeq ($(CFG_C_COMPILER),ccache gcc) - ifeq ($(origin CC),default) - CC=ccache gcc - endif - ifeq ($(origin CXX),default) - CXX=ccache g++ - endif - ifeq ($(origin CPP),default) - CPP=ccache gcc - endif -else - CFG_ERR := $(error please try on a system with gcc or clang) -endif -endif -endif + CFLAGS += -Qunused-arguments + CXXFLAGS += -Qunused-arguments + CPPFLAGS += -Qunused-arguments endif CFG_RLIB_GLOB=lib$(1)-*.rlib @@ -173,9 +143,9 @@ CFG_LIB_NAME_i686-unknown-linux-gnu=lib$(1).so CFG_STATIC_LIB_NAME_i686-unknown-linux-gnu=lib$(1).a CFG_LIB_GLOB_i686-unknown-linux-gnu=lib$(1)-*.so CFG_LIB_DSYM_GLOB_i686-unknown-linux-gnu=lib$(1)-*.dylib.dSYM -CFG_CFLAGS_i686-unknown-linux-gnu := -m32 -CFG_GCCISH_CFLAGS_i686-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 -CFG_GCCISH_CXXFLAGS_i686-unknown-linux-gnu := -fno-rtti +CFG_CFLAGS_i686-unknown-linux-gnu := -m32 $(CFLAGS) +CFG_GCCISH_CFLAGS_i686-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS) +CFG_GCCISH_CXXFLAGS_i686-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_i686-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32 CFG_GCCISH_DEF_FLAG_i686-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= CFG_GCCISH_PRE_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-whole-archive @@ -203,9 +173,9 @@ AR_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos ar) CFG_LIB_NAME_arm-apple-darwin = lib$(1).dylib CFG_LIB_GLOB_arm-apple-darwin = lib$(1)-*.dylib CFG_LIB_DSYM_GLOB_arm-apple-darwin = lib$(1)-*.dylib.dSYM -CFG_CFLAGS_arm-apple-darwin := $(CFG_IOS_FLAGS) -CFG_GCCISH_CFLAGS_arm-apple-darwin := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS) -CFG_GCCISH_CXXFLAGS_arm-apple-darwin := -fno-rtti $(CFG_IOS_FLAGS) +CFG_CFLAGS_arm-apple-darwin := $(CFG_IOS_FLAGS) $(CFLAGS) +CFG_GCCISH_CFLAGS_arm-apple-darwin := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS) $(CFLAGS) +CFG_GCCISH_CXXFLAGS_arm-apple-darwin := -fno-rtti $(CFG_IOS_FLAGS) $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_arm-apple-darwin := -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind CFG_GCCISH_DEF_FLAG_arm-apple-darwin := -Wl,-exported_symbols_list, CFG_GCCISH_PRE_LIB_FLAGS_arm-apple-darwin := @@ -232,9 +202,9 @@ CFG_LIB_NAME_x86_64-apple-darwin=lib$(1).dylib CFG_STATIC_LIB_NAME_x86_64-apple-darwin=lib$(1).a CFG_LIB_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib CFG_LIB_DSYM_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib.dSYM -CFG_CFLAGS_x86_64-apple-darwin := -m64 -arch x86_64 -CFG_GCCISH_CFLAGS_x86_64-apple-darwin := -Wall -Werror -g -fPIC -m64 -arch x86_64 -CFG_GCCISH_CXXFLAGS_x86_64-apple-darwin := -fno-rtti +CFG_CFLAGS_x86_64-apple-darwin := -m64 -arch x86_64 $(CFLAGS) +CFG_GCCISH_CFLAGS_x86_64-apple-darwin := -Wall -Werror -g -fPIC -m64 -arch x86_64 $(CFLAGS) +CFG_GCCISH_CXXFLAGS_x86_64-apple-darwin := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_x86_64-apple-darwin := -dynamiclib -pthread -framework CoreServices -m64 CFG_GCCISH_DEF_FLAG_x86_64-apple-darwin := -Wl,-exported_symbols_list, CFG_GCCISH_PRE_LIB_FLAGS_x86_64-apple-darwin := @@ -260,9 +230,9 @@ CFG_LIB_NAME_i686-apple-darwin=lib$(1).dylib CFG_STATIC_LIB_NAME_i686-apple-darwin=lib$(1).a CFG_LIB_GLOB_i686-apple-darwin=lib$(1)-*.dylib CFG_LIB_DSYM_GLOB_i686-apple-darwin=lib$(1)-*.dylib.dSYM -CFG_CFLAGS_i686-apple-darwin := -m32 -arch i386 -CFG_GCCISH_CFLAGS_i686-apple-darwin := -Wall -Werror -g -fPIC -m32 -arch i386 -CFG_GCCISH_CXXFLAGS_i686-apple-darwin := -fno-rtti +CFG_CFLAGS_i686-apple-darwin := -m32 -arch i386 $(CFLAGS) +CFG_GCCISH_CFLAGS_i686-apple-darwin := -Wall -Werror -g -fPIC -m32 -arch i386 $(CFLAGS) +CFG_GCCISH_CXXFLAGS_i686-apple-darwin := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_i686-apple-darwin := -dynamiclib -pthread -framework CoreServices -m32 CFG_GCCISH_DEF_FLAG_i686-apple-darwin := -Wl,-exported_symbols_list, CFG_GCCISH_PRE_LIB_FLAGS_i686-apple-darwin := @@ -288,9 +258,9 @@ CFG_LIB_NAME_arm-linux-androideabi=lib$(1).so CFG_STATIC_LIB_NAME_arm-linux-androideabi=lib$(1).a CFG_LIB_GLOB_arm-linux-androideabi=lib$(1)-*.so CFG_LIB_DSYM_GLOB_arm-linux-androideabi=lib$(1)-*.dylib.dSYM -CFG_CFLAGS_arm-linux-androideabi := -D__arm__ -DANDROID -D__ANDROID__ -CFG_GCCISH_CFLAGS_arm-linux-androideabi := -Wall -g -fPIC -D__arm__ -DANDROID -D__ANDROID__ -CFG_GCCISH_CXXFLAGS_arm-linux-androideabi := -fno-rtti +CFG_CFLAGS_arm-linux-androideabi := -D__arm__ -DANDROID -D__ANDROID__ $(CFLAGS) +CFG_GCCISH_CFLAGS_arm-linux-androideabi := -Wall -g -fPIC -D__arm__ -DANDROID -D__ANDROID__ $(CFLAGS) +CFG_GCCISH_CXXFLAGS_arm-linux-androideabi := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_arm-linux-androideabi := -shared -fPIC -ldl -g -lm -lsupc++ CFG_GCCISH_DEF_FLAG_arm-linux-androideabi := -Wl,--export-dynamic,--dynamic-list= CFG_GCCISH_PRE_LIB_FLAGS_arm-linux-androideabi := -Wl,-whole-archive @@ -319,9 +289,9 @@ CFG_LIB_NAME_arm-unknown-linux-gnueabihf=lib$(1).so CFG_STATIC_LIB_NAME_arm-unknown-linux-gnueabihf=lib$(1).a CFG_LIB_GLOB_arm-unknown-linux-gnueabihf=lib$(1)-*.so CFG_LIB_DSYM_GLOB_arm-unknown-linux-gnueabihf=lib$(1)-*.dylib.dSYM -CFG_CFLAGS_arm-unknown-linux-gnueabihf := -D__arm__ -CFG_GCCISH_CFLAGS_arm-unknown-linux-gnueabihf := -Wall -g -fPIC -D__arm__ -CFG_GCCISH_CXXFLAGS_arm-unknown-linux-gnueabihf := -fno-rtti +CFG_CFLAGS_arm-unknown-linux-gnueabihf := -D__arm__ $(CFLAGS) +CFG_GCCISH_CFLAGS_arm-unknown-linux-gnueabihf := -Wall -g -fPIC -D__arm__ $(CFLAGS) +CFG_GCCISH_CXXFLAGS_arm-unknown-linux-gnueabihf := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_arm-unknown-linux-gnueabihf := -shared -fPIC -g CFG_GCCISH_DEF_FLAG_arm-unknown-linux-gnueabihf := -Wl,--export-dynamic,--dynamic-list= CFG_GCCISH_PRE_LIB_FLAGS_arm-unknown-linux-gnueabihf := -Wl,-whole-archive @@ -350,9 +320,9 @@ CFG_LIB_NAME_arm-unknown-linux-gnueabi=lib$(1).so CFG_STATIC_LIB_NAME_arm-unknown-linux-gnueabi=lib$(1).a CFG_LIB_GLOB_arm-unknown-linux-gnueabi=lib$(1)-*.so CFG_LIB_DSYM_GLOB_arm-unknown-linux-gnueabi=lib$(1)-*.dylib.dSYM -CFG_CFLAGS_arm-unknown-linux-gnueabi := -D__arm__ -mfpu=vfp -CFG_GCCISH_CFLAGS_arm-unknown-linux-gnueabi := -Wall -g -fPIC -D__arm__ -mfpu=vfp -CFG_GCCISH_CXXFLAGS_arm-unknown-linux-gnueabi := -fno-rtti +CFG_CFLAGS_arm-unknown-linux-gnueabi := -D__arm__ -mfpu=vfp $(CFLAGS) +CFG_GCCISH_CFLAGS_arm-unknown-linux-gnueabi := -Wall -g -fPIC -D__arm__ -mfpu=vfp $(CFLAGS) +CFG_GCCISH_CXXFLAGS_arm-unknown-linux-gnueabi := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_arm-unknown-linux-gnueabi := -shared -fPIC -g CFG_GCCISH_DEF_FLAG_arm-unknown-linux-gnueabi := -Wl,--export-dynamic,--dynamic-list= CFG_GCCISH_PRE_LIB_FLAGS_arm-unknown-linux-gnueabi := -Wl,-whole-archive @@ -380,9 +350,9 @@ CFG_LIB_NAME_mips-unknown-linux-gnu=lib$(1).so CFG_STATIC_LIB_NAME_mips-unknown-linux-gnu=lib$(1).a CFG_LIB_GLOB_mips-unknown-linux-gnu=lib$(1)-*.so CFG_LIB_DSYM_GLOB_mips-unknown-linux-gnu=lib$(1)-*.dylib.dSYM -CFG_CFLAGS_mips-unknown-linux-gnu := -mips32r2 -msoft-float -mabi=32 -mno-compact-eh -CFG_GCCISH_CFLAGS_mips-unknown-linux-gnu := -Wall -g -fPIC -mips32r2 -msoft-float -mabi=32 -mno-compact-eh -CFG_GCCISH_CXXFLAGS_mips-unknown-linux-gnu := -fno-rtti +CFG_CFLAGS_mips-unknown-linux-gnu := -mips32r2 -msoft-float -mabi=32 -mno-compact-eh $(CFLAGS) +CFG_GCCISH_CFLAGS_mips-unknown-linux-gnu := -Wall -g -fPIC -mips32r2 -msoft-float -mabi=32 -mno-compact-eh $(CFLAGS) +CFG_GCCISH_CXXFLAGS_mips-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_mips-unknown-linux-gnu := -shared -fPIC -g -mips32r2 -msoft-float -mabi=32 CFG_GCCISH_DEF_FLAG_mips-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= CFG_GCCISH_PRE_LIB_FLAGS_mips-unknown-linux-gnu := -Wl,-whole-archive @@ -409,9 +379,9 @@ CFG_LIB_NAME_i686-pc-mingw32=$(1).dll CFG_STATIC_LIB_NAME_i686-pc-mingw32=$(1).lib CFG_LIB_GLOB_i686-pc-mingw32=$(1)-*.dll CFG_LIB_DSYM_GLOB_i686-pc-mingw32=$(1)-*.dylib.dSYM -CFG_CFLAGS_mips-i686-pc-mingw32 := -m32 -march=i686 -D_WIN32_WINNT=0x0600 -CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -Werror -g -m32 -march=i686 -D_WIN32_WINNT=0x0600 -I$(CFG_SRC_DIR)src/etc/mingw-fix-include -CFG_GCCISH_CXXFLAGS_i686-pc-mingw32 := -fno-rtti +CFG_CFLAGS_mips-i686-pc-mingw32 := -m32 -march=i686 -D_WIN32_WINNT=0x0600 $(CFLAGS) +CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -Werror -g -m32 -march=i686 -D_WIN32_WINNT=0x0600 -I$(CFG_SRC_DIR)src/etc/mingw-fix-include $(CFLAGS) +CFG_GCCISH_CXXFLAGS_i686-pc-mingw32 := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_i686-pc-mingw32 := -shared -fPIC -g -m32 CFG_GCCISH_DEF_FLAG_i686-pc-mingw32 := CFG_GCCISH_PRE_LIB_FLAGS_i686-pc-mingw32 := @@ -438,9 +408,9 @@ CFG_LIB_NAME_i586-mingw32msvc=$(1).dll CFG_STATIC_LIB_NAME_i586-mingw32msvc=$(1).lib CFG_LIB_GLOB_i586-mingw32msvc=$(1)-*.dll CFG_LIB_DSYM_GLOB_i586-mingw32msvc=$(1)-*.dylib.dSYM -CFG_CFLAGS_i586-mingw32msvc := -march=i586 -m32 -CFG_GCCISH_CFLAGS_i586-mingw32msvc := -Wall -Werror -g -march=i586 -m32 -CFG_GCCISH_CXXFLAGS_i586-mingw32msvc := -fno-rtti +CFG_CFLAGS_i586-mingw32msvc := -march=i586 -m32 $(CFLAGS) +CFG_GCCISH_CFLAGS_i586-mingw32msvc := -Wall -Werror -g -march=i586 -m32 $(CFLAGS) +CFG_GCCISH_CXXFLAGS_i586-mingw32msvc := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_i586-mingw32msvc := -shared -g -m32 CFG_GCCISH_DEF_FLAG_i586-mingw32msvc := CFG_GCCISH_PRE_LIB_FLAGS_i586-mingw32msvc := @@ -469,9 +439,9 @@ CFG_LIB_NAME_i686-w64-mingw32=$(1).dll CFG_STATIC_LIB_NAME_i686-w64-mingw32=$(1).lib CFG_LIB_GLOB_i686-w64-mingw32=$(1)-*.dll CFG_LIB_DSYM_GLOB_i686-w64-mingw32=$(1)-*.dylib.dSYM -CFG_CFLAGS_i586-w64-mingw32 := -march=i586 -m32 -D_WIN32_WINNT=0x0600 -CFG_GCCISH_CFLAGS_i686-w64-mingw32 := -Wall -Werror -g -m32 -D_WIN32_WINNT=0x0600 -CFG_GCCISH_CXXFLAGS_i686-w64-mingw32 := -fno-rtti +CFG_CFLAGS_i586-w64-mingw32 := -march=i586 -m32 -D_WIN32_WINNT=0x0600 $(CFLAGS) +CFG_GCCISH_CFLAGS_i686-w64-mingw32 := -Wall -Werror -g -m32 -D_WIN32_WINNT=0x0600 $(CFLAGS) +CFG_GCCISH_CXXFLAGS_i686-w64-mingw32 := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_i686-w64-mingw32 := -shared -g -m32 CFG_GCCISH_DEF_FLAG_i686-w64-mingw32 := CFG_GCCISH_PRE_LIB_FLAGS_i686-w64-mingw32 := @@ -499,9 +469,9 @@ CFG_LIB_NAME_x86_64-w64-mingw32=$(1).dll CFG_STATIC_LIB_NAME_x86_64-w64-mingw32=$(1).lib CFG_LIB_GLOB_x86_64-w64-mingw32=$(1)-*.dll CFG_LIB_DSYM_GLOB_x86_64-w64-mingw32=$(1)-*.dylib.dSYM -CFG_CFLAGS_x86_64-w64-mingw32 := -m64 -D_WIN32_WINNT=0x0600 -CFG_GCCISH_CFLAGS_x86_64-w64-mingw32 := -Wall -Werror -g -m64 -D_WIN32_WINNT=0x0600 -CFG_GCCISH_CXXFLAGS_x86_64-w64-mingw32 := -fno-rtti +CFG_CFLAGS_x86_64-w64-mingw32 := -m64 -D_WIN32_WINNT=0x0600 $(CFLAGS) +CFG_GCCISH_CFLAGS_x86_64-w64-mingw32 := -Wall -Werror -g -m64 -D_WIN32_WINNT=0x0600 $(CFLAGS) +CFG_GCCISH_CXXFLAGS_x86_64-w64-mingw32 := -fno-rtti $(CXXFLAGS) CFG_GCCISH_LINK_FLAGS_x86_64-w64-mingw32 := -shared -g -m64 CFG_GCCISH_DEF_FLAG_x86_64-w64-mingw32 := CFG_GCCISH_PRE_LIB_FLAGS_x86_64-w64-mingw32 := @@ -528,8 +498,8 @@ CFG_LIB_NAME_x86_64-unknown-freebsd=lib$(1).so CFG_STATIC_LIB_NAME_x86_64-unknown-freebsd=lib$(1).a CFG_LIB_GLOB_x86_64-unknown-freebsd=lib$(1)-*.so CFG_LIB_DSYM_GLOB_x86_64-unknown-freebsd=$(1)-*.dylib.dSYM -CFG_CFLAGS_x86_64-unknown-freebsd := -I/usr/local/include -CFG_GCCISH_CFLAGS_x86_64-unknown-freebsd := -Wall -Werror -g -fPIC -I/usr/local/include +CFG_CFLAGS_x86_64-unknown-freebsd := -I/usr/local/include $(CFLAGS) +CFG_GCCISH_CFLAGS_x86_64-unknown-freebsd := -Wall -Werror -g -fPIC -I/usr/local/include $(CFLAGS) CFG_GCCISH_LINK_FLAGS_x86_64-unknown-freebsd := -shared -fPIC -g -pthread -lrt CFG_GCCISH_DEF_FLAG_x86_64-unknown-freebsd := -Wl,--export-dynamic,--dynamic-list= CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-freebsd := -Wl,-whole-archive