H8_3069F/開発環境/クロスツールチェーンの構築 のバックアップソース(No.2)

Last-modified:
*クロスツールチェーンの構築 [#n39e957c]
**はじめに [#ade5dba1]
-Ubuntu12.04でH8300のツールチェーンを構築する

&ref(build.sh);

**事前準備 [#wac6be0c]
***m4のインストール [#v8116f46]
-ubuntの場合は事前にm4をインストールしておく必要がある
 sudo apt-get install m4

**手順 [#u82867ac]
***【STEP1】ソースの取得 [#b2e181bc]
 $ curl -O http://www.ring.gr.jp/archives/GNU/binutils/binutils-2.23.2.tar.bz2
 $ curl -O http://www.ring.gr.jp/archives/GNU/gcc/gcc-4.8.0/gcc-4.8.0.tar.bz2
 $ curl -O http://www.ring.gr.jp/archives/GNU/gmp/gmp-5.1.1.tar.bz2
 $ curl -O http://www.ring.gr.jp/archives/GNU/mpfr/mpfr-3.1.2.tar.bz2
 $ curl -O http://www.multiprecision.org/mpc/download/mpc-1.0.tar.gz
 $ curl -O ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.11.1.tar.bz2
 $ curl -O ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.0.tar.gz

***【STEP2】binutilsのビルド [#gdca476a]
 $ tar xjf  binutils-2.23.2.tar.bz2
 $ cd binutils-2.23.2/
 $ ./configure \
 --target=h8300-elf \
 --disable-nls \
 --prefix=/usr/local/h8_cross_tools
 $ make -j4
 $ sudo make install
 $ cd ..

***【STEP3】gmpのビルド [#y5995ae0]
 $ tar xjf gmp-5.1.1.tar.bz2 
 $ cd gmp-5.1.1/
 $ ./configure \
 --prefix=/usr/local/h8_cross_tools/gmp
 $ make -j4
 $ make check -j4
 $ sudo make install
 $ cd ..

***【STEP4】mpfrのビルド [#zbf97009]
 $ tar xjf mpfr-3.1.2.tar.bz2
 $ cd mpfr-3.1.2/
 $ ./configure \
 --prefix=/usr/local/h8_cross_tools/mpfr \
 --with-gmp=/usr/local/h8_cross_tools/gmp
 $ make -j4
 $ make check -j4
 $ sudo make install
 $ cd ..

***【STEP5】mpcのビルド [#je662128]
 $ tar xzf mpc-1.0.tar.gz
 $ cd mpc-1.0/
 $ ./configure \
 --prefix=/usr/local/h8_cross_tools/mpc \
 --with-gmp=/usr/local/h8_cross_tools/gmp/ \
 --with-mpfr=/usr/local/h8_cross_tools/mpfr/
 $ make -j4
 $ make check -j4
 $ sudo make install
 $ cd ..

***【STEP6】islのビルド [#m3be737c]
 $ tar xjf isl-0.11.1.tar.bz2
 $ cd isl-0.11.1/
 $ ./configure \
 --prefix=/usr/local/h8_cross_tools/isl \
 --with-gmp-prefix=/usr/local/h8_cross_tools/gmp/
 $ make -j4
 $ sudo make install
 $ cd ..

***【STEP7】cloogのビルド [#o4d9ea63]
 $ tar xzf cloog-0.18.0.tar.gz
 $ cd cloog-0.18.0/
 $ ./configure \
 --prefix=/usr/local/h8_cross_tools/cloog \
 --with-gmp-prefix=/usr/local/h8_cross_tools/gmp/
 $ make -j4
 $ sudo make install
 $ cd ..

***【STEP8】gccのビルド [#c03cf4e1]
 $ tar xjf gcc-4.8.0.tar.bz2
 $ cd gcc-4.8.0/
 $ mkdir build
 $ cd build/
 $ 
 $ export LD_LIBRARY_PATH=/usr/local/h8_cross_tools/gmp/lib/\
 :/usr/local/h8_cross_tools/mpfr/lib/\
 :/usr/local/h8_cross_tools/mpc/lib/\
 :/usr/local/h8_cross_tools/isl/lib/\
 :/usr/local/h8_cross_tools/cloog/lib/\
 :$LD_LIBRARY_PATH
 $ 
 $ ../configure \
 --target=h8300-elf \
 --disable-nls \
 --disable-threads \
 --disable-shared \
 --disable-libssp \
 --disable-isl-version-check \
 --disable-cloog-version-check \
 --enable-languages=c \
 --with-gmp=/usr/local/h8_cross_tools/gmp/ \
 --with-mpfr=/usr/local/h8_cross_tools/mpfr/ \
 --with-mpc=/usr/local/h8_cross_tools/mpc/ \
 --with-isl=/usr/local/h8_cross_tools/isl/ \
 --with-cloog=/usr/local/h8_cross_tools/cloog/ \
 --prefix=/usr/local/h8_cross_tools/
 $ 
 $ make
 $ sudo make install