Thread
:
3D Graphics Engine for N900
View Single Post
ali1234
2009-11-20 , 17:02
Posts: 15 | Thanked: 48 times | Joined on Nov 2009 @ United Kingdom
#
19
Hello,
I have compiled Ogre for armel using the N900 SDK. I have not tried running it yet, but it should work. Here is how to do it:
install cmake in the SDK
check out ogre svn (tested with revision 9270)
export a clean working dir (svn export . ../ogre-maemo)
apply this patch:
----------------------------------- cut -----------------------------------
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
----------------------------------- cut -----------------------------------
create a directory to build in eg build-n900
now you should have a directory structure something like this:
ogre
\ ogre (svn managed directory)
\ ogre-maemo (which patch applied)
\ build-n900 (where cmake will build it)
Now build it with:
cd build-n900 && cmake -DOGRE_BUILD_TOOLS=0 ../ogre-maemo && make && make install
Quote & Reply
|
The Following 2 Users Say Thank You to ali1234 For This Useful Post:
BruceL
,
REMFwhoopitydo
ali1234
View Public Profile
Send a private message to ali1234
Find all posts by ali1234