ObjFW  Check-in [c553a24d31]

Overview
Comment:README-WINDOWS.md: Complete rewrite for MSYS2

MSYS2 is currently the best way to use MinGW on Windows and also the
best way to keep it up to date. It offers Win64 support as well and can
be used to install a lot of useful tools, for example Git, and usually
has quite recent versions of all packages.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c553a24d31ef85bf98b2595e36504ea923b4a51a7d50259928c65cee6e4debe2
User & Date: js on 2015-02-01 11:37:12
Other Links: manifest | tags
Context
2015-02-01
11:48
ObjFW.xcodeproj: Increase LastUpgradeCheck check-in: 5318593192 user: js tags: trunk
11:37
README-WINDOWS.md: Complete rewrite for MSYS2 check-in: c553a24d31 user: js tags: trunk
00:47
Reduce code size for OF_UNRECOGNIZED_SELECTOR check-in: e0c84651d6 user: js tags: trunk
Changes

Modified README-WINDOWS.md from [d219066df7] to [ca2228e45c].

1
2
3
4
5
6
7
8
9

10
11
12
13


14
15
16
17

18
19
20



21
22
23
24
25
26

27
28
29
30
31
32
33
34
35
36
37
38

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
64

65


66
67
68
69

70
71
72
73
74

ObjFW on Windows
================

This file contains instructions on how to get a working build environment to
compile and use ObjFW on Windows.


Prerequisites
=============


The first thing you need to install is MinGW. If you already have MinGW
installed, please *remove* it! ObjFW needs a GCC that emits DWARF-2 exception
handling code. SjLj is *not* supported, and this is what most MinGW builds use.




Installation
============


TDM-GCC
-------




Instead of using the official MinGW builds, we're going to use the TDM-GCC
builds, as these contain a version emitting DWARF-2 exception handling code.
Even when using TDM-GCC, most builds will output SjLj exceptions. This is why
we are going to use this
[installer](http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-webdl.exe/download).


After downloading and starting the installer, we choose to create a new
installation. In the next step, the installer asks whether we want a
`MinGW/TDM` installation or a `MinGW-w64/TDM64 Experimental` installation. It
is very important to choose the `MinGW/TDM` installation, as `MinGW-w64/TDM64`
does *not* include GCC versions that output DWARF-2 exceptions! When asked for
an installation path, it is recommended to keep the default of `C:\MinGW32`;
the selected mirror does not really matter. After that, the components to be
installed have to be selected. Select `TDM-GCC Recommended, C/C++` as
installation type, then expand `Components` → `gcc` → `Version` and select the
TDM-GCC version ending in -dw2 and enable the `objc` checkbox. In the next step
the installer will start downloading and installing the selected components.



MSys
----

Next, we're going to install MSys. To do so, we're going to use the official
MinGW installer, but we are *not* going to install MinGW with it, so follow
these steps carefully. First, go to the [SourceForge download page for the
MinGW installer](http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/)
and select the latest version. Get the .exe file there. When you launch it,
select the same installation path you selected for TDM-GCC before. After
selecting the installation directory, *deselect* all compilers and select
*only* `MSYS Basic System` and `MinGW Developer ToolKit`. Make sure `MinGW
Compiler Suite` is white and not grey! The installation progress bar will be
completely filled after a short while and it will appear to hang - this is
*not* the case. When it reaches that step, it starts downloading the required
files and installs them. Just give it some time.



Building ObjFW
==============

Building ObjFW for Windows works pretty much the same way it works on any other
operating system. The only thing you need to pay attention to is that the
TDM-GCC binary is called gcc-dw2. So all you need to do is `export OBJC=gcc-dw2`
before executing the usual `./autogen.sh && ./configure && make install`.





Troubleshooting
===============


If you are getting errors about no threads being available when typing `make`,
you've hit a bug present in some versions of Git for Windows. If you delete
your checkout and get a
[tarball](https://webkeks.org/git/?p=objfw.git;a=snapshot;h=HEAD;sf=tgz), it
should work.




|
|


|
<
>

|
|
|
>
>


|
<
>

<
<
>
>
>

<
<
<
|
|
>

|
|
|
|
|
|
|
|
|
|
|
>


|
|

|
|
|
|
|
|
|
|
|
|
|
<

>

|
|

|
<
<
<
>

>
>

|
<

>
|
|
|
|
|
>
1
2
3
4
5
6
7
8

9
10
11
12
13
14
15
16
17
18

19
20


21
22
23
24



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

57
58
59
60
61
62
63



64
65
66
67
68
69

70
71
72
73
74
75
76
77
ObjFW on Windows
================

  This file contains instructions on how to get a working build environment to
  compile and use ObjFW on Windows.


Getting MSYS2

-------------

  The first thing to install is [MSYS2](https://msys2.github.io) to provide a
  basic UNIX-like environment for Windows. Unfortunately, the binaries are not
  signed and there is no way to verify their integrity, so only download this
  from a trusted connection. Everything else you will download using MSYS2
  later will be cryptographically signed.


Updating MSYS2

--------------



  The first thing to do is updating MSYS2. It is important to update things in
  a certain order, as `pacman` (the package manager MSYS2 uses, which comes
  from ArchLinux) does not know about a few things that are special on Windows.




  First, update the mirror list:

    $ pacman -Sy pacman-mirrors

  Then proceed to update the `msys2-runtime` itself, `bash` and `pacman`:

    $ pacman -S msys2-runtime bash pacman

  Now close the current window and restart MSYS2, as the current window is now
  defunct. In a new MSYS2 window, update the rest of MSYS2:

    $ pacman -Su

  Now you have a fully updated MSYS2. Whenever you want to update MSYS2,
  proceed in this order. Notice that the first `pacman` invocation includes
  `-y` to actually fetch a new list of packages.


Installing MinGW-w64 using MSYS2
--------------------------------

  Now it's time to install MinGW-w64. If you want to build 32 bit binaries:

    $ pacman -S mingw-w64-i686-gcc-objc

  For 64 bit binaries:

    $ pacman -S mingw-w64-x86_64-gcc-objc

  There is nothing wrong with installing them both, as MSYS2 has created two
  entries in your start menu: MinGW-w64 Win32 Shell and MinGW-w64 Win64 Shell.
  So if you want to build for 32 or 64 bit, you just start the correct shell.


  Finally, install a few more things needed to build ObjFW:

    $ pacman -S autoconf automake git make


Getting, building and installing ObjFW



--------------------------------------

  Start the MinGW-w64 Win32 or Win64 Shell (depening on what version you want
  to build) and check out ObjFW:

    $ git clone https://webkeks.org/git/objfw.git


  You can also download a release tarball if you want. Now go to the newly
  checked out repository and build and install it:

    $ ./autogen.sh && ./configure && make -j16 install

  If everything was successfully, you can now build projects using ObjFW for
  Windows using the normal `objfw-compile` and friends.