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

Steve Lhomme robux4 at ycbcr.xyz
Tue Mar 24 15:46:20 CET 2020


Unset the main environment variables that may affect basic compilation/linking.

When not cross-compiling we use the same environment as the rest of the
compiled contribs.
---
 contrib/src/main.mak | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 708885cdec..7105dc508a 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -338,6 +338,15 @@ HOSTVARS_PIC := $(HOSTTOOLS) \
 	CXXFLAGS="$(CXXFLAGS) $(PIC)" \
 	LDFLAGS="$(LDFLAGS)"
 
+# environment to use to build native programs (build, ie not the host)
+ifdef HAVE_CROSS_COMPILE
+BUILDVARS := env -u CC -u CFLAGS -u CPPFLAGS -u CXX -u CXXFLAGS -u LD -u LDFLAGS -u AR -u CCAS -u RANLIB -u STRIP
+BUILDCONF := --prefix="$(BUILDPREFIX)" --build="$(BUILD)" --host="$(BUILD)" --target="$(HOST)"
+else
+BUILDVARS := $(HOSTVARS)
+BUILDCONF := $(HOSTCONF)
+endif
+
 download_git = \
 	rm -Rf -- "$(@:.tar.xz=)" && \
 	$(GIT) init --bare "$(@:.tar.xz=)" && \
-- 
2.17.1



More information about the vlc-devel mailing list