Mercurial > hg > aboriginal
changeset 60:b42bd3e8606b
Add force_cross_compile and block_host_toolchain to try to make the i686 native
target behave. (Yes, building i686 on i686 _can_ be cross compiling.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 23 Dec 2006 19:01:05 -0500 |
parents | 18c065749b79 |
children | eb42ad9e8f81 |
files | include.sh |
diffstat | 1 files changed, 27 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/include.sh Sat Dec 23 02:49:48 2006 -0500 +++ b/include.sh Sat Dec 23 19:01:05 2006 -0500 @@ -141,6 +141,33 @@ done } +# Yet more FSF brain damage: If your host and target are the same, obviously +# you can't be cross compiling. (Nevermind that one is glibc and the other is +# uClibc, or one toolchain may have TLS and the other doesn't...) +# Hit configure with a very large rock until it stops moving. +function force_cross_compile() +{ + (find "${CURSRC}" -name "configure" || dienow) | + xargs sed -i -e "s/\(cross_compiling=\)[a-z]*/\1yes/" || dienow +} + + +# Make sure we're _not_ using the host toolchain to build anything. +OLDPATH="$PATH" +function block_host_toolchain() +{ + mkdir -p "${WORK}/block" && + echo '#!/bin/sh\necho "Ran $0" >&2\nexit 1' > "${WORK}/block/die_die_die" && + chmod +x "${WORK}/block/die_die_die" && + for i in "${WORK}/block/"{cc,gcc,ld,nm,ar,as,ranlib,strip,objcopy,objdump,c++} + do + ln -s die_die_die "$i" || dienow + done && + export PATH="${CROSS}/bin:${WORK}/block:$OLDPATH" + + [ $? -ne 0 ] && dienow +} + # Setup umask 022