From 5e6a9e2a6639013519bf95d90b51f57917ac9549 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Fri, 16 Oct 2015 03:57:00 +1100 Subject: [PATCH] plugins: add qt override example with minimal deps and custom cflags --- plugins/custom-qt-min/overrides.mk | 82 ++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 plugins/custom-qt-min/overrides.mk diff --git a/plugins/custom-qt-min/overrides.mk b/plugins/custom-qt-min/overrides.mk new file mode 100644 index 00000000..159e0dd8 --- /dev/null +++ b/plugins/custom-qt-min/overrides.mk @@ -0,0 +1,82 @@ +# This file is part of MXE. +# See index.html for further information. + +# MXE provides a fully featured build of Qt. Some users want more control... +# http://lists.nongnu.org/archive/html/mingw-cross-env-list/2013-08/msg00010.html +# http://lists.nongnu.org/archive/html/mingw-cross-env-list/2012-05/msg00019.html +# +# build of qt and deps is (say): 25 mins with 12.5 MB test program +# custom with minimal deps is: 4 mins with 7.6 MB test program +# custom min deps and cflags is: 4 mins with 5.9 MB test program +# +# make qt MXE_PLUGIN_DIRS='plugins/custom-qt-min' + +qt_DEPS := gcc + +define qt_BUILD + $(SED) -i 's,\(^QMAKE_CFLAGS_RELEASE\).*,\1 = -pipe -Os -fomit-frame-pointer -momit-leaf-frame-pointer -fdata-sections -ffunction-sections,g' '$(1)/mkspecs/win32-g++/qmake.conf' + cd '$(1)' && QTDIR='$(1)' ./bin/syncqt + cd '$(1)' && \ + ./configure \ + -opensource \ + -confirm-license \ + -fast \ + -xplatform win32-g++-4.6 \ + -device-option CROSS_COMPILE=$(TARGET)- \ + -device-option PKG_CONFIG='$(TARGET)-pkg-config' \ + -force-pkg-config \ + -release \ + -static \ + -prefix '$(PREFIX)/$(TARGET)/qt' \ + -prefix-install \ + -make libs \ + -nomake demos \ + -nomake docs \ + -nomake examples \ + -nomake tools \ + -nomake translations \ + -no-accessibility \ + -no-audio-backend \ + -no-dbus \ + -no-declarative \ + -no-exceptions \ + -no-gif \ + -no-glib \ + -no-gstreamer \ + -no-iconv \ + -no-libjpeg \ + -no-libmng \ + -no-libpng \ + -no-libtiff \ + -no-multimedia \ + -no-opengl \ + -no-openssl \ + -no-phonon \ + -no-phonon-backend \ + -no-qt3support \ + -no-reduce-exports \ + -no-rpath \ + -no-script \ + -no-scripttools \ + -no-sql-mysql \ + -no-sql-odbc \ + -no-sql-psql \ + -no-sql-sqlite \ + -no-sql-tds \ + -no-stl \ + -no-svg \ + -no-webkit \ + -no-xmlpatterns \ + -qt-zlib \ + -v + + $(MAKE) -C '$(1)' -j '$(JOBS)' + rm -rf '$(PREFIX)/$(TARGET)/qt' + $(MAKE) -C '$(1)' -j 1 install + + mkdir '$(1)/test-qt' + cd '$(1)/test-qt' && '$(PREFIX)/$(TARGET)/qt/bin/qmake' '$(PWD)/$(2).pro' + $(MAKE) -C '$(1)/test-qt' -j '$(JOBS)' + $(INSTALL) -m755 '$(1)/test-qt/release/test-qt.exe' '$(PREFIX)/$(TARGET)/bin/' + +endef