[vlc-devel] [PATCH] contrib: unexport env variables when cross-compiling

Marvin Scholz epirat07 at gmail.com
Mon Sep 30 17:43:46 CEST 2019


Meson always interprets these env variables for the build compiler,
even when cross-compiling, therefore we need to unset them,
they are anyway included in HOSTVARS already for other build systems.
---
 contrib/src/main.mak | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 7eef7b85b6..b07b9a0855 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -314,6 +314,19 @@ MESON_HOST_FLAGS := \
 	LDFLAGS="$(LDFLAGS)"
 ifdef HAVE_CROSS_COMPILE
 HOSTVARS_MESON := PATH="$(PREFIX)/bin:$(PATH)"
+# For cross-compilation with meson, we need to unset compiler and flags
+# env variables as meson will always use them for the BUILD machine compiler!
+unexport CC
+unexport CXX
+unexport LD
+unexport AR
+unexport CCAS
+unexport RANLIB
+unexport STRIP
+unexport CPPFLAGS
+unexport CFLAGS
+unexport CXXFLAGS
+unexport LDFLAGS
 else
 HOSTVARS_MESON := $(HOSTTOOLS) $(MESON_HOST_FLAGS)
 endif
-- 
2.20.1 (Apple Git-117)



More information about the vlc-devel mailing list