Mercurial > hg > syntilista
annotate qt5-cross-build.txt @ 27:0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 03 Apr 2017 14:32:43 +0300 |
parents | |
children | 30babce5c4be |
rev | line source |
---|---|
27
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 # In Debian 9 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 apt-get install gcc-mingw-w64 g++-mingw-w64 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 # Clone Qt5 base git repo: |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 git clone https://code.qt.io/qt/qt5.git qt5-src |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 cd qt5-src/ |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 # Checkout desired version |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 git checkout 5.8 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 # Initialize subrepos, we need just qtbase |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 ./init-repository -f --module-subset=qtbase |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 git checkout v5.8.0 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
15 git submodule update |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
17 # Configure for cross-compilation |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
18 ./configure -release -opensource -nomake examples -nomake tests -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32- -opengl desktop |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
19 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
20 # Qt5.8 requires this Windows 10 -specific header file |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
21 wget https://raw.githubusercontent.com/tpn/winsdk-10/master/Include/10.0.10240.0/um/UIViewSettingsInterop.h |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
22 -O /usr/i686-w64-mingw32/include/ |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
23 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
24 # Build it |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
25 make -j8 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
26 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
27 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 # To cross-compile using qmake |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
29 /misc/packages/qt5-src/qtbase/bin/qmake |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
30 make |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
31 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
32 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
33 # The compiled exe requires DLL libraries ( Qt5Core.dll Qt5Gui.dll Qt5Widgets.dll |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
34 # ) etc. which can be found from the QT5 cross build directory. Copy them |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 # into your application (executable) directory. |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
36 /misc/packages/qt5-src/qtbase/bin/ |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
37 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
39 # And plugins, usually platforms/qwindows.dll and whatever you need, |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
40 # but it depends on your application. You will have to create the |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
41 # same subdirectories under your target application directory. |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
42 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
43 mkdir -p $TGTDIR/platforms |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
44 cp /misc/packages/qt5-src/qtbase/plugins/platforms/qwindows.dll $TGTDIR/platforms/ |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
45 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
46 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
47 # Also libgcc and libstdc++ DLLs are needed, found from |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
48 /usr/lib/gcc/i686-w64-mingw32/6.3-win32/ |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
49 |
0ade5c3e424c
Some loose instructions for cross-building for Windows on Debian 9.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
50 # or so .. |