Debian Codegraph @

Documents/README.Windows

raw
1 ~~~~~~~~~~~~~~~~~
2 BRLTTY on Windows
3 ~~~~~~~~~~~~~~~~~
4
5 .. include:: prologue.rst
6 .. _Cygwin's Web Site: http://www.cygwin.com/
7 .. _MinGW's Web Site: http://mingw.sourceforge.net/
8 .. _LibUSB-Win32's Web Site: http://libusb-win32.sourceforge.net/
9 .. _LibUSB-1.0's Web Site: http://www.libusb.org/wiki/windows_backend
10 .. _Cygwin Ports: http://cygwinports.org/
11 .. _Cygwin java-ecj jar: ftp://sourceware.org/pub/java/ecj-4.5.jar
12
13 Building BRLTTY
14 ===============
15
16 System Requirements
17 -------------------
18
19 The earliest release of Windows that is supported by BRLTTY is Windows 98.
20
21 Pre-built versions of BRLTTY are available for download on
22 `BRLTTY's Web Site`_. Their names begin with ``brltty-win-``. Those with the
23 ``.zip`` extension are archives, and those with the ``.exe`` extension are
24 installers.
25
26 In order to build BRLTTY yourself from a prepared source tarball, you'll need
27 Cygwin (see `Cygwin's Web Site`_) and/or MinGW (see `MinGW's Web Site`_).
28 You'll also need the following additional packages:
29
30 * gcc
31 * make
32 * w32api (version 3.6 or later)
33
34 If you'd like to build BRLTTY from its source repository (rather than from one
35 of the prepared source tarballs) then you'll also need these packages:
36
37 * autoconf
38 * tcltk
39
40 If you'd like to prepare the documentation (by doing ``make`` within the
41 ``Documents/`` subdirectory) then you'll need these packages:
42
43 * linuxdoc-tools (not pre-packaged in Cygwin)
44 * doxygen
45
46 If you're using MSYS (the MinGW command shell) for running ``configure`` and
47 ``make``, you should always use Windows-like paths (e.g. ``c:/brltty``) rather
48 than MSYS paths (e.g. ``/c/brltty``) because BRLTTY does **not** understand
49 MSYS paths.
50
51 Windows 98 and ME Limitation
52 ----------------------------
53
54 On Windows versions 2000, XP, 2003, and later, BRLTTY automatically accesses
55 the Windows console that you're currently using as you switch between them.
56 This isn't possible on earlier versions. One way to still achieve this
57 functionality, though, is to run one BRLTTY on the root window that directly
58 accesses your braille device, and another one on each console that indirectly
59 accesses your braille device via BrlAPI. This scheme may sound complicated,
60 but it can be set up to run automatically.
61
62 The first (or root) BRLTTY should be run as part of Windows startup. It must be
63 run with the options that are necessary for it to access your braille device,
64 e.g. ``-b`` (to specify the driver), ``-d`` (to specify the device), and
65 (maybe) ``-B`` (to specify driver-specific parameters). It must also be given
66 the ``-Xroot=yes`` option (which attaches it to the root window).
67
68 An additional BRLTTY must then be run for each new console. It should be
69 invoked like this::
70
71 brltty -bba -N
72
73 The ``-bba`` option tells it to access the root BRLTTY via BrlAPI, and the
74 ``-N`` option tells it not to start a BrlAPI server of its own.
75
76 These (non-root) BRLTTYs can be started automatically by, for example, invoking
77 them from your ``.bashrc`` script. Each of these BRLTTYs only reviews the
78 console it's running within, and connects, via BrlAPI, to the root BRLTTY in
79 order to access your braille device.
80
81 If you're not concerned with security, and would rather not fiddle with the
82 ``brlapi.key`` file, then add the ``-Aauth=none`` option to the command line
83 that starts the root BRLTTY. You don't need to worry about unauthorized access
84 over the network since the default is that only locally running programs can
85 connect to BrlAPI.
86
87 Package Management via the Command Line
88 ---------------------------------------
89
90 Managing Cygwin Packages
91 ~~~~~~~~~~~~~~~~~~~~~~~~
92
93 A convenient way to manage Cygwin packages from the command line
94 is to use the ``apt-cyg`` command.
95 It's similar to the ``apt-get`` command which some Linux distributions use.
96
97 As of the time of this writing, this is how you can install it::
98
99 svn --force export http://apt-cyg.googlecode.com/svn/trunk/ /usr/local/bin/
100 chmod +x /usr/local/bin/apt-cyg
101
102 If you're using the 64-bit Cygwin platform, then, after installing apt-cyg,
103 you'll need to make a couple of simple modifications to it. Using your
104 favourite text editor, and remembering that the actual line numbers within your
105 version may differ from those shown below, edit ``/usr/local/bin/apt-cyg`` and
106 make the following changes:
107
108 1) On line 98, change ``$mirror/setup.bz2`` to ``$mirror/x86_64/setup.bz2``.
109
110 2) On line 105, change ``$mirror/setup.ini`` to ``$mirror/x86_64/setup.ini``.
111
112 To search for a package, you can do:
113
114 .. parsed-literal:: apt-cyg find *pattern*
115
116 To install a package, you can do:
117
118 .. parsed-literal:: apt-cyg install *name*
119
120 For full details, you can do:
121
122 .. parsed-literal:: apt-cyg help
123
124 Managing MinGW Packages
125 ~~~~~~~~~~~~~~~~~~~~~~~
126
127 A convenient way to manage MinGW packages from the command line
128 is to use the ``mingw-get`` command.
129 Be sure to invoke it with arguments because
130 when invoked with no arguments its graphical interface is used.
131
132 To list all of the packages, you can do:
133
134 .. parsed-literal:: mingw-get list
135
136 To install a package, you can do:
137
138 .. parsed-literal:: mingw-get install *name*
139
140 For full details, you can do:
141
142 .. parsed-literal:: mingw-get -h
143
144 USB Support
145 -----------
146
147 USB devices are supported thanks to the ``LibUSB-Win32`` and the ``LibUSB-1.0``
148 packages. If both are installed, preference is given to ``LibUSB-1.0``.
149
150 Pre-built versions of BRLTTY have USB support compiled in, and the required
151 Windows drivers are also included, so you just need to let the installer set
152 them up.
153
154 In order to build BRLTTY yourself with USB support enabled, you'll need to
155 **first** install at least one of LibUSB-Win32 or LibUSB-1.0.
156
157 LibUSB-Win32
158 ~~~~~~~~~~~~
159
160 At the time of this writing, LibUSB-Win32 binaries can be found on
161 `LibUSB-Win32's Web Site`_. They'll be named something like
162 ``libusb-win32-bin-<version>.exe``, and should be available on
163 ``http://sourceforge.net/project/showfiles.php?group_id=78138``.
164
165 * On Cygwin:
166
167 1) Install the ``libusb-win32`` package.
168
169 * On MinGW:
170
171 1) Unpack the archive somewhere.
172
173 2) Symlink the header and library files into your MinGW
174 installation::
175
176 ln -s LibUSB-Win32/include/lusb0_usb.h /mingw/include/usb.h
177 ln -s LibUSB-Win32/lib/gcc/libusb.a /mingw/lib/
178 ln -s LibUSB-Win32/bin/x86/libusb0_x86.dll /mingw/bin/libusb0.dll
179
180 In order to be able to use the LibUSB-Win32 driver, you'll need to copy its
181 run-time files into BRLTTY's source tree::
182
183 cp LibUSB-Win32/bin/x86/libusb0.sys brltty/hotplug/libusb0.sys
184 cp LibUSB-Win32/bin/x86/libusb0_x86.dll brltty/hotplug/libusb0.dll
185 cp LibUSB-Win32/bin/amd64/libusb0.sys brltty/hotplug/libusb0_x64.sys
186 cp LibUSB-Win32/bin/amd64/libusb0.dll brltty/hotplug/libusb0_x64.dll
187
188 Then, either right-click on ``brltty/hotplug/brltty.inf`` and select
189 ``install``, or, on braille device plug, point at the
190 ``brltty/hotplug/brltty.inf`` file.
191
192 LibUSB-1.0
193 ~~~~~~~~~~
194
195 As of the time of this writing, LibUSB-1.0 binary snapshots can be found on
196 `LibUSB-1.0's Web Site`_. They'll be named something like
197 ``libusb_<date>.7z``.
198
199 * On Cygwin:
200
201 1) Install the ``libusb1.0-devel`` package.
202
203 * On MinGW:
204
205 1) Unpack the archive somewhere.
206
207 2) Symlink the header and library files into your MinGW
208 installation::
209
210 ln -s LibUSB-1.0/include/libusbx-1.0 /mingw/include/libusb-1.0
211 ln -s LibUSB-1.0/MinGW32/dll/libusb-1.0.dll.a /mingw/lib/
212 ln -s LibUSB-1.0/MinGW32/dll/libusb-1.0.dll /mingw/bin/
213
214 3) Copy the file ``libusb-1.0.pc`` in the ``Windows/`` subdirectory of
215 BRLTTY's source tree into MinGW's ``/mingw/lib/pkgconfig/`` directory. If
216 the ``pkgconfig/`` subdirectory doesn't already exist then create it.
217
218 In order to be able to use the LibUSB-1.0 driver, you'll need to either
219 right-click on ``brltty/hotplug/brltty-libusb-1.0.inf`` and select ``install``,
220 or, on braille device plug, point at the
221 ``brltty/hotplug/brltty-libusb-1.0.inf`` file.
222
223 Configuring a BRLTTY Build
224 --------------------------
225
226 Some of BRLTTY's configure options are of particular interest to users of the
227 Windows platform:
228
229 --enable-relocatable-install
230 The default is for BRLTTY to refer to its components via absolute paths. On
231 the Windows platform, however, the convention is for a package to use
232 relative paths so that it's entirely self-contained. This enables it to be
233 installed into an arbitrary directory, and to be moved around thereafter at
234 well. This option builds BRLTTY such that relative paths are used.
235
236 Missing Java Class Definitions on Cygwin
237 ----------------------------------------
238
239 You may get a Java failure that looks something like this::
240
241 Exception in thread "main" java.lang.NoClassDefFoundError:
242 org.eclipse.jdt.internal.compiler.batch.GCCMain
243 at gnu.java.lang.MainThread.run(Unknown Source)
244 Caused by: java.lang.ClassNotFoundException:
245 org.eclipse.jdt.internal.compiler.batch.GCCMain
246 not found in gnu.gcj.runtime.SystemClassLoader
247 {urls=[], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
248
249 This problem occurs when the ``java-ecj`` package isn't installed. It can be
250 obtained from the `Cygwin Ports`_. You can also resolve the problem by downloading
251 the `Cygwin java-ecj jar`_, and installing it into ``/usr/share/java/ecj.jar``.
252
253 Using BRLTTY
254 ============
255
256 Windows Scripts for Managing BRLTTY
257 -----------------------------------
258
259 These ``.bat`` scripts are in the top-level folder where BRLTTY has been installed.
260 They should be run by a user that has administrative privileges.
261
262 ``run-brltty.bat``
263 ~~~~~~~~~~~~~~~~~~
264
265 Manually run BRLTTY with a log level of ``info``.
266 Logs are written to the file ``brltty.log``
267 in the top-level folder where BRLTTY has been installed.
268 All arguments are passed through to BRLTTY.
269
270 ``debug-brltty.bat``
271 ~~~~~~~~~~~~~~~~~~~~
272
273 Manually run BRLTTY, via the ``run-brltty.bat`` script, with options that
274 set the log level to ``debug`` and enable several useful log categories.
275 All arguments are passed through to the ``run-brltty.bat`` script.
276
277 ``kill-brltty.bat``
278 ~~~~~~~~~~~~~~~~~~~
279
280 Forcibly terminate the manually-run BRLTTY process.
281
282 ``enable-brlapi.bat``
283 ~~~~~~~~~~~~~~~~~~~~~~
284
285 Install the BrlAPI service and start it.
286
287 ``disable-brlapi.bat``
288 ~~~~~~~~~~~~~~~~~~~~~~~~
289
290 Stop the BrlAPI service and uninstall it.
291
292 Sticking to a Console
293 ---------------------
294
295 It may be useful to have BRLTTY only review the console that it's started in,
296 i.e. for it not to follow the keyboard focus. To achieve this, set the
297 ``FollowFocus`` parameter of BRLTTY's ``Windows`` screen driver to ``no``. This
298 can be done:
299
300 On the Command Line:
301 ``-Xwn:FollowFocus=no``
302
303 In ``brltty.conf``:
304 ``screen-parameter wn:FollowFocus=no``
305
306 Sharing the Braille Device with Other Screen Readers
307 ----------------------------------------------------
308
309 When you're not on a window that BRLTTY can handle, its default action is to
310 retain control of the braille device and to present a short message explaining
311 the problem. If you have another braille-capable screen reader and would like
312 it to take over instead, then both BRLTTY and that other screen reader must be
313 instructed to share the braille device.
314
315 BRLTTY can be instructed to share the braille device via its
316 ``--release-device`` option (the short form of this option is ``-r``). When
317 this option is in effect, BRLTTY releases the braille device when you move onto
318 a window that it can't handle, and then tries to regain control of the braille
319 device when you move onto a window that it can handle. Note that these actions
320 take a noticeable amount of time so you should only use this option if it's
321 actually needed.
322
323 Sharing with JAWS
324 ~~~~~~~~~~~~~~~~~
325
326 A common case wherein a JAWS user might want BRLTTY to be in control of the
327 braille device when on a console window is when using Cygwin.
328
329 There are two phases to configuring JAWS to run in the background while BRLTTY
330 controls the braille device. First, a usable window title must be established
331 and stable. Second, JAWS braille must be put to sleep.
332
333 .. topic:: What is a Window Title?
334
335 Every window in Windows has a title bar that contains the name of the
336 application that's running in it, as well as some controls to do things like
337 move and resize the window. BRLTTY doesn't show this title bar.
338
339 For a program window, JAWS uses the name of the program's executable as the
340 name of the configuration files to load when that program gains focus. For a
341 console application such as Cygwin, however, it uses the title of the window
342 instead. You must, therefore, tell JAWS within the window title that this is
343 a Cygwin window.
344
345 .. topic:: Setting the Window Title
346
347 JAWS uses one of the words in the window title as the name of the
348 configuration file set to load. This file set is what tells JAWS the
349 specifics of how to handle the application. It is, therefore, where JAWS
350 must be instructed to put its braille component to sleep.
351
352 As of this writing, it appears that JAWS uses the following algorithm for
353 choosing which word in the title to use as the name of the file set:
354
355 1) If there are no slashes (``/``) or backslashes (``\``) in the title then
356 JAWS uses the first word. Thus, if the title is ``Cygwin Bash Shell``
357 then JAWS will load the ``Cygwin`` configuration file set.
358
359 2) If there's at least one slash (``/``) or backslash (``\``) in the title
360 then JAWS uses the last word. Thus, if the title is ``$PWD - Cygwin``
361 then JAWS will similarly load the ``Cygwin`` configuration file set.
362
363 .. topic:: Setting Cygwin's Window Title
364
365 First, it is imperative that you replace, or at least modify, the default
366 ``PS1`` (primary shell prompt) setting. The default for this setting, as
367 distributed by Cygwin, places ``$PWD`` (the path to the current working
368 directory) in the window title, thus requiring you to have a separate JAWS
369 configuration for every directory on the system! One possible way to resolve
370 this "problem" is to uncomment the ``settitle`` function (which can be found
371 near the end of ``.bashrc``). This function allows you to place a string of
372 your own choice in the title. You can use this function, therefore, as
373 follows::
374
375 export PROMPT_COMMAND='settitle "$PWD - Cygwin"'
376 export PS1='$ '
377
378 The first of these lines causes the window title to be set just before each
379 shell prompt. Since ``$PWD`` always contains at least one slash (``/``), the
380 operative word in the title will be ``Cygwin`` (the last word), and JAWS,
381 therefore, will load any ``Cygwin`` configuration files that it finds.
382
383 The second of these lines sets the primary shell prompt to the customary
384 dollar (``$``) sign. More importantly, though, it replaces Cygwin's default
385 ``PS1`` setting which, because it contains escape sequences that overwrite
386 the title with ``$PWD``, renders the window unrecognizable by JAWS.
387
388 .. topic:: Putting JAWS Braille to Sleep
389
390 Now that a stable window title has been established, JAWS braille can
391 finally be put to sleep. While in Cygwin, and with BRLTTY not running, do
392 the following:
393
394 1) Press Insert+F2 to bring up the ``Run JAWS Manager`` dialog.
395
396 2) Down-Arrow to ``Configuration Manager``, and press Enter. Verify that the
397 title on the top line contains ``Cygwin.jcf``.
398
399 3) Press Alt+S for ``Set Options``.
400
401 4) Press B for ``Braille``.
402
403 5) Press S for ``Braille Sleep Mode``.
404
405 6) Verify that the box is checked. It should look like ``<x>`` (rather than
406 like ``< >``). Press Space to toggle the setting if the ``x`` isn't there.
407
408 7) Press Enter to leave the menu.
409
410 8) Press Control+S to save the file.
411
412 9) Press Alt+F4 to exit the configuration manager.
413
414 .. topic:: Putting JAWS Speech to Sleep
415
416 If you'd like to use JAWS speech in Windows, but not in Cygwin, you can do
417 the following:
418
419 1) Press Insert+F2 to bring up the ``Run JAWS Manager`` dialog.
420
421 2) Down-Arrow to ``Configuration Manager`` and press Enter. Verify that the
422 title on the top line contains ``Cygwin.jcf``.
423
424 3) Press Alt+S for ``Set Options``.
425
426 4) Press A for ``Advanced``.
427
428 5) You should be on an item labelled ``Sleep Mode Enable`` with an empty
429 check box (``< >``). Press Space to check it (``<x>``).
430
431 6) Press Enter to leave the menu.
432
433 7) Press Control+S to save the file.
434
435 8) Press Alt+F4 to exit the configuration manager.
436
437 .. topic:: Known Problem
438
439 You'll always be able to switch to Cygwin, and BRLTTY (if it's running) will
440 take control of the braille device automatically. Switching back to Windows
441 and JAWS, however, may be problematic. The degree of success seems to depend
442 on the type of braille device being used. It usually works properly.
443 Sometimes, however, when using a USB device, the cable needs to be
444 unplugged/replugged to allow JAWS to regain control. In extreme cases, you
445 may need to exit BRLTTY before going to Windows.
446
447 MinGW Scripts for Building BRLTTY
448 =================================
449
450 The ``mkwin`` Script
451 --------------------
452
453 The ``mkwin`` script,
454 which can be found in the ``Windows/`` subdirectory of BRLTTY's source tree,
455 builds the Windows archive and installer for BRLTTY.
456
457 Software Components Required by ``mkwin``
458 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
459
460 Links to the pages where we found these
461 installers, components, and files are listed.
462 In case any of these links becomes out-of-date, however,
463 copies of some of them have been preserved at
464 `<http://BRLTTY.app/archive/Windows/>`_.
465
466 The following software components should already be installed:
467
468 * ``MinGW`` [32-bit] (from `<http://mingw.org/>`_)
469
470 The following ``MinGW`` packages may still need to be installed:
471
472 * ``msys-bison``
473 * ``msys-dos2unix``
474 * ``msys-groff``
475 * ``msys-m4``
476 * ``msys-tar``
477 * ``msys-unzip``
478 * ``msys-wget``
479 * ``msys-zip``
480 * ``mingw32-libpdcurses``
481 * ``mingw32-pthreads-w32``
482 * ``mingw32-tcl``
483
484 The following packages should also be installed:
485
486 * ``AutoHotkey`` (from `<http://www.autohotkey.com/>`_)
487
488 The ``mkwin`` script assumes that it has been installed in
489 ``C:\Program Files (x86)\AutoHotkey``.
490 The ``-A`` (AutoHotkey) option can be used to specify another location.
491 The installer currently being used is named ``AutoHotkey104805_Install.exe``.
492
493 * ``NSIS`` (from `<http://nsis.sourceforge.net/>`_)
494
495 The ``mkwin`` script assumes that it has been installed in
496 ``C:\Program Files (x86)\NSIS``.
497 The ``-N`` (NSIS) option can be used to specify another location.
498 The installer currently being used is named ``nsis-3.0b0-setup.exe``.
499
500 * ``Python`` (from `<http://www.python.org/>`_)
501
502 The 32-bit variants are required. Version 2 or 3 may be used. If the
503 ``python`` command isn't in your command search path, or if you'd like to
504 use a different version of ``Python``, then use the ``-P`` (Python) option
505 to specify the top-level directory of the desired ``Python`` version.
506
507 * ``Cython`` (from `<http://cython.org/>`_)
508
509 A corresponding version of ``Cython`` must be installed for each version of
510 ``Python``. Each ``Cython`` version is installed within the corresponding
511 ``Python`` version's hierarchy. Install ``Cython`` with the command::
512
513 pip install cython
514
515 Some systems, either in addition to or in place of the ``pip`` command,
516 have the ``pip2`` and/or the ``pip3`` command. As you might have guessed,
517 ``pip2`` corresponds to ``Python2`` and ``pip3`` corresponds to ``Python3``.
518 It's best to use the one with the most explicit version suffix.
519
520 If the ``pip`` command isn't already included within the version of
521 ``Python`` that you're using (usually within its ``scripts`` subdirectory)
522 then you can install it from `<https://pip.pypa.io/en/stable/installing/>`_.
523
524 Copies of the files mentioned below are at
525 `<http://BRLTTY.app/archive/Windows/Cython/>`_:
526
527 + To force use of MinGW's (rather than Microsoft's) C compiler,
528 add ``distutils.cfg`` to the ``Python/lib/distutils/`` directory.
529 It should contain these lines::
530
531 [build]
532 compiler = mingw32
533
534 + If you get a message like "Unknown MS Compiler version 1900"
535 then you'll probably need to apply the patch ``patch1``
536 (from `<https://bugs.python.org/file40608/patch.diff>`_)
537 when within the ``Python/lib/distutils/`` directory::
538
539 cd Python/lib/distutils
540 patch patch1
541
542 + If you get a message like "cannot find -lvcruntime140"
543 then you'll need to add the 32-bit version of ``vcruntime140.dll``
544 (from `<http://www.dll-files.com/>`_)
545 to the ``Python/libs/`` directory.
546 You can verify that you have the 32-bit version with the ``file`` command::
547
548 file vcruntime140.dll
549 vcruntime140.dll: PE32 executable (DLL) (console) Intel 80386, for MS Windows
550
551 A message like "vcruntime140.dll: file not recognized: File format not recognized"
552 probably means that you don't have the 32-bit version of the DLL.
553
554 * ``LibUSB-Win32`` (from `<http://libusb-win32.sourceforge.net/>`_)
555
556 The ``mkwin`` script assumes that it has been installed in
557 ``C:\LibUSB-Win32``.
558 The ``-U`` (LibUSB-Win32) option can be used to specify another location.
559 The archive currently being used is named ``libusb-win32-bin-1.2.6.0.zip``.
560 Our copy of this archive has a top-level directory named ``libusb-win32-bin-1.2.6.0``.
561
562 * ``LibUSB-1.0`` (from `<http://www.libusb.org/wiki/windows_backend>`_)
563
564 The ``mkwin`` script assumes that it has been installed in
565 ``C:\LibUSB-1.0``.
566 The ``-X`` (libusbx) option can be used to specify another location.
567 The archive currently being used is named ``libusbx-1.0.18-win.7z``.
568 Our copy of this archive doesn't have a top-level directory.
569 We have an alternate copy of this archive named ``libusbx-1.0.18-win.tar.gz``.
570
571 * ``WinUSB`` (from `<http://www.libusb.org/wiki/windows_backend>`_)
572
573 The ``mkwin`` script assumes that it has been installed in
574 ``C:\WinUSB``.
575 The ``-W`` (WinUSB) option can be used to specify another location.
576 The archive currently being used is named ``winusb.zip``.
577 Our copy of this archive doesn't have a top-level directory.
578
579 * ``ICU`` (from `<http://icu-project.org/>`_)
580
581 The ``mkwin`` script assumes that it has been installed in ``C:\ICU``.
582 The ``-I`` (ICU) option can be used to specify another location.
583 The archive currently being used is named ``icu4c-53_1-Win32-msvc10.zip``.
584 Our copy of this archive has a top-level directory named ``icu``.
585 Since Windows file systems don't have case sensitive names,
586 renaming it from ``icu`` to ``ICU`` is optional.
587
588 * ``pkg-config`` (from `<http://gtk.org/download/win32.php>`_)
589
590 The archive currently being used is named ``pkg-config_0.28-1_win32.zip``.
591 Our copy of this archive doesn't have a top-level directory.
592 It should be unpacked when in MinGW's ``/mingw/`` directory.
593
594 * ``Glib`` (from `<http://gtk.org/download/win32.php>`_)
595
596 The archive currently being used is named ``glib_2.34.3-1_win32.zip``.
597 Our copy of this archive doesn't have a top-level directory.
598 It should be unpacked when in MinGW's ``/mingw/`` directory.
599
600 * ``gettext-runtime`` (from `<http://gtk.org/download/win32.php>`_)
601
602 Only install it if your MinGW installation doesn't already have it.
603 Check for the presence of a ``libintl`` DLL in MinGW's ``/mingw/bin/`` directory.
604
605 The ``mkwin`` script uses the ``lib`` command,
606 which belongs to MSVC (Microsoft Visual C++).
607 On newer Windows systems, MSVC has become
608 a component of Microsoft Visual Studio.
609 If you don't have it then you'll need to get
610 the following files from someone who does.
611 Copies of them are at `<http://BRLTTY.app/archive/Windows/MSVC/>`_.
612
613 * lib.exe
614 * link.exe
615 * mspdb100.dll
616 * msvcr100.dll
617
618 All of them should be placed within the same directory
619 (MinGW's ``/usr/local/bin/`` directory may be a good place).
620 Either add this directory to your command search path
621 or use the ``-M`` (MSVC) option to specify its location.
622
623 If you'd like to have USB support then create the symbolic links as described
624 within the MinGW instructions for using `LibUSB-Win32`_ and/or `LibUSB-1.0`_.
625 You'll also need to create ``.pc`` (pkg-config) files for them within MinGW's
626 ``/mingw/lib/pkgconfig>`` directory. The ones we've created are at
627 `<http://BRLTTY.app/archive/Windows/pkgconfig/>`_.
628
629 If you'd like to have Bluetooth support then you'll need to add
630 the files listed below to MinGW's ``/mingw/include/`` directory.
631 Copies of them are at `<http://BRLTTY.app/archive/Windows/Bluetooth/>`_.
632
633 * ws2bth.h
634 * bthdef.h
635 * bthsdpdef.h
636
637 More ``mkwin`` Options
638 ~~~~~~~~~~~~~~~~~~~~~~
639
640 ``-u`` (USB)
641 Specify which USB package is to be used. The following USB packages are
642 supported:
643
644 * libusb (for LibUSB-Win32)
645 * libusb-1.0 (for LibUSB-1.0 + WinUSB)
646
647 ``-C`` (Cygwin)
648 Specify the root (top-level) directory of a Cygwin installation.
649 If it isn't specified then ``/cygwin`` (if it exists) is assumed.
650 Cygwin's ``bin/`` directory is added to the end of the command search path
651 as a last resort for finding needed commands that MinGW may not have.
652
653 ``-s`` (shell)
654 Invoke an interactive shell just before the archive is created so that you
655 can have a look at and/or modify what it will contain. If the ``SHELL``
656 environment variable is set then that shell is used. If not, ``/bin/sh`` is
657 assumed.
658
659 ``-t`` (temporary directory)
660 Specify the temporary directory that is to be used for the build.
661 It must not already exist.
662 If it isn't specified then an internally generated path is used.
663
664 ``-k`` (keep)
665 Don't remove the temporary directory
666 at the end of a successful build.
667 It isn't removed if the build fails
668 so that you can have a look at what went wrong.
669
670 .. include:: common-options.rst
671
672 ``mkwin`` Parameters
673 ~~~~~~~~~~~~~~~~~~~~
674
675 The ``mkwin`` script accepts two parameters:
676
677 1) The path to the top-level directory of BRLTTY's source tree.
678 It may be either relative or absolute.
679 This parameter is required.
680
681 2) The build revision.
682 It may be any character sequence that doesn't include whitespace.
683 It is appended, with a prepended dash (``-``), to
684 BRLTTY's version number in order to construct the build version.
685 This parameter is optional - if it isn't specified then
686 the revision number part of the build identifier is used.
687
688 The build name is used as:
689
690 * the name of the top-level directory within the archive
691 * the file name of the archive (which has the ``.zip`` extension)
692 * the file name of the installer (which has the ``.exe`` extension)
693
694 It has the following form::
695
696 brltty-win-buildVersion-buildRevision-usbPackage
697
698 For example:
699
700 * if your current working directory is the ``Windows/`` subdirectory of
701 BRLTTY's source tree,
702
703 * if the current BRLTTY version is 5.2,
704
705 * and remembering that the default USB package is ``libusb``,
706
707 then invoking the following command::
708
709 ./mkwin .. 4
710
711 will create these files within the current working directory:
712
713 * brltty-win-5.2-4-libusb.zip (the archive)
714 * brltty-win-5.2-4-libusb.exe (the installer)
715
716 The ``winsetup`` Script
717 -----------------------
718
719 The ``winsetup`` script,
720 which can be found in the ``Windows/`` subdirectory of BRLTTY's source tree,
721 ensures that all needed components are installed on your system
722 so that `the mkwin script`_ can successfully build BRLTTY.
723
724 ``winsetup`` Options
725 ~~~~~~~~~~~~~~~~~~~~
726
727 ``-a`` (archive URL)
728 Specify the location for BRLTTY's Windows archive.
729
730 ``-d`` (dry run)
731 Don't actually install anything.
732
733 ``-k`` (keep)
734 Don't remove the temporary directory.
735
736 ``-p`` (Python directory)
737 Specify the location where Python has been installed.
738
739 ``-t`` (temporary directory)
740 Specify the temporary directory that is to be used for the installs.
741 It must not already exist.
742 If it isn't specified then an internally generated path is used.
743
744 .. include:: common-options.rst
745