X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage2%2Fcis-binutils;h=04bddd600367fe5d67b3afecfb98769b3baf5f2c;hb=a934432259aa5d5b687fe52731d6baf13c9675dc;hp=d49567d268381288b0fae03a356be047884f13c8;hpb=16cc35ba4890382ee9368a176e4f5a7fa773b7a6;p=hvlinux.git diff --git a/stage2/cis-binutils b/stage2/cis-binutils index d49567d..04bddd6 100755 --- a/stage2/cis-binutils +++ b/stage2/cis-binutils @@ -1,30 +1,48 @@ #!/bin/sh +set -o errexit + +# First argument of this script is the package name. +# Remaining arguments are additional configure options. # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list -# Saves CFLAGS and CXXFLAGS, and clears them. -save_flags_no_optimizations +PACKAGE=${1} +shift +CONFIGURE_OPTS=${*} # Applying patches (if any) -apply_patches ${1} && +apply_patches ${PACKAGE} + +cd ${LFS_TMP}/${PACKAGE} + +case "${HVL_TARGET}" in + "x86_64") + # Libiberty uses gcc -print-multi-os-directory to determine where to + # install libiberty.a. Because our temporary GCC is still + # multilib-aware, the command returns ../lib64 which causes the archive + # to be installed into /usr/lib64. The following sed will prevent this: + sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' libiberty/Makefile.in + + # This adds 64 bit support to Binutils. + CONFIGURE_OPTS="${CONFIGURE_OPTS} --enable-64-bit-bfd" + ;; +esac -# First, we only want to install the linker. This is done because the -# source and build directories from stage1 were not kept. -cd ${LFS_TMP}/${1}-build && -../${1}/configure \ +cd ${LFS_TMP}/${PACKAGE}-build +../${PACKAGE}/configure \ --prefix=/usr \ - --enable-shared && -make tooldir=/usr && -make check && -make tooldir=/usr install && + --sysconfdir=/etc \ + ${CONFIGURE_OPTS} +make configure-host +make tooldir=/usr -cp -v -f ../${1}/include/libiberty.h /usr/include && +# Install the package: +make tooldir=/usr install -# Restore original CFLAGS and CXXFLAGS values. -restore_flags +# Install the libiberty header file that is needed by some packages: +cp -v ../${PACKAGE}/include/libiberty.h /usr/include -# Return last error exit $?