annotate build-win32.sh @ 69:a242548ccce8

Build system cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 10 Apr 2017 00:24:33 +0300
parents 423d2383a605
children cde3d200967c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #!/bin/sh
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 INSTALL_USB="/mnt/sdb1/Syntilista/"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 INSTALL_WINE="$HOME/.wine/drive_c/Syntilista/"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
5 BUILDPATH="win32/"
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
6
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
7 QT5_PREFIX="/misc/packages/qt5-src"
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
8 QT5_BASE="${QT5_PREFIX}/qtbase"
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
9
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 MINGWPATH="/usr/lib/gcc/i686-w64-mingw32/6.3-win32/"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 do_cpinstall()
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 {
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 # $1 src base path
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 # $2 dst base path
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 # $3 common sub path
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 # $4 filename
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 mkdir -p "$2/$3"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 cp -f "$1/$3/$4" "$2/$3/$4"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 }
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 do_install()
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 {
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 TARGET="$1"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 if test ! -d "$TARGET"; then
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 echo "ERROR: Target directory '$TARGET' does not exist."
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 return 1
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 fi
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 echo "Installing to '$TARGET' ..."
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
33 do_cpinstall "$QT5_BASE/plugins/" "$TARGET" "platforms" "qwindows.dll"
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
34 do_cpinstall "$QT5_BASE/plugins/" "$TARGET" "sqldrivers" "qsqlite.dll"
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
35
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 for i in Core Gui Sql Widgets; do
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
37 cp -f "$QT5_BASE/lib/Qt5$i.dll" "$TARGET"
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 done
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 for i in libstdc++-6 libgcc_s_sjlj-1; do
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 cp -f "$MINGWPATH/$i.dll" "$TARGET"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 strip "$TARGET/$i.dll"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 done
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 cp -f "$BUILDPATH/Syntilista.exe" "$TARGET"
59
423d2383a605 Copy / convert COPYING file to CRLF line endings format in the target.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
46 unix2dos -n "COPYING" "$TARGET/COPYING.txt"
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
47 return 0
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 }
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49
29
0129b619511c Check for qt5 crossbuild qmake before trying to build anything.
Matti Hamalainen <ccr@tnsp.org>
parents: 28
diff changeset
50
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
51 ### Create cross-building makefiles
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
52 make -f Makefile.cross-mingw-win32 QT5_PREFIX="$QT5_PREFIX" BINPATH="$BUILDPATH"
37
3d1990eb1020 Actually run qmake.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
53
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
54 ### Install to targets
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
55 do_install "$INSTALL_USB" && rm -f "$INSTALL_USB/syntilista.sqlite3"
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 do_install "$INSTALL_WINE"