]> git.mxchange.org Git - flightgear.git/blobdiff - configure.ac
Automake version check is best done only in the autogen.sh file, and not
[flightgear.git] / configure.ac
index 48aed5347486c6e3a0760f14eac132dd1b457d5c..66d0c94ba523e167f56abb89dd4678c0e88e574f 100644 (file)
@@ -51,14 +51,6 @@ 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/\.//g'`
-if test $AUTO_MAKE_VERSION -lt 15; then
-    echo "You need to upgrade your automake to version 1.5 or newer"
-    exit 1
-fi
-
 # Used by JSBSim
 AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
 
@@ -93,26 +85,6 @@ 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])
@@ -374,8 +346,8 @@ AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
 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!"
@@ -386,15 +358,28 @@ if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
     exit
 fi
 
-# 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
+
+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,7 +407,7 @@ 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.0.19 or newer])
 AC_TRY_RUN([
 #include <stdio.h>
 
@@ -476,7 +461,9 @@ if test "x$ac_cv_header_mk4_h" != "xyes"; then
     exit
 fi
 
-AC_MSG_CHECKING([for proper metakit version])
+AC_MSG_CHECKING([for metakit 2.4.3 or newer])
+saved_LIBS="$LIBS"
+LIBS="$saved_LIBS -lmk4"
 AC_TRY_RUN([
 #include <mk4.h>
 
@@ -498,6 +485,27 @@ int main() {
    AC_MSG_ERROR([Install metakit 2.4.3 or later first...])],
   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