Fix #7824: failure to build a cross-compiler on Haiku.
* force creation of a cross-compiler for both gcc2 and gcc4 when
building on Haiku (by suffixing the build and host machine with
'_buildhost')
(cherry picked from commit df69e209bb
)
Conflicts:
build/scripts/build_cross_tools_gcc4
This commit is contained in:
parent
12629b106e
commit
de2188e964
@ -20,6 +20,11 @@ additionalMakeArgs=$*
|
||||
# additional flags for the binutils build. Should there ever be any other
|
||||
# flags than -jN, we need to handle this differently.
|
||||
|
||||
if [ `uname -o` = 'Haiku' ]; then
|
||||
# force cross-build if building on Haiku:
|
||||
buildhostMachine=i586-pc-haiku_buildhost
|
||||
buildHostSpec="--build=$buildhostMachine --host=$buildhostMachine"
|
||||
fi
|
||||
|
||||
if [ ! -d $haikuSourceDir ]; then
|
||||
echo "ERROR: No such directory: \"$haikuSourceDir\"" >&2
|
||||
@ -101,8 +106,8 @@ fi
|
||||
# build binutils
|
||||
cd $binutilsObjDir
|
||||
CFLAGS="-O2" CXXFLAGS="-O2" $buildToolsDir/binutils/configure \
|
||||
--prefix=$installDir --target=i586-pc-haiku --disable-nls \
|
||||
--enable-shared=yes --disable-werror || exit 1
|
||||
--prefix=$installDir $buildHostSpec --target=i586-pc-haiku \
|
||||
--disable-nls --enable-shared=yes --disable-werror || exit 1
|
||||
make $additionalMakeArgs || exit 1
|
||||
make $additionalMakeArgs install || exit 1
|
||||
|
||||
@ -146,10 +151,10 @@ case `uname` in
|
||||
;;
|
||||
esac
|
||||
CFLAGS="-O2 -U_FORTIFY_SOURCE" CXXFLAGS="-O2" $buildToolsDir/gcc/configure \
|
||||
--prefix=$installDir \
|
||||
--target=i586-pc-haiku --disable-nls --enable-shared=yes \
|
||||
--enable-languages=c,c++ --with-headers=$tmpIncludeDir \
|
||||
--with-libs=$tmpLibDir || exit 1
|
||||
--prefix=$installDir $buildHostSpec --target=i586-pc-haiku \
|
||||
--disable-nls --enable-shared=yes --enable-languages=c,c++ \
|
||||
--with-headers=$tmpIncludeDir --with-libs=$tmpLibDir \
|
||||
|| exit 1
|
||||
unset CC
|
||||
|
||||
# hack the Makefile to avoid trouble with stuff we don't need anyway
|
||||
@ -192,4 +197,3 @@ rm -rf $objDir
|
||||
|
||||
|
||||
echo "binutils and gcc for cross compilation have been built successfully!"
|
||||
|
||||
|
@ -50,6 +50,12 @@ arm-*)
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ `uname -o` = 'Haiku' ]; then
|
||||
# force cross-build if building on Haiku:
|
||||
buildhostMachine=${haikuMachine}_buildhost
|
||||
buildHostSpec="--build=$buildhostMachine --host=$buildhostMachine"
|
||||
fi
|
||||
|
||||
if [ ! -d $haikuSourceDir ]; then
|
||||
echo "No such directory: \"$haikuSourceDir\"" >&2
|
||||
exit 1
|
||||
@ -135,10 +141,11 @@ export LC_ALL=POSIX
|
||||
# build binutils
|
||||
cd $binutilsObjDir
|
||||
CFLAGS="-O2" CXXFLAGS="-O2" $binutilsSourceDir/configure \
|
||||
--prefix=$installDir --target=$haikuMachine --disable-nls \
|
||||
--disable-shared --disable-werror \
|
||||
--prefix=$installDir $buildHostSpec --target=$haikuMachine \
|
||||
--disable-nls --disable-shared --disable-werror \
|
||||
--with-sysroot=$sysrootDir \
|
||||
$binutilsConfigureArgs || exit 1
|
||||
$binutilsConfigureArgs \
|
||||
|| exit 1
|
||||
$MAKE $additionalMakeArgs || exit 1
|
||||
$MAKE $additionalMakeArgs install || exit 1
|
||||
|
||||
@ -194,11 +201,13 @@ copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix
|
||||
|
||||
# configure gcc
|
||||
cd $gccObjDir
|
||||
CFLAGS="-O2" CXXFLAGS="-O2" $gccSourceDir/configure --prefix=$installDir \
|
||||
--target=$haikuMachine --disable-nls --disable-shared --with-system-zlib \
|
||||
CFLAGS="-O2" CXXFLAGS="-O2" $gccSourceDir/configure \
|
||||
--prefix=$installDir $buildHostSpec --target=$haikuMachine \
|
||||
--disable-nls --disable-shared --with-system-zlib \
|
||||
--enable-languages=c,c++ --enable-lto --enable-frame-pointer \
|
||||
--with-sysroot=$sysrootDir \
|
||||
$gccConfigureArgs || exit 1
|
||||
$gccConfigureArgs \
|
||||
|| exit 1
|
||||
|
||||
# make gcc
|
||||
$MAKE $additionalMakeArgs || {
|
||||
|
Loading…
Reference in New Issue
Block a user