[lfs-support] Problem on compiling and installing Binutils-2.21.1a

Firerat firer4t at googlemail.com
Tue Jan 10 03:51:16 PST 2012

On Tue, Jan 10, 2012 at 11:21 AM, Uthayanan <suthayanan at gmail.com> wrote:
> Hi Firerat,
> I  did that in following way.
> I went to the binutis-2.21 folder first (after unziping ) and then offered the commands in the book. I think the commands in the book simply get out of the binutils folder and create binutil-build under source directory..
> Correct me If I am wrong.

No you are not wrong,
that is exactly what is happening

The thing is you say that make failed because no makefile  was found,
this will happen if you did not "start" from the binutils-2.21 dir

/mnt/lfs/source$ tar vxf binutils-2.21.tar*z*
# you forgot to cd into the source dir
/mnt/lfs/source$ mkdir -v ../binutils-build; cd ../binutils-build
# you created a dir on the root of your LFS partition and entered it

/mnt/lfs/binutils-build$ ../binutils-2.22/configure \
    --target=$LFS_TGT --prefix=/tools \
    --disable-nls --disable-werror
# the above failed, and ../binutils-2.22/configure doesn't exist,
# make then fails because Makefile was never created

you can be forgiven,
5.3. General Compilation Instructions
is not explicit, it makes perfect sense if you know a bit of linux,
but if you are green it probably means not a lot,

don't worry, I'm sure it is a very common mistake..

to make life easier, use this  .bashrc ( 4.4. Setting Up the Environment )

cat > ~/.bashrc << "EOF"
set +h
umask 022
LFS_TGT=$(uname -m)-lfs-linux-gnu
# Firerat's 'untar and cd into' bash function
Untar () {
if [ "$#" != "1" -o ! -e "$1" ];
    echo "Untar requires one argument"
    echo "e.g."
    echo "Source.tar.bz2"
    exit 1
cd $(tar -vxf $1 | awk -F\/ 'END{print $1}')
#TODO make this report errors better
## End Firerat's 'untar and cd into' bash function

don't forget to
     source ~/.bashrc
( or logout and in again )

I added a small function,
instead of using

    tar -xf binutils.2.21.tar.bz2
    cd binutils.2.21

you can use

    Untar binutils.2.21.tar.bz2

and it will automagically cd into it for you
don't worry about how it works just yet,

More information about the lfs-support mailing list