public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ben Dougall <bend@freenet.co.uk>
To: gcc@gcc.gnu.org
Subject: installing gcc into os x instructions
Date: Wed, 01 Jan 2003 21:09:00 -0000	[thread overview]
Message-ID: <4AD4FBBE-1DCD-11D7-8FE8-0030653F9ECE@freenet.co.uk> (raw)

HOW TO INSTALL GCC IN MAC OS X:

(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 about prefix)
(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

to make the gnu gcc available from the terminal with one command type:
setenv PATH /usr/opt/bin:$PATH

then to call this gcc, the command is:
fsf-gcc

rather than the usual:
gcc
which accesses apple's gcc

for example type (which is 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.

             reply	other threads:[~2003-01-01 21:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-01 21:09 Ben Dougall [this message]
2003-01-01 21:38 ` DELETE THIS " Ben Dougall
2003-01-01 23:04 Ben Dougall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AD4FBBE-1DCD-11D7-8FE8-0030653F9ECE@freenet.co.uk \
    --to=bend@freenet.co.uk \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).