summaryrefslogtreecommitdiffstats
path: root/plugins/examples
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2016-07-10 11:51:59 (GMT)
committerGitHub <noreply@github.com>2016-07-10 11:51:59 (GMT)
commit2ee728cf99c0fe022e3fa9fddd0cfa41d79c8111 (patch)
treecc6557472120d3efa321a6bb3dccec5ae13a7f8d /plugins/examples
parent0f69807bae7f9987f282701644db7bba21f95487 (diff)
parentff380791b7aff3cd8d047e91322b7f933869e2b7 (diff)
downloadmxe-2ee728cf99c0fe022e3fa9fddd0cfa41d79c8111.zip
mxe-2ee728cf99c0fe022e3fa9fddd0cfa41d79c8111.tar.gz
mxe-2ee728cf99c0fe022e3fa9fddd0cfa41d79c8111.tar.bz2
Merge pull request #1431 from tonytheodore/qt5-host-tools
add qt5-host-tools example plugin
Diffstat (limited to 'plugins/examples')
-rw-r--r--plugins/examples/host-toolchain/README.md13
-rw-r--r--plugins/examples/host-toolchain/qt5-host-tools.mk52
2 files changed, 64 insertions, 1 deletions
diff --git a/plugins/examples/host-toolchain/README.md b/plugins/examples/host-toolchain/README.md
index 1478edf..a22215e 100644
--- a/plugins/examples/host-toolchain/README.md
+++ b/plugins/examples/host-toolchain/README.md
@@ -2,7 +2,9 @@ Cross Compiling a Host Toolchain
--------------------------------
This plugin demonstrates a minimal working toolchain built with MXE to
-execute on a Windows host. To build:
+execute on a Windows host.
+
+#### GCC
```
make gcc-host MXE_PLUGIN_DIRS=plugins/examples/host-toolchain/
@@ -15,6 +17,15 @@ Once complete, copy `usr/{target}` to an appropriate Windows machine
and execute the `usr\{target}\bin\test-gcc-host.bat` batch file. This
builds and runs the `libgomp` test as a sanity check.
+#### Qt5 tools (`qmake.exe`, `rcc.exe`, etc.)
+
+```
+make qt5-host-tools MXE_PLUGIN_DIRS=plugins/examples/host-toolchain/
+```
+
+This will build `qtbase` then run a second pass to cross-compile the qt tools
+and install them to `usr/{target}/qt5-host-tools/bin`.
+
Why?
----
diff --git a/plugins/examples/host-toolchain/qt5-host-tools.mk b/plugins/examples/host-toolchain/qt5-host-tools.mk
new file mode 100644
index 0000000..07fcacb
--- /dev/null
+++ b/plugins/examples/host-toolchain/qt5-host-tools.mk
@@ -0,0 +1,52 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := $(basename $(notdir $(lastword $(MAKEFILE_LIST))))
+$(PKG)_FILE = $(qtbase_FILE)
+$(PKG)_PATCHES = $(realpath $(sort $(wildcard $(addsuffix /qtbase-[0-9]*.patch, $(TOP_DIR)/src))))
+$(PKG)_SUBDIR = $(qtbase_SUBDIR)
+$(PKG)_DEPS := gcc qtbase
+
+# main configure options: -platform -host-option -external-hostbindir
+# further testing needed: -prefix -extprefix -hostprefix -sysroot -no-gcc-sysroot
+# and keeping options synced with qtbase
+
+define $(PKG)_BUILD
+ $(SED) -i 's,BUILD_ON_MAC=yes,BUILD_ON_MAC=no,g' '$(1)/configure'
+ mkdir '$(1).build'
+ cd '$(1).build' && '$(1)/configure' \
+ -prefix '$(PREFIX)/$(TARGET)/$(PKG)' \
+ -static \
+ -release \
+ -c++std c++11 \
+ -platform win32-g++ \
+ -host-option CROSS_COMPILE=${TARGET}- \
+ -external-hostbindir '$(PREFIX)/$(TARGET)/qt5/bin' \
+ -device-option PKG_CONFIG='${TARGET}-pkg-config' \
+ -device-option CROSS_COMPILE=${TARGET}- \
+ -force-pkg-config \
+ -no-sql-{db2,ibase,mysql,oci,odbc,psql,sqlite,sqlite2,tds} \
+ -no-use-gold-linker \
+ -nomake examples \
+ -nomake tests \
+ -opensource \
+ -confirm-license \
+ -continue \
+ -verbose
+
+ rm -rf '$(PREFIX)/$(TARGET)/$(PKG)'
+ # install qmake.exe (created by configure)
+ # and generate remaining build configuration
+ $(MAKE) -C '$(1).build' -j $(JOBS) \
+ sub-qmake-qmake-aux-pro-install_subtargets \
+ sub-src-qmake_all
+
+ # build and install other tools
+ $(MAKE) -C '$(1).build/src' -j $(JOBS) \
+ sub-moc-install_subtargets \
+ sub-qdbuscpp2xml-install_subtargets \
+ sub-qdbusxml2cpp-install_subtargets \
+ sub-qlalr-install_subtargets \
+ sub-rcc-install_subtargets \
+ sub-uic-install_subtargets
+endef