Update for compiling with Apple gcc

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@25808 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2007-12-31 02:33:02 +00:00
parent ea9bd34f6a
commit 1a435b6e22
2 changed files with 79 additions and 106 deletions

View file

@ -1,3 +1,8 @@
2007-12-30 Adam Fedor <fedor@gnu.org>
* Documentation/README.Darwin: Update for compiling with
Apple gcc.
2007-12-26 Nicola Pero <nicola.pero@meta-innovation.com>
* Documentation/debugapp.1: Minor updates.

View file

@ -1,5 +1,5 @@
Date : 15-Jan-2004
Last update: 20070507
Last update: 20071229
Authors: Adam Fedor <fedor@gnu.org>
Quentin Mathé <qmathe@club-internet.fr>
Lars S.-Helldorf <lars.sonchocky-helldorf@hamburg.de>
@ -37,10 +37,15 @@ or:
PRELIMINAIRES
-------------
For all targets, get the following software. I'd recommend installing Fink (and
FinkCommander on Mac OS X) or MacPorts to get all this software. Make sure that
Fink or MacPorts is in your path; newer versions do a good job of doing this for
you.
For all targets, get the following software. I'd recommend installing
Fink (and FinkCommander on Mac OS X) or MacPorts to get all this
software. Make sure that Fink or MacPorts is in your path; newer
versions do a good job of doing this for you. It's quite possible for
libraries installed via Fink/Macports to conflict with Apple
libraries, which cause strange errors running GNUstep apps (like odd
crashes and seg faults). In that cause you might want to hand-compile
the libraries you need (only the tiff and libffi libraries are REALLY needed,
everything else is basically optional).
Remember you usually need root access to install software. That means when you
see an instruction like 'make install', you usually need to use sudo
@ -53,7 +58,7 @@ see an instruction like 'make install', you usually need to use sudo
libjpeg (Optional, highly recommended - don't get from fink!)
libpng (Optional, highly recommended)
libffi (Required, only contained in the GCC distributions and pyobjc)
libffi (Required, from ftp.gnustep.org/pub/gnustep/libs)
ffcall (On Darwin x86 - use instead of libffi)
Xfree86 (Required, already in Mac OS X 10.3/Darwin 7 and later)
@ -66,9 +71,9 @@ see an instruction like 'make install', you usually need to use sudo
Obtaining GNUstep
-----------------
The main GNUstep project pages tell you how to get hold of this. You can get the
latest release of the following libraries.
You need these gnustep packages:
The main GNUstep project pages tell you how to get hold of this. You
can get the latest release of the following libraries. You need these
gnustep packages:
GNUstep-make
GNUstep-base
@ -89,7 +94,7 @@ Theoretically possible are:
gnu-gnu-gnu # gnu-objc runtime with gnustep-base and gnustep-gui.
# Most widely tested.
apple-gnu-gnu # apple-objc runtime with gnustep libraries. Does
# currently not work.
# not work.
apple-apple-gnu # Apple Foundation with gnustep-gui on the top. Only of
# academic interest.
apple-apple-apple # Cocoa with GNUstep additions. For porting GNUstep apps
@ -103,11 +108,9 @@ potentially gives two different targets:
Apple GCC, gnu-gnu-gnu
FSF GCC, gnu-gnu-gnu
Unfortunately, using Apple GCC with gnu-gnu-gnu doesn't appear to work currently
(see below for more info), so this option really isn't open now. In addition,
if you are on Mac OS X, you can also use the Apple Foundation and AppKit
frameworks to do GNUstep development with Cocoa, but this only works with the
Apple compiler:
In addition, if you are on Mac OS X, you can also use the Apple
Foundation and AppKit frameworks to do GNUstep development with Cocoa,
but this only works with the Apple compiler:
Apple GCC, apple-apple-apple
@ -118,16 +121,19 @@ For GNUstep on Darwin x86, Apple GCC compiles GNUstep-base, but causes strange
problems when running programs (e.g. the program hangs while allocating memory
or executes methods multiple times). So we have to use FSF GCC. Additionally,
libffi has not been ported to Darwin x86, so you will need to install ffcall
instead.
instead. NOTE: Has not been tested in a long time...
GNUstep on Darwin PowerPC
-------------------------
You can use either the Apple compiler of the FSF compiler. For the Apple
compiler, you need at least Mac OS X 10.4 with XCode 2.5 release.
Building FSF-GCC
----------------
The easiest way to get FSF GCC is through Fink or MacPorts. If you would like to
compile by hand, follow these directions:
The easiest way to get FSF GCC is through Fink or MacPorts. If you
would like to compile by hand, follow these directions:
Darwin x86:
@ -197,8 +203,9 @@ then:
./configure --with-library-combo=gnu-gnu-gnu \
[--prefix=<GNUstep install dir>] [CC=<gcc install dir>/bin/gcc]
(apple-apple-apple is the default if you don't specify gnu-gnu-gnu). If you want
to be able to compile for different targets/platforms together. Do this:
(apple-apple-apple is the default if you don't specify
gnu-gnu-gnu). If you want to be able to compile for different
targets/platforms together. Do this:
./configure --with-library-combo=gnu-gnu-gnu --disable-flattened \
--enable-multi-platform [--prefix=<GNUstep install dir>] \
@ -209,54 +216,6 @@ Now:
make
make install
Building and installing libobjc (target Apple GCC, gnu-gnu-gnu only !!!)
-------------------------------
Warning ! Don't compile libobjc if you are using FSF GCC. Go to gnustep-objc
(or from CVS, into dev-libs/libobjc), and type:
make install
This should build and install the GNU Objective-C runtime and headers for you.
Building and installing libffi (on Darwin PowerPC only !!!)
------------------------------
Untar the GNU GCC distribution, at least a version 3.4.x (even if you are not
compiling the compiler) and:
mkdir libffi-build
cd libffi-build
<gcc-3.4.x install dir>/libffi/configure [CC=<gcc install dir>/bin/gcc]
make
make install
Note: some 3.4.x versions doesn't have a working libffi on Mac OS X / Darwin.
Use PyObjC libffi from http://pyobjc.sourceforge.net, in the case libffi
install doesn't work with the 3.4.x version.
(This libffi issue needs to be tested with the various GCC 3.4.x versions)
mkdir libffi-build
cd libffi-build
<pyobjc dir>/libffi-src/configure [CC=<gcc install dir>/bin/gcc]
make
make install
Warning ! Don't install libffi in <gcc install dir>, let it just install in
/usr/local
Building and installing ffcall (on Darwin x86 only !!!)
------------------------------
./configure --prefix=$GNUSTEP_SYSTEM_ROOT \
--libdir=$GNUSTEP_SYSTEM_ROOT/Library/Libraries \
--includedir=$GNUSTEP_SYSTEM_ROOT/Library/Headers
Now you can now build and install it simply by typing:
make
make install
Source GNUstep.sh
-----------------
@ -268,21 +227,48 @@ If you are using c shell like tcsh, type:
source <GNUstep install dir>/System/Library/Makefiles/GNUstep.csh
Building and installing libobjc (target Apple GCC, gnu-gnu-gnu only !!!)
-------------------------------
Warning ! Don't compile libobjc if you are using FSF GCC. Go to gnustep-objc
(or from CVS, into dev-libs/libobjc), and type:
make install
cd $GNUSTEP_SYSTEM_ROOT/Library/Libraries
ln -s libobjc.dylib libobjc-gnu.dylib
This should build and install the GNU Objective-C runtime and headers for you.
Building and installing libffi (on Darwin PowerPC only !!!)
------------------------------
There's no official libffi release. Get the one from the GNUstep ftp site
./configure --prefix=$GNUSTEP_SYSTEM_ROOT \
--libdir=$GNUSTEP_SYSTEM_ROOT/Library/Libraries \
--includedir=$GNUSTEP_SYSTEM_ROOT/Library/Headers
make
make install
Building and installing ffcall (on Darwin x86 only (may work on PPC))
------------------------------
./configure --prefix=$GNUSTEP_SYSTEM_ROOT \
--libdir=$GNUSTEP_SYSTEM_ROOT/Library/Libraries \
--includedir=$GNUSTEP_SYSTEM_ROOT/Library/Headers
make
make install
Building and installing GNUstep-base
------------------------------------
Go to GNUstep-base (or from CVS into the core/base directory).
If you are using the FSF GCC (with the Apple GCC which only works currently
with the apple-apple-apple library combo, you don't need to run the configure
yourself unless you need special options), type:
./configure [--with-xml-prefix=/usr] [--disable-xmltest] [--disable-do] \
[LDFLAGS=-L/sw/lib] [CPPFLAGS=-I/sw/include] [CC=<gcc install dir>/bin/gcc]
[LDFLAGS=-L/sw/lib] [CPPFLAGS=-I/sw/include] [CC=<gcc install dir>/bin/gcc] \
[CPPFLAGS=-fnested-functions]
To know which options you need to use with your environment:
--disable-xmltest is needed with the latest Mac OS X 10.3 / Darwin 7
--disable-xmltest is needed with Mac OS X 10.3 / Darwin 7
versions xml2-config tool and libxml2 headers reports differents versions,
because of this versions conflict the GNUstep xmltest fails.
@ -302,15 +288,9 @@ To know which options you need to use with your environment:
CPPFLAGS=-I/sw/include is needed when you installed libxslt with Fink and
you want to compile the base library with libxslt support.
followed when you are using the Apple GCC by:
CPPFLAGS=-fnested-functions is required when using Apple gcc
make install
Note: this should automatically run the configure script for you (in the case
you haven't done it).
otherwise (with the FSF GCC) followed by:
followed by:
make
make install
@ -325,9 +305,7 @@ Building and installing GNUstep-gui
Go to GNUstep-gui (or from CVS into the core/gui directory).
If you are using the Apple GCC (doesn't work currently) or the FSF GCC type:
./configure [CC=<gcc install dir>/bin/gcc]
./configure --disable-gsnd
followed by:
@ -336,22 +314,18 @@ followed by:
Note: The gsnd server hasn't been ported to Mac OS X / Darwin yet.
In the case configure didn't found libjpeg, use
--with-jpeg-library=<jpeg libdir> --with-jpeg-include=<jpeg include dir> to have
the libjpeg detected.
Example:
./configure --with-jpeg-library=/usr/local/lib
--with-jpeg-include=/usr/local/include
Some other configure options:
--with-jpeg-library=<jpeg libdir>
--with-jpeg-include=<jpeg include dir>
to have the libjpeg detected.
--disable-jpeg
Building and installing GNUstep-back
------------------------------------
Warning ! You must have installed X11User.pkg from the Panther install disc and
also X11SDK.pkg from the xCode Tools install disc to be able to compile
GNUstep-back under Mac OS X 10.3.
Warning ! You must have installed X11User.pkg from the Panther
install disc and also X11SDK.pkg from the xCode Tools install disc to
be able to compile GNUstep-back under Mac OS X 10.3.
If you aren't installing GNUstep under Mac OS X 10.3 / Darwin 7, you can use
XDarwin (ftp://ftp.xfree86.org/pub/XFree86/4.3.0/binaries/Darwin-ppc-6.x/) for
@ -359,7 +333,7 @@ the X server, take a look at http://www.xdarwin.org
In the back directory, type:
./configure [CC=<gcc install dir>/bin/gcc]
./configure
make
make install
@ -376,12 +350,6 @@ so that it could be found:
PATH=/sw/lib/freetype/bin:$PATH
make sure in config.make that -L/sw/lib/freetype2/lib is included before -L/usr/X11R6/lib (Adam Fedor <fedor@gnu.org>) Mac OS X 10.4 doesn't have this problem.
Then you should be able to configure back and install it:
./configure --enable-graphics=art [CC='<gcc install dir>/bin/gcc']
make
make install
You also need to have /sw/lib in your library path before running GNUstep apps
with the art backend, as it needs to find libart2, so put the above export
DYLD_LIBRARY_PATH somewhere in your .profile (or do the export before launching