Skip to content

Instantly share code, notes, and snippets.

@sksat
Last active February 1, 2018 05:01
Show Gist options
  • Save sksat/6ec5ec8252f29440610e2fc544221993 to your computer and use it in GitHub Desktop.
Save sksat/6ec5ec8252f29440610e2fc544221993 to your computer and use it in GitHub Desktop.
freebsd9向けのクロスコンパイラのビルド
#!/bin/bash
mkdir build
cd build
wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.29.tar.gz
tar zxvf binutils-2.29.tar.gz
cd binutils-2.29
./configure --enable-libssp --enable-gold --enable-ld --target=x86_64-pc-freebsd7 --prefix=/usr/cross-freebsd
make
make install
cd ..
mkdir -p /usr/cross-freebsd/x86_64-pc-freebsd9/include
mkdir -p /usr/cross-freebsd/x86_64-pc-freebsd9/lib
wget ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2
tar jxf gmp-6.1.2.tar.bz2
cd gmp-6.1.2
./configure --prefix=/usr/cross-freebsd --enable-shared --enable-static --enable-mpbsd --enable-fft --enable-cxx --host=x86_64-pc-freebsd9
make
make install
cd ..
wget ftp://ftp.gnu.org/gnu/mpfr/mpfr-4.0.0.tar.bz2
tar jxf mpfr-4.0.0.tar.bz2
cd mpfr-4.0.0
./configure --prefix=/usr/cross-freebsd --with-gnu-ld --with-gmp=/usr/cross-freebsd --enable-static --enable-shared --host=x86_64-pc-freebsd9
make
make install
cd ..
wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
tar zxvf mpc-1.0.3.tar.gz
cd mpc-1.0.3
./configure --prefix=/usr/cross-freebsd --with-gnu-ld --with-gmp=/usr/cross-freebsd --with-mpfr=/usr/cross-freebsd --enable-static --enable-shared --host=x86_64-pc-freebsd9
make
make install
cd ..
wget ftp://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.gz
tar zxvf gcc-7.2.0.tar.gz
cd gcc-7.2.0
mkdir build
cd build
../configure --without-headers --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-nls --enable-libssp --enable-gold --enable-ld --target=x86_64-pc-freebsd9 --prefix=/usr/cross-freebsd --with-gmp=/usr/cross-freebsd/x86_64-pc-freebsd9 --with-mpc=/usr/cross-freebsd/x86_64-pc-freebsd9 --with-mpfr=/usr/cross-freebsd/x86_64-pc-freebsd9 --disable-libgomp
LD_LIBRARY_PATH=/usr/cross-freebsd/lib make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment