+failure if you believe you have the correct metakit version.
+Also, look up this issue in the FlightGear FAQ.])],
+ AC_MSG_RESULT(yes)
+)
+
+dnl Check for the presence of SimGear
+AC_CHECK_HEADER(simgear/version.h)
+if test "x$ac_cv_header_simgear_version_h" != "xyes"; then
+ echo
+ echo "You *must* have the SimGear support library installed on your system"
+ echo "to build the FGFS simulator!"
+ echo
+ echo "Please see README.SimGear for more details."
+ echo
+ echo "configure aborted."
+ exit
+fi
+
+AC_MSG_CHECKING([for simgear 0.3.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 3
+#define MIN_MICRO 0
+
+int main() {
+ int major, minor, micro;
+
+ printf("%d.%d.%d or greater... ", MIN_MAJOR, MIN_MINOR, MIN_MICRO);
+
+ sscanf( STRINGIFY(SIMGEAR_VERSION), "%d.%d.%d", &major, &minor, µ );
+
+ if ( major < MIN_MAJOR ) {
+ return -1;
+ } else if ( major == MIN_MAJOR && minor < MIN_MINOR ) {
+ return -1;
+ } else if ( major == MIN_MAJOR && minor == MIN_MINOR && micro < MIN_MICRO ){
+ return -1;
+ }
+
+ return 0;
+}
+
+],
+ AC_MSG_RESULT(yes),
+ [AC_MSG_RESULT(wrong version);
+ AC_MSG_ERROR([Install latest simgear first...])],