tools-make/Documentation/README.MinGW

124 lines
4.3 KiB
Text
Raw Normal View History

Compiling GNUstep on 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 has only partially been ported to MinGW
so expect some problems when trying to compile. Also, there are still
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.
MinGW on Cygwin
---------------
This is the only configuration I've tested so far. This method
uses the Cygwin tools to help out with the configuration and
compilation of the libraries. It's always good to get the very latest
version of Cygwin and MinGW. These instructions were performed with
Cygwin DLL 1.1.4 and MingW gcc 2.95.2-1. If you have more experience
with MinGW than me, please help improve these instructions!
I assume you have installed Cygwin and MinGW, and dowloaded and
unpacked the GNUstep packages. You also need to download a version of
the Objective-C runtime (e.g. gnustep-objc) that compiles as a shared
library (DLL). See the GNUstep-HOWTO file for more information on
where to get various files.
1. First, start up a Cygwin BASH shell and make sure the MinGW tools
are in your path:
export PATH=//c/mingw/bin:$PATH
(Put in whatever path you have for the mingw tools).
2. The default location for GNUstep on Unix systems in /usr/GNUstep, but
there is no default for Windows machines, so you need to set that up
first with the GNUSTEP_SYSTEM_ROOT environment variable. To put it in
a similar location, you might try:
export GNUSTEP_SYSTEM_ROOT=//c/mingw/GNUstep/System
But you can put it anywhere you like (as long as you specify the full
path with the disk label so MinGW can find it). You can also specify this
with configure, using the --prefix=//c/mingw/GNUstep/System option.
3. You need to build and install each sub-package separately. So
first, go to the 'gnustep-make' package and configure:
cd gnustep-make
./configure --target=i386-mingw32
4. Now build the gnustep-make package. Occationally, the make that comes
with MinGW doesn't like the way GNUstep makefiles are setup (or perhaps
it's that MingW make doesn't work with bash), so you can try
using Cygwin's make instead:
/usr/bin/make target=i386-mingw32
/usr/bin/make target=i386-mingw32 install
5. Now source the GNUstep.sh file so the rest of the packages will
compile correctly:
. $GNUSTEP_SYSTEM_ROOT/Makefiles/GNUstep.sh
6. Now you can compile the Objective-C runtime DLL (unless you already
have one installed). First edit the GNUmakefile and set the THREADING
variable to 'win32'. Then:
cd gnustep-objc
/usr/bin/make target=i386-mingw32 shared=yes
/usr/bin/make target=i386-mingw32 shared=yes install
7. Now we can configure and build the gnustep-base library.
cd gnustep-base
./configure --target=i386-mingw32
/usr/bin/make target=i386-mingw32 shared=yes
/usr/bin/make target=i386-mingw32 shared=yes install
Note that the base library is not completely ported to run on MinGW yet.
In particular, anything using sockets, RunLoops and FileHandles.
Alos, the gnustep-base DLL doesn't seem to be set up correctly.
To compile the gstep-base as a static library, use:
/usr/bin/make shared=no target=i386-mingw32
If you get tired of typing "target=i386-mingw32" all the time, then before
you exec the GNUstep.sh script, just set the GNUSTEP_HOST:
export GNUSTEP_HOST=i586-pc-mingw32
. $GNUSTEP_SYSTEM_ROOT/Makefiles/GNUstep.sh
Native MinGW
------------
(Information provided by Craig Miskell)
So far, this configuration only works when compiling the Makefile package
(gnustep-make). It should, in the future work on the libraries. First, you
need to get a port of sh (probably zsh) for Windows
(ftp://ftp.blarg.net/users/amol/).
1. Make sure $HOST_CC or $CC is set to MinGW's gcc. The default seems to be
wrong.
2. Now configure. You may need to set the installation directory, because
the default installation dir is for Unix machines:
./configure --prefix=/usr/GNUstep/System
(Make sure the drive is specified correctly in the path).
3. Then make and install
make
make install
4. Now source the GNUstep.sh file so the rest of the packages will
compile correctly:
. $GNUSTEP_SYSTEM_ROOT/Makefiles/GNUstep.sh