_trust_dpkg-arch_over_uname-m
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Mon, 24 Jan 2022 10:55:59 +0000 (10:55 +0000)
committerUtkarsh Gupta <utkarsh@debian.org>
Mon, 24 Jan 2022 10:55:59 +0000 (10:55 +0000)
qt-bugs@ issue : N180631
Trolltech task ID : 181882

qt-bugs@ issue : N180631
Trolltech task ID : 181882

Gbp-Pq: Name 07_trust_dpkg-arch_over_uname-m.diff

configure

index 10ad7ca0b0b7ef71f6bf2292b0b971bd983b9d7e..7e3570b9e5253c0f667b008caeddd455296d2aa8 100755 (executable)
--- a/configure
+++ b/configure
@@ -247,7 +247,53 @@ DeviceVar()
 #-------------------------------------------------------------------------------
 
 # need that throughout the script
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+# This is a ugly hack that shouldn't be extended any more. New archs
+# should just use the default *) UNAME_MACHINE="$DPKG_ARCH" The current mappings
+# is for backwards compatibility with existing archs already released.
+DPKG_ARCH=`(dpkg-architecture -qDEB_HOST_ARCH) 2>/dev/null` || UNAME_MACHINE=unknown
+case $DPKG_ARCH in 
+       amd64)
+               UNAME_MACHINE="x86_64"
+       ;;
+       arm)
+               UNAME_MACHINE="armv4l"
+       ;;
+       armel)
+               UNAME_MACHINE="armv5tel"
+       ;;
+       hppa)
+               UNAME_MACHINE="parisc"
+       ;;
+       hurd-i386)
+               UNAME_MACHINE="i686-AT386"
+       ;;
+       i386)
+               UNAME_MACHINE="i686"
+       ;;
+       kfreebsd-amd64)
+               UNAME_MACHINE="x86_64"
+       ;;
+       kfreebsd-i386)
+               UNAME_MACHINE="i586"
+       ;;
+       lpia)
+               UNAME_MACHINE="i686"
+       ;;
+       mips*)
+               UNAME_MACHINE="mips"
+       ;;
+       powerpc)
+               UNAME_MACHINE="ppc"
+       ;;
+       ppc64el)
+               UNAME_MACHINE="ppc64le"
+       ;;
+       *)
+               UNAME_MACHINE="$DPKG_ARCH"
+       ;;
+
+
+esac
 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown