summaryrefslogtreecommitdiff
path: root/debian/patches/07_trust_dpkg-arch_over_uname-m.diff
blob: 48fa1ae4e54c93d403f10de437aeb0424721e51d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
author: Sune Vuorela
Reported to trolltech as N180631 - and task 181882
--- a/configure
+++ b/configure
@@ -94,7 +94,50 @@ getQMakeConf()
 #-------------------------------------------------------------------------------
 
 # 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="parisc64"
+	;;
+	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"
+	;;
+	mipsel)
+		UNAME_MACHINE="mips"
+	;;
+	powerpc)
+		UNAME_MACHINE="ppc"
+	;;
+	*)
+		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