Installation of gcc 2.7.2.1, g77 0.5.19.1 and gpc 2.0

Japanese version is here.

The contents of this page is obsolete for recent C and Fortran compilers. If you don't need Pascal, you may want to visit EGCS project homepage.

Here described an installation sequence of latest version of gcc, g77 and gpc (GNU compilers of C, Fortran and Pascal). Summarizing it first:

  1. getting source archives.
  2. unpacking archives of gcc and gpc, and make.
  3. unpacking the g77 archive onto gcc source directory, and make.

FYI, versions of related binaries of our system are:

And I had gcc-2.7.0 installed from binary distribution.

Getting Sources

There are many many sites distributing sources of gcc and g77. You may find them everywhere, so try the nearest. Following are some major ones in Japan.

	ftp://ftp.iij.ad.jp/pub/GNU/
	ftp://ftp.iis.u-tokyo.ac.jp/GNU/

File names should be:

	gcc-2.7.2.1.tar.gz
	g77-0.5.19.1.tar.gz

Latest gpc package corresponding to gcc 2.7.2.1 is at

	ftp://ftp.hiroshima-u.ac.jp/pub/GNU/gnu-pascal/

in Japan. Master is at:

	ftp://ftp.kampi.hut.fi/jtv/gnu-pascal/

File name is

	gpc-2.0.tar.gz

Installation of gpc

For building gpc, you need gcc compiler 2.7.2.1 which does *not* include g77 extension. So make pure gcc compiler first, and make gpc with it.

  1. Unpack source archives. It is recommended to extract gcc and gpc to different directory.

    	tar zxf gcc-2.7.2.1.tar.gz
    	tar zxf gpc-2.0.tar.gz
    
  2. At first, Make pure gcc for gpc compilation. Option "--prefix" designates /usr as an install directory.

    	cd gcc-2.7.2.1
    	./configure --prefix=/usr
    	make LANGUAGES=c
    
  3. Next, make gpc. Use version 2.7.2.1 of gcc built previously.

    	cd ../gpc-2.0
    	./configure --with-gccsrc=../gcc-2.7.2.1 --with-gccbin=../gcc-2.7.2.1
    
  4. "make" and "make install" as root. Large binaries should be placed at /usr/lib/gcc-lib/i?86-unknown-linux/2.7.2.1/, and you may want to "strip" them. You may also want to "gzip" the info files, which are installed to /usr/info.

Installation of gcc and g77

  1. If you have made gpc, clean the gcc source tree as distributed.

    	cd ../gcc-2.7.2.1
    	make distclean
    	cd ..
    

    If you have not, just unpack the gcc source archives.

    	tar zxf gcc-2.7.2.1.tar.gz
    
  2. Unpack the g77 source archive. "f" directory in the archive must be placed at the root of gcc source tree. Following procedure is recommended in "INSTALL" file of g77.

    	ln -s gcc-2.7.2.1 g77-0.5.19.1
    	tar zxf g77-0.5.19.1.tar.gz
    	rm g77-0.5.19.1
    
  3. patch g77 extensions to gcc source

    	cd gcc-2.7.2.1
    	patch -p1 < f/gbe/2.7.2.1.diff
    
  4. If you already use f2c and want coexist it with g77, create a file whose name is "f2c-exists-ok" in directory gcc-2.7.2.1. On the other hand, if you want use g77 as "f77", create "f77-install-ok". It is convenient to use "touch" command. Read gcc-2.7.2.1/f/INSTALL for details.

  5. Run "configure" and "make" as follows. In the following, I designate /usr as an installation directory. Read gcc-2.7.2.1/INSTALL for more detail.

    	./configure --prefix=/usr
    	make LANGUAGES=c
    	make stage1
    	make CC="stage1/xgcc -Bstage1/" CFLAGS="-O"
    	make stage2
    	rm -rf stage1
    	make CC="stage2/xgcc -Bstage2/" CFLAGS="-O"
    

    The procedures after the 2nd line can be replaced by

    	make bootstrap
    

    if you have enough disk space.

  6. Install the binaries as root. In usual cases, it is recommended to "make compare" to check the consistency of the binaries, but it has no effect in ELF case.

    	make install CC="stage2/xgcc -Bstage2/" CFLAGS="-O"\
    	LANGUAGES="c c++ objective-c g77"
    

    In my experience, first trial of "make install" was failed in creating g77 info, but second trial (just type "make install" again) was successful. (why?)

  7. Binaries are placed at /usr/bin and /usr/lib/gcc-lib/i?86-unknown-linux/2.7.2.1.f.1/. Strip them and gzip the info files as the case of gpc.


NAKANO, Takeo nakano@apm.seikei.ac.jp
(last updated on 10 Feb 1996)

Index