mirror of
https://github.com/gnustep/tools-make.git
synced 2025-05-06 11:50:42 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@12403 72102866-910b-0410-8b05-ffd578937521
193 lines
6.2 KiB
Text
193 lines
6.2 KiB
Text
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.
|
|
|
|
The base library is not completely ported to run on MinGW yet.
|
|
In particular, anything using sockets, RunLoops and FileHandles will probably
|
|
not work.
|
|
|
|
Note for compiling with shared libraries (DLLs), it's a good idea to
|
|
remove the libobjc.a that comes with gcc (gcc -v for location) so that
|
|
it isn't accidentally found instead of the libobjc DLL that you will
|
|
compile below. Also note that, despite the statement in the GNUstep-HOWTO,
|
|
even if you have 3.x, you still need to install gnustep-objc as it properly
|
|
exports symbols for DLLs.
|
|
|
|
Note also that the //c construct for specifying paths with drives has
|
|
been depreciated. You'll need to use /cygwin/path or C: style paths now.
|
|
|
|
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.3.2 and MingW gcc 2.95.3-5. 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:
|
|
|
|
ffcall
|
|
gnustep-make
|
|
gnustep-objc
|
|
gnustep-base
|
|
|
|
See the GNUstep-HOWTO file for more information on where to get
|
|
various files. You need to build and install each package separately,
|
|
as described below.
|
|
|
|
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. Configure and compile gnustep-make.
|
|
The default location for GNUstep on Windows systems in C:/GNUstep.
|
|
To use another location you can use the --prefix argument to configure.
|
|
First, go to the 'gnustep-make' package and configure:
|
|
|
|
cd gnustep-make
|
|
./configure --target=i386-mingw32
|
|
|
|
3. 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 instead of just make).
|
|
|
|
make target=i386-mingw32
|
|
make target=i386-mingw32 install
|
|
|
|
4. Now source the GNUstep.sh file so the rest of the packages will
|
|
compile correctly:
|
|
|
|
. C:/GNUstep/System/Makefiles/GNUstep.sh
|
|
|
|
Also put this command in your shell startup script. Be sure to adjust
|
|
this path to match your real GNUstep root directory if you changed it
|
|
when configuring gnustep-make.
|
|
|
|
NOTE for WIN98 users: You should also define the environment variables
|
|
HOMEDRIVE and HOMEPATH, since these aren't defined normally.
|
|
|
|
5. Compile and install the ffcall package (Version 1.8b or above). It's
|
|
simply a C library so it requires no special tools other than the compiler.
|
|
|
|
LD=`which ld` RANLIB=/usr/bin/ranlib ./configure --target=i386-mingw32 \
|
|
--prefix=`cygpath -u $GNUSTEP_SYSTEM_ROOT`
|
|
|
|
which installs the libraries in the GNUstep directory structure (There is
|
|
a script in ffcall-1.8c and higher that automatically configures ffcall
|
|
and installs, called compile-mingw). Then
|
|
|
|
make
|
|
make install
|
|
|
|
6. Now you can compile the Objective-C runtime DLL, gnustep-objc (unless
|
|
you already have one installed):
|
|
|
|
cd gnustep-objc
|
|
make target=i386-mingw32 shared=yes
|
|
make target=i386-mingw32 shared=yes install
|
|
|
|
Make sure to remove libobjc.a that comes with gcc, otherwise it will find that
|
|
one instead of the one we want. The libobjc library that comes with gcc-3.x
|
|
MAY work if you add some extra lines to the .def file, but I won't go into
|
|
that here. It's good just to use gnustep-objc.
|
|
|
|
7. Now we can configure and build the gnustep-base library.
|
|
|
|
cd gnustep-base
|
|
./configure --target=i386-mingw32
|
|
make target=i386-mingw32 shared=yes
|
|
make target=i386-mingw32 shared=yes install
|
|
|
|
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.
|
|
|
|
./configure
|
|
|
|
(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
|
|
|
|
|
|
Problems?
|
|
---------
|
|
|
|
[1] Problems compiling ffcall with MingWs gcc? Use Cygwin gcc:
|
|
|
|
export CC="gcc -mno-cygwin"
|
|
|
|
[2] It's really important that all the libraries you link with GNUstep be
|
|
shared libraries. Even static libraries based on C (e.g. libtiff) will
|
|
prevent Objective-C modules from being loaded in Objective-C libraries.
|
|
|
|
[3] On Windows XP, at least, there are sometimes spaces in the path to the
|
|
user directory. The make program cannot deal with this. One potential solution
|
|
is to re-define the GNUSTEP_USER_ROOT location so it doesn't have spaces:
|
|
|
|
./configure --with-user-root='/home/$USERNAME/GNUstep'
|
|
|
|
is a good alternative.
|
|
|
|
Good Sites for Pre-Compiled Binaries
|
|
------------------------------------
|
|
|
|
Many libraries, etc from:
|
|
|
|
<http://sourceforge.net/project/showfiles.php?group_id=7382>
|
|
<http://penguin.at0.net/~fredo/files/old/> (for libxml2, more?)
|
|
<http://sourceforge.net/project/showfiles.php?group_id=23617> (libtiff)
|
|
|
|
MingW guile from
|
|
|
|
<http://www.textsure.net/~ela/devel.html>.
|
|
|
|
also need guile from
|
|
|
|
<http://sourceforge.net/project/showfiles.php?group_id=7382>
|
|
|
|
for guile-config file.
|
|
|
|
Author
|
|
------
|
|
|
|
Adam Fedor <fedor@gnu.org>
|