This file is indexed.

/usr/share/GNUstep/Documentation/User/GNUstep/README.MinGW is in gnustep-make-doc 2.6.2-2.1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
Date:	28-Feb-2007 (tested under Windows XP)
Update: 06-Mar-2010
Author: Nicola Pero <nicola.pero@meta-innovation.com>
        after Richard Frith-Macdonald <rfm@gnu.org> and others


PURPOSE
-------

This document is intended to provide a step by step instruction on how
to use GNUstep on recent Windows operating systems (XP, 2000, and
probably NT).

It will get as far as explaining how to build a GNUstep application
and create a standalone version that can be shipped standalone to
Windows end users.

The recommended way to get GNUstep working on Windows is to use MinGW
and MSYS to get a Unix-like environment where you can easily build
your GNUstep software (this is what is described in this file).

Software built in the MinGW/MSYS environment is native Windows
software that you can then run without having to rely on the environment
you used to build.

So, this document is divided in two parts.

In the first part ("STEP BY STEP INSTALLATION INSTRUCTIONS"), we will
describe how to get MSYS/MinGW up and running, and how to build
GNUstep software in this environment.

In the second part ("HOW TO SHIP YOUR GNUSTEP APPLICATION TO WINDOWS
USERS"), we'll show an example of how to package (and use) the .exes,
.dlls and resources (that you can build using the environment
described in the first part) as Windows standalone binaries.


INTRODUCTION TO MINGW
---------------------

MinGW is a collection of header files and import libraries that allow
one to use GCC and produce native Windows32 programs that do not rely
on any 3rd-party DLLs.  GNUstep's port to MinGW is recent so expect
some occasional problems when trying to compile things.  Also, there
are still occasional subtle problems with running GNU tools on
Windows, so any problems you may encounter may just as easly have to
do with the compilation tools you are using as with GNUstep.

MSYS is a very much cut down version of the Cygwin environment ...
providing a minimal set of tools needed to build programs using
MingGW.  If you wish to build for MinGW by cross-compiling from a
Cygwin environment, please read README.Cygwin instead.

The gui library is only partially ported to run under MinGW. The look
and behavior may not be consistent.  Contributions are welcome.


PRELIMINARIES
-------------

One way to vastly simplify installing GNUstep, is to use the Windows-based
GNUstep installer.  Get it from

http://www.gnustep.org/resources/sources.html#windows

If you have already installed this, you can skip to the end and just
start compiling and packaging applications!  Although you may want to
read the rest of the instructions for other helpful information.



A. STEP BY STEP INSTALLATION INSTRUCTIONS
-----------------------------------------

1. Install MinGW
================

Download MinGW-5.1.6.exe from 

 http://sourceforge.net/projects/mingw

Then start it up.  Select 'Current' as the package version to install.
Then select 'MinGW Base Tools', 'Objective-C Compiler' and 'MinGW
Make' as packages to install.  Set the installation path to

C:\xxx\msys\1.0\mingw.

(where \xxx\ is the top-level path you want to use, I use Nicola/GNUstep so
I install it into C:\Nicola\GNUstep\msys\1.0\mingw)

PS: Earlier versions of MinGW might not work.

2. Install msys
===============

Download MSYS-1.0.11.exe following the links in
http://www.mingw.org/download.shtml.  Execute and install it into
C:/xxx/msys/1.0

The postinstall script should ask you for the mingw location, then
detect it and be happy that it's there and all is setup properly.


3. Install msys developer toolkit
=================================

Download msysDTK-1.0.1.exe from the same site.  Execute it and install
into C:/xxx/msys/1.0


Now your MSYS/MinGW system should be setup!  There should be an icon
on your desktop called 'MSYS'.  Double-clicking on it will launch a
Unix-like shell.  Go around and make sure you know how to use it.  Log
into it and work in it.


4. Additional Windows steps
===========================

You may need to edit /mingw/include/winsock2.h to change the size of the
sa_data field in the sockaddr structure from 14 to 22 ... this is because
some versions of Windows have changed the layout of this structure.
This modification may be needed to be able to correctly determine the
network interface details for your machine.

It's a good idea to remove the libobjc.a and libobjc.la and
include/objc headers that come with gcc (gcc -v for location) so that
they are not accidentally found instead of the libobjc DLL that you
will compile below.  This is what I did to remove them:

rm -Rf /mingw/lib/gcc/mingw32/3.4.5/include/objc
rm -Rf /mingw/lib/libobjc.a
rm -Rf /mingw/lib/libobjc.la

Now you can open a window containg a shell by choosing MSYS from the
start menu.

From this window we can now start building things.


On Windows Vista and later, an additional problem has been reported
where 'make install' would sometimes fail because of permission
problems.  The problem is discussed here --

http://lists.gnu.org/archive/html/gnustep-dev/2010-06/msg00055.html

you may have to install the additional MinGW files, as explained
there.


5. Additional Useful Tools [Optional]
=====================================

If you want to install GNUstep from Subversion, you need a Subversion
client.  I used
http://www.sliksvn.com/pub/Slik-Subversion-1.6.9-win32.msi and then
installed subversion in a random directory.  Then you can run svn.exe
from the MS-DOS console (or the MSYS one).

If you need Emacs, get a Windows version from
ftp://ftp.gnu.org/gnu/emacs/windows/emacs-23.1-bin-i386.zip.  To
install it, simply unpack it in your home directory, you can now
execute the binary in 'bin'.


6. Installing pthreads
======================

GNUstep-base now requires a pthreads API.  So you'll have to get one
and install it (if you're using an old version of gnustep-base, this
may not be necessary).

Get

 libpthreads-2.8.0-3-mingw32-dll-2.tar.lzma
 pthreads-w32-2.8.0-3-minfw32-dev.tar.lzma

from 

 http://sourceforge.net/projects/mingw

Uncompress them in your mingw tree --

mv libpthreads-2.8.0-3-mingw32-dll-2.tar.lzma /mingw
mv  pthreads-w32-2.8.0-3-minfw32-dev.tar.lzma /mingw
cd /mingw
tar --extract --verbose --lzma --file libpthreads-2.8.0-3-mingw32-dll-2.tar.lzma
tar --extract --verbose --lzma --file pthreads-w32-2.8.0-3-minfw32-dev.tar.lzma


7. Obtaining GNUstep
====================

The main GNUstep project pages tell you how to get hold of this. You
can get the latest release of the libraries. However, since MinGW
support is currently evolving, we recommend that you get the latest
snapshot or code from SVN.

svn co http://svn.gna.org/svn/gnustep/modules/core


8. Installing gnustep-make
==========================

go in core/make and do 

./configure --with-layout=fhs --with-thread-lib=-lpthread
make
make install

The reason we recommend using the 'fhs' layout is that if do this, you
don't need to do anything to set up your environment.  You could use
the standard 'gnustep' layout instead, in which case you need to
source GNUstep.sh to run stuff.

We also need to force -lpthread which is not currently the default on
Windows.


9. setup your GNUstep environment
=================================

Nothing to do here since we're using the fhs native layout.
But if at some point something doesn't work for you, try using

export GNUSTEP_MAKEFILES=/usr/local/share/GNUstep/Makefiles


10. Installing gnustep-objc
==========================

Download gnustep-libobjc (you can find it at
http://www.gnustep.org/resources/downloads.php, or use subversion:
svn co http://svn.gna.org/svn/gnustep/libs/libobjc/trunk),
and compile it:

make THREADING=posix
make THREADING=posix install


11. Reinstalling gnustep-make
=============================

Go in core/make and reconfigure/recompile again so that gnustep-objc
is detected:

make distclean
./configure --with-layout=fhs --with-thread-lib=-lpthread
make 
make install

gnustep-make should have detected your custom libobjc.


12. Installing libffi
=====================

Download libffi-3.0.9.tar.gz from the GNUstep website, unpack it, compile and install:

cd libffi-3.0.9
./configure --prefix=/mingw
make
make install
mv /mingw/lib/libffi-3.0.9/include/* /mingw/include/

(if you get a popup about contest.exe failing, just ignore it)
NB. The headers have to be moved manually because the package won't install
them in the right place.


13. Installing additional packages
==================================

Download the following packages:

 libintl-0.14.4.exe
 libiconv-1.9.2-1.exe
 zlib-1.2.3.exe

from http://gnuwin32.sourceforge.net, and install them.  To install
them, execute the installer, and select C:\xxx\msys\1.0\mingw\ as the
installation directory.  Do a full install and do not create any
shortcuts in the menu or desktop.


14. Installing SSL support (Optional)
=====================================

(Optional) if you want to use the SSL support built in gnustep-base
(for example, so that gnustep-base can access https:// URLs), you need
an SSL package.  You can use gnutls (the default), or openssl.

If you want to use gnutls, then download gnutls-2.2.1.exe from
http://josefsson.org/gnutls4win and install it, browsing to the
msys/1.0/mingw directory and then taking care to remove the trailing
gnutls-2.2.1 which appears in the 'Destination Folder' path, before
clicking 'Next' and 'Install'.  This should result in the correct
files being installed in each of the bin lib and include
subdirectories so that they can be found by gnustep-base-2.1.15 or
later.

TODO: OpenSSL instructions.


15. XML support
===============

You need to get the source code for libxml2 and  build it yourself.

Download the libxml2 source from http://www.xmlsoft.org.

I used libxml2-2.7.6.tar.gz

Unpack the source, change into the directory and do the usual routine --

cd libxml2-2.7.6
./configure
make
make install

(you can safely ignore the warning about not being able to remove
libtoolT during configure).

You should now have libxml2 installed on your system.

IMPORTANT: Do *not* install libxslt.  It has been reported that
libxslt is currently built in the wrong way and will prevent anything
from linking correctly if you try to use it.

(FIXME: Check if we can now install libxslt)


16. Installing gnustep-base
===========================

Go in gnustep-base, and type 

./configure
make
make install

At this point, you should be able to compile and run any non-gui tool
and library (to check this try, for example, 'defaults read').  The
next steps are only required for gui applications.


17. Installing gui additional packages
======================================

For the gui, download and install the following packages:

  jpeg-6b-4.exe
  tiff-3.8.2-1.exe
  libpng-1.2.37-setup.exe
  libungif-4.1.4-1.exe

The process is always the same: download the exe file from the
gnuwin32 website, execute it and install the package into
C:\xxx\msys\1.0\mingw.


18. Installing gnustep-gui
==========================

Go in the gui, and type:

  ./configure
  make
  make install


19. Installing gnustep-back
===========================

Go in back, and type:

  ./configure
  make
  make install


20. Testing your gui installation
=================================

Go in a simple gui application (examples/gui a very good starting
point), compile and run it. :-)

Additionally, you might want to compile and run Gorm or other GNUstep
applications.  Gorm (and hopefully other GNUstep applications too)
should compile and run out of the box.

Troubleshooting
---------------

Issues with updating:
Before attempting to update your GNUstep installation, be sure to stop/kill
all running GNUstep programs or services (i.e. gdomap, gdnc, gpbs) since
Windows cannot overwrite files that are currently in use.

Where we specify specific versions of packages to be used, we have
tested with those versions - later or earlier versions may work, but
may well not.  Generally earlier versions should be assumed not to
work.



B. HOW TO SHIP YOUR GNUSTEP APPLICATION TO WINDOWS USERS
--------------------------------------------------------

You probably want to ship your Windows application as a standalone
.zip file that Windows users can easily download and use.

We will explain what to do with an example: that of packaging
Gomoku.app.  We will first build the application (creating
Gomoku.app), then we'll add to to it all the GNUstep DLLs and
resources that are needed to run the application, and we'll end up
with a single directory, Gomoku.app, that contains a program
(Gomoku.exe) and a bunch of DLLs and various other resources required
to run the program.

The end user just needs to get this directory (from a .zip or .tgz
file, for example) and can double-click on Gomoku.exe to start the
program (no GNUstep installation required).


1. Build the application
========================

Build your application (Gomoku.app in this example) in your
MinGW/GNUstep environment.  Generally, this means getting the source
code and typing 'make' in it.  If you're trying to follow the
Gomoku.app example, the source code is here:

http://www.gnustep.it/nicola/Applications/Gomoku/index.html

Once you have built it, make sure you can run your application from
within mingw by using 'openapp', as in 'openapp ./Gomoku.app'.

2. Copy your application somewhere
==================================

Now take your built application and copy it somewhere -- we'll be
working on it!  Eg, I just copy it in my home directory.

cp -R /home/Nico/Gomoku-1.2.8/Gomoku.app /home/Nico/


3. Copy DLLs into your application
==================================

Now search for MinGW/GNUstep DLL files in /bin and /local/bin, and
copy them all into Gomoku.app:

cp $(find /bin -name *.dll) /home/Nico/Gomoku.app/
cp $(find /local/bin -name *.dll) /home/Nico/Gomoku.app/


4. Copy your GNUstep Library folder
===================================

Now copy all of the GNUstep resources into the application --

mkdir -p /home/Nicola/Gomoku.app/GNUstep/
cp -R /usr/local/lib/GNUstep/* /home/Nico/Gomoku.app/GNUstep/

I put them all into Gomoku.app/GNUstep/, which means that later on
I'll set up the GNUstep.conf file to map GNUSTEP_*_LIBRARY to that
directory.


5. Copy key GNUstep binary programs
===================================

mkdir -p /home/Nicola/Gomoku.app/GNUstep/Tools/
cp /local/bin/gpbs.exe /home/Nicola/Gomoku.app/GNUstep/Tools
cp /local/bin/gdnc.exe /home/Nicola/Gomoku.app/GNUstep/Tools
cp /local/bin/gdomap.exe /home/Nicola/Gomoku.app/GNUstep/Tools
cp /local/bin/make_services.exe /home/Nicola/Gomoku.app/GNUstep/Tools

I put them all into Gomoku.app/GNUStep/Tools, which means that later
on I'll set up the GNUstep.conf file to map GNUSTEP_*_TOOLS to that
directory.


6. Add a GNUstep.conf
=====================

You need to add a Gomoku.app/GNUstep.conf file to tell gnustep-base
where to find things inside Gomoku.app -- here is the one I use (which
matches the locations where I copied things in the previous steps) --

GNUSTEP_USER_CONFIG_FILE=.GNUstep.conf
GNUSTEP_USER_DIR=GNUstep
GNUSTEP_USER_DEFAULTS_DIR=GNUstep/Defaults

GNUSTEP_SYSTEM_APPS=./GNUstep/Apps
GNUSTEP_SYSTEM_ADMIN_APPS=./GNUstep/Apps
GNUSTEP_SYSTEM_TOOLS=./GNUstep/Tools
GNUSTEP_SYSTEM_ADMIN_TOOLS=./GNUstep/Tools
GNUSTEP_SYSTEM_LIBRARY=./GNUstep
GNUSTEP_SYSTEM_HEADERS=./GNUstep/Headers
GNUSTEP_SYSTEM_LIBRARIES=./GNUstep/Libraries
GNUSTEP_SYSTEM_DOC=./GNUstep/Documentation
GNUSTEP_SYSTEM_DOC_MAN=./GNUstep/Documentation/man
GNUSTEP_SYSTEM_DOC_INFO=./GNUstep/Documentation/info

GNUSTEP_NETWORK_APPS=./GNUstep/Apps
GNUSTEP_NETWORK_ADMIN_APPS=./GNUstep/Apps
GNUSTEP_NETWORK_TOOLS=./GNUstep/Tools
GNUSTEP_NETWORK_ADMIN_TOOLS=./GNUstep/Tools
GNUSTEP_NETWORK_LIBRARY=./GNUstep
GNUSTEP_NETWORK_HEADERS=./GNUstep/Headers
GNUSTEP_NETWORK_LIBRARIES=./GNUstep/Libraries
GNUSTEP_NETWORK_DOC=./GNUstep/Documentation
GNUSTEP_NETWORK_DOC_MAN=./GNUstep/Documentation/man
GNUSTEP_NETWORK_DOC_INFO=./GNUstep/Documentation/info

GNUSTEP_LOCAL_APPS=./GNUstep/Apps
GNUSTEP_LOCAL_ADMIN_APPS=./GNUstep/Apps
GNUSTEP_LOCAL_TOOLS=./GNUstep/Tools
GNUSTEP_LOCAL_ADMIN_TOOLS=./GNUstep/Tools
GNUSTEP_LOCAL_LIBRARY=./GNUstep
GNUSTEP_LOCAL_HEADERS=./GNUstep/Headers
GNUSTEP_LOCAL_LIBRARIES=./GNUstep/Libraries
GNUSTEP_LOCAL_DOC=./GNUstep/Documentation
GNUSTEP_LOCAL_DOC_MAN=./GNUstep/Documentation/man
GNUSTEP_LOCAL_DOC_INFO=./GNUstep/Documentation/info

So, just copy and paste this code into a GNUstep.conf file that you
put into /home/Nico/Gomoku.app/GNUstep.conf.


7. Now the application should be working
========================================

At this stage, everything should be working "standalone".

By that we mean that if you give your Gomoku.app/ to a Windows user
(with no GNUstep installed on their machine), they should be able to
run it by just double-clicking on the Gomoku executable inside of the
Gomoku.app/ directory! :-)

Try it out and make sure that it works.


8. Cleanup
==========

If you look at your Gomoku.app/ directory, you will see that it is
really big.  We mass-copied stuff from the GNUstep/MinGW directories;
but generally, you want to make sure you remove anything that you
don't strictly need.  So go in there and remove anything that you
don't need.

First thing, you should remove the MSYS libraries, which we never use --

rm Gomoku.app/msys-1.0.dll
rm Gomoku.app/msysltdl-3.dll
rm Gomoku.app/libW11.dll
rm Gomoku.app/libperl.dll
rm Gomoku.app/librle3.dll

Then, remove any additional library that your application doesn't use;
for example, I removed --

rm Gomoku.app/Renaissance.dll
rm Gomoku.app/ProjectCenter.dll

Finally, remove Apps and other stuff that you might have copied from
the general GNUstep installation --

rm -Rf Gomoku.app/GNUstep/Apps
rm -Rf Gomoku.app/GNUstep/Frameworks/ProjectCenter.framework

Generally, you may want to build the whole stuff making sure you only
include what you strictly need.


9. Stripping
============

The resulting directory might still be pretty big.  If you are trying
to distribute it over the internet, your users will probably
appreciate if you stripped it, removing symbols.  Just run 'strip'
on all the .exe and .dll files in your application.

strip $(find /home/Nico/Gomoku.app/ -name '*.exe')
strip $(find /home/Nico/Gomoku.app/ -name '*.dll')

That will reduce the size a lot.  If you're not distributing it over
the internet, you might be happy leaving the symbols in though.


10. Checking Licenses
====================

Finally, before deployment, you need to realize that you are shipping
a lot of GNUstep (and non-GNUstep) software with your application.

This is fine, just make sure you are aware of the licenses, and that
you comply with them.


PACKAGING/WINDOWS TODOS
-----------------------

The gdnc, gpbs processes are somehow a bit of a pain.  They are
automatically started when you start your application, but they are
not automatically stopped when you quit it.  This might have bad
consequences, eg, if you are using your application from a USB flash
disk, Windows doesn't let you unplug the USB disk while gdnc/gpbs are
running, because they are running from the disk!

Also, it's not clear what happens if you have two or three such
GNUstep apps downloaded from the web and you try to run them at the
same time.  What about gdomap etc ?