[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GCC compiler note for GNUstep Build Guide
From: |
Gerold Rupprecht |
Subject: |
GCC compiler note for GNUstep Build Guide |
Date: |
Sat, 26 Jun 2004 17:35:42 +0200 |
User-agent: |
KMail/1.5.4 |
Dear Dennis,
Thanks for your efforts to write the GNUstep Build Guide.
I am trying to use it to get myself up and going with SuSE 9.0 on AMD/Intel.
The problem I encountered was the gcc compiler collection that is standard
with this distribution does not include the Objective-C compiler.
I found this a major obstacle. I would appreciate it if you could add a note
on this to your build guide.
The objective is to add a fully working version of gcc with as a second
compiler avoiding changing the environment for other users of the system.
The website for the GCC compiler is http://gcc.gnu.org/install and is a good
starting point to choose what options are available and how to go about
making a proper Objective-C compiler.
As my personal user (gerold) I personally downloaded the files:
binutils-2.15.tar.gz (optional host tools to build the compiler if missing)
gcc-3.5-20040530.tar.bz2,
gcc-testsuite-3.5-20040530.tar.bz2,
dejagnu-1.4.3.tar.gz
to my home directory:
/home/gerold/src
You will probably need to change the owner and group with your own for the
dejagnu-1.4.3.tar.gz file as follows:
su
Password:
chown gerold:users dejagnu-1.4.3.tar.gz
exit
bunzip2 gcc-3.5-20040530.tar.bz2
tar -xf gcc-3.5-20040530.tar
bunzip2 gcc-testsuite-3.5-20040530.tar.bz2
tar -xf gcc-testsuite-3.5-20040530.tar
tar -zxf dejagnu-1.4.3.tar.gz
tar -zxf binutils-2.15.tar.gz
For convenience I shortened the names:
mv binutils-2.15 binutils
mv gcc-3.5-20040530 gcc-3.5
Then a clean subdirectory is recommended:
mkdir /home/gerold/src/gccbuild
cd /home/gerold/src/gccbuild
where the configure script can be invoked:
../gcc-3.5/configure --prefix=/usr/local/gcc35 --srcdir=../gcc-3.5
Note the prefix instruction to customise the installation directory. This
lets you install the compiler and all its related files below the single
top-level directory, allowing multiple versions of GCC installed on the same
system (you do need to think of other users on the system).
The command:
make bootstrap
will then go through the three stage process of building your new compiler.
This is a good time to read or eat a meal as the computer will be busy for
quite some time.
Your new compiler of course should be tested to see if everything went well
using dejagnu. The programs expect and wish (tcl) should be already
installed.
Check with:
which expect
/usr/bin/expect
which wish
/usr/bin/wish
cd dejagnu-1.4.3/
./configure
make
su
Password:
make install
exit
Now dejagnu has been installed it can be used to check the new compiler as
shown (note this can take a considerable amount of time so choose the
moment):
cd /home/users/gerold/src/gccbuild
make -k check
Some of the tests will fail as your compiler will go through several torturous
tests of extreme conditions.
As a courtesy please send the test results to the gcc developers. They
appreciate the feedback by running the following:
cd /home/users/gerold/src/gcc-3.5
Note that you can add any commentary into the optional extra_info.txt file
regarding your tests.
contrib/test_summary [-p extra_info.txt] -m gcc-testresults@gcc.gnu.org ¦ /
bin/sh
Finally the new compiler can be installed :
su -
Password:
cd /home/users/gerold/src/gccbuild
make install
ldconfig -v
The last command will update the dynamic linker cache file, making the new
shared libraries available (libgcc and other language specific libraries).
Finally the correct version of gcc needs to be visible in your path, rather
than the standard one installed beforehand.
Change your startup script, in my case for a standard Suse install, .bashrc:
cp .bashrc .bashrc.original
vi .bashrc
to include the line
i
export PATH=/usr/local/gcc35/bin:${PATH}
:wq
When you open a new shell check your work:
which gcc
You should get a response similar to:
/usr/local/gcc35/bin/gcc
You are now ready to continue on the way to GNUstep.
For more elaborate options and explanations such as cross compiling see Kurt
Wall and William von Hagen's book "The Definitive Guide to GCC" ISBN (pbk):
1-59059-109-7 Copyright Apress, Springer-Verlag New York, Inc. 2004.
--
Gerold Rupprecht
3, rue Louis-Curval
CH-1206 Geneva
Switzerland
- GCC compiler note for GNUstep Build Guide,
Gerold Rupprecht <=