Update MinGW instructions.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@38350 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2015-02-20 05:59:04 +00:00
parent b4faf5f9dc
commit b64e214a8e
2 changed files with 314 additions and 234 deletions

View file

@ -1,3 +1,7 @@
2015-02-19 Germán Arias <germanandre@gmx.es>
* Documentation/README.MinGW: Update instructions for latest MinGW.
2015-01-19 Richard Frith-Macdonald <rfm@gnu.org>
* TestFramework/gnustep-tests.in: Report abandoned files as failed.

View file

@ -1,15 +1,15 @@
Date: 28-Feb-2007 (tested under Windows XP)
Update: 06-Mar-2010
Date: 28-Feb-2007
Update: 19-Feb-2015
Author: Nicola Pero <nicola.pero@meta-innovation.com>
after Richard Frith-Macdonald <rfm@gnu.org> and others
after Richard Frith-Macdonald <rfm@gnu.org>,
Germán Arias <germanandre@gmx.es> 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).
to use GNUstep on recent Windows operating systems.
It will get as far as explaining how to build a GNUstep application
and create a standalone version that can be shipped standalone to
@ -26,7 +26,7 @@ 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
describe how to get MinGW/MSYS up and running, and how to build
GNUstep software in this environment.
In the second part ("HOW TO SHIP YOUR GNUSTEP APPLICATION TO WINDOWS
@ -40,28 +40,21 @@ 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.
on any 3rd-party DLLs.
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
GNUstep installer. Get it from:
http://www.gnustep.org/resources/sources.html#windows
http://www.gnustep.org/windows/installer.html
If you have already installed this, you can skip to the end and just
start compiling and packaging applications! Although you may want to
@ -75,68 +68,94 @@ A. STEP BY STEP INSTALLATION INSTRUCTIONS
1. Install MinGW
================
Download MinGW-5.1.6.exe from
Download MinGW-Get-Setup.exe from
http://sourceforge.net/projects/mingw
http://sourceforge.net/projects/mingw/files/Installer/
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
Then start it up. Set the installation path to
C:\xxx\msys\1.0\mingw.
C:\xxx\
(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.
Where \xxx\ is the top-level path you want to use, I use Nicola/GNUstep so
I install it into C:\Nicola\GNUstep\. We will refer to this path as MINGWPATH.
3. Install msys developer toolkit
=================================
2. Install necessary packages
=============================
Download msysDTK-1.0.1.exe from the same site. Execute it and install
into C:/xxx/msys/1.0
MinGW create an access on the desktop to the "MinGW installer", a package
manager you can use to install packages available to MinGW. To build GNUstep
you will need many packages.
At MinGW Installer select "All packages" and then install the following
packages (bin and dev packages when correspond):
(I'm really not sure if all them are necessary)
mingw32-autoconf
mingw32-binutils
mingw32-bzip2
mingw32-gcc
mingw32-gcc-g++
mingw32-gcc-objc
mingw32-gdb
mingw32-gmp
mingw32-libbz2
mingw32-libgmp
mingw32-libiconv
mingw32-libintl
mingw32-libpthread-old
mingw32-libpthreadgc
mingw32-libtool
mingw32-libunistring
mingw32-libz
mingw32-make
mingw32-pkginfo
mingw32-pthreads-w32
mingw32-w32api
msys-base
msys-bash
msys-console
msys-crypt
msys-diffutils
msys-libcrypt
msys-libgmp
msys-libiconv
msys-libminires
msys-m4
msys-minires
msys-zlib
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.
3. Additional Useful Tools
==========================
You will need install GNUstep from Subversion, so you need a Subversion
client. I used:
http://www.sliksvn.com/pub/Slik-Subversion-1.6.9-win32.msi
and then install subversion in a random directory.
4. Additional Windows steps
You will need and editor, for example Emacs. Get a Windows version for
MinGW from:
https://www.gnu.org/software/emacs/
To install it, simply unpack it in your MINGWPATH, you can now
execute the binary in 'MINGWPATH/bin'.
3. Additional Windows steps
===========================
You may need to edit /mingw/include/winsock2.h to change the size of the
You may need to edit /MINGWPATH/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
@ -148,247 +167,304 @@ 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
4. Mount your MINGWPATH directory
=================================
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
With Emacs create a file called "fstab" in C:\MINGWPATH\msys\x.x\etc and add
a line like:
export GNUSTEP_MAKEFILES=/usr/local/share/GNUstep/Makefiles
C:\MINGWPATH /mingw
Remember MINGWPATH is the path where you installed mingw (We assume you
install it at your C: drive, if not change it). "mingw" is the name to
refer to your MINGWPATH directory inside MSYS console, you can use any other
name, but remember it because we will need this later. We will refer to this
name as MOUNTDIR.
10. Installing gnustep-objc
5. Launch the MSYS console
==========================
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
Launch the console at C:\MINGWPATH\msys\x.x\msys.bat (double click).
11. Reinstalling gnustep-make
=============================
6. Installing gnustep-make
==========================
Go in core/make and reconfigure/recompile again so that gnustep-objc
is detected:
Get gnustep-make:
make distclean
./configure --with-layout=fhs --with-thread-lib=-lpthread
make
make install
svn co http://svn.gna.org/svn/gnustep/tools/make/trunk make
gnustep-make should have detected your custom libobjc.
Then install it:
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
cd make
./configure
make
make install
mv /mingw/lib/libffi-3.0.9/include/* /mingw/include/
7. Special recommendation
=========================
In next steps don't use "make -j", because can cause problems.
8. Installing libffi
====================
Download libffi-x.x.x.tar.gz from https://sourceware.org/libffi/.
Unpack it, compile and install:
cd libffi-x.x.x
./configure --prefix=/MOUNTDIR
make
make install
mv /MOUNTDIR/lib/libffi-x.x.x/include/* /MOUNTDIR/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
==================================
9. Install ICU
==============
Download the following packages:
Download latest ICU from http://site.icu-project.org/ (zip package).
Unpack it, compile and install as fallow:
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.
cd icu/source
./runConfigureICU --disable-release MinGW --prefix=/MOUNTDIR
make
make install
14. Installing SSL support (Optional)
=====================================
10. Install GNUtls
==================
(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.
Download the latest version from the official page (windows binary). Copy
this at your MINGWPATH directory and unpack it.
15. XML support
===============
11. Install pkg-config
======================
You need to get the source code for libxml2 and build it yourself.
The best option is install pkg-config lite from:
Download the libxml2 source from http://www.xmlsoft.org.
http://sourceforge.net/projects/pkgconfiglite/files/
I used libxml2-2.7.6.tar.gz
Download latest version, unpack it an copy the files at corresponding
directories in your MINGWPATH directory.
Unpack the source, change into the directory and do the usual routine --
cd libxml2-2.7.6
12. Install xml2
================
There are available binary packages of xml, but all these don't provide an
m4 file to be used with pkg-config. And since gnustep-base use pkg-config to
detect xml we need install it from source. So download the latest version
from http://xmlsoft.org/ and install it:
cd libxml2-x.x.x
./configure --prefix=/MOUNTDIR
make
make install
13. Fix problem with mingwrt
============================
(I you are using mingw32-mingwrt-3.21.1 or above skip this step.
Run MinGW Installer to see what version are you using.)
Launch Emacs and open the file /MINGWPATH/include/unistd.h
And comment the line 95 (#include <parts/time.h>) and all the function
nanosleep (from line 104 to 117). Save the file.
14. Source GNUstep.sh
=====================
Probably you will need source the GNUstep script:
. /local/share/GNUstep/Makefiles/GNUstep.sh
15. Install gnnustep-base
=========================
Get gnustep-base:
svn co http://svn.gna.org/svn/gnustep/libs/base/trunk base
Then compile and install it:
ca base
./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.
16. Install jpeg
================
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.
Download the latest version from http://ijg.org/. Then compile and install it
as fallow:
(FIXME: Check if we can now install libxslt)
16. Installing gnustep-base
===========================
Go in gnustep-base, and type
./configure
cd jpeg-xx
autoheader
./configure --prefix=/MOUNTDIR
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. Install libtiff
===================
Download latest version from http://www.libtiff.org/. Then compile and
install it:
cd tiff-x.x.x
./configure --prefix=/MOUNTDIR
make
make install
17. Installing gui additional packages
======================================
18. Install libpng
==================
For the gui, download and install the following packages:
Download latest version from http://libpng.org/pub/png/libpng.html.
Then compile and install it:
cd lpngXXX
cp scripts/pnglibconf.h.prebuild pnglibconf.h
cp scripts/makefile.msys makefile
Launch Emacs and edit the makefile to set prefix as "prefix=/MOUNTDIR", then:
make
make install
19. Install libungif
====================
From http://gnuwin32.sourceforge.net/ download
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.
Execute it and install the package into your MINGWPATH directory.
18. Installing gnustep-gui
==========================
20. Install libao
=================
Go in the gui, and type:
Download libao from http://xiph.org/ao/. And install it:
./configure
make
make install
cd libao-x.x.x
./cofigure --prefix=/MOUNTDIR
make
make install
19. Installing gnustep-back
===========================
21. Install Aspell
==================
Go in back, and type:
Download the windows port http://aspell.net/. And
install it in your MINGWPATH directory.
./configure
make
make install
Install any other required dictionary from source (not binaries) for the
corresponding version, in this case 0.50:
cd aspell-xx-x.x
./cofigure
make
make install
20. Testing your gui installation
22. Add path to icu libraries
=============================
FIXME: Why this is needed?
Edit the file /MINGWPATH/msys/etc/profile and add the path to ICU libs:
export PATH=$PATH:/MOUNTDIR/lib
23. Install gnustep-gui
=======================
Get gnustep-gui:
svn co http://svn.gna.org/svn/gnustep/libs/gui/trunk gui
Then compile and install it:
cd gui
./configure
make
make install
24. Install gnustep-back
========================
Get gnustep-back:
svn co http://svn.gna.org/svn/gnustep/libs/back/trunk back
Then compile and install it:
cd back
./configure
make
make install
25. Install WinUXTheme (optional)
=================================
Get WinUXTheme:
svn co http://svn.gna.org/svn/gnustep/plugins/themes/WinUXTheme/ winuxtheme
Then compile and install it:
cd winuxtheme
make
make install
Set it:
defaults write NSGlobalDomain GSTheme WinUXTheme
26. Source the gnustep script when launch the console
=====================================================
Edit the file /MINGWPATH/msys/etc/profile and add this line to source the
gnustep script:
. /local/share/GNUstep/Makefiles/GNUstep.sh
27. Testing your gui installation
=================================
Get the examples:
svn co http://svn.gna.org/svn/gnustep/tests/examples/trunk/ examples
Go in a simple gui application (examples/gui a very good starting
point), compile and run it. :-)
point), compile and run it. :-). Ink and PowerPaint should work fine
on Windows, test these.
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
---------------