+LIBS="$saved_LIBS"
+
+dnl Check if SimGear was built with Norman's JPEG factory support
+if test "x$with_simgear" != "x"; then
+AC_CHECK_HEADER($with_simgear/include/simgear/screen/jpgfactory.hxx,[ac_cv_header_simgear_screen_jpgfactory_hxx=yes],[ac_cv_header_simgear_screen_jpgfactory_hxx=no])
+else
+AC_CHECK_HEADER(simgear/screen/jpgfactory.hxx)
+fi
+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")
+
+# Check for "plib" without which we cannot go on
+AC_CHECK_HEADER(plib/ul.h)
+if test "x$ac_cv_header_plib_ul_h" != "xyes"; then