SUMMARY: How to compile GCC

From: Vivian Lee (
Date: Thu Nov 21 1996 - 21:10:39 CST

Dear all SunManager,

My original questing:

>I has a demo license of SunPro SPARC Compiler C 3.0 (will be expired on
>11 Dec 1996). Now I want to use the SPARC Compiler to compile the GCC for
>production (permenant) use.
>Can any one told me:
>1. What package(s) should I need and where can I ftp them?
>2. What is the procedure and order for compile the GCC packages and
> get it work (including support for C++)?

Thanks to the following SunManager and their suggestion also listed:

Vivian Lee.

>From: Jean-Pierre Aquilina <>
>One very good site I know of is
>This is the SunSite Northern Europe at Imperial College, London.
>There is a company that will offer you support, and from where you can
>also get a copy. The URL is:

>From: (Brett Lymn)
>You just need the gcc sources which are widely available on many
>mirror sites. If you want to use the C++ stuff then fetch glib++ as
>well these are the C++ libraries, these are not required for compiling
>gcc/g++ but they are required to build C++ programs. The sources for
>both are available on (the main GNU site).
>Follow the detailed instructions in the INSTALL document. Really, it
>is very straight forward, you run the configuration (I normally don't
>worry about any parameters for config, I just let it guess the machine
>& os to compile for - it works fine) and then do the make of which
>there are a few stages but it is all spelt out in the INSTALL document
>that comes with gcc.

>From: "Xu, Guo Miao (Hui, Kwok Miu)" <>
>You may download gcc source code at
> ftp to:

>From: "David Evans" <>
>Either download gcc, gdb and libg and read the docs (which are very
>clear) or download the binaries directly. Its available from

>From: (Brett Lymn)
>If you have the Sun compiler kit installed then all those things
>should be there. Make sure you have the SUNbtool package installed
>from the standard distribution CD, that is about all you need, that
>and make sure you have /usr/ccs/bin in your path when doing the make.
>By default gcc will try to use the standard system tools to build itself.

>From: "Yaron Hemi, Trendline LTD." <>
>First of all, you can get *precompiled* GCC for Solaris 2.5 at
> (or something like that). If you really
>want to compile your own (which is not easy or fun), you can get GCC and
>related items from
>You'll need the latest gcc, g++, libc and binutils (I think). In any
>case, there is a very good and detailed README and INSTALL guide packaged
>inside GCC's distribution.

>From: Swee-Chuan Khoo <>
>you can get one from
>all the steps are in the same packages that you downloaded.
>Get version 2.7.2

>From: Herbert Wengatz <>
>Why don't you just get a precompiled Version from the Net ?

>From: Dave Roberts <>
>GNU stuff has mirror archives all over the place, one of them is
> in /archive/system/gnu.
>I think the latest version is 2.7.2 (something like that)
>Read the README files. Edit the configuration, and essentially you simply
>make a first stage C compiler. This create a GNU C compiler out of your
>native compiler. You then use this compiler to make the code again, into
>a second stage. This time you can specify all languages including C++.
>Finally, you should use the second stage C compiler to build a 3rd stage,
>and then compare the differences between 2 and 3. If there are none, then
>you know the compilation was successful, and you can install the SECOND
>stage (2nd) compilers on your system.
>I've just done this for one of my SunOS 4.1.4 boxes, and there were no
>problems at all. I have done it on Solaris 2.5, but it was a long time
>ago, and I can't remember if there were problems.

>From: Kevin Davidson <>
>The README and INSTALL files explain in detail, but basically you do
> Untar the files.
> Decide where you want the package installed. eg /usr/local or /opt/gnu
> Run configure with appropriate arguments to install in the right
> place.
> Build gcc/g++ etc:
> make bootstrap LANGUAGES="c c++ objective-c"
> then go drink coffee for an hour or so while gcc builds itself
> make install LANGUAGES="c c++ objective-c"
> Run configure for libg++, `make' it and then `make install' it.
> There are prebuilt Solaris packages around, but they tend to be of
>out of date versions of gcc and libg++.

>From: Rich Kulawiec <>
>Both of the questions were answered just last week -- check
>the archives on the mailing list for a very complete summary
>of how you can get gcc and build it. BTW, the answer to #2
>is given at great length in the "README" that comes with gcc.

>From: (Tim Evans)
>Download the gcc source from
>Read the "INSTALL" document for instructions.

>From: (Renan Martins Baptista)
>I would like to elaborate on some topics, which is fairly eligible
>to help you:
>1. Most of the answers to your inquiries here, are in the Sun Managers
> FAQ, but not as explicit as it should be. So your questions proceed,
> thereafter.
>2. Even if your license expire, you can use the binaries of a older
> version of the onw gcc, to compile a new version. Here are the si-
> tes:
> for binaries:
> ftp site: - at /pub/gnu/sparc-sun-solaris2
> You will find a recent binary version which works fine. You can also
> use that binaries to compile the MOST recent version. You can find
> the gcc MOST recent sources at the same ftp site on directory /pub/GNU.
> On the ftp server:, you will find instructions on how
> to install at the directory pub/solaris. There's also o good FAQ, with
> all your responses.

>From: Yizhong Zhou <>
>You can get gcc from The latest version
>is, I believe. Unzip and untar it with
> gzip -cd gcc- | tar -xf -
>Then read the INSTALL file, which gives instructions on how to build it.

>From: "Steven L. Jenkins" <>
>(make sure to get in Binary mode)
>cd /pub/gnu
>get gcc-2.7.2.tar.gz
>Detailed instructions are included in the package.

>From: Alex Finkel <>
>You can get a precompiled version of GCC 2.7.2 for Solaris 2 at:

>From: (Frank Pardo)
>You can get GCC it by anonymous FTP from a number of sites. Two good USA
>sites are and Sorry, I don't know which is
>the closest site to you; it's probably in Japan somewhere...
>The latest version of GCC is At the FTP sites you will find it
>as a compressed archive named gcc- (If you want to "play
>safe", you can get a slightly older version, such as gcc-2.7.0.tar.gz.)
>Remember to download it in "binary mode".
>If you have Gnu Tar, you can uncompress and unarchive the sources in one
>step: "tar -zxvf gcc-". If you don't have Gnu Tar, first
>use gunzip to uncompress, then use tar to unarchive. Executable copies
>of gunzip are available at a number of Sun-oriented sites.
>Then print the file ./gcc- and read it carefully. It will
>tell you how to compile and install the compiler.
>Here are two problems that I had and how I solved them:
>[1] If you don't have "bison" on you system, you may have to "touch" a
>few files before you "make" GCC, to let "make" know that they're up to
>date: bi-parser.c, c-parse.c, cexp.c, and objc-parse.c (these are the
>ones that have matching *.y files in the source directory).
>[2] If you don't have "makeinfo" on your system, you may need to edit
>the Makefile before you "make install". This is what the relevant lines
>look like in my Makefile:
# Copy the compiler files into directories where they will be run.
# Install the driver last so that the window when things are
# broken is small.
install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
install-libobjc install-man lang.install-normal install-driver
# fp suppressed install-info bcs no makeinfo on this system 1996nov18mon
#=install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
#=install-libobjc install-man install-info lang.install-normal install-driv>er

>From: Laurent Duperval <laurent@Grafnetix.COM>
>You probably got some answers so I'll only reply if you tell me nothing
>worked. No use filling your mailbox with useless, duplicate info. So
>if you need help, don't hesitate.

>From: (Scott J. Bertin)
>You want to get gcc- and libg++-2.7.2 from in
>the pub/gnu directory. Compile gcc first (detailed instrucions are
>included in the package) and then use gcc to compile libg++. You may
>optionall want to get binutils-2.7 and compile it before gcc to use the
>GNU linker and assembler. gdb-4.16 is a good debugger you may want to
>get also.

>From: "Michael R. Zika" <>
>You probably want to pick up libg++ for full C++ support, maybe g77
>(Fortran compiler) and the dbg (debugger)... They are all in the
>same directory.
>You need gzip first, then gcc, then whatever other packages you want...

>Get gcc- from
>After you've unzipped and untarred it (you need to use gzip --
>available at the same location) you can follow the instructions
>in the README file. It is not too difficult.

>From: (Dave Foster)
>Don't compile anything! Just download the gcc 2.7.2 binaries in
>package format from

End of Summary.

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:16 CDT