[ClanLib] fix build on non-x86 arches

Dan Horák sharkcz at fedoraproject.org
Tue Jan 8 13:08:39 UTC 2013


commit f471759d99f243ebe4a5d053f1ee31c6486d163a
Author: Dan Horák <dan at danny.cz>
Date:   Tue Jan 8 14:08:34 2013 +0100

    fix build on non-x86 arches

 ClanLib-2.3.4-non-x86.patch |   38 ++++++++++++++++++++++++++++++++++++++
 ClanLib-arm-platform.patch  |   34 ----------------------------------
 ClanLib.spec                |    9 ++++++---
 3 files changed, 44 insertions(+), 37 deletions(-)
---
diff --git a/ClanLib-2.3.4-non-x86.patch b/ClanLib-2.3.4-non-x86.patch
new file mode 100644
index 0000000..acaa852
--- /dev/null
+++ b/ClanLib-2.3.4-non-x86.patch
@@ -0,0 +1,38 @@
+diff -up ClanLib-2.3.6/Sources/Core/System/detect_cpu_ext.cpp.non-x86 ClanLib-2.3.6/Sources/Core/System/detect_cpu_ext.cpp
+--- ClanLib-2.3.6/Sources/Core/System/detect_cpu_ext.cpp.non-x86	2011-11-15 13:15:42.000000000 +0100
++++ ClanLib-2.3.6/Sources/Core/System/detect_cpu_ext.cpp	2013-01-08 13:33:20.000000000 +0100
+@@ -30,7 +30,7 @@
+ #include "Core/precomp.h"
+ #include "API/Core/System/system.h"
+ 
+-#ifdef CL_ARM_PLATFORM
++#if ! (defined(__i386__) || defined(__x86_64__) || defined(__amd64__))
+ bool CL_System::detect_cpu_extension(CL_CPU_ExtensionPPC ext)
+ {
+ 	throw ("Congratulations, you've just been selected to code this feature!");
+@@ -48,11 +48,12 @@ bool CL_System::detect_cpu_extension(CL_
+ #ifdef __GNUC__
+ 
+ 
+-#ifdef __amd64__
++#if defined(__amd64__) || defined(__x86_64__)
+ 
+ #define __cpuid(out, infoType)\
+ 	asm("cpuid": "=a" ((out)[0]), "=b" ((out)[1]), "=c" ((out)[2]), "=d" ((out)[3]): "a" (infoType));
+-#else
++
++#elif defined(__i386__)
+ 
+ #define __cpuid(out, infoType) \
+ 	asm volatile(	"pushl %%ebx \n" \
+@@ -61,6 +62,10 @@ bool CL_System::detect_cpu_extension(CL_
+ 			"popl %%ebx" \
+ 		: "=a" ((out)[0]), "=r" ((out)[1]), "=c" ((out)[2]), "=d" ((out)[3]): "a" (infoType));
+ 
++#else
++
++#define __cpuid(out, infoType) {}
++
+ #endif
+ 
+ #endif
diff --git a/ClanLib.spec b/ClanLib.spec
index 2acd0a1..8ce5e32 100644
--- a/ClanLib.spec
+++ b/ClanLib.spec
@@ -1,7 +1,7 @@
 Summary:        Cross platform C++ game library
 Name:           ClanLib
 Version:        2.3.6
-Release:        5%{?dist}
+Release:        6%{?dist}
 Group:          System Environment/Libraries
 License:        zlib
 URL:            http://www.clanlib.org/
@@ -10,8 +10,8 @@ Source0:        http://www.clanlib.org/download/releases-2.0/%{name}-%{version}.
 # to reflect the exact version for which it was downloaded
 Source1:        ClanLib-%{version}-generated-docs.zip
 Patch1:         ClanLib-2.3.4-gcc47.patch
-Patch2:         ClanLib-arm-platform.patch
 Patch3:         ClanLib-2.3-r8912.patch
+Patch4:         ClanLib-2.3.4-non-x86.patch
 BuildRequires:  libX11-devel libXi-devel libXmu-devel libGLU-devel libICE-devel
 BuildRequires:  libXext-devel libXxf86vm-devel libXt-devel xorg-x11-proto-devel
 BuildRequires:  libvorbis-devel mikmod-devel alsa-lib-devel
@@ -39,8 +39,8 @@ ClanLib development headers and libraries
 %prep
 %setup -q -a 1
 %patch1 -p1
-%patch2 -p1 -b .arm
 %patch3 -p0 -b .r8912
+%patch4 -p1 -b .non-x86
 mv reference_doxygen html
 
 
@@ -70,6 +70,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
 
 
 %changelog
+* Tue Jan 08 2013 Dan Horák <dan[at]danny.cz> - 2.3.6-6
+- fix build on non-x86 arches
+
 * Mon Jan 07 2013 Adam Tkac <atkac redhat com> - 2.3.6-5
 - fix building against new mesa (upstream change r8912)
 


More information about the scm-commits mailing list