annotate build-win32.sh @ 283:958451fcd85a

Rename various variables etc.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 09 May 2023 11:03:00 +0300
parents 8c6fb6ee6f9e
children 02d2dec01f0f
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
227
07e7f254ef16 Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
2 INSTALL_USB="/mnt/sdb1"
28
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/"
72
cde3d200967c Use temporary file for unix2dos because of exfat limitations causing warnings.
Matti Hamalainen <ccr@tnsp.org>
parents: 69
diff changeset
4 TMPFILE="unix2dos.tmp"
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
6 BUILDPATH="win32/"
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
7
283
958451fcd85a Rename various variables etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
8 QT_VERSION_PREFIX="Qt5"
958451fcd85a Rename various variables etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
9 QT_PREFIX="/misc/packages/qt5-src"
958451fcd85a Rename various variables etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
10 QT_BASE="${QT_PREFIX}/qtbase"
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
11
261
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
12 MINGWPATH="$(dirname $(i686-w64-mingw32-g++ -print-prog-name=cc1))"
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
13 MINGWLIBS="/usr/i686-w64-mingw32/lib/"
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
14
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
15
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
16 fatal()
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
17 {
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
18 echo "ERROR: $1"
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
19 exit 1
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
20 }
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
21
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
22
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
23 do_cp()
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
24 {
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
25 cp -f "$1" "$2" || fatal "Could not copy file '$1' to '$2'."
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
26 }
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
27
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
28
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
29 do_mkdir()
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
30 {
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
31 mkdir -p "$1" || fatal "Could not create directory '$1'."
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
32 }
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
33
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 do_cpinstall()
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 {
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 # $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
38 # $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
39 # $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
40 # $4 filename
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
261
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
42 do_mkdir "$2/$3"
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
43 do_cp "$1/$3/$4" "$2/$3/$4"
28
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
270
8c6fb6ee6f9e Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
46
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 do_install()
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 TARGET="$1"
261
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
50
227
07e7f254ef16 Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
51 if test -d "$TARGET"; then
07e7f254ef16 Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
52 rm -fr "$TARGET"
261
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
53 elif test -e "$TARGET"; then
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
54 fatal "Target '$TARGET' exists but is not a directory!"
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 fi
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56
261
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
57 mkdir -p "$TARGET" || fatal "Could not create target directory '$TARGET'."
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
58
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
59 echo "Installing to '${TARGET}' ..."
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60
283
958451fcd85a Rename various variables etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
61 do_cpinstall "${QT_BASE}/plugins/" "$TARGET" "platforms" "qwindows.dll"
958451fcd85a Rename various variables etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
62 do_cpinstall "${QT_BASE}/plugins/" "$TARGET" "sqldrivers" "qsqlite.dll"
958451fcd85a Rename various variables etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
63 do_cpinstall "${QT_BASE}/plugins/" "$TARGET" "printsupport" "windowsprintersupport.dll"
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
64
142
36c9cb759326 Implement simple SQLite database backup at program exit using Qt HTTP/HTTPS
Matti Hamalainen <ccr@tnsp.org>
parents: 114
diff changeset
65 for i in Core Gui Sql Widgets PrintSupport Network; do
283
958451fcd85a Rename various variables etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
66 do_cp "${QT_BASE}/lib/${QT_VERSION_PREFIX}${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
67 done
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 for i in libstdc++-6 libgcc_s_sjlj-1; do
261
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
70 do_cp "${MINGWPATH}/${i}.dll" "$TARGET"
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
71 strip "${TARGET}/${i}.dll"
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 done
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73
261
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
74 for i in zlib1.dll; do
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
75 do_cp "${MINGWLIBS}/${i}" "$TARGET"
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
76 done
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
77
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
78 do_cp "$BUILDPATH/Syntilista.exe" "$TARGET"
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
79 unix2dos -n "COPYING.html" "$TMPFILE" || fatal "Could not unix2dos."
f6a99b984b8e Clean up build script a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 257
diff changeset
80 do_cp "$TMPFILE" "$TARGET/COPYING.txt"
72
cde3d200967c Use temporary file for unix2dos because of exfat limitations causing warnings.
Matti Hamalainen <ccr@tnsp.org>
parents: 69
diff changeset
81 rm -f "$TMPFILE"
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 }
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83
29
0129b619511c Check for qt5 crossbuild qmake before trying to build anything.
Matti Hamalainen <ccr@tnsp.org>
parents: 28
diff changeset
84
270
8c6fb6ee6f9e Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
85 ### Build the binaries
283
958451fcd85a Rename various variables etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
86 make -f Makefile.cross-mingw QT_PREFIX="$QT_PREFIX" BINPATH="$BUILDPATH"
37
3d1990eb1020 Actually run qmake.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
87
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
88 ### Install to targets
227
07e7f254ef16 Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
89 if test -d "$INSTALL_USB" && mount|grep -q "$INSTALL_USB"; then
07e7f254ef16 Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
90 do_install "$INSTALL_USB/Syntilista"
07e7f254ef16 Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
91 else
07e7f254ef16 Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
92 echo "INFO: '$INSTALL_USB' is not mounted. Not installing."
07e7f254ef16 Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
93 fi
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 do_install "$INSTALL_WINE"