Commit 14d0108f authored by Josua Mayer's avatar Josua Mayer

make ready for cross-compiling

parent 513ed464
QT-Embedded deb tree
Cross-Compiling for armhf:
- Install Cross-Compiler fro armhf from emdebian: https://wiki.debian.org/CrossToolchains#Installation
- install build dependencies: sudo apt-get install pkg-config debhelper libz-dev:armhf libsqlite3-dev:armhf
- build deb: dpkg-buildpackage -a armhf -b
Build on armhf:
- install build dependencies: sudo apt-get install pkg-config debhelper libz-dev libsqlite3-dev
- build deb: dpkg-buildpackage -a armhf -b
......@@ -3,6 +3,7 @@ Priority: optional
Maintainer: unknown <privacy@not.given>
Build-Depends:
debhelper (>= 9),
pkg-config,
libz-dev,
libsqlite3-dev,
Standards-Version: 3.9.5
......
......@@ -7,37 +7,37 @@
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
# import system information
include /usr/share/dpkg/architecture.mk
# add work-around for finding libQtCLucene.so.4
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-rpath-link,$(CURDIR)/build/lib
# generate Qt platform definition for debian
# (to allow cross-compiling with debians gcc names)
genplatformdef_target:
./mkqtspec.sh
genplatformdef_target_clean:
rm -rf source/mkspecs/linux-debian-* source/mkspecs/qws/linux-debian-*
# main packaging script based on dh7 syntax
%:
dh $@ --sourcedirectory=source --builddirectory=build --parallel
# debmake generated override targets
# This is example for Cmake (See http://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
override_dh_auto_clean: genplatformdef_target_clean
rm -rf build
dh_auto_clean
override_dh_auto_configure:
override_dh_auto_configure: genplatformdef_target
mkdir -p build
cd build; ../source/configure \
cd build; env \
../source/configure \
-opensource \
-confirm-license \
-embedded \
-platform linux-debian-$(DEB_TARGET_ARCH) \
-xplatform qws/linux-debian-$(DEB_TARGET_ARCH) \
-force-pkg-config \
-prefix /opt/qt-embedded \
-no-rpath \
-plugin-sql-sqlite \
......@@ -52,3 +52,6 @@ override_dh_auto_test:
override_dh_shlibdeps:
# make sure dpkg-shlibdeps can find the qt libraries when its looking
dh_shlibdeps -l/opt/qt-embedded/lib
override_dh_strip:
# dont strip until we figure out how to install qt-tools (qmake, moc, lrelease) built for the target system
#!/bin/bash -e
# read system information from dpkg-architecture to generate qt build configuration
DEB_TARGET_ARCH=$(dpkg-architecture -qDEB_TARGET_ARCH)
DEB_TARGET_GNU_TYPE=$(dpkg-architecture -qDEB_TARGET_GNU_TYPE)
# standard target (not needed for embedded build)
mkdir -p source/mkspecs/linux-debian-$DEB_TARGET_ARCH
cp -v source/mkspecs/linux-arm-gnueabi-g++/qplatformdefs.h source/mkspecs/linux-debian-$DEB_TARGET_ARCH/
cat > source/mkspecs/linux-debian-$DEB_TARGET_ARCH/qmake.conf << EOF
MAKEFILE_GENERATOR = UNIX
TARGET_PLATFORM = unix
TEMPLATE = app
CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
QT += core gui
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
# modifications to g++.conf
QMAKE_CC = $DEB_TARGET_GNU_TYPE-gcc
QMAKE_CXX = $DEB_TARGET_GNU_TYPE-g++
QMAKE_LINK = $DEB_TARGET_GNU_TYPE-g++
QMAKE_LINK_SHLIB = $DEB_TARGET_GNU_TYPE-g++
# modifications to linux.conf
QMAKE_AR = $DEB_TARGET_GNU_TYPE-ar cqs
QMAKE_OBJCOPY = $DEB_TARGET_GNU_TYPE-objcopy
QMAKE_STRIP = $DEB_TARGET_GNU_TYPE-strip
load(qt_config)
EOF
# embedded target
# based on source/mkspecs/qws/linux-arm-g++
mkdir -p source/mkspecs/qws/linux-debian-$DEB_TARGET_ARCH
cp -v source/mkspecs/qws/linux-generic-g++/qplatformdefs.h source/mkspecs/qws/linux-debian-$DEB_TARGET_ARCH/
cat > source/mkspecs/qws/linux-debian-$DEB_TARGET_ARCH/qmake.conf << EOF
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)
# modifications to g++.conf
QMAKE_CC = $DEB_TARGET_GNU_TYPE-gcc
QMAKE_CXX = $DEB_TARGET_GNU_TYPE-g++
QMAKE_LINK = $DEB_TARGET_GNU_TYPE-g++
QMAKE_LINK_SHLIB = $DEB_TARGET_GNU_TYPE-g++
# modifications to linux.conf
QMAKE_AR = $DEB_TARGET_GNU_TYPE-ar cqs
QMAKE_OBJCOPY = $DEB_TARGET_GNU_TYPE-objcopy
QMAKE_STRIP = $DEB_TARGET_GNU_TYPE-strip
load(qt_config)
EOF
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment