[vlc-devel] [PATCH 2/2] contrib: share the environment to use to build native tools

Steve Lhomme robux4 at ycbcr.xyz
Mon Mar 23 13:39:44 CET 2020


Unset the main environment variables that may affect basic compilation/linking.
---
 contrib/src/lua/rules.mak | 2 +-
 contrib/src/main.mak      | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index 2ee660ddf87..c30724a4ca9 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -91,7 +91,7 @@ endif
 
 ifdef HAVE_CROSS_COMPILE
 # Remove the cross-compiler environment for the native compiler
-LUACVARS=CFLAGS="" CPPFLAGS="" LDFLAGS=""
+LUACVARS=$(NATIVE_ENV)
 else
 ifdef HAVE_WIN32
 LUACVARS=CPPFLAGS="-DLUA_DL_DLL"
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index fa7751da5a8..63a5de28287 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -187,6 +187,8 @@ CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS)
 CXXFLAGS := $(CXXFLAGS) $(EXTRA_CFLAGS) $(EXTRA_CXXFLAGS)
 LDFLAGS := $(LDFLAGS) -L$(PREFIX)/lib $(EXTRA_LDFLAGS)
 
+NATIVE_ENV := env -u CC -u CFLAGS -u CPPFLAGS -u CXX -u CXXFLAGS -u LD -u LDFLAGS -u AR -u CCAS -u RANLIB -u STRIP
+
 ifdef ENABLE_PDB
 CFLAGS := $(CFLAGS) -gcodeview
 CXXFLAGS := $(CXXFLAGS) -gcodeview
-- 
2.17.1



More information about the vlc-devel mailing list