[vlc-commits] contrib: not pass HOSTVARS to meson when cross-compiling

Marvin Scholz git at videolan.org
Wed Jun 12 21:09:44 CEST 2019


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Thu Jun  6 13:45:08 2019 +0200| [ccee6f6488f75013cb54b84e13082f32fd1320bc] | committer: Marvin Scholz

contrib: not pass HOSTVARS to meson when cross-compiling

Meson always interprets these env variables for the build
compiler, even when cross-compiling.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ccee6f6488f75013cb54b84e13082f32fd1320bc
---

 contrib/src/main.mak | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 18d26bbc9d..a1be81cacf 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -329,9 +329,14 @@ HOSTVARS_PIC := $(HOSTTOOLS) \
 	CXXFLAGS="$(CXXFLAGS) $(PIC)" \
 	LDFLAGS="$(LDFLAGS)"
 
-# Keep a version of HOSTVARS without the tools, since meson requires the
-# tools variables to point to the native ones
-HOSTVARS_MESON := $(HOSTVARS)
+# For cross-compilation with meson, do not set compiler and flags
+# in HOSTVARS as meson will always use them for the BUILD machine compiler!
+ifdef HAVE_CROSS_COMPILE
+HOSTVARS_MESON := PATH="$(PREFIX)/bin:$(PATH)"
+else
+HOSTVARS_MESON := $(HOSTTOOLS) $(HOSTVARS)
+endif
+
 HOSTVARS := $(HOSTTOOLS) $(HOSTVARS)
 
 download_git = \



More information about the vlc-commits mailing list