Please excuse the sloppy patch, and consider this one instead.
On Dec 21, 2007 11:04 AM, Hans Fugal <[EMAIL PROTECTED]> wrote:
> Please review the attached patch and either apply or give feedback.
>
>
> On Dec 20, 2007 6:26 PM, Hans Fugal <[EMAIL PROTECTED]> wrote:
> > In src/Main/Makefile.am, OSG_LIBS is set explicitly to -losg, etc.
> > This is not portable with OS X, which uses "-framework osg" (it can
> > also use the -losg style depending on how osg was installed. End users
> > will use the -framework style installation).
--
Hans Fugal
Fugal Computing
Index: fgs/configure.ac
===================================================================
--- fgs.orig/configure.ac 2007-12-21 11:20:23.000000000 -0700
+++ fgs/configure.ac 2007-12-21 11:23:14.000000000 -0700
@@ -504,6 +504,75 @@
exit
fi
+case "${host}" in
+*-apple-darwin*)
+
+ dnl Thank you Christian Bauer from SheepSaver
+ dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
+ AC_DEFUN([AC_CHECK_FRAMEWORK], [
+ AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
+ AC_CACHE_CHECK([whether compiler supports framework $1],
+ ac_Framework, [
+ saved_LIBS="$LIBS"
+ LIBS="$LIBS -framework $1"
+ AC_TRY_LINK(
+ [$2], [],
+ [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
+ )
+ ])
+ AS_IF([test AS_VAR_GET(ac_Framework) = yes],
+ [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
+ )
+ AS_VAR_POPDEF([ac_Framework])dnl
+ ])
+
+ if USE_OSGDEBUG; then
+ AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
+ AC_CHECK_LIB(osgGAd,osgGAGetVersion)
+ AC_CHECK_LIB(osgTextd,osgTextGetVersion)
+ LIBS="$LIBS -losgFXd"
+ AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
+ AC_CHECK_LIB(osgDBd,osgDBGetVersion)
+ AC_CHECK_LIB(osgSimd,osgSimGetVersion)
+ AC_CHECK_LIB(osgd,osgGetVersion)
+ AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
+ else
+ AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>])
+ AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>])
+ AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>])
+ AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>])
+ AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>])
+ AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>])
+ AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>])
+ AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>])
+ AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>])
+ fi
+ ;;
+*)
+ if USE_OSGDEBUG; then
+ AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
+ AC_CHECK_LIB(osgGAd,osgGAGetVersion)
+ AC_CHECK_LIB(osgTextd,osgTextGetVersion)
+ LIBS="$LIBS -losgFXd"
+ AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
+ AC_CHECK_LIB(osgDBd,osgDBGetVersion)
+ AC_CHECK_LIB(osgSimd,osgSimGetVersion)
+ AC_CHECK_LIB(osgd,osgGetVersion)
+ AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
+ else
+ AC_CHECK_LIB(osgViewer,osgViewerGetVersion)
+ AC_CHECK_LIB(osgGA,osgGAGetVersion)
+ AC_CHECK_LIB(osgText,osgTextGetVersion)
+ LIBS="$LIBS -losgFX"
+ AC_CHECK_LIB(osgUtil,osgUtilGetVersion)
+ AC_CHECK_LIB(osgDB,osgDBGetVersion)
+ AC_CHECK_LIB(osgSim,osgSimGetVersion)
+ AC_CHECK_LIB(osg,osgGetVersion)
+ AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
+ fi
+ ;;
+esac
+
AC_LANG_POP
dnl Check for system installed zlib
Index: fgs/src/Main/Makefile.am
===================================================================
--- fgs.orig/src/Main/Makefile.am 2007-12-21 11:21:21.000000000 -0700
+++ fgs/src/Main/Makefile.am 2007-12-21 11:21:59.000000000 -0700
@@ -26,12 +26,6 @@
endif
endif
-if USE_OSGDEBUG
-OSG_LIBS = -losgViewerd -losgGAd -losgTextd -losgFXd -losgUtild -losgDBd -losgSimd -losgd -lOpenThreadsd
-else
-OSG_LIBS = -losgViewer -losgGA -losgText -losgFX -losgUtil -losgDB -losgSim -losg -lOpenThreads
-endif
-
JSBSIM_LIBS = \
$(top_builddir)/src/FDM/JSBSim/libJSBSim.a \
$(top_builddir)/src/FDM/JSBSim/initialization/libInit.a \
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel