>book, in particular the instructions for GCC and Binutils. You can also
>just pastebin the history for the clfs user so someone here can look
>over your commands.

#!/bin/bash
#
# Binutils Pass 1
#
tar xf binutils-2.25.1.tar &&
cd binutils-2.25.1 &&
mkdir -v ../binutils-build &&
cd ../binutils-build &&
../binutils-2.25.1/configure --prefix=/tools --with-sysroot=$LFS 
--with-lib-path=/tools/lib --target=$LFS_TGT --disable-nls --disable-werror &&
echo 'End of configure' &&
make &&
echo 'End of make' &&
case $(uname -m) in
  x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;;
esac
make install &&
echo 'End of make install' &&
cd .. &&
rm -rf binutils-build &&
rm -rf binutils-2.25.1/ &&
echo 'Binutils Pass 1 finished'

#!/bin/bash
#
# GCC Pass 1
#
tar xf gcc-5.2.0.tar &&
cd gcc-5.2.0 &&
tar -xf ../mpfr-3.1.3.tar.xz &&
mv -v mpfr-3.1.3 mpfr &&
tar -xf ../gmp-6.0.0a.tar.xz &&
mv -v gmp-6.0.0 gmp &&
tar -xf ../mpc-1.0.3.tar.gz &&
mv -v mpc-1.0.3 mpc &&
echo 'End of unpacking' &&
for file in \
 $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
  cp -uv $file{,.orig}
  sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
      -e 's@/usr@/tools@g' $file.orig > $file
  echo '
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
  touch $file.orig
done
mkdir -v ../gcc-build &&
cd ../gcc-build &&
echo 'End of manual linking configuration' &&
../gcc-5.2.0/configure --target=$LFS_TGT --prefix=/tools 
--with-glibc-version=2.11 --with-sysroot=$LFS --with-newlib --without-headers 
--with-local-prefix=/tools --with-native-system-header-dir=/tools/include 
--disable-nls --disable-shared --disable-multilib --disable-decimal-float 
--disable-threads --disable-libatomic --disable-libgomp --disable-libquadmath 
--disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++ 
&&
echo 'End of configure' &&
make &&
echo 'End of make' &&
make install &&
echo 'End of make install' &&
cd .. &&
rm -rf gcc-build &&
rm -rf gcc-5.2.0/ &&
echo 'GCC Pass 1 finished'

#!/bin/bash
#
# Pass 1 Linux API Headers
#
tar xf linux-4.2.tar.xz &&
cd linux-4.2 &&
make mrproper &&
echo 'End of make mrproper' &&
make INSTALL_HDR_PATH=dest headers_install &&
echo 'End of make headers_install' &&
cp -rv dest/include/* /tools/include &&
echo 'End of manual install' &&
cd .. &&
rm -rf linux-4.2/ &&
echo 'Pass 1 Linux API Headers finished'

#!/bin/bash
#
# Pass 1 Glibc
#
tar xf glibc-2.22.tar.xz &&
cd glibc-2.22 &&
patch -Np1 -i ../glibc-2.22-upstream_i386_fix-1.patch &&
mkdir -v ../glibc-build &&
cd ../glibc-build &&
../glibc-2.22/configure --prefix=/tools --host=$LFS_TGT 
--build=$(../glibc-2.22/scripts/config.guess) --disable-profile 
--enable-kernel=2.6.32 --enable-obsolete-rpc --with-headers=/tools/include 
libc_cv_forced_unwind=yes libc_cv_ctors_header=yes libc_cv_c_cleanup=yes &&
echo 'End of configure' &&
make &&
echo 'End of make' &&
make install &&
echo 'End of make install' &&
cd .. &&
rm -rf glibc-build/ &&
rm -rf glibc-2.22/ &&
echo 'Glibc Pass 1 finished'

#!/bin/bash
#
# Pass 1 Libstdc++
#
tar xf gcc-5.2.0.tar &&
cd gcc-5.2.0 &&
mkdir -v ../gcc-build &&
cd ../gcc-build &&
../gcc-5.2.0/libstdc++-v3/configure --host=$LFS_TGT --prefix=/tools 
--disable-multilib --disable-nls --disable-libstdcxx-threads 
--disable-libstdcxx-pch 
--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/5.2.0 &&
echo 'End of configure' &&
make &&
echo 'End of make' &&
make install &&
echo 'End of make install' &&
cd .. &&
rm -rf gcc-build &&
rm -rf gcc-5.2.0/ &&
echo 'Pass 1 Libstdc++ finished'

#!/bin/bash
#
# Binutils Pass 2
#
tar xf binutils-2.25.1.tar &&
cd binutils-2.25.1 &&
mkdir -v ../binutils-build &&
cd ../binutils-build &&
CC=$LFS_TGT-gcc &&
AR=$LFS_TGT-ar &&
RANLIB=$LFS_TGT-ranlib &&
../binutils-2.25.1/configure --prefix=/tools --disable-nls --disable-werror 
--with-lib-path=/tools/lib --with-sysroot &&
echo 'End of configure' &&
make &&
echo 'End of make' &&
make install &&
echo 'End of make install' &&
make -C ld clean &&
echo 'End of ' &&
make -C ld LIB_PATH=/usr/lib:/lib &&
echo 'End of ' &&
cp -v ld/ld-new /tools/bin &&
echo 'End of manual copy' &&
cd .. &&
rm -rf binutils-build &&
rm -rf binutils-2.25.1/ &&
echo 'Binutils Pass 2 finished'

#!/bin/bash
#
# GCC Pass 2
#
tar xf gcc-5.2.0.tar &&
cd gcc-5.2.0 &&
cat gcc/limitx.h gcc/glimits.h gcc/limity.h >   `dirname $($LFS_TGT-gcc 
-print-libgcc-file-name)`/include-fixed/limits.h &&
for file in  $(find gcc/config -name linux64.h -o -name linux.h -o -name 
sysv4.h); do   cp -uv $file{,.orig};   sed -e 
's@/lib\(64\)\?\(32\)\?/ld@/tools&@g'       -e 's@/usr@/tools@g' $file.orig > 
$file;   echo '
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file;   touch $file.orig; done &&
tar -xf ../mpfr-3.1.3.tar.xz &&
mv -v mpfr-3.1.3 mpfr &&
tar -xf ../gmp-6.0.0a.tar.xz &&
mv -v gmp-6.0.0 gmp &&
tar -xf ../mpc-1.0.3.tar.gz &&
mv -v mpc-1.0.3 mpc &&
mkdir -v ../gcc-build &&
cd ../gcc-build &&
echo 'End of linker configuration' &&
CC=$LFS_TGT-gcc &&
CXX=$LFS_TGT-g++ &&
AR=$LFS_TGT-ar &&
RANLIB=$LFS_TGT-ranlib &&
../gcc-5.2.0/configure --prefix=/tools --with-local-prefix=/tools 
--with-native-system-header-dir=/tools/include --enable-languages=c,c++ 
--disable-libstdcxx-pch --disable-multilib --disable-bootstrap 
--disable-libgomp &&
echo 'End of configure' &&
make &&
echo 'End of make' &&
make install &&
echo 'End of make install' &&
ln -sv gcc /tools/bin/cc
cd .. &&
rm -rf gcc-build &&
rm -rf gcc-5.2.0/ &&
echo 'GCC Pass 2 finished'
echo 'Done'
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to