Hi,
i've picked up the work on the OSX Port of MG. I had Version 3.4.0 running successfully on my MacBook. Now i'm trying to get it running again from svn revision 2455, which has some problems. At the moment i'm using cmake/make for building MG "the unix way" on my MacBook, because of missing knowledge of C++ and Xcode.
MAXPATHLEN and _NSGetExecutablePath were unkown in platform_common.cpp. I've fixed this by this changes:
Index: source/shared_lib/sources/platform/common/platform_common.cpp
===================================================================
--- source/shared_lib/sources/platform/common/platform_common.cpp (revision 2455)
+++ source/shared_lib/sources/platform/common/platform_common.cpp (working copy)
@@ -25,6 +25,13 @@
#endif
+#if defined(__APPLE__)
+
+#include <sys/param.h> // For MAXPATHLEN
+#include <mach-o/dyld.h> // For _NSGetExecutablePath
+
+#endif
+
#ifdef WIN32
#define S_ISDIR(mode) (((mode) & _S_IFDIR) == _S_IFDIR)
#elif defined(__GNUC__)
@@ -1789,8 +1796,8 @@
}
}
#elif __APPLE__
+ uint32_t path_len = MAXPATHLEN;
char path[MAXPATHLEN+1]="";
- uint32_t path_len = MAXPATHLEN;
if ( _NSGetExecutablePath(path, &path_len) ) {
if(includeExeNameInPath == true) {
value = exeName;
But now i've the following problem:
[ 0%] Generating mg.tmp
[ 1%] Built target run
[ 26%] Built target streflop
[ 26%] Built target g2xml
[ 27%] Built target xml2g
[ 28%] [ 28%] Building CXX object source/shared_lib/CMakeFiles/libmegaglest.dir/sources/platform/macosx/gl_wrap.mm.o
Building CXX object source/shared_lib/CMakeFiles/libmegaglest.dir/sources/platform/macosx/NSFont_OpenGL.m.o
cc1objplus: note: -ftree-vectorize enables strict aliasing. -fno-strict-aliasing is ignored when Auto Vectorization is used.
cc1obj: warning: command line option "-fvisibility-inlines-hidden" is valid for C++/ObjC++ but not for ObjC
cc1obj: note: -ftree-vectorize enables strict aliasing. -fno-strict-aliasing is ignored when Auto Vectorization is used.
In file included from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/streflop.h:90,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/streflop_cond.h:13,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/platform/common/math_wrapper.h:18,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/graphics/vec.h:16,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/platform/sdl/window.h:21,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/sources/platform/macosx/gl_wrap.mm:21:
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h:61:2: warning: #warning STREFLOP: FE_XXX flags were already defined and will be redefined! Check you do not use the system libm.
In file included from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/streflop.h:90,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/streflop_cond.h:13,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/platform/common/math_wrapper.h:18,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/graphics/vec.h:16,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/platform/sdl/window.h:21,
from /Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/sources/platform/macosx/gl_wrap.mm:21:
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h: In function ‘int streflop::fegetenv(streflop::fenv_t*)’:
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h:327: error: lvalue required in asm statement
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h:332: error: lvalue required in asm statement
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h:327: error: invalid lvalue in asm output 0
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h:332: error: invalid lvalue in asm output 0
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h: In function ‘int streflop::fesetenv(const streflop::fenv_t*)’:
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h:341: error: lvalue required in asm statement
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h:346: error: lvalue required in asm statement
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h:341: error: invalid lvalue in asm output 0
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/FPUSettings.h:346: error: invalid lvalue in asm output 0
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/sources/platform/macosx/gl_wrap.mm: In function ‘BOOL Shared::Platform::makeDisplayList(GLint, NSImage*)’:
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/sources/platform/macosx/gl_wrap.mm:52: error: call of overloaded ‘ceil(double)’ is ambiguous
/usr/include/architecture/i386/math.h:366: note: candidates are: double ceil(double)
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/SMath.h:453: note: streflop::Double streflop::ceil(streflop::Double)
/Users/m0ellemeister/Downloads/MegaGlest-svn/megaglest-cmake/source/shared_lib/include/streflop/SMath.h:245: note: streflop::Simple streflop::ceil(streflop::Simple)
/usr/include/c++/4.2.1/cmath:172: note: long double std::ceil(long double)
/usr/include/c++/4.2.1/cmath:168: note: float std::ceil(float)
make[2]: *** [source/shared_lib/CMakeFiles/libmegaglest.dir/sources/platform/macosx/gl_wrap.mm.o] Error 1
make[1]: *** [source/shared_lib/CMakeFiles/libmegaglest.dir/all] Error 2
make: *** [all] Error 2
Maybe some one can give me a hint how to fix this? Thx.