This quick guide will allow you to install GCC 3.1 (Free Software Foundation version, not Apple's) along with the C, C++, and objective-C compilers. This is useful if you want to test out your code before Apple's release of GCC3 in Jaguar (10.2). Features of 3.1 include faster compilation, better code optimization, a new C++ library, and better support for the ANSI code standards.
However, there are some problems with this release. GCC will not recognize some compiler flags and the dynamic linker does not work with this build - you will often have to link statically and configure software with the "--disabled-" shared flag. If anyone knows how to get around these problems, feel free to post in the comments.
Read the rest of the article for the how-to (the Dev Tools are required)...
NOTE: Compiling GCC can take several hours depending on your machine's speed, so plan accordingly.
#ifndef _SIZE_T_DEFINEDAdd
#ifndef _BSD_SIZE_T_DEFINED_
#define _SIZE_T_DEFINEDAdd
#define _BSD_SIZE_T_DEFINED_ /* for Darwin */
#endif /* ___int_size_t_h */Add
#endif /* _BSD_SIZE_T_DEFINED_ */
#undef toupperAdd
/* APPLE LOCAL begin supply missing ctype.h decls 2001-07-11 sts */
/* These are supposed be in ctype.h like the standard says! We need
this until Darwin ctype.h gets fixed and/or GCC has a fixincludes
to supply these if they're missing. */
extern "C" {
extern int isalnum(int c);
extern int isalpha(int c);
extern int iscntrl(int c);
extern int isdigit(int c);
extern int isgraph(int c);
extern int islower(int c);
extern int isprint(int c);
extern int ispunct(int c);
extern int isspace(int c);
extern int isupper(int c);
extern int isxdigit(int c);
}
/* APPLE LOCAL end supply missing ctype.h decls 2001-07-11 sts */
% limit stacksize 3072
% mkdir ../gcc_build;cd ../gcc_build
% ../gcc-3.1/configure --enable-languages='c,c++,objc'
% make bootstrap-lean
% sudo make install
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020723090544155