Hi Jari, Thanks for your patch, and sorry for my very late reply. I'm back from my vacation and have been catching up the discussions on the list.
It all seems good to me but I need to work a bit more on OpenAL and svn lib thingies. Mac OS X, by default, has OpenAL.framework with ALUT implementation. Only the problem is that it lacks alut.h in its Headers folder. So what we need to check is the existance of alut.h in SimGear's configure FlightGear's configure doesn't need to check the existance of alut.h since it doens't include the header. Anyway, we have to either install OpenAL with alut.h to /Library/Frameworks or manually add alut.h to /Developer/SDKs/*/System/Library/Frameworks/OpenAL.frameworks/Headers/ We also need some hacks to alc.h for avoiding error messages (invalid type conversion between ALvoid and void) when using g++ 4.2.x. Maybe we should add some note on this issue to README.OpenAL. svn library checks look good to me, but we probably should let the users specify the location of the libs. This is mainly because svn libs on 10.5.x is older and users usually install the newer ones to /usr/local or some other folder. LDFLAGS="-L/some/path/to/svn-libs" configure works in such case, but configure --with-svn-libs=/some/path/to/svnlibs could be better. Anyway, I'll apply your patch and make some modifications for better usability, so be patient for a bit more please. Best, Tat On Nov 1, 2009, at 7:03 AM, Jari Häkkinen wrote: > I have made changes (improvements?) to the configure script. I have > attached a patch file for configure.ac with changes targeting issues > with building flightgear on my mac. The changes will only impact mac > users. > > Changes made: > > 1) Fixed mixup in AC_ARG_WITH between osg and plib. > > 2) Added check for that openal framework can be located in the default > framework path. Test for non-standard path is not implemented. > > 3) Added check if alut is a part of the OpenAL framework, if not the a > AC_SEARCH_LIBS os performed to search for freealut. Snow Leopard > does not provide alut as a part of the OpenAL framework. > > 4) I added --with-cocoa-framework option. This enables the user to > switch from the default Carbon framework to Cocoa. > > Comments: > > Change 1) is an error in configure.ac and should be fixed even if the > rest of my changes are rejected. > > Change 2) and 3) may break things for other mac users since there was > no checks before, configure simply set some variables without testing. > > Change 4) is needed to compile 64-bit binaries on mac but the change > will not affect Carbon users. Carbon is 32-bit only whereas Cocoa > comes also in 64-bit flavour. (OSG works with Cocoa but OSG quicktime > support must be dropped and the ImageIO plug-in must probably be used > in OSG). > > Can some other mac users try my changes and report back? If the > changes work on other machines than mine then can convince someone to > commit the changes to CVS. > > > Cheers, > > Jari > Index: configure.ac > =================================================================== > RCS file: /var/cvs/FlightGear-0.9/source/configure.ac,v > retrieving revision 1.154 > diff -u -p -r1.154 configure.ac > --- configure.ac 17 Sep 2009 07:39:04 -0000 1.154 > +++ configure.ac 31 Oct 2009 21:55:35 -0000 > @@ -85,16 +85,27 @@ case "${host}" in > ]) > > # Mac OS X specific configure options > - AC_ARG_WITH(osg_framework, [ --with-osg-framework=PREFIX Specify > the prefix path to osg frameworks [default=standard framework paths]]) > > - if test "x$with_plib_framework" != "x" ; then > - echo "plib prefix is $with_plib_framework" > + # OpenAL framework is used by default, no openal_framework implemented. > + > + AC_ARG_WITH(cocoa_framework, [ --with-cocoa-framework Use the > Cocoa rather than Carbon]]) > + if test "x$with_cocoa_framework" != "x" ; then > + macAPI=Cocoa > + AC_MSG_NOTICE([Using Cocoa framework]) > + else > + macAPI=Carbon > + AC_MSG_NOTICE([Using Carbon framework]) > fi > > - AC_ARG_WITH(plib_framework, [ --with-plib-framework=PREFIX > Specify the prefix path to PLIB framework [default=standard framework paths]]) > + AC_ARG_WITH(osg_framework, [ --with-osg-framework=PREFIX Specify > the prefix path to osg frameworks [default=standard framework paths]]) > if test "x$with_osg_framework" != "x" ; then > echo "osg prefix is $with_osg_framework" > fi > + > + AC_ARG_WITH(plib_framework, [ --with-plib-framework=PREFIX > Specify the prefix path to PLIB framework [default=standard framework paths]]) > + if test "x$with_plib_framework" != "x" ; then > + echo "plib prefix is $with_plib_framework" > + fi > ;; > esac > > @@ -335,7 +346,7 @@ case "${host}" in > *-apple-darwin*) > dnl Mac OS X > > - LIBS="$LIBS -framework GLUT -framework OpenGL -framework AGL -framework > Carbon -lobjc" > + LIBS="$LIBS -framework GLUT -framework OpenGL -framework AGL -framework > $macAPI -lobjc" > joystick_LIBS="$joystick_LIBS -framework IOKit -framework CoreFoundation" > ;; > > @@ -399,11 +410,27 @@ case "${host}" in > *-apple-darwin*) > dnl Mac OS X > > - LIBS="$LIBS -framework IOKit -framework OpenAL" > - openal_LIBS="$LIBS" > - # not sure how to test if OpenAL exists on MacOS (does it come by > default?) > - OPENAL_OK="yes" > - ALUT_OK="yes" > + if test "x$with_openal_lib" != "x"; then > + # Check for openal libs with AC_CHECK_LIB() missing here! > + openal_LIBS="" > + else > + # Check that OpenAL framework can be found > + AC_CHECK_FRAMEWORK(OpenAL,[#include <OpenAL/al.h>]) > + if test "x$ac_cv_framework_OpenAL" = "xyes" ; then > + openal_LIBS="$FRAMEWORKS" > + OPENAL_OK="yes" > + # Looking for alut.h, if found assume that it is a part of > + # the OpenAL package. > + AC_CHECK_HEADERS([OpenAL/alut.h],[ALUT_OK="yes"]) > + fi > + fi > + > + # Check if alut was considered to be a part of the OpenAL > + # framework above, if not try to locate a alut library. > + if test "x$ALUT_OK" = "xno" ; then > + AC_SEARCH_LIBS(alutInit, alut, > + [ ALUT_OK="yes" openal_LIBS="$openal_LIBS -lalut" ]) > + fi > ;; > > *) > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference_______________________________________________ > Flightgear-devel mailing list > Flightgear-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flightgear-devel ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel