Debian Codegraph @

Build/mk-win32

raw
1 #!/bin/bash
2 ###############################################################################
3 # BRLTTY - A background process providing access to the console screen (when in
4 # text mode) for a blind person using a refreshable braille display.
5 #
6 # Copyright (C) 1995-2026 by The BRLTTY Developers.
7 #
8 # BRLTTY comes with ABSOLUTELY NO WARRANTY.
9 #
10 # This is free software, placed under the terms of the
11 # GNU Lesser General Public License, as published by the Free Software
12 # Foundation; either version 2.1 of the License, or (at your option) any
13 # later version. Please see the file LICENSE-LGPL for details.
14 #
15 # Web Page: http://brltty.app/
16 #
17 # This software is maintained by Dave Mielke <[email protected]>.
18 ###############################################################################
19
20 . "`dirname "${0}"`/mk-prologue.sh"
21 windowsDirectory="${sourceRoot}/Windows"
22 . "${windowsDirectory}/mingw32.sh"
23
24 readonly defaultUsbPackageNames=( libusb libusb-1.0 )
25
26 showProgramUsageNotes() {
27 cat <<END_OF_PROGRAM_USAGE_NOTES
28 The positional parameters are the names of USB packages. If none are
29 specified, the default is: ${defaultUsbPackageNames[*]}
30 END_OF_PROGRAM_USAGE_NOTES
31 }
32
33 processExtraProgramParameters() {
34 [ "${#}" -gt 0 ] || set -- "${defaultUsbPackageNames[@]}"
35 usbPackageNames=( "${@}" )
36 }
37
38 optionalProgramParameters
39 parseProgramArguments "${@}"
40
41 mkIgnoreMismatch "^mkwin32: revision identifier: "
42 mkIgnoreMismatch "^ *Creating library "
43 mkIgnoreMismatch "^Successfully compiled: "
44
45 mkIgnoreMismatch "^declare: usage: "
46 mkIgnoreMismatch "^.*: declare: -[nA]: "
47
48 read <"${windowsDirectory}/python-location" pythonLocation || exit "${?}"
49 [ -e "${pythonLocation}" ] || logError "Python not found: ${pythonLocation}"
50 [ -d "${pythonLocation}" ] || logError "not a directory: ${pythonLocation}"
51
52 for usbPackage in "${usbPackageNames[@]}"
53 do
54 mkPlatformName="win32[${usbPackage}]"
55 mkOldLogName="Windows32-${usbPackage}"
56 mkNewLogName="${programName}-${usbPackage}"
57 mkBuild "${windowsDirectory}/mkwin32" -P "${pythonLocation}" -u "${usbPackage}" -- "${sourceRoot}"
58 done
59
60 exit 0