GCC How to Install (caller fixed version)


日本語

how to install gcc

$TOPDIR: directory for build
$PREFIX: directory for install
$TARGET (=mips-rmt-elf) target for cross compile

environment

setting



	$mkdir $TOPDIR
	$SHELL=/bin/bash
	$PREFIX="installdir"
	$TARGET=mips-rmt-elf
	$cd $TOPDIR
	$tar -xvzf gcc-rmt-fixed.1.0.5.tar.gz
	$tar -xvzf binutils-rmt-fixed.1.0.5.tar.gz
	$tar -xvzf newlib-rmt-1.0.1.tar.gz
	
	

install binutils



	$mkdir build-binutils
	$cd build-binutils

	### configure ###
	$../binutils-2.17/configure \
		--prefix=$PREFIX \
		--target=$TARGET \
		--disable-werror

	### make ###
	$make 

	### make install ###
	$make  install

	$cd ..
	
	

install gcc (first)



	### set path ###
	$export ATH="$PREFIX/bin:$PATH"

	$cd gcc-3.4.3
	$ln -snf ../newlib-1.13.0/newlib
	$ln -snf ../newlib-1.13.0/libgloss
	cd ..

	$mkdir build-gcc_1
	$cd build-gcc_1

	### configure ###
	$../gcc-3.4.3/configure \
		--prefix=$PREFIX \
		--target=$TARGET \
		--disable-werror \
		--with-gnu-as \
		--with-gnu-ld \
		--with-newlib \
		--enable-languages=c,c++

	### make ###
	$make 

	### make install ###
	$make  install

	$cd ..
	
	

install newlib



	$mkdir build-newlib
	$cd build-newlib

	### configure ###
	$../newlib-3.4.3/configure \
		--prefix=$PREFIX \
		--target=$TARGET \
		--disable-werror

	### make ###
	$make 

	### make install ###
	$make  install

	$cd ..
	
	

install gcc (second)



	### configure ###
	$mkdir build-gcc
	$cd build-gcc
	$../gcc-3.4.3/configure \
		--prefix=$PREFIX \
		--target=$TARGET \
		--disable-werror \
		--with-gnu-as \
		--with-gnu-ld \
		--with-newlib \
		--enable-languages=c,c++

	### make ###
	$make 

	### make install ###
	$make  install

	$cd ..
	
	

point