]> git.mxchange.org Git - flightgear.git/blobdiff - configure.ac
Use simgear abstraction instead of directly osg for the AIBase class.
[flightgear.git] / configure.ac
index fda72f9fc2ef00d83d3f6c67465b3515db4a7723..1e6eb40a7c5353bc9a48533bfc6af726d77cef7d 100644 (file)
@@ -58,7 +58,7 @@ case "${host}" in
 
     dnl Thank you Christian Bauer from SheepSaver
     dnl Modified by Tatsuhiro Nishioka for accepting a given framework path
-    dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES, $3=FRAMEWORK_PATH) ; $3 is optional
+    dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES, $3=FRAMEWORK_PATH, $4=ACTION_IF_FOUND) ; 
     AC_DEFUN([AC_CHECK_FRAMEWORK], [
     AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
     AC_CACHE_CHECK([whether compiler supports framework $1],
@@ -71,6 +71,7 @@ case "${host}" in
             FRAMEWORKS="$FRAMEWORKS -F$3"
             CXXFLAGS="$CXXFLAGS -F$3"
             CCFLAGS="$CCFLAGS -F$3"
+            CPPFLAGS="$CPPFLAGS -F$3"
             dnl This is needed for AC_TRY_LINK when a framework path is specified
             export DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}:$3"
         fi
@@ -82,6 +83,7 @@ case "${host}" in
     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_IF([test AS_VAR_GET(ac_Framework) = yes], $4)
     AS_VAR_POPDEF([ac_Framework])dnl
     ])
 
@@ -107,9 +109,9 @@ case "${host}" in
        export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$with_plib_framework"
     fi
 
-    AC_ARG_WITH(openal_framework, [ --with-openal-framework=PREFIX    Speicfy the prefix path to OpenAL.framework ])
-    if test "x$with_openal_framework" != "x"; then
-        echo "OpenAL framework prefix is $with_openal_framework"
+    AC_ARG_WITH(alut_framework, [ --with-alut-framework=PREFIX    Specify the prefix path to ALUT.framework ])
+    if test "x$with_alut_framework" != "x"; then
+        echo "ALUT framework prefix is $with_alut_framework"
     fi
 
     ;;
@@ -175,6 +177,17 @@ else
 fi
 AM_CONDITIONAL(ENABLE_SP_FDM, test "x$enable_sp_fdms" != "xno")
 
+# Specify whether we want to compile ATCDCL.
+# default to with_atcdcl=yes
+AC_ARG_ENABLE(atcdcl, [  --enable-atcdcl                Compile and link the depricated atc/ai module], [enable_atcdcl="$enableval"] )
+if test "x$enable_atcdcl" != "xno"; then
+    AC_DEFINE([ENABLE_ATCDCL], 1, [Define to include old ATC/AI module])
+else
+    AC_DEFINE([ENABLE_ATCDCL], 0, [Define to include old ATC/AI module])
+fi
+AM_CONDITIONAL(ENABLE_ATCDCL, test "x$enable_atcdcl" != "xno")
+
+
 
 dnl EXPERIMENTAL generic event driven input device
 # defaults to no
@@ -218,6 +231,7 @@ if test "x$with_threads" = "xyes"; then
 fi
 AC_CHECK_HEADER(pthread.h)
 
+
 dnl Used by JSBSim to conditionally compile in fgfs interface code
 AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
 
@@ -300,7 +314,7 @@ AC_SEARCH_LIBS(clock_gettime, rt)
 base_LIBS="$LIBS"
 
 dnl Check for SDL or glut if enabled.
-AC_ARG_ENABLE(osgviewer, [  --enable-osgviewer                  Configure to use osgViewer(default)], [enable_osgviewer="$enableval"])
+AC_ARG_ENABLE(osgviewer, [  --enable-osgviewer             Configure to use osgViewer(default)], [enable_osgviewer="$enableval"])
 AC_ARG_ENABLE(sdl,  [  --enable-sdl                   Configure to use SDL], [enable_sdl="$enableval"])
 AC_ARG_ENABLE(glut, [  --enable-glut                  Configure to use GLUT], [enable_glut="$enableval"])
 AM_CONDITIONAL(USE_SDL, test "x$enable_sdl" = "xyes")
@@ -416,19 +430,15 @@ case "${host}" in
 *-apple-darwin*)
     dnl Mac OS X
 
-    # Mac OS X has OpenAL.framework with ALUT by default
-    # so we can use it without checking it.
-    # Note: SimGear needs to check the existance of alut.h since it includes the header.
-    LIBS="$LIBS -framework IOKit -framework OpenAL"
-    openal_LIBS="$LIBS"
-    OPENAL_OK="yes"
-    ALUT_OK="yes"
+    # Mac OS X has OpenAL.framework, but no ALUT, by default, so we
+    # require use of a non-Apple ALUT.framework which we provide
+    openal_LIBS="-framework IOKit -framework OpenAL"
     
-    dnl Check for OpenAL.framework when --with-openal-framework is specified
-    if test "x$with_openal_framework" != "x"; then
-      AC_CHECK_FRAMEWORK(OpenAL, [#include <OpenAL/alut.h>], $with_openal_framework)
-    fi
-
+    AC_CHECK_FRAMEWORK(OpenAL, [#include <OpenAL/al.h>], "", [OPENAL_OK="yes"])
+    AC_CHECK_FRAMEWORK(ALUT, [#include <ALUT/alut.h>], $with_alut_framework, [
+        ALUT_OK="yes"
+        openal_LIBS="$openal_LIBS -framework ALUT"
+    ])
     ;;
 
 *)
@@ -500,7 +510,7 @@ if test "x$ac_cv_header_simgear_version_h" != "xyes"; then
     exit
 fi
 
-AC_MSG_CHECKING([for SimGear 1.9.0 or newer])
+AC_MSG_CHECKING([for SimGear 2.0.0 or newer])
 AC_TRY_RUN([
 #include <stdio.h>
 
@@ -509,8 +519,8 @@ AC_TRY_RUN([
 #define STRINGIFY(X) XSTRINGIFY(X)
 #define XSTRINGIFY(X) #X
 
-#define MIN_MAJOR 1
-#define MIN_MINOR 9
+#define MIN_MAJOR 2
+#define MIN_MINOR 0
 #define MIN_MICRO 0
 
 int main() {
@@ -615,88 +625,48 @@ dnl joystick lib
 AC_DEFINE([ENABLE_PLIB_JOYSTICK], 1, [Define to enable plib joystick support])
 
 # Find the OSG libraries.  Note special handling for OS X frameworks
-case "${host}" in
-*-apple-darwin*)
-    if test "x$with_osg_framework" = "x"; then
-        if test "x$enable_osgdebug" = "xyes"; then
-            # debug version of osg libs
-            AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
-            openthreads_LIBS="$LIBS"
-            LIBS=""
-            AC_CHECK_LIB(osgd,osgGetVersion)
-            AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
-            AC_CHECK_LIB(osgDBd,osgDBGetVersion)
-            AC_CHECK_LIB(osgTextd,osgTextGetVersion)
-            AC_CHECK_LIB(osgGAd,osgGAGetVersion)
-            AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
-            AC_CHECK_LIB(osgSimd,osgSimGetVersion)
-            AC_CHECK_LIB(osgParticled,osgParticleGetVersion)
-            OSG_LIBS="$LIBS -losgFXd $openthreads_LIBS"
-            LIBS=""
-        else
-            # release version of osg libs
-            AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
-            openthreads_LIBS="$LIBS"
-            LIBS=""
-            AC_CHECK_LIB(osg,osgGetVersion)
-            AC_CHECK_LIB(osgUtil,osgUtilGetVersion)
-            AC_CHECK_LIB(osgDB,osgDBGetVersion)
-            AC_CHECK_LIB(osgText,osgTextGetVersion)
-            AC_CHECK_LIB(osgGA,osgGAGetVersion)
-            AC_CHECK_LIB(osgViewer,osgViewerGetVersion)
-            AC_CHECK_LIB(osgSim,osgSimGetVersion)
-            AC_CHECK_LIB(osgParticle,osgParticleGetVersion)
-            OSG_LIBS="$LIBS -losgFX $openthreads_LIBS"
-            LIBS=""
-            # echo $LIBS
-        fi
-        AC_SUBST(openthreads_LIBS)
-        AC_SUBST(OSG_LIBS)
-    else
-        # Checking osg frameworks.
-        AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework)
-        AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework)
-        AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework)
-        AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework)
-        AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework)
-        AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework)
-        AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework)
-        AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework)
-        AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework)
-        osg_FRAMEWORKS="$FRAMEWORKS"
-        FRAMEWORKS=""
-        AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework)
-        openthreads_FRAMEWORK="$FRAMEWORKS"
-        AC_SUBST(osg_FRAMEWORKS)
-        AC_SUBST(openthreads_FRAMEWORK)
-    fi
-    ;;
-*)
+if test "x$with_osg_framework" = "x"; then
     if test "x$enable_osgdebug" = "xyes"; then
-        AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
-        AC_CHECK_LIB(osgd,osgGetVersion)
-        AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
-        AC_CHECK_LIB(osgDBd,osgDBGetVersion)
-        AC_CHECK_LIB(osgTextd,osgTextGetVersion)
-        AC_CHECK_LIB(osgGAd,osgGAGetVersion)
-        AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
-        AC_CHECK_LIB(osgSimd,osgSimGetVersion)
-        AC_CHECK_LIB(osgParticled,osgParticleGetVersion)
-        LIBS="$LIBS -losgFXd $opengl_LIBS"
+        AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion, , [AC_MSG_ERROR(OpenThreads library not found.)],)
+        AC_CHECK_LIB(osgd,osgGetVersion, , [AC_MSG_ERROR(OpenSceneGraph library not found.)],)
+        AC_CHECK_LIB(osgUtild,osgUtilGetVersion, , [AC_MSG_ERROR(OpenSceneGraph utility library not found.)],)
+        AC_CHECK_LIB(osgDBd,osgDBGetVersion, , [AC_MSG_ERROR(OpenSceneGraph database library not found.)],)
+        AC_CHECK_LIB(osgTextd,osgTextGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Text library not found.)],)
+        AC_CHECK_LIB(osgGAd,osgGAGetVersion, , [AC_MSG_ERROR(OpenSceneGraph GUI Abstraction library not found.)],)
+        AC_CHECK_LIB(osgViewerd,osgViewerGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Viewer library not found.)],)
+        AC_CHECK_LIB(osgSimd,osgSimGetVersion, , [AC_MSG_ERROR(OpenSceneGraph simulation library not found.)],)
+        AC_CHECK_LIB(osgParticled,osgParticleGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Particle library not found.)],)
+        AC_CHECK_LIB(osgFXd, osgFXGetVersion, , [AC_MSG_ERROR(OpenSceneGraph FX library not found.)],)
     else
-        AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
-        AC_CHECK_LIB(osg,osgGetVersion)
-        AC_CHECK_LIB(osgUtil,osgUtilGetVersion)
-        AC_CHECK_LIB(osgDB,osgDBGetVersion)
-        AC_CHECK_LIB(osgText,osgTextGetVersion)
-        AC_CHECK_LIB(osgGA,osgGAGetVersion)
-        AC_CHECK_LIB(osgViewer,osgViewerGetVersion)
-        AC_CHECK_LIB(osgSim,osgSimGetVersion)
-        AC_CHECK_LIB(osgParticle,osgParticleGetVersion)
-        LIBS="$LIBS -losgFX $opengl_LIBS"
+        AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion, , [AC_MSG_ERROR(OpenThreads library not found.)],)
+        AC_CHECK_LIB(osg,osgGetVersion, , [AC_MSG_ERROR(OpenSceneGraph library not found.)],)
+        AC_CHECK_LIB(osgUtil,osgUtilGetVersion, , [AC_MSG_ERROR(OpenSceneGraph utility library not found.)],)
+        AC_CHECK_LIB(osgDB,osgDBGetVersion, , [AC_MSG_ERROR(OpenSceneGraph database library not found.)],)
+        AC_CHECK_LIB(osgText,osgTextGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Text library not found.)],)
+        AC_CHECK_LIB(osgGA,osgGAGetVersion, , [AC_MSG_ERROR(OpenSceneGraph GUI Abstraction library not found.)],)
+        AC_CHECK_LIB(osgViewer,osgViewerGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Viewer library not found.)],)
+        AC_CHECK_LIB(osgSim,osgSimGetVersion, , [AC_MSG_ERROR(OpenSceneGraph simulation library not found.)],)
+        AC_CHECK_LIB(osgParticle,osgParticleGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Particle library not found.)],)
+        AC_CHECK_LIB(osgFX, osgFXGetVersion, , [AC_MSG_ERROR(OpenSceneGraph FX library not found.)],)
     fi
-    ;;
-esac
+else
+    # Checking osg frameworks.
+    AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework)
+    AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework)
+    AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework)
+    AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework)
+    AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework)
+    AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework)
+    AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework)
+    AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework)
+    AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework)
+    osg_FRAMEWORKS="$FRAMEWORKS"
+    FRAMEWORKS=""
+    AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework)
+    openthreads_FRAMEWORK="$FRAMEWORKS"
+    AC_SUBST(osg_FRAMEWORKS)
+    AC_SUBST(openthreads_FRAMEWORK)
+fi
 AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x")
 
 AC_CHECK_HEADER(osg/Version)
@@ -775,10 +745,9 @@ fi
 dnl Check for Subversion library support
 save_LIBS=$LIBS
 save_CPPFLAGS=$CPPFLAGS
-LIBS=""
+LIBS="`apr-1-config --link-ld`"
 CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes`"
-AC_CHECK_LIB(svn_client-1, svn_client_checkout3)
-AC_CHECK_HEADERS([svn_client.h glut.h])
+AC_CHECK_HEADERS([svn_client.h])
 if test "x$ac_cv_header_svn_client_h" != "xyes"; then
   echo "TerraSync will shell out for command line subversion"
   svn_LIBS=""
@@ -786,6 +755,7 @@ if test "x$ac_cv_header_svn_client_h" != "xyes"; then
 else
   echo "TerraSync will use integrated subversion library"
   AC_SEARCH_LIBS(svn_client_checkout, svn_client-1)
+  AC_SEARCH_LIBS(svn_cmdline_init, svn_subr-1)
   svn_LIBS=$LIBS
   svn_CPPFLAGS=$CPPFLAGS
   AC_SUBST(svn_LIBS)
@@ -942,3 +912,8 @@ else
     echo "Include special purpose flight models: no"
 fi
 
+if test "x$enable_atcdcl" != "xno"; then
+    echo "Build depricated ATC/AI module: yes"
+else
+    echo "Build depricated ATC/AI module: no"
+fi