1
0
Fork 0

Added a check for the proper version of simgear.

This commit is contained in:
curt 2000-09-20 21:43:27 +00:00
parent 683325ae42
commit 6282096168

View file

@ -219,6 +219,60 @@ else
echo "no zlib found, using version provided by SimGear."
fi
# 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 proper simgear version)
AC_TRY_RUN([
#include <simgear/version.h>
#if !defined(SIMGEAR_VERSION)
#error simgear version too old, please upgrade.
#endif
#define STRINGIFY(X) XSTRINGIFY(X)
#define XSTRINGIFY(X) #X
#define MIN_MAJOR 0
#define MIN_MINOR 0
#define MIN_MICRO 13
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, &micro );
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...])],
AC_MSG_RESULT(yes)
)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T