[vlc-devel] [PATCH v2 02/11] contrib: qt: install qt build tools in a separate directory

Pierre Lamot pierre at videolabs.io
Wed Sep 16 09:24:50 CEST 2020


  Qt build tools shouldn't be installed in $(PREFIX)/bin because they aren't
  host tools. This is notably causing issues when building build tools from qt
  because it will use the same headers as the host which may be incompatible.
  This affect tools like qmltyperegistrar which is required to build Qt5.15 or
  qmlcachegen.

  They can't be installed in $(BUILDBINDIR)/bin because while most tools are
  agnostic of the host, some tools like qmake contains references to the host
  installation.

  qmake won't recognise tools installed as with HOST prefix (ie: bin/$(HOST)-moc).

  VLC configure script doesn't really care about the location of the tools as
  this one is retrieve through pkgconfig.
---
 contrib/src/qt/rules.mak                 | 6 +++++-
 contrib/src/qtdeclarative/rules.mak      | 4 ++--
 contrib/src/qtgraphicaleffects/rules.mak | 2 +-
 contrib/src/qtquickcontrols2/rules.mak   | 2 +-
 contrib/src/qtsvg/rules.mak              | 2 +-
 5 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/contrib/src/qt/rules.mak b/contrib/src/qt/rules.mak
index 901f6f6ce6..0a3089c59d 100644
--- a/contrib/src/qt/rules.mak
+++ b/contrib/src/qt/rules.mak
@@ -106,7 +106,7 @@ ENV_VARS := $(HOSTVARS) DXSDK_DIR=$(PREFIX)/bin
 .qt: qt
 	# Prevent all Qt contribs from generating and installing libtool .la files
 	cd $< && sed -i "/CONFIG/ s/ create_libtool/ -create_libtool/g" mkspecs/features/qt_module.prf
-	+cd $< && $(ENV_VARS) ./configure $(QT_PLATFORM) $(QT_CONFIG) -prefix $(PREFIX)
+	+cd $< && $(ENV_VARS) ./configure $(QT_PLATFORM) $(QT_CONFIG) -prefix $(PREFIX) -hostprefix $(PREFIX)/lib/qt5
 	# Make && Install libraries
 	cd $< && $(ENV_VARS) $(MAKE)
 	cd $< && $(MAKE) -C src sub-corelib-install_subtargets sub-gui-install_subtargets sub-widgets-install_subtargets sub-platformsupport-install_subtargets sub-zlib-install_subtargets sub-bootstrap-install_subtargets sub-network-install_subtargets sub-testlib-install_subtargets
@@ -122,6 +122,10 @@ ifdef HAVE_WIN32
 	# Vista styling
 	$(SRC)/qt/AddStaticLink.sh "$(PREFIX)" Qt5Widgets plugins/styles qwindowsvistastyle
 endif
+	#fix host tools headers to avoid collusion with target headers
+	mkdir -p $(PREFIX)/lib/qt5/include
+	cp -R $(PREFIX)/include/QtCore $(PREFIX)/lib/qt5/include
+	sed -i -e "s#\$\$QT_MODULE_INCLUDE_BASE#$(PREFIX)/lib/qt5/include#g" $(PREFIX)/lib/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
 	# Install a qmake with correct paths set
 	cd $< && $(MAKE) sub-qmake-qmake-aux-pro-install_subtargets install_mkspecs
 	touch $@
diff --git a/contrib/src/qtdeclarative/rules.mak b/contrib/src/qtdeclarative/rules.mak
index a14b06ad73..7bcaae8c97 100644
--- a/contrib/src/qtdeclarative/rules.mak
+++ b/contrib/src/qtdeclarative/rules.mak
@@ -29,8 +29,8 @@ QT_DECLARATIVE_CONFIG := \
 
 .qtdeclarative: qtdeclarative
 	# Generate Makefile & src/Makefile
-	cd $< && $(PREFIX)/bin/qmake -- $(QT_DECLARATIVE_CONFIG)
-	cd $</src && $(PREFIX)/bin/qmake -o Makefile src.pro
+	cd $< && $(PREFIX)/lib/qt5/bin/qmake -- $(QT_DECLARATIVE_CONFIG)
+	cd $</src && $(PREFIX)/lib/qt5/bin/qmake -o Makefile src.pro
 	# Build & install only what we require
 	# Invoke the build rules one at a time as some rule dependencies seem to be broken
 	cd $< && $(MAKE) -C src sub-quick-make_first-ordered
diff --git a/contrib/src/qtgraphicaleffects/rules.mak b/contrib/src/qtgraphicaleffects/rules.mak
index 3d2842adcc..43e9294e03 100644
--- a/contrib/src/qtgraphicaleffects/rules.mak
+++ b/contrib/src/qtgraphicaleffects/rules.mak
@@ -24,7 +24,7 @@ qtgraphicaleffects: qtgraphicaleffects-everywhere-src-$(QTGE_VERSION).tar.xz .su
 	$(MOVE)
 
 .qtgraphicaleffects: qtgraphicaleffects
-	cd $< && $(PREFIX)/bin/qmake
+	cd $< && $(PREFIX)/lib/qt5/bin/qmake
 	# Make && Install libraries
 	cd $< && $(MAKE)
 	cd $< && $(MAKE) -C src sub-effects-install_subtargets
diff --git a/contrib/src/qtquickcontrols2/rules.mak b/contrib/src/qtquickcontrols2/rules.mak
index 7903a19a5a..d158909cda 100644
--- a/contrib/src/qtquickcontrols2/rules.mak
+++ b/contrib/src/qtquickcontrols2/rules.mak
@@ -31,7 +31,7 @@ QUICK_CONTROL_CONFIG := \
     -no-feature-quickcontrols2-imagine
 
 .qtquickcontrols2: qtquickcontrols2
-	cd $< && $(PREFIX)/bin/qmake -- $(QUICK_CONTROL_CONFIG)
+	cd $< && $(PREFIX)/lib/qt5/bin/qmake -- $(QUICK_CONTROL_CONFIG)
 	# Make && Install libraries
 	cd $< && $(MAKE) sub-src-qmake_all
 ifndef HAVE_CROSS_COMPILE
diff --git a/contrib/src/qtsvg/rules.mak b/contrib/src/qtsvg/rules.mak
index d3eeade887..6924865dea 100644
--- a/contrib/src/qtsvg/rules.mak
+++ b/contrib/src/qtsvg/rules.mak
@@ -25,7 +25,7 @@ qtsvg: qtsvg-everywhere-src-$(QTSVG_VERSION).tar.xz .sum-qtsvg
 	$(MOVE)
 
 .qtsvg: qtsvg
-	cd $< && $(PREFIX)/bin/qmake
+	cd $< && $(PREFIX)/lib/qt5/bin/qmake
 	# Make && Install libraries
 	cd $< && $(MAKE)
 	cd $< && $(MAKE) -C src sub-plugins-install_subtargets sub-svg-install_subtargets
-- 
2.25.1



More information about the vlc-devel mailing list