diff options
author | T Parys <tparys@gmail.com> | 2009-12-09 19:32:33 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-12-09 19:32:33 -0500 |
commit | fdf2477bd0842f3958fab9b986c1bfd6df5147e1 (patch) | |
tree | 1b4908980b1b775ef9d1130e2b244def7df6ff34 | |
parent | cross-fix-root: improve .pc dir searching (diff) | |
download | crossdev-fdf2477bd0842f3958fab9b986c1bfd6df5147e1.tar.gz crossdev-fdf2477bd0842f3958fab9b986c1bfd6df5147e1.tar.bz2 crossdev-fdf2477bd0842f3958fab9b986c1bfd6df5147e1.zip |
emerge-wrapper: clean up target parsing
URL: http://bugs.gentoo.org/264343
Signed-off-by: T Parys <tparys@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-x | wrappers/emerge-wrapper | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/wrappers/emerge-wrapper b/wrappers/emerge-wrapper index b050ad8..004bce7 100755 --- a/wrappers/emerge-wrapper +++ b/wrappers/emerge-wrapper @@ -11,30 +11,37 @@ cross_wrap_etc() { (cd /usr/$chost/etc ; ln -s /etc/make.globals make.globals ) conf=/usr/$chost/etc/make.conf - if [[ ${chost:0:1} == "i" ]] && [[ ${chost:3:4} == "86" ]]; then + case $chost in + i?86*) E_MACHINE=EM_X86 ARCH=x86 - fi - - if [[ ${chost:3:4} == "x86_64" ]]; then + ;; + x86_64*) E_MACHINE=EM_X86_64 ARCH=amd64 - fi - - if [[ ${chost:0:3} == "arm" ]]; then + ;; + arm*) E_MACHINE=EM_ARM ARCH=arm echo 'UCLIBC_CPU_DEFAULT="GENERIC_ARM"' >> ${conf} - fi - - if [[ ${chost:0:4} == "mips" ]]; then + ;; + mips*) E_MACHINE=EM_MIPS ARCH=mips - fi - if [[ ${chost:0:2} == "sh" ]]; then + ;; + sh*) E_MACHINE=EM_SH ARCH=sh - fi + ;; + *) + echo "!!! WARNING - Cannot auto-configure CHOST ${chost}" + echo "!!! You should edit ${conf}" + echo "!!! by hand to complete your configuration" + E_MACHINE="__E_MACHINE__" + ARCH="__ARCH__" + ;; + esac + [[ ${chost/gnu/} != $chost ]] && sed -i -e s/__LIBC__/glibc/g ${conf} [[ ${chost/uclibc/} != $chost ]] && sed -i -e s/__LIBC__/glibc/g ${conf} [[ $E_MACHINE != "" ]] && sed -i -e s/'#E_MACHINE=__E_MACHINE__'/E_MACHINE=${E_MACHINE}/g ${conf} |