mxe/src/qt.mk

150 lines
5.8 KiB
Makefile
Raw Normal View History

2009-10-03 20:11:16 +01:00
# Copyright (C) 2009 Mark Brand
# Volker Grabsch
# Tony Theodore
2009-10-03 20:11:16 +01:00
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject
# to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Qt
PKG := qt
$(PKG)_IGNORE :=
$(PKG)_VERSION := 4.6.0
$(PKG)_CHECKSUM := c2cbbde83f1ebac3b8dd13a112fcad757d395041
2009-10-03 20:11:16 +01:00
$(PKG)_SUBDIR := $(PKG)-everywhere-opensource-src-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-everywhere-opensource-src-$($(PKG)_VERSION).tar.gz
$(PKG)_WEBSITE := http://qt.nokia.com/
$(PKG)_URL := http://get.qt.nokia.com/qt/source/$($(PKG)_FILE)
$(PKG)_DEPS := gcc libodbc++ postgresql freetds openssl libgcrypt zlib libpng jpeg libmng tiff sqlite
2009-10-03 20:11:16 +01:00
define $(PKG)_UPDATE
wget -q -O- 'http://qt.gitorious.org/qt/qt/commits' | \
grep '<li><a href="/qt/qt/commit/' | \
$(SED) -n 's,.*<a[^>]*>v\([0-9][^>-]*\)<.*,\1,p' | \
2009-10-03 20:11:16 +01:00
tail -1
endef
define $(PKG)_BUILD
# Native, unpatched build of Qt for moc, rcc, uic and qmake
cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,qt)
mv '$(1)/$(qt_SUBDIR)' '$(1).native'
2009-10-06 13:08:28 +01:00
$(SED) 's,PLATFORM_X11=yes,PLATFORM_X11=no,' -i '$(1)'.native/configure
$(SED) 's,PLATFORM=solaris-cc$$,PLATFORM=solaris-g++,' -i '$(1)'.native/configure
2009-10-03 20:11:16 +01:00
cd '$(1)'.native && ./configure \
-opensource \
-confirm-license \
-prefix '$(PREFIX)/$(TARGET)' \
-prefix-install \
-fast \
-release \
-no-exceptions \
2009-10-03 20:11:16 +01:00
-nomake demos \
-nomake examples \
-nomake libs \
-nomake tools \
-nomake docs \
-nomake translations
$(MAKE) -C '$(1)'.native -j $(JOBS) sub-tools-bootstrap
$(MAKE) -C '$(1)'.native -j $(JOBS) sub-moc
$(MAKE) -C '$(1)'.native -j $(JOBS) sub-rcc
$(MAKE) -C '$(1)'.native -j $(JOBS) sub-uic
# rebuild qmake to use "-unix" as default and to use the correct "ar" command
$(SED) 's,\(Option::TARG_MODE Option::target_mode = Option::TARG_\)[A-Z_]*,\1UNIX_MODE,' -i '$(1)'.native/qmake/option.cpp
$(SED) 's,"ar -M,"$(TARGET)-ar -M,' -i '$(1)'.native/qmake/generators/win32/mingw_make.cpp
$(MAKE) -C '$(1)'.native/qmake -j $(JOBS)
# install the native tools manually
$(INSTALL) -m755 '$(1)'.native/bin/moc '$(PREFIX)/bin/$(TARGET)-moc'
$(INSTALL) -m755 '$(1)'.native/bin/rcc '$(PREFIX)/bin/$(TARGET)-rcc'
$(INSTALL) -m755 '$(1)'.native/bin/uic '$(PREFIX)/bin/$(TARGET)-uic'
$(INSTALL) -m755 '$(1)'.native/bin/qmake '$(PREFIX)/bin/$(TARGET)-qmake'
2009-10-03 20:11:16 +01:00
# Trick the build system into using native tools
ln -s '$(1)'.native/bin/{moc,rcc,uic,qmake} '$(1)'/bin/
# Make sure we don't build the tools again
echo 'qmake:' >'$(1)'/qmake/Makefile.unix
for f in `ls -1 '$(1)'/src/tools`; \
do echo TEMPLATE = subdirs >'$(1)'/src/tools/"$$f"/"$$f".pro; \
done
# Adjust the mkspec values that contain the TARGET platform prefix.
# The patch planted strings HOSTPLATFORMPREFIX and HOSTPLATFORMINCLUDE.
$(SED) 's,HOSTPLATFORMPREFIX-,$(TARGET)-,g' -i '$(1)'/mkspecs/win32-g++/qmake.conf
$(SED) 's,HOSTPLATFORMINCLUDE,$(PREFIX)/$(TARGET)/include,g' -i '$(1)'/mkspecs/win32-g++/qmake.conf
2009-10-03 20:11:16 +01:00
# Configure Qt for MinGW target
cd '$(1)' && ./configure \
-opensource \
-confirm-license \
-xplatform win32-g++ \
-host-arch i386 \
2009-10-06 13:08:28 +01:00
-host-little-endian \
2009-10-03 20:11:16 +01:00
-little-endian \
-largefile \
-force-pkg-config \
-release \
2009-10-03 20:11:16 +01:00
-exceptions \
-static \
-prefix '$(PREFIX)/$(TARGET)' \
-prefix-install \
-bindir '$(1)'/bindirsink \
-script \
-opengl desktop \
-no-webkit \
-no-phonon \
2009-10-03 20:11:16 +01:00
-no-phonon-backend \
-accessibility \
-no-reduce-exports \
-no-rpath \
-make libs \
-nomake demos \
-nomake docs \
-nomake examples \
2009-10-27 17:05:29 +00:00
-plugin-sql-sqlite \
-plugin-sql-odbc \
-plugin-sql-psql \
-plugin-sql-tds \
-system-zlib \
-qt-gif \
-system-libtiff \
-system-libpng \
-qt-libmng \
-system-libjpeg \
-system-sqlite \
-openssl-linked \
-v
2009-10-03 20:11:16 +01:00
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(TARGET)-ranlib '$(1)'/lib/*.a
rm -rf '$(PREFIX)/$(TARGET)/mkspecs'
2009-10-03 20:11:16 +01:00
$(MAKE) -C '$(1)' install
# Manually created prl files for static plugins to help applications link to system libs
$(INSTALL) -m664 '$(1)/lib/qjpeg.prl' '$(PREFIX)/$(TARGET)/lib/'
# $(INSTALL) -m664 '$(1)/lib/qmng.prl' '$(PREFIX)/$(TARGET)/lib/'
$(INSTALL) -m664 '$(1)/lib/qsqlite.prl' '$(PREFIX)/$(TARGET)/lib/'
$(INSTALL) -m664 '$(1)/lib/qsqlodbc.prl' '$(PREFIX)/$(TARGET)/lib/'
$(INSTALL) -m664 '$(1)/lib/qsqlpsql.prl' '$(PREFIX)/$(TARGET)/lib/'
$(INSTALL) -m664 '$(1)/lib/qsqltds.prl' '$(PREFIX)/$(TARGET)/lib/'
$(INSTALL) -m664 '$(1)/lib/qtiff.prl' '$(PREFIX)/$(TARGET)/lib/'
2009-10-03 20:11:16 +01:00
endef