This one is a bit better, as it leaves SSE/2 enabled on targets that support it.

Description: Conditionalize SSE and SSE2 support
 This makes sure it builds compatible binaries also on 
 machines which have sse/sse2. Fixes the SIGILL bug. 
 Checks for DEB_HOST_ARCH_CPU!=i386 before tests are attempted.
 Will try to use SSE/SSE2 on all other architectures.
 Generated Code will still need MMX support to run. 
Bug-Debian: http://bugs.debian.org/599680

--- blender-2.63a.orig/build_files/cmake/macros.cmake
+++ blender-2.63a/build_files/cmake/macros.cmake
@@ -358,35 +358,40 @@ macro(TEST_SSE_SUPPORT
 	endif()
 
 	set(CMAKE_REQUIRED_FLAGS "${${_sse_flags}} ${${_sse2_flags}}")
-
-	if(NOT DEFINED SUPPORT_SSE_BUILD)
-		# result cached
-		check_c_source_runs("
-			#include <xmmintrin.h>
-			int main(void) { __m128 v = _mm_setzero_ps(); return 0; }"
-		SUPPORT_SSE_BUILD)
-
-		if(SUPPORT_SSE_BUILD)
-			message(STATUS "SSE Support: detected.")
-		else()
-			message(STATUS "SSE Support: missing.")
+	
+	if(NOT ( $ENV{DEB_HOST_ARCH_CPU} STREQUAL "i386" ) )
+	
+		if(NOT DEFINED SUPPORT_SSE_BUILD)
+			# result cached
+			check_c_source_runs("
+				#include <xmmintrin.h>
+				int main(void) { __m128 v = _mm_setzero_ps(); return 0; }"
+			SUPPORT_SSE_BUILD)
+
+			if(SUPPORT_SSE_BUILD)
+				message(STATUS "SSE Support: detected.")
+			else()
+				message(STATUS "SSE Support: missing.")
+			endif()
 		endif()
-	endif()
-
-	if(NOT DEFINED SUPPORT_SSE2_BUILD)
-		# result cached
-		check_c_source_runs("
+	
+		if(NOT DEFINED SUPPORT_SSE2_BUILD)
+			# result cached
+			check_c_source_runs("
 			#include <emmintrin.h>
-			int main(void) { __m128d v = _mm_setzero_pd(); return 0; }"
-		SUPPORT_SSE2_BUILD)
+				int main(void) { __m128d v = _mm_setzero_pd(); return 0; }"
+			SUPPORT_SSE2_BUILD)
 
-		if(SUPPORT_SSE2_BUILD)
-			message(STATUS "SSE2 Support: detected.")
-		else()
-			message(STATUS "SSE2 Support: missing.")
+			if(SUPPORT_SSE2_BUILD)
+				message(STATUS "SSE2 Support: detected.")
+			else()
+				message(STATUS "SSE2 Support: missing.")
+			endif()
 		endif()
+	else()
+		message(STATUS "SSE Support: missing.")
+		message(STATUS "SSE2 Support: missing.")
 	endif()
-
 	unset(CMAKE_REQUIRED_FLAGS)
 endmacro()
 

Reply via email to