]> git.mxchange.org Git - flightgear.git/blobdiff - configure.ac
Added static port system and a new altimeter model connected to it.
[flightgear.git] / configure.ac
index b2f747880b07217ffbf1d3954cadfc5e09d4c0ea..528f070d5ac7fe355e3547d1134ff3df23d69429 100644 (file)
@@ -8,11 +8,11 @@ dnl working configure script.
 AC_INIT
 AC_CONFIG_SRCDIR([src/Aircraft/aircraft.cxx])
 
-# Require at least automake 2.53
-AC_PREREQ(2.53)
+# Require at least automake 2.52
+AC_PREREQ(2.52)
 
 # Initialize the automake stuff
-AM_INIT_AUTOMAKE(FlightGear, 0.7.11pre1)
+AM_INIT_AUTOMAKE(FlightGear, 0.9.0)
 
 # Checks for programs.
 AC_PROG_MAKE_SET
@@ -51,24 +51,22 @@ AC_EGREP_CPP(yes,
 echo "IS_CYGWIN = $is_cygwin"
 AM_CONDITIONAL(IS_CYGWIN, test "x$is_cygwin" = "xyes")
 
-# Determine version of automake ... important becuase of
-# incompatibilities between versions
-AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\-p[[0-9]]$//' | sed -e 's/\.//'`
-AM_CONDITIONAL(ANCIENT_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 14)
-AM_CONDITIONAL(OLD_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 15)
-
 # Used by JSBSim
 AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
 
+
 # Used on the Irix platform
 AR="ar"
+ARFLAGS="cru"
 OS=`uname -s`
 if test "$OS" = "IRIX" -o "$OS" = "IRIX64"; then
     if test "$CXX" = "CC"; then
         AR="CC -ar"
-        AC_SUBST(AR)
+        ARFLAGS="-o"
     fi
 fi
+AC_SUBST(AR)
+AC_SUBST(ARFLAGS)
 
 
 # Specify if we want logging (testing build) or not (release build)
@@ -91,29 +89,9 @@ fi
 AM_CONDITIONAL(ENABLE_NETWORK_OLK, test "x$with_network_olk" != "xno")
 
 
-# Check if SimGear was built with Norman JPEG factory support
-AC_CHECK_HEADER(simgear/screen/jpgfactory.hxx)
-if test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes"; then
-    AC_CHECK_LIB(jpeg, jpeg_start_compress)
-    if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
-        echo
-        echo "The JPEG factory code was built and installed with SimGear."
-        echo "However it appears the libjpeg is no longer installed."
-        echo "You need to install libjpeg or remove jpgfactory support from"
-        echo "SimGear"
-        echo
-        echo "libjpeg is available at :"
-        echo "  ftp://ftp.uu.net in the directory graphics/jpeg"
-       exit 1
-    fi
-    AC_DEFINE([FG_JPEG_SERVER], 1,
-              [Define to build with jpeg screen shot server])
-fi
-AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes")
-
 # Specify if we want to use WeatherCM instead of FGEnvironment.
 # default to with_weathercm=no
-AC_ARG_WITH(new-environment, [  --with-weathercm  Use WeatherCM instead of FGEnvironment])
+AC_ARG_WITH(new-environment, [  --with-weathercm        Use WeatherCM instead of FGEnvironment])
 if test "x$with_weathercm" = "xyes" ; then
     echo "Building with WeatherCM"
     AC_DEFINE([FG_WEATHERCM], 1,
@@ -138,7 +116,7 @@ fi
 AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes")
 
 # specify the plib location
-AC_ARG_WITH(plib, [  --with-plib=prefix      Specify the prefix path to plib])
+AC_ARG_WITH(plib, [  --with-plib=PREFIX      Specify the prefix path to plib])
 
 if test "x$with_plib" != "x" ; then
     echo "plib prefix is $with_plib"
@@ -146,7 +124,7 @@ if test "x$with_plib" != "x" ; then
 fi
 
 # specify the metakit location
-AC_ARG_WITH(metakit, [  --with-metakit=prefix   Specify the prefix path to metakit])
+AC_ARG_WITH(metakit, [  --with-metakit=PREFIX   Specify the prefix path to metakit])
 
 if test "x$with_metakit" != "x" ; then
     echo "metakit prefix is $with_metakit"
@@ -154,7 +132,7 @@ if test "x$with_metakit" != "x" ; then
 fi
 
 # specify the simgear location
-AC_ARG_WITH(simgear, [  --with-simgear=prefix   Specify the prefix path to simgear])
+AC_ARG_WITH(simgear, [  --with-simgear=PREFIX   Specify the prefix path to simgear])
 
 if test "x$with_simgear" != "x" ; then
     echo "SimGear prefix path is $with_simgear"
@@ -166,7 +144,7 @@ AC_CHECK_HEADER(windows.h)
 
 # extra library and include directories
 if test "x$ac_cv_header_windows_h" != "xyes" ; then
-    EXTRA_DIRS="${EXTRA_DIRS} /usr/local /usr/X11R6"
+    EXTRA_DIRS="${EXTRA_DIRS} /usr/X11R6"
 
     if test -d /opt/X11R6 ; then
         EXTRA_DIRS="${EXTRA_DIRS} /opt/X11R6"
@@ -320,9 +298,6 @@ else
     echo Win32 specific hacks...
     AC_DEFINE([WIN32], 1, [Define if building on a Win32 platform])
 
-    # force a failed check since we will be building under windoze
-    AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
-
     # just define these to true and hope for the best
     ac_cv_lib_glut_glutGetModifiers="yes"
     ac_cv_lib_glut_glutGameModeString="yes"
@@ -369,9 +344,14 @@ AC_SUBST(opengl_LIBS)
 
 AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
 
+# The following are C++ items that need to be tested for with the c++
+# compiler
+
+AC_LANG_PUSH(C++)
+
 # Check for "plib" without which we cannot go on
-AC_CHECK_HEADER(plib/pu.h)
-if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
+AC_CHECK_HEADER(plib/ul.h)
+if test "x$ac_cv_header_plib_ul_h" != "xyes"; then
     echo
     echo "You *must* have the plib library installed on your system to build"
     echo "the FGFS simulator!"
@@ -382,19 +362,28 @@ if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
     exit
 fi
 
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-# needed for plib 1.3.x and later
-AC_CHECK_LIB(plibul, ulInit,,,)
+AC_MSG_CHECKING([for plib 1.6.0 or newer])
+AC_TRY_RUN([
+#include <plib/ul.h>
 
-if test "x$ac_cv_lib_plibul_ulInit" != "xyes"; then
-    echo
-    echo "You have an old version of plib, you need to upgrade to at least"
-    echo "plib-1.4.2"
-    exit
-fi
+#define MIN_PLIB_VERSION 160
 
-AC_LANG_RESTORE
+int main() {
+    int major, minor, micro;
+
+    if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
+        return -1;
+    }
+
+    return 0;
+}
+
+],
+  AC_MSG_RESULT(yes),
+  [AC_MSG_RESULT(wrong version);
+   AC_MSG_ERROR([Install plib 1.6.0 or later first...])],
+  AC_MSG_RESULT(yes)
+)
 
 # If we get here then plib is available, so force use of plib joystick lib
 AC_DEFINE([ENABLE_PLIB_JOYSTICK], 1, [Define to enable plib joystick support])
@@ -422,17 +411,18 @@ if test "x$ac_cv_header_simgear_version_h" != "xyes"; then
     exit
 fi
 
-AC_MSG_CHECKING(for proper simgear version)
-
+AC_MSG_CHECKING([for simgear 0.2.0 or newer])
 AC_TRY_RUN([
+#include <stdio.h>
+
 #include <simgear/version.h>
 
 #define STRINGIFY(X) XSTRINGIFY(X)
 #define XSTRINGIFY(X) #X
 
 #define MIN_MAJOR 0
-#define MIN_MINOR 0
-#define MIN_MICRO 18
+#define MIN_MINOR 2
+#define MIN_MICRO 0
 
 int main() {
     int major, minor, micro;
@@ -475,6 +465,60 @@ if test "x$ac_cv_header_mk4_h" != "xyes"; then
     exit
 fi
 
+AC_MSG_CHECKING([for metakit 2.4.3 or newer])
+saved_LIBS="$LIBS"
+LIBS="$saved_LIBS -lmk4"
+AC_TRY_RUN([
+#include <mk4.h>
+
+#define MIN_MK4_VERSION 243
+
+int main() {
+    int major, minor, micro;
+
+    if ( d4_MetaKitLibraryVersion < MIN_MK4_VERSION ) {
+        return -1;
+    }
+
+    return 0;
+}
+
+],
+  AC_MSG_RESULT(yes),
+  [AC_MSG_RESULT(wrong version);
+   AC_MSG_ERROR([
+
+Install metakit 2.4.3 or later first.
+
+Or, the compiler may not be finding your libmk4.so library.
+Please check the config.log file for specific details of the
+failure if you believe you have the correct metakit version.])],
+  AC_MSG_RESULT(yes)
+)
+LIBS="$saved_LIBS"
+
+# Check if SimGear was built with Norman JPEG factory support
+AC_CHECK_HEADER(simgear/screen/jpgfactory.hxx)
+if test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes"; then
+    AC_CHECK_LIB(jpeg, jpeg_start_compress)
+    if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
+        echo
+        echo "The JPEG factory code was built and installed with SimGear."
+        echo "However it appears the libjpeg is no longer installed."
+        echo "You need to install libjpeg or remove jpgfactory support from"
+        echo "SimGear"
+        echo
+        echo "libjpeg is available at :"
+        echo "  ftp://ftp.uu.net in the directory graphics/jpeg"
+       exit 1
+    fi
+    AC_DEFINE([FG_JPEG_SERVER], 1,
+              [Define to build with jpeg screen shot server])
+fi
+AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes")
+
+AC_LANG_POP
+
 # Check for system installed zlib
 AC_CHECK_HEADER(zlib.h)
 if test "x$ac_cv_header_zlib_h" != "xyes"; then
@@ -509,7 +553,7 @@ AC_FUNC_VPRINTF
 AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
        random setitimer getitimer signal GetLocalTime rint getrusage )
 
-AM_CONFIG_HEADER([src/Include/config.h])
+AM_CONFIG_HEADER(src/Include/config.h)
 
 AC_CONFIG_FILES([ \
        Makefile \
@@ -543,6 +587,7 @@ AC_CONFIG_FILES([ \
        src/FDM/Makefile \
        src/GUI/Makefile \
        src/Input/Makefile \
+       src/Instrumentation/Makefile \
        src/Main/Makefile \
        src/Main/runfgfs \
        src/Main/runfgfs.bat \
@@ -553,6 +598,7 @@ AC_CONFIG_FILES([ \
        src/Objects/Makefile \
        src/Scenery/Makefile \
        src/Sound/Makefile \
+       src/Systems/Makefile \
        src/Time/Makefile \
        src/WeatherCM/Makefile \
        tests/Makefile \