Hi Hans,

Thanks for your contribution!

There are some workarounds that I made for Macs (Xcode project) on  
these issues.
You can check out the patches from the svn repository available from  
FlightGear Mac OS X website so take a look at that.

Since I need to make universal binary packages for Mac OS X, I  
haven't integrated the
Mac portions into configure/automake in the original source tree, but  
it's very
welcome to have configure/automake things for Macs.
Plus, I really hope that such patches will be applied into the  
repository soon.
# Or I should have a cvs account to do it myself.

anyway, about ALUT thing, I simply added the alut.h since I don't  
want to change
Apple's framework.

To avoild errors regarding to APIENTRY, I made a patch:

--- org/plib-1.8.4/src/pui/puGLUT.h     2004-02-16 05:49:03.000000000  
-0800
+++ PLIB/plib/src/pui/puGLUT.h  2006-11-16 07:37:01.000000000 -0800
@@ -32,6 +32,10 @@
#ifdef UL_MAC_OSX
# include <GLUT/glut.h>
+# ifndef APIENTRY
+// This is a workaround to avoid getting errors in osg/BufferObject
+#   define APIENTRY
+# endif

--- org/SimGear/simgear/compiler.h      2006-11-03 01:57:02.000000000  
-0800
+++ SimGear/SimGear/simgear/compiler.h  2006-11-16 01:23:06.000000000  
-0800
@@ -376,7 +376,9 @@
#  define SG_GLU_H <OpenGL/glu.h>
#  define SG_GLEXT_H <OpenGL/glext.h>
#  define SG_GLUT_H <GLUT/glut.h>
-
+#  ifndef APIENTRY
+#    define APIENTRY
+#  endif
inline int (isnan)(double r) { return !(r <= 0 || r >= 0); }
#else
#  define SG_GL_H <GL/gl.h>

Hope it helps.

Now I'm working on building both 0.9.11-pre1 and cvs head.
I had some errors in linking osgViewer (when building fgfs cvs-head/ 
OSG-svn head)
OSG-2.0 seems OK so I'll go with it for cvs-head for a while.
By the way, do you know which revision/tag is suitable for building  
0.9.11-pre1?

Tat

On Jun 29, 2007, at 6:51 AM, Hans Fugal wrote:

> Here's what I had to do to compile CVS on OS X Tiger.
>
> Install dependencies. I got plib from macports, simgear from CVS, and
> OSG 2.0 binaries from the OSG website.
>
> Tiger includes OpenAL 1.1, but not ALUT, so there is no alut.h on the
> system. According to Apple[1] you should install freealut to get  
> alut.h,
> but Apple in their infinite wisdom decided to include the ALUT symbols
> in their OpenAL framework, so if you try to install freealut you get
> symbol conflicts. See [2] for the gory details. The simplest solution
> seems to be to grab alut.h from the OpenAL 1.0 distribution and put it
> in /System/Library/Frameworks/OpenAL.framework/Headers
>
> As mentioned in a previous email, there is a compilation problem  
> due to
> glut.h undefining APIENTRY. I hope that we can find a workaround for
> that in FlightGear source, but in the meantime the easiest fix is to
> hack your plib/pu.h to define APIENTRY after including glut.h (or hack
> glut.h to not undefine it).
>
> The following patch is required:
>
> --- a/src/Instrumentation/render_area_2d.cxx
> +++ b/src/Instrumentation/render_area_2d.cxx
> @@ -30,7 +30,8 @@
>  #   include <windows.h>
>  #endif
>
> -#include <GL/gl.h>
> +#include <simgear/compiler.h>
> +#include SG_GL_H
>
>  #include "render_area_2d.hxx"
>
>
> Since OSG binaries are frameworks, the linkage needs to be changed to
> use -framework instead of -l. If you build OSG by hand, -l is correct,
> however you have to set OSG_LIBRARY_PATH=/usr/local/lib/ 
> osgPlugins-2.0.0
> because the make install target and the source code aren't on the same
> page as to where plugins should be installed. I have reported that to
> the OSG list and hopefully in future releases it will be fixed. In any
> case, users will rather use the binaries (frameworks) and  
> developers can
> build frameworks from SVN, so -framework seems to me to be the most
> correct.
>
> Whether using -l or -framework for osg libraries, I had to link in  
> osgGA
> and osgText explicitly or it would not link.
>
>
> Are we working towards total independence from plib?  If so the  
> APIENTRY
> problem will disappear on its own.
>
> The -framework issue I am happy to provide a patch for, as soon as  
> I can
> figure out the right way to hack the autoconf/automake stuff to do so.
> Currently src/Main/Makefile.am includes the -l phrases explicitly,  
> that
> will probably need to be changed to something more generic,  
> probably in
> configure.ac. Does anyone know the right place for this? I'm  
> inclined to
> take the OpenAL test in configure.ac as a basis.
>
> Thanks
>
> References
> 1. http://developer.apple.com/qa/qa2006/qa1504.html
> 2. http://opensource.creative.com/pipermail/openal/2006-August/ 
> 009761.html
>
> -- 
> Hans Fugal
> Fugal Computing
>
> ---------------------------------------------------------------------- 
> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to