View Single Post
Posts: 15 | Thanked: 48 times | Joined on Nov 2009 @ United Kingdom
#20
Updated patch which actually works:
Code:
diff -Nur ogre-orig/CMakeLists.txt ogre-maemo/CMakeLists.txt
--- ogre-orig/CMakeLists.txt	2009-10-29 11:13:21.000000000 +0000
+++ ogre-maemo/CMakeLists.txt	2009-11-05 01:07:47.000000000 +0000
@@ -56,7 +56,10 @@
 
 # Set compiler specific build flags
 if (CMAKE_COMPILER_IS_GNUCXX)
-  add_definitions(-msse)
+  # need a test here to only enable this flag on processors that have SSE
+  if(NOT ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm"))
+    add_definitions(-msse)
+  endif ()
 endif ()
 if (MSVC)
   add_definitions(/fp:fast)
diff -Nur ogre-orig/OgreMain/src/OgrePlatformInformation.cpp ogre-maemo/OgreMain/src/OgrePlatformInformation.cpp
--- ogre-orig/OgreMain/src/OgrePlatformInformation.cpp	2009-09-15 15:24:55.000000000 +0100
+++ ogre-maemo/OgreMain/src/OgrePlatformInformation.cpp	2009-11-05 00:14:13.000000000 +0000
@@ -42,7 +42,8 @@
 
     #if OGRE_CPU == OGRE_CPU_ARM
         #include <sys/sysctl.h>
-        #include <mach/machine.h>
+//        This file is missing - iPhone specific?
+//        #include <mach/machine.h>
     #endif
 #endif
 
@@ -530,10 +531,10 @@
         
         static char processor[257];
         size_t s = sizeof processor;
-        static int mib[] = { CTL_HW, HW_MODEL };
-        if (sysctl (mib, 2, processor, &s, 0, 0) >= 0)
-            cpuID = processor;
-        else
+//        static int mib[] = { CTL_HW, HW_MODEL };
+//        if (sysctl (mib, 2, processor, &s, 0, 0) >= 0)
+//            cpuID = processor;
+//        else
             cpuID = "Unknown ARM";
 
 #endif
diff -Nur ogre-orig/OgreMain/src/nedmalloc/malloc.c.h ogre-maemo/OgreMain/src/nedmalloc/malloc.c.h
--- ogre-orig/OgreMain/src/nedmalloc/malloc.c.h	2009-01-05 15:29:00.000000000 +0000
+++ ogre-maemo/OgreMain/src/nedmalloc/malloc.c.h	2009-11-20 17:34:19.000000000 +0000
@@ -1838,7 +1838,12 @@
 /* Cope with old-style linux recursive lock initialization by adding */
 /* skipped internal declaration from pthread.h */
 #ifdef linux
-#ifndef PTHREAD_MUTEX_RECURSIVE
+
+// this test fails to give the correct result when PTHREAD_MUTEX_RECURSIVE
+// is declared as an enum rather than a #define - which is the case on 
+// recent pthreads libraries
+//#ifndef PTHREAD_MUTEX_RECURSIVE
+#if 0
 extern int pthread_mutexattr_setkind_np __P ((pthread_mutexattr_t *__attr,
 					   int __kind));
 #define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
Compile and install with:

Code:
cmake -DOGRE_BUILD_TOOLS=0 -DOGRE_BUILD_RENDERSYSTEM_GLES=1 ../ogre-maemo && make && make install
You need to install libxaw7 and libgles1 on the device. Tested as far as opening a render window on the device. It should really work now.
 

The Following 8 Users Say Thank You to ali1234 For This Useful Post: