GCC & DESTDIR

Jack Stone jwjstone at fastmail.fm
Sun Feb 8 03:07:51 PST 2009


Chris Staub wrote:
> I don't see a "problem" other than a user attempting something that 
> simply isn't supposed to be done. Everything in chapter 5 is meant to be 
> installed into /tools. In any case, you haven't provided the exact 
> details - what DESTDIR did you use and what exactly was your configure 
> command?

I'm sorry if I made it seem like a problem with the book, that wasn't my
intention.

I've included the exact build script I'm using below. The only
difference from the book is that I have added a DESTDIR=/absolute/path
to the install command. The exact path is a directory generated by
mktemp and is passed into this script.

I'm trying to do this as part of the first stage of package management
and automation.

Thanks,

Jack

**** BEGIN BUILD SCRIPT

#!/bin/bash -e

echo $PATH

set +h

destdir=$1

tar -jxf gcc-4.3.2.tar.bz2
cd gcc-4.3.2

cp -v gcc/Makefile.in{,.orig}
sed 's@\./fixinc\.sh at -c true@' gcc/Makefile.in.orig > gcc/Makefile.in

cp -v gcc/Makefile.in{,.tmp}
sed 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp \
        > gcc/Makefile.in

for file in $(find gcc/config -name linux64.h -o -name linux.h)
do
        cp -uv $file{,.orig}
        sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
        -e 's@/usr@/tools at g' $file.orig > $file

        echo "
#undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR 0" >> $file
        touch $file.orig
done

tar -jxf ../mpfr-2.3.2.tar.bz2
mv mpfr-2.3.2 mpfr
tar -jxf ../gmp-4.2.4.tar.bz2
mv gmp-4.2.4 gmp

mkdir -v ../gcc-build
cd ../gcc-build

../gcc-4.3.2/configure --prefix=/tools \
        --with-local-prefix=/tools --enable-clocale=gnu \
        --enable-shared --enable-threads=posix \
        --enable-__cxa_atexit --enable-languages=c,c++ \
        --disable-libstdcxx-pch --disable-bootstrap

make

make DESTDIR=$destdir install
#make install

*** END BUILD SCRIPT



More information about the lfs-support mailing list