Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2009-05-26 04:46:19 +0400
committerZoltan Varga <vargaz@gmail.com>2009-05-26 04:46:19 +0400
commit7890c4d61cf903da4af0eb8d304961b1909e5e62 (patch)
treeedda82a8a36f70292cfc48ae785982d5ab82ad0e /CMakeLists.txt
parent1410581e22dc231de82f95a111b5f7348c45a76a (diff)
2009-05-26 Zoltan Varga <vargaz@gmail.com>
* CMakeLists.txt: implement arm fpu detection, add vfp detection as well. svn path=/trunk/mono/; revision=134737
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt42
1 files changed, 30 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed80942bc8e..3d49ae35102 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2431,20 +2431,38 @@ if (with_tls STREQUAL "__thread")
###fi
endif()
-###if test ${TARGET} = ARM && test x$cross_compiling = xno && test x$enable_mcs_build != xno; then
+
# ******************************************
# *** Check to see what FPU is available ***
# ******************************************
-### ac_msg_checking(which FPU to use)
-
-### AC_TRY_COMPILE([], [
-### __asm__ ("ldfd f0, [r0]");
-### ], set(fpu FPA, fpu=NONE))
-
-### ac_msg_result($fpu)
-### set(CPPFLAGS "$CPPFLAGS -DARM_FPU_$fpu=1")
-### unset fpu
-###fi
+# FIXME: Don't do this if cross-compiling
+if(${TARGET} STREQUAL "ARM")
+ ac_msg_checking("which FPU to use")
+ set(CMAKE_REQUIRED_FLAGS "-mfloat-abi=softfp -mfpu=vfp")
+ set(compiles_fpu_vfp)
+ check_c_source_compiles("
+void main () {
+ __asm__ (\"faddd d7, d6, d7\");
+}
+" compiles_fpu_vfp)
+ set(compiles_fpu_fpa)
+ set(cmake_required_flags)
+ check_c_source_compiles("
+void main () {
+ __asm__ (\"ldfd f0, [r0]\");
+}
+" compiles_fpu_fpa)
+ if(compiles_fpu_vfp)
+ set(fpu VFP)
+ elseif(compiles_fpu_fpa)
+ set(fpu FPA)
+ else()
+ set(fpu NONE)
+ endif()
+ ac_msg_result(${fpu})
+ set(CPPFLAGS "${CPPFLAGS} -DARM_FPU_${fpu}=1")
+ set(fpu)
+endif()
if(${TARGET} STREQUAL "unknown")
set(CPPFLAGS ${CPPFLAGS} -DNO_PORT)
@@ -2452,7 +2470,7 @@ if(${TARGET} STREQUAL "unknown")
endif()
if(NOT ACCESS_UNALIGNED)
- set(CPPFLAGS ${CPPFLAGS} -DNO_UNALIGNED_ACCESS)
+ set(CPPFLAGS "${CPPFLAGS} -DNO_UNALIGNED_ACCESS")
endif()
###case "x$gc" in