← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1747: Some tiny modifications for Mac OS X compatibility (Does not compil yet).

 

------------------------------------------------------------
revno: 1747
committer: Vincent Richefeu <richefeu@macbook-pro-de-vincent-richefeu.local>
branch nick: trunk
timestamp: Fri 2009-08-28 15:01:10 +0200
message:
  Some tiny modifications for Mac OS X compatibility (Does not compil yet).
modified:
  SConstruct
  core/MetaBody.hpp
  core/Timing.hpp
  gui/qt3/GLViewer.cpp
  pkg/common/RenderingEngine/GLDrawWidgets/GLDrawColorScale.cpp
  pkg/common/RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp
  pkg/snow/PreProcessor/Voxel/Config.cpp
  pkg/snow/PreProcessor/Voxel/DataSurface.cpp
  pkg/snow/PreProcessor/Voxel/DataVoxel.cpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'SConstruct'
--- SConstruct	2009-08-25 22:28:12 +0000
+++ SConstruct	2009-08-28 13:01:10 +0000
@@ -145,6 +145,7 @@
 	('CPPPATH', 'Additional paths for the C preprocessor (whitespace separated)',None,None,Split),
 	('LIBPATH','Additional paths for the linker (whitespace separated)',None,None,Split),
 	('QTDIR','Directories where to look for qt3',['/usr/share/qt3','/usr/lib/qt','/usr/lib/qt3','/usr/qt/3','/usr/lib/qt-3.3'],None,Split),
+	#('CXX','The c++ compiler','g++-4.2'),# FIXME, VR sorry for macosx port 
 	('CXX','The c++ compiler','g++'),
 	('CXXFLAGS','Additional compiler flags for compilation (like -march=core2).',None,None,Split),
 	('march','Architecture to use with -march=... when optimizing','native',None,None),
@@ -329,6 +330,7 @@
 	# check "optional" libs
 	if 'opengl' in env['features']:
 		ok=conf.CheckLibWithHeader('glut','GL/glut.h','c++','glutGetModifiers();',autoadd=1)
+		#if not ok: ok=conf.CheckLibWithHeader('glut','GLUT/glut.h','c++','glutGetModifiers();',autoadd=1)
 		if not ok: featureNotOK('opengl')
 	if 'gts' in env['features']:
 		env.ParseConfig('pkg-config glib-2.0 --cflags --libs');
@@ -433,7 +435,13 @@
 env.Append(LIBS=[],SHLINKFLAGS=['-rdynamic'])
 
 # if this is not present, vtables & typeinfos for classes in yade binary itself would not be exported, plugins wouldn't work
-env.Append(LINKFLAGS=['-rdynamic','-z','origin']) 
+if env['PLATFORM']=='darwin': 
+	print 'darwin platform'
+	#env.Append(LINKFLAGS=['-Z']) # ?? FIXME
+	env.Append(FRAMEWORKS=['CoreServices','Carbon'])
+else:
+	env.Append(LINKFLAGS=['-rdynamic','-z','origin']) 
+
 # makes dynamic library loading easier (no LD_LIBRARY_PATH) and perhaps faster
 env.Append(RPATH=runtimeLibDirs)
 # find already compiled but not yet installed libraries for linking

=== modified file 'core/MetaBody.hpp'
--- core/MetaBody.hpp	2009-08-06 21:05:28 +0000
+++ core/MetaBody.hpp	2009-08-28 13:01:10 +0000
@@ -17,6 +17,10 @@
 #include"BexContainer.hpp"
 #include"GroupRelationData.hpp"
 
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 255 
+#endif
+
 class MetaBody : public Body
 {
 	public :

=== modified file 'core/Timing.hpp'
--- core/Timing.hpp	2009-07-27 17:08:23 +0000
+++ core/Timing.hpp	2009-08-28 13:01:10 +0000
@@ -7,7 +7,14 @@
 	long nExec;
 	delta nsec;
 	TimingInfo():nExec(0),nsec(0){}
-	static delta getNow(bool evenIfDisabled=false){ if(!enabled && !evenIfDisabled) return 0L; struct timespec ts; clock_gettime(CLOCK_MONOTONIC,&ts); return delta(1e9*ts.tv_sec+ts.tv_nsec);}
+	static delta getNow(bool evenIfDisabled=false){ 
+		if(!enabled && !evenIfDisabled) return 0L; struct timespec ts; 
+#ifdef __APPLE__
+#else
+		clock_gettime(CLOCK_MONOTONIC,&ts); 
+#endif
+		return delta(1e9*ts.tv_sec+ts.tv_nsec);
+	}
 	static bool enabled;
 };
 

=== modified file 'gui/qt3/GLViewer.cpp'
--- gui/qt3/GLViewer.cpp	2009-08-23 15:50:47 +0000
+++ gui/qt3/GLViewer.cpp	2009-08-28 13:01:10 +0000
@@ -12,7 +12,13 @@
 #include"QtGUI.hpp"
 #include"YadeCamera.hpp"
 #include"YadeQtMainWindow.hpp"
-#include<GL/glut.h>
+
+#ifdef __APPLE__
+#  include <GLUT/glut.h>
+#else
+#  include <GL/glut.h>
+#endif
+
 #include<yade/lib-opengl/FpsTracker.hpp>
 #include<yade/lib-opengl/OpenGLWrapper.hpp>
 #include<yade/core/Body.hpp>

=== modified file 'pkg/common/RenderingEngine/GLDrawWidgets/GLDrawColorScale.cpp'
--- pkg/common/RenderingEngine/GLDrawWidgets/GLDrawColorScale.cpp	2009-08-03 10:02:11 +0000
+++ pkg/common/RenderingEngine/GLDrawWidgets/GLDrawColorScale.cpp	2009-08-28 13:01:10 +0000
@@ -7,7 +7,13 @@
 *************************************************************************/
 
 #include "GLDrawColorScale.hpp"
-#include <GL/glut.h>
+
+#ifdef __APPLE__
+#  include <GLUT/glut.h>
+#else
+#  include <GL/glut.h>
+#endif
+
 #include <yade/pkg-common/ColorScale.hpp>
 #include<yade/lib-opengl/OpenGLWrapper.hpp>
 

=== modified file 'pkg/common/RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp'
--- pkg/common/RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp	2009-08-28 06:41:57 +0000
+++ pkg/common/RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp	2009-08-28 13:01:10 +0000
@@ -5,9 +5,16 @@
 #include<yade/lib-opengl/OpenGLWrapper.hpp>
 #include<yade/lib-opengl/GLUtils.hpp>
 #include<yade/core/Timing.hpp>
-#include<GL/glu.h>
-#include<GL/gl.h>
-#include<GL/glut.h>
+
+#ifdef __APPLE__
+#  include <OpenGL/glu.h>
+#  include <OpenGL/gl.h>
+#  include <GLUT/glut.h>
+#else
+#  include <GL/glu.h>
+#  include <GL/gl.h>
+#  include <GL/glut.h>
+#endif
 
 YADE_PLUGIN((OpenGLRenderingEngine));
 YADE_REQUIRE_FEATURE(OPENGL)

=== modified file 'pkg/snow/PreProcessor/Voxel/Config.cpp'
--- pkg/snow/PreProcessor/Voxel/Config.cpp	2009-07-29 10:05:36 +0000
+++ pkg/snow/PreProcessor/Voxel/Config.cpp	2009-08-28 13:01:10 +0000
@@ -1,6 +1,12 @@
 YADE_REQUIRE_FEATURE(COMPILED_BY_INCLUDE_FROM_SnowVoxelsLoader.cpp)
 #include "Config.hpp"
-#include <GL/glut.h>
+
+#ifdef __APPLE__
+#  include <GLUT/glut.h>
+#else
+#  include <GL/glut.h>
+#endif
+
 #include <iostream>
 namespace po = boost::program_options;
 

=== modified file 'pkg/snow/PreProcessor/Voxel/DataSurface.cpp'
--- pkg/snow/PreProcessor/Voxel/DataSurface.cpp	2009-07-28 05:23:39 +0000
+++ pkg/snow/PreProcessor/Voxel/DataSurface.cpp	2009-08-28 13:01:10 +0000
@@ -2,7 +2,13 @@
 #include <fstream>
 #include <boost/lexical_cast.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
-#include <GL/glut.h>
+
+#ifdef __APPLE__
+#  include <GLUT/glut.h>
+#else
+#  include <GL/glut.h>
+#endif
+
 #include "DataSurface.hpp"
 #include<yade/pkg-snow/Config.hpp>
 #include "VoxelEnvelope.hpp"

=== modified file 'pkg/snow/PreProcessor/Voxel/DataVoxel.cpp'
--- pkg/snow/PreProcessor/Voxel/DataVoxel.cpp	2009-07-29 10:05:36 +0000
+++ pkg/snow/PreProcessor/Voxel/DataVoxel.cpp	2009-08-28 13:01:10 +0000
@@ -2,7 +2,13 @@
 #include <fstream>
 #include <boost/lexical_cast.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
-#include <GL/glut.h>
+
+#ifdef __APPLE__
+#  include <GLUT/glut.h>
+#else
+#  include <GL/glut.h>
+#endif
+
 #include "DataVoxel.hpp"
 #include "Config.hpp"
 #include <list>