crossgcc: Normalize library directories

Various of the build scripts used upstream can't cope with
multilib library paths (eg. lib64), so move things to a place
where they can find them, if such paths are used.

Change-Id: I0dd9bba9a9eadd92d8704157e868fb37c715ee91
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/2013
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Patrick Georgi 2012-12-08 08:02:44 +01:00 committed by Ronald G. Minnich
parent 5d01b765e3
commit 198d23c119
1 changed files with 26 additions and 0 deletions

View File

@ -78,6 +78,17 @@ cyan='\033[0;36m'
CYAN='\033[1;36m' CYAN='\033[1;36m'
NC='\033[0m' # No Color NC='\033[0m' # No Color
normalize_dirs()
{
mkdir -p $DESTDIR$TARGETDIR/lib
test -d $DESTDIR$TARGETDIR/lib32 && mv $DESTDIR$TARGETDIR/lib32/* $DESTDIR$TARGETDIR/lib
test -d $DESTDIR$TARGETDIR/lib64 && mv $DESTDIR$TARGETDIR/lib64/* $DESTDIR$TARGETDIR/lib
rmdir -p $DESTDIR$TARGETDIR/lib32 $DESTDIR$TARGETDIR/lib64
perl -pi -e "s,/lib32,/lib," $DESTDIR$TARGETDIR/lib/*.la
perl -pi -e "s,/lib64,/lib," $DESTDIR$TARGETDIR/lib/*.la
}
searchgnu() searchgnu()
{ {
# $1 short name # $1 short name
@ -327,6 +338,9 @@ printf "Building GMP ${GMP_VERSION} ... "
|| touch .failed || touch .failed
$MAKE $JOBS || touch .failed $MAKE $JOBS || touch .failed
$MAKE install DESTDIR=$DESTDIR || touch .failed $MAKE install DESTDIR=$DESTDIR || touch .failed
normalize_dirs
if [ ! -f .failed ]; then touch .success; fi if [ ! -f .failed ]; then touch .success; fi
) > build-gmp/crossgcc-build.log 2>&1 ) > build-gmp/crossgcc-build.log 2>&1
test -r build-gmp/.failed && printf "${RED}failed${NC}\n" || \ test -r build-gmp/.failed && printf "${RED}failed${NC}\n" || \
@ -354,6 +368,8 @@ printf "Building MPFR ${MPFR_VERSION} ... "
$MAKE $JOBS || touch .failed $MAKE $JOBS || touch .failed
$MAKE install DESTDIR=$DESTDIR || touch .failed $MAKE install DESTDIR=$DESTDIR || touch .failed
normalize_dirs
# work around build problem of libgmp.la # work around build problem of libgmp.la
if [ "$DESTDIR" != "" ]; then if [ "$DESTDIR" != "" ]; then
perl -pi -e "s,$DESTDIR,," $DESTDIR$TARGETDIR/libgmp.la perl -pi -e "s,$DESTDIR,," $DESTDIR$TARGETDIR/libgmp.la
@ -380,6 +396,8 @@ printf "Building MPC ${MPC_VERSION} ... "
$MAKE $JOBS || touch .failed $MAKE $JOBS || touch .failed
$MAKE install DESTDIR=$DESTDIR || touch .failed $MAKE install DESTDIR=$DESTDIR || touch .failed
normalize_dirs
if [ ! -f .failed ]; then touch .success; fi if [ ! -f .failed ]; then touch .success; fi
) > build-mpc/crossgcc-build.log 2>&1 ) > build-mpc/crossgcc-build.log 2>&1
test -r build-mpc/.failed && printf "${RED}failed${NC}\n" || \ test -r build-mpc/.failed && printf "${RED}failed${NC}\n" || \
@ -401,6 +419,8 @@ printf "Building libelf ${LIBELF_VERSION} ... "
$MAKE $JOBS || touch .failed $MAKE $JOBS || touch .failed
$MAKE install DESTDIR=$DESTDIR || touch .failed $MAKE install DESTDIR=$DESTDIR || touch .failed
normalize_dirs
if [ ! -f .failed ]; then touch .success; fi if [ ! -f .failed ]; then touch .success; fi
) > build-libelf/crossgcc-build.log 2>&1 ) > build-libelf/crossgcc-build.log 2>&1
test -r build-libelf/.failed && printf "${RED}failed${NC}\n" || \ test -r build-libelf/.failed && printf "${RED}failed${NC}\n" || \
@ -497,6 +517,9 @@ printf "Building Expat ${EXPAT_VERSION} ... "
--prefix=$TARGETDIR --target=${TARGETARCH} || touch .failed --prefix=$TARGETDIR --target=${TARGETARCH} || touch .failed
$MAKE || touch .failed $MAKE || touch .failed
$MAKE install DESTDIR=$DESTDIR || touch .failed $MAKE install DESTDIR=$DESTDIR || touch .failed
normalize_dirs
if [ ! -f .failed ]; then touch .success; fi if [ ! -f .failed ]; then touch .success; fi
) > build-expat/crossgcc-build.log 2>&1 ) > build-expat/crossgcc-build.log 2>&1
test -r build-expat/.failed && printf "${RED}failed${NC}\n" || \ test -r build-expat/.failed && printf "${RED}failed${NC}\n" || \
@ -518,6 +541,9 @@ printf "Building Python ${PYTHON_VERSION} ... "
--target=${TARGETARCH} || touch .failed --target=${TARGETARCH} || touch .failed
$MAKE $JOBS || touch .failed $MAKE $JOBS || touch .failed
$MAKE install DESTDIR=$DESTDIR || touch .failed $MAKE install DESTDIR=$DESTDIR || touch .failed
normalize_dirs
if [ ! -f .failed ]; then touch .success; fi if [ ! -f .failed ]; then touch .success; fi
) > build-python/crossgcc-build.log 2>&1 ) > build-python/crossgcc-build.log 2>&1
test -r build-python/.failed && printf "${RED}failed${NC}\n" || \ test -r build-python/.failed && printf "${RED}failed${NC}\n" || \