This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
installing gcc3.2.1 in mac os x 10.2.2
- From: Ben Dougall <bend at freenet dot co dot uk>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 2 Jan 2003 20:12:21 +0000
- Subject: installing gcc3.2.1 in mac os x 10.2.2
INSTALL GCC 3.2.1 IN MAC OS X (10.2.2):
________________________________________________________________
fsf-gcc -v results in (the fsf- was the added prefix):
Reading specs from
/usr/opt/gcc/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/specs
Configured with: ../gccfolder/configure --enable-threads=posix
--enable-shared --prefix=/usr/opt/gcc --program-prefix=fsf-
--disable-libgcj --enable-version-specific-runtime-libs
--enable-languages=c
Thread model: posix
gcc version 3.2.1
just the c language is installed here
________________________________________________________________
(in order to be able to do this you need to download gcc from the gnu
gcc site and you already need to have installed apple's gcc that comes
with apple's developer tools cd (this is also freely downloadable if
you haven't got the cd, from apple's dev site - you need to register
with them first though but it's not too painfull))
i did this using:
os x 10.2.2 (i beleive 10.2 maybe the lowest this'll work with but i'm
not sure on that)
the july2002 version of dev tools (with the later november2002 update)
gcc-core-3.2.1.tar.gz (i picked core rather than the full one because
i'm only interested in c, not any of the other languages)
create a folder somewhere.
put the gcc folder that you've downloaded and uncompressed in that
folder just created. this folder, with the uncompressed original files
in, will be refered to here from now on as srcdir and that's how it's
refered to in other gcc documentation.
create another folder in the same folder that you just created, next to
the srcdir folder. this folder will be refered to as objdir. (the
folder names you use don't have to be literally objdir and srcdir but
they can be)
so you've got two folders - the srcdir folder that has all the
downloaded and uncompressed gcc files. and the objdir folder, both of
which are in another folder.
open the terminal application
in the terminal type:
limit stack 800
(that results in no response)
then using:
cd foldername
navigate to the empty objdir wherever you put that on your drive.
(cd=change directory).
type this (including the ../ and changing 'srcdir' to the name of the
srcdir, if you've used a different name):
../srcdir/configure --enable-threads=posix --enable-shared
--prefix=/usr/opt/gcc --program-prefix=fsf- --disable-libgcj
--enable-version-specific-runtime-libs --enable-languages=c
(skip down to the end of these instructions for a bit more about the
prefix fsf- bit)
(i guess leave off --enable-languages=c if you want all the languages?)
it'll then go through a whole series of checks which'll take a few
minutes.
a patch needs to be run before anything else.
create a text file with the following text in it:
*** gcc/ginclude/stddef.h.orig 2002-12-30 13:54:24.000000000 +0100
--- gcc/ginclude/stddef.h 2002-12-30 13:56:49.000000000 +0100
***************
*** 239,244 ****
--- 239,245 ----
#ifndef _WCHAR_T_
#ifndef _BSD_WCHAR_T_
#ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */
+ #ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */
#ifndef _WCHAR_T_DEFINED_
#ifndef _WCHAR_T_DEFINED
#ifndef _WCHAR_T_H
***************
*** 275,280 ****
--- 276,282 ----
#ifdef _BSD_RUNE_T_
#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
typedef _BSD_RUNE_T_ rune_t;
+ #define _BSD_RUNE_T_DEFINED_
#define _BSD_WCHAR_T_DEFINED_
#if defined (__FreeBSD__)
/* Why is this file so hard to maintain properly? In constrast to
***************
*** 306,311 ****
--- 308,314 ----
#endif
#endif
#endif
+ #endif
#endif /* __WCHAR_T__ */
#endif /* __wchar_t__ */
#undef __need_wchar_t
save that into the srcdir folder. then navigate yourself to the srcdir
folder in the terminal:
cd ../srcdir
if you're in the objdir folder
('cd ../' takes you up one level)
then type this in the terminal:
patch -p0 < [filename of the patch]
so if you named the patch text file as patchfile, you'd use:
patch -p0 < patchfile
in the terminal, get back to the objdir:
cd ../objdir
this part takes a *long* time for it to do. (g3 500mHz powerbook -
about an hour, maybe more). type:
make bootstrap
after that, while in the terminal, in objdir folder type:
sudo make install
you'll then be asked for your password. this is the password that you
use when installing anything in os x.
type in the password and press return.
(this part isn't necessary to installing but i found it a usefull thing
to know) - to see this installation in the finder you have to open the
'usr' folder which is hidden in os x. to open the hidden folder type in
the terminal:
open /usr
then this makes the terminal aware of this new gcc:
setenv PATH /usr/opt/gcc/bin:$PATH
(i've had trouble with the path part. it does work but is only
temporary :/ i'm sure there's an easy way to sort it out but it's only
easy if you know what to type and i don't.)
so then you can call this gcc by typing:
fsf-gcc
rather than the usual:
gcc
which accesses apple's gcc, and will still do that.
for example type (the 'fsf-' is the part specified in the configure
command near the start of these instructions. so you can probably use
whatever prefix you want):
fsf-gcc -v
to see the version info of the new gcc.