Changeset - r22796:f5b7f87b98f2
[Not reviewed]
master
0 1 0
Patric Stout - 7 years ago 2018-04-14 18:11:49
truebrain@openttd.org
Change: [Build] use flags set by env at the end, not at the start (based on patch by adf88) (#6715)

This closes #6433
1 file changed with 20 insertions and 6 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1481,21 +1481,27 @@ make_compiler_cflags() {
 

	
 
make_cflags_and_ldflags() {
 
	# General CFlags for BUILD
 
	CFLAGS_BUILD="$CFLAGS_BUILD"
 
	CFLAGS_BUILD_ENV="$CFLAGS_BUILD"
 
	CFLAGS_BUILD=""
 
	# Special CXXFlags for BUILD
 
	CXXFLAGS_BUILD="$CXXFLAGS_BUILD"
 
	CXXFLAGS_BUILD_ENV="$CXXFLAGS_BUILD"
 
	CXXFLAGS_BUILD=""
 
	# LDFLAGS for BUILD
 
	LDFLAGS_BUILD="$LDFLAGS_BUILD"
 
	LDFLAGS_BUILD_ENV="$LDFLAGS_BUILD"
 
	LDFLAGS_BUILD=""
 
	# FEATURES for BUILD (lto)
 
	FEATURES_BUILD=""
 
	# General CFlags for HOST
 
	CFLAGS="$CFLAGS"
 
	CFLAGS_ENV="$CFLAGS"
 
	CFLAGS=""
 
	# Special CXXFlags for HOST
 
	CXXFLAGS="$CXXFLAGS"
 
	CXXFLAGS_ENV="$CXXFLAGS"
 
	CXXFLAGS=""
 
	# Libs to compile. In fact this is just LDFLAGS
 
	LIBS="-lstdc++"
 
	# LDFLAGS used for HOST
 
	LDFLAGS="$LDFLAGS"
 
	LDFLAGS_ENV="$LDFLAGS"
 
	LDFLAGS=""
 
	# FEATURES for HOST (lto)
 
	FEATURES=""
 

	
 
@@ -1913,6 +1919,14 @@ make_cflags_and_ldflags() {
 
		fi
 
	fi
 

	
 
	# All flags to be extended via the env
 
	CFLAGS_BUILD="$CFLAGS_BUILD $CFLAGS_BUILD_ENV"
 
	CXXFLAGS_BUILD="$CXXFLAGS_BUILD $CXXFLAGS_BUILD_ENV"
 
	LDFLAGS_BUILD="$LDFLAGS_BUILD $LDFLAGS_BUILD_ENV"
 
	CFLAGS="$CFLAGS $CFLAGS_ENV"
 
	CXXFLAGS="$CXXFLAGS $CXXFLAGS_ENV"
 
	LDFLAGS="$LDFLAGS $LDFLAGS_ENV"
 

	
 
	log 1 "using CFLAGS_BUILD... $CFLAGS_BUILD"
 
	log 1 "using CXXFLAGS_BUILD... $CXXFLAGS_BUILD"
 
	log 1 "using LDFLAGS_BUILD... $LDFLAGS_BUILD"
0 comments (0 inline, 0 general)