Next Previous Contents

7. Create gcc RPM Package

The GNU gcc rpm is the most important rpm package which you should create after successfully creating rpm of RPM package. In order to create GNU gcc rpm package, you need to install rpms, unix pkgs or manual configure and install the following (given in order of dependency) :

You should download the tar.gz files or Unix packages . I downloaded solaris packages for texinfo.pkd, fileutils.pkg, patch.pkg, libtool.pkg, gcc and others. If you download tar.gz source file then you should install them in a temporary location like $HOME/localtmp
bash# mkdir $HOME/localtmp
bash# cd $HOME/localtmp
bash# gzip -d libtool*.tar.gz
bash# tar -xvf libtool*.tar
bash# ./configure --with-prefix=$HOME/localtmp
bash# make; make install

You should include the temporary location of autoconf by:
bash# PATH=$HOME/localtmp/bin:$PATH
bash# export PATH

Now you are ready to build gcc rpm:


bash# rpm -i gcc*.src.rpm
bash# cd /usr/local/src/redhat/SPECS
bash# rpm -ba gcc*.spec

On Solaris 2.8 I had to make few changes to gcc*.spec file:
  1. In %build section : Insert --enable-hacker-mode option for configure command. This is to correct error - "This configuration not supported in solaris 2.8". If --enable-hacker-mode option does not work then you may have to comment out gcc_targetplatform within the code %ifarch sparc .... %endif, just before the configure command.
  2. In %build section : For the configure command comment out %{_target_platform}, if configure fails.
  3. In %install section: Comment out numprocs = $(getconf _NPROCESSORS) and put numprocs=1. Since my box had 2 cpus I put numprocs=2. The solaris has /usr/bin/getconf which is different from GNU getconf in glibc.
Setup shared lib in solaris:
 
solaris# cd /var/ld
solaris# man ld.so.1
solaris# man crle
solaris# crle  < hit return to see config info>
solaris# crle /usr/lib:/usr/local/lib:/usr/local/pgsql/lib:/usr/local/BerkeleyDB.3.1/lib

7.1 Solaris Sparc gcc, glibc, kernel-headers and binutils

You can download the source code rpm for sparc from sparc-gcc or go to http://www.rpmfind.net and type sparc in the search field. You can also download sparc-glibc, sparc-kernel-headers and sparc-binutils source rpms.


solaris# rpm -i sparc-gcc*.src.rpm
solaris# cd /usr/local/src/redhat/SPECS
solaris# rpm -ba sparc-gcc.spec

You may want to edit sparc-binutils.spec and in %install section: Comment out numprocs = $(getconf _NPROCESSORS) and put numprocs=1. Since my box had 2 cpus I put numprocs=2. The solaris has /usr/bin/getconf which is different from GNU getconf in glibc. Also change %files section change %doc /usr/man/man1/sparc-linux-ld.1.gz to %doc /usr/man/man1/sparc-linux-ld.1.

7.2 PowerPC gcc, glibc, kernel-headers and binutils

The PowerPC arch rpms are at http://penguinppc.org.

7.3 Create glibc RPM

If configure complains that your platform is not supported, then you may want to edit glibc.spec file and in %configure section put --enable-hacker-mode,

For Solaris there is ready-made sparc-glibc*.src.rpm from sparc-gcc or go to http://www.rpmfind.net and type sparc in the search field.

The glibc needs the sparc-kernel-headers*.rpm which you can get from sparc-gcc.


Next Previous Contents