1 dnl Process this file with autogen.sh to produce a working configure
5 AC_CONFIG_SRCDIR([src/Airports/simple.cxx])
7 dnl Require at least automake 2.52
10 dnl Initialize the automake stuff
11 dnl set the $host variable based on local machine/os
13 AM_INIT_AUTOMAKE(FlightGear, 2.0.0)
15 dnl Checks for programs.
24 AX_BOOST_BASE([1.37.0])
26 # Show all compiler warnings by default
27 CXXFLAGS="$CXXFLAGS -Wall"
28 CFLAGS="$CFLAGS -Wall"
30 if test "x$BOOST_CPPFLAGS" != "x-I/usr/include" ; then
31 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
34 # specify the simgear location
35 AC_ARG_WITH(simgear, [ --with-simgear=PREFIX Specify the prefix path to SimGear])
37 if test "x$with_simgear" != "x" ; then
38 echo "SimGear prefix path is $with_simgear"
39 EXTRA_DIRS="${EXTRA_DIRS} $with_simgear"
40 CXXFLAGS="$CXXFLAGS -I$with_simgear"
43 # specify the plib location
44 AC_ARG_WITH(plib, [ --with-plib=PREFIX Specify the prefix path to plib])
46 if test "x$with_plib" != "x" ; then
47 echo "plib prefix is $with_plib"
48 EXTRA_DIRS="${EXTRA_DIRS} $with_plib"
51 # specify the osg location
52 AC_ARG_WITH(osg, [ --with-osg=PREFIX Specify the prefix path to osg])
54 if test "x$with_osg" != "x" ; then
55 echo "osg prefix is $with_osg"
56 EXTRA_DIRS="${EXTRA_DIRS} $with_osg"
59 # specify framework related locations for Mac OS X
63 dnl Thank you Christian Bauer from SheepSaver
64 dnl Modified by Tatsuhiro Nishioka for accepting a given framework path
65 dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES, $3=FRAMEWORK_PATH, $4=ACTION_IF_FOUND) ;
66 AC_DEFUN([AC_CHECK_FRAMEWORK], [
67 AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
68 AC_CACHE_CHECK([whether compiler supports framework $1],
71 FRAMEWORKS="$FRAMEWORKS -framework $1"
72 if test "$3" = ""; then
73 FRAMEWORKS="$FRAMEWORKS $ADD2LD"
74 elif test "`echo $FRAMEWORKS | grep -- -F$3`" = ""; then
75 FRAMEWORKS="$FRAMEWORKS -F$3"
76 CXXFLAGS="$CXXFLAGS -F$3"
77 CCFLAGS="$CCFLAGS -F$3"
78 CPPFLAGS="$CPPFLAGS -F$3"
79 dnl This is needed for AC_TRY_LINK when a framework path is specified
80 export DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}:$3"
84 [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
87 AS_IF([test AS_VAR_GET(ac_Framework) = yes],
88 [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
90 AS_IF([test AS_VAR_GET(ac_Framework) = yes], $4)
91 AS_VAR_POPDEF([ac_Framework])dnl
94 # Mac OS X specific configure options
95 AC_ARG_WITH(cocoa_framework, [ --with-cocoa-framework Use the Cocoa rather than Carbon])
96 if test "x$with_cocoa_framework" != "x" ; then
98 AC_MSG_NOTICE([Using Cocoa framework])
101 AC_MSG_NOTICE([Using Carbon framework])
104 AC_ARG_WITH(osg_framework, [ --with-osg-framework=PREFIX Specify the prefix path to osg frameworks [default=standard framework paths]])
105 if test "x$with_osg_framework" != "x" ; then
106 echo "osg prefix is $with_osg_framework"
107 export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$with_osg_framework"
110 AC_ARG_WITH(plib_framework, [ --with-plib-framework=PREFIX Specify the prefix path to PLIB framework [default=standard framework paths]])
111 if test "x$with_plib_framework" != "x" ; then
112 echo "plib prefix is $with_plib_framework"
113 export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$with_plib_framework"
116 AC_ARG_WITH(alut_framework, [ --with-alut-framework=PREFIX Specify the prefix path to ALUT.framework ])
117 if test "x$with_alut_framework" != "x"; then
118 echo "ALUT framework prefix is $with_alut_framework"
124 dnl Determine an extra directories to add to include/lib search paths
126 *-apple-darwin* | *-*-mingw32*)
127 echo no EXTRA_DIRS for $host
131 if test -d /usr/local ; then
132 EXTRA_DIRS="${EXTRA_DIRS} /usr/local"
137 if test -d /usr/X11R6 ; then
138 EXTRA_DIR1="/usr/X11R6"
140 if test -d /opt/X11R6 ; then
141 EXTRA_DIR2="/opt/X11R6"
143 EXTRA_DIRS="${EXTRA_DIRS} $EXTRA_DIR1 $EXTRA_DIR2 /usr/local"
147 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
152 if test "$CXX" = "CC"; then
155 CXXFLAGS="$CXXFLAGS -c99 -I$with_simgear/include/simgear/compatibility"
156 CFLAGS="$CFLAGS -c99"
170 dnl set logging; default value of with_logging=yes
171 AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
172 if test "x$with_logging" = "xno" ; then
173 AC_DEFINE([FG_NDEBUG], 1, [Define for no logging output])
176 AC_ARG_ENABLE(sp_fdms, [ --enable-sp-fdms Include special purpose Flight Models], [enable_sp_fdms="$enableval"] )
177 if test "x$enable_sp_fdms" != "xno"; then
178 AC_DEFINE([ENABLE_SP_FDM], 1, [Define to include special purpose FDMs])
180 AC_DEFINE([ENABLE_SP_FDM], 0, [Define to include special purpose FDMs])
182 AM_CONDITIONAL(ENABLE_SP_FDM, test "x$enable_sp_fdms" != "xno")
184 # Specify whether we want to compile ATCDCL.
185 # default to with_atcdcl=yes
186 AC_ARG_ENABLE(atcdcl, [ --enable-atcdcl Compile and link the deprecated atc/ai module], [], [enable_atcdcl="$enableval"] )
187 if test "x$enable_atcdcl" = "xyes"; then
188 AC_DEFINE([ENABLE_ATCDCL], 1, [Define to include old ATC/AI module])
190 AC_DEFINE([ENABLE_ATCDCL], 0, [Define to include old ATC/AI module])
192 AM_CONDITIONAL(ENABLE_ATCDCL, test "x$enable_atcdcl" = "xyes")
194 dnl EXPERIMENTAL generic event driven input device
196 AC_ARG_WITH(eventinput, [ --with-eventinput Include event driven input (EXPERIMENTAL) [default=no]], [], [with_eventinput=no])
197 if test "x$with_eventinput" = "xyes"; then
198 AC_DEFINE([WITH_EVENTINPUT], 1, [Define to enable generic event driven input device])
200 dnl OS specific sources for event driven input
201 dnl Linux and Mac OS X are supported at this moment
203 eventinput_EXTRA_OBJS="FGMacOSXEventInput.o"
204 eventinput_INCUDES=""
209 dnl FIXME: include paths for dbus are hard-coded at this moment.
210 dnl FIXME: these must be found in configure
212 eventinput_EXTRA_OBJS="FGLinuxEventInput.o"
213 eventinput_INCLUDES="-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib/dbus-1.0/include"
214 eventinput_LIBS="-ldbus-1 -lhal"
217 echo "Event driven input is not supported on ${host}."
220 AC_SUBST(eventinput_EXTRA_OBJS)
221 AC_SUBST(eventinput_INCLUDES)
222 AC_SUBST(eventinput_LIBS)
224 AM_CONDITIONAL(WITH_EVENTINPUT, test "x$with_eventinput" = "xyes")
226 dnl Thread related checks
228 AC_ARG_WITH(threads, [ --with-threads Include tile loading threads [default=yes]], [], [with_threads=yes])
229 if test "x$with_threads" = "xyes"; then
230 AC_DEFINE([ENABLE_THREADS], 1, [Define to enable threaded tile paging])
231 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
232 CFLAGS="$CFLAGS -D_REENTRANT"
234 AC_CHECK_HEADER(pthread.h)
236 dnl Used by JSBSim to conditionally compile in fgfs interface code
237 AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
239 # Check for MS Windows environment
240 AC_CHECK_HEADER(windows.h)
242 dnl Using AM_CONDITIONAL is a step out of the protected little
243 dnl automake fold so it is potentially dangerous. But, we are
244 dnl beginning to run into cases where the standard checks are not
245 dnl enough. AM_CONDITIONALS are then referenced to conditionally
246 dnl build a Makefile.in from a Makefile.am which lets us define custom
247 dnl includes, compile alternative source files, etc.
249 dnl Check for external variables daylight and timezone.
251 if test "$have_daylight" = yes; then
252 AC_DEFINE([HAVE_DAYLIGHT], 1, [Define if system has daylight variable])
256 if test "$have_timezone" = yes; then
257 AC_DEFINE([HAVE_TIMEZONE], 1, [Define if system has timezone variable])
261 dnl add joystick support libraries
262 dnl search for FreeBSD library
263 AC_SEARCH_LIBS(hid_init, usbhid)
264 joystick_LIBS="$LIBS"
268 dnl ENABLE_AUDIO_SUPPORT could be depricated at any time in favor of
269 dnl just assuming we have audio support on all platform. We can
270 dnl depend on plib to hide the details.
271 AC_DEFINE([ENABLE_AUDIO_SUPPORT], 1, [Define for audio support])
273 dnl X11 might be installed on Mac OS X or cygwin/mingwin, we don't want
274 dnl to use it if it is.
276 *-apple-darwin* | *-*-cygwin* | *-*-mingw32*)
277 echo no fancy X11 check
286 dnl Checks for libraries.
288 dnl Thread related checks
289 AC_SEARCH_LIBS(pthread_create, [pthread c_r])
290 if test "x$ac_cv_header_pthread_h" = "xyes"; then
291 if test "x$ac_cv_search_pthread_exit" = "x-lc_r"; then
292 CXXFLAGS="-pthread $CXXFLAGS"
293 CFLAGS="-pthread $CFLAGS"
294 LIBS="-lsgthreads $LIBS"
301 dnl search for network related libraries
302 AC_SEARCH_LIBS(inet_addr, xnet)
303 AC_SEARCH_LIBS(socket, socket)
304 AC_SEARCH_LIBS(main, nsl)
309 dnl check for some default libraries
310 AC_SEARCH_LIBS(sqrt, [am ffm fm fastm m])
311 AC_SEARCH_LIBS(ceil, m)
312 AC_SEARCH_LIBS(dlclose, dl)
313 AC_SEARCH_LIBS(clock_gettime, rt)
317 dnl Check for SDL or glut if enabled.
318 AC_ARG_ENABLE(osgviewer, [ --enable-osgviewer Configure to use osgViewer (default)], [enable_osgviewer="$enableval"])
319 AC_ARG_ENABLE(sdl, [ --enable-sdl Configure to use SDL], [enable_sdl="$enableval"])
320 AC_ARG_ENABLE(glut, [ --enable-glut Configure to use GLUT], [enable_glut="$enableval"])
321 AM_CONDITIONAL(USE_SDL, test "x$enable_sdl" = "xyes")
322 AM_CONDITIONAL(USE_GLUT, test "x$enable_glut" = "xyes")
323 if test "x$enable_sdl" != "xyes" -a "x$enable_glut" != "xyes" -a "x$enable_osgviewer" != "xno"; then
324 enable_osgviewer="yes"
326 if test \( "x$enable_osgviewer" = "xyes" \
327 -a \( "x$enable_sdl" = "xyes" -o "x$enable_glut" = "xyes" \) \) \
328 -o \( "x$enable_sdl" = "xyes" -a "x$enable_glut" = "xyes" \); then
329 echo " Only one of --enable-osgviewer, --enable-sdl, or --enable -glut may"
333 AC_DEFINE([PU_USE_NONE], 1, [Define to use application's pu callbacks])
335 AC_ARG_ENABLE(osgdebug, [ --enable-osgdebug Use OSG debug libraries], [enable_osgdebug="$enableval"])
337 dnl check for OpenGL related libraries
339 *-*-cygwin* | *-*-mingw32*)
340 dnl CygWin under Windoze.
342 echo Win32 specific hacks...
343 AC_DEFINE([WIN32], 1, [Define for Win32 platforms])
344 AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms])
346 if test "x$enable_sdl" = "xyes"; then
347 AC_SEARCH_LIBS(SDL_Init, SDL)
349 LIBS="$LIBS -lglut32"
352 LIBS="$LIBS -lglu32 -lopengl32 -luser32 -lgdi32"
353 joystick_LIBS="$joystick_LIBS -lwinmm"
355 dnl add -lwsock32 for mingwin
358 echo "********** BUILDING FOR MINGW32 *************"
359 network_LIBS="$network_LIBS -lws2_32"
363 echo "Will link apps with $LIBS"
370 LIBS="$LIBS -framework GLUT -framework OpenGL -framework AGL -framework $macAPI -lobjc"
371 LDFLAGS="$LDFLAGS -headerpad_max_install_names"
372 joystick_LIBS="$joystick_LIBS -framework IOKit -framework CoreFoundation"
376 dnl X-Windows based machines
378 dnl Skip X11 library tests if requested.
379 if test "x$no_x" != "xyes"; then
380 AC_SEARCH_LIBS(XCreateWindow, X11)
381 AC_SEARCH_LIBS(XShmCreateImage, Xext)
382 AC_SEARCH_LIBS(XGetExtensionVersion, Xi)
383 AC_SEARCH_LIBS(IceOpenConnection, ICE)
384 AC_SEARCH_LIBS(SmcOpenConnection, SM)
385 AC_SEARCH_LIBS(XtMalloc, Xt)
386 AC_SEARCH_LIBS(XmuLookupStandardColormap, Xmu)
389 AC_SEARCH_LIBS(glNewList, [ GL GLcore MesaGL ])
390 if test "x$ac_cv_search_glNewList" = "x-lGLcore"; then
391 dnl if GLcore found, then also check for GL
392 AC_SEARCH_LIBS(glXCreateContext, GL)
395 dnl if using mesa, check for xmesa.h
396 if test "x$ac_cv_search_glNewList" = "x-lMesaGL"; then
397 AC_CHECK_HEADER(GL/fxmesa.h)
398 if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then
399 AC_DEFINE([XMESA], 1, [Define for fxmesa])
400 AC_DEFINE([FX], 1, [Define for fxmesa])
404 AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
405 AC_SEARCH_LIBS(glutGetModifiers, [ glut freeglut ])
406 if test "x$enable_sdl" = "xyes"; then
407 AC_SEARCH_LIBS(SDL_Init, SDL)
414 LIBS="$base_LIBS $joystick_LIBS"
416 dnl check for OpenAL libraries
420 *-*-cygwin* | *-*-mingw32*)
421 dnl CygWin under Windoze.
422 INCLUDES="$INCLUDES -I/usr/local/include/"
423 LIBS="$LIBS -L/usr/local/lib"
424 AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal 'openal -ldsound -lwinmm' ] )
425 AC_SEARCH_LIBS(alutInit, [ openal32 ALut alut ] )
426 LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
428 OPENAL_OK="$ac_cv_search_alGenBuffers"
429 ALUT_OK="$ac_cv_search_alutInit"
435 # Mac OS X has OpenAL.framework, but no ALUT, by default, so we
436 # require use of a non-Apple ALUT.framework which we provide
437 openal_LIBS="-framework IOKit -framework OpenAL"
439 AC_CHECK_FRAMEWORK(OpenAL, [#include <OpenAL/al.h>], "", [OPENAL_OK="yes"])
440 AC_CHECK_FRAMEWORK(ALUT, [#include <ALUT/alut.h>], $with_alut_framework, [
442 openal_LIBS="$openal_LIBS -framework ALUT"
447 dnl default unix style machines
450 LIBS="$LIBS $thread_LIBS"
451 AC_SEARCH_LIBS(alGenBuffers, openal)
452 AC_SEARCH_LIBS(alutInit, [ alut openal ] )
453 OPENAL_OK="$ac_cv_search_alGenBuffers"
454 ALUT_OK="$ac_cv_search_alutInit"
461 if test "$OPENAL_OK" == "no"; then
463 echo "You *must* have the openal library installed on your system to build"
466 echo "Please see README.OpenAL for more details."
468 echo "configure aborted."
472 if test "$ALUT_OK" == "no"; then
474 echo "You *must* have the alut library installed on your system to build"
477 echo "Please see README.OpenAL for more details."
479 echo "configure aborted."
487 AC_SUBST(openal_LIBS)
488 AC_SUBST(opengl_LIBS)
489 AC_SUBST(thread_LIBS)
490 AC_SUBST(network_LIBS)
491 AC_SUBST(joystick_LIBS)
493 # The following are C++ items that need to be tested for with the c++
498 dnl Check for the presence of SimGear
499 if test "x$with_simgear" != "x"; then
500 AC_CHECK_HEADER($with_simgear/include/simgear/version.h, [ac_cv_header_simgear_version_h=yes], [ac_cv_header_simgear_version_h=no])
502 AC_CHECK_HEADER(simgear/version.h)
504 if test "x$ac_cv_header_simgear_version_h" != "xyes"; then
506 echo "You *must* have the SimGear support library installed on your system"
507 echo "to build the FGFS simulator!"
509 echo "Please see README.SimGear for more details."
511 echo "configure aborted."
515 AC_MSG_CHECKING([for SimGear 2.0.0 or newer])
519 #include <simgear/version.h>
521 #define STRINGIFY(X) XSTRINGIFY(X)
522 #define XSTRINGIFY(X) #X
529 int major, minor, micro;
531 /* printf("%d.%d.%d or greater, ", MIN_MAJOR, MIN_MINOR, MIN_MICRO); */
532 printf("[found %s] ... ", STRINGIFY(SIMGEAR_VERSION));
534 sscanf( STRINGIFY(SIMGEAR_VERSION), "%d.%d.%d", &major, &minor, µ );
536 if ( (major < MIN_MAJOR) ||
537 (major == MIN_MAJOR && minor < MIN_MINOR) ||
538 (major == MIN_MAJOR && minor == MIN_MINOR && micro < MIN_MICRO) ) {
547 [AC_MSG_RESULT(wrong version);
548 AC_MSG_ERROR([Install latest SimGear first...])],
554 dnl Check if SimGear was built with Norman's JPEG factory support
555 if test "x$with_simgear" != "x"; then
556 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])
558 AC_CHECK_HEADER(simgear/screen/jpgfactory.hxx)
560 if test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes"; then
561 AC_CHECK_LIB(jpeg, jpeg_start_compress)
562 if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
564 echo "The JPEG factory code was built and installed with SimGear."
565 echo "However it appears the libjpeg is no longer installed."
566 echo "You need to install libjpeg or remove jpgfactory support from"
569 echo "libjpeg is available at :"
570 echo " ftp://ftp.uu.net in the directory graphics/jpeg"
573 AC_DEFINE([FG_JPEG_SERVER], 1,
574 [Define to build with jpeg screen shot server])
576 AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes")
578 # Check for "plib" without which we cannot go on
581 if test "x$with_plib_framework" != "x"; then
582 AC_CHECK_FRAMEWORK(PLIB, [#include <plib/ul.h>], $with_plib_framework, no)
583 plib_FRAMEWORK="$FRAMEWORKS"
584 AC_SUBST(plib_FRAMEWORK)
589 AM_CONDITIONAL(HAVE_FRAMEWORK_PLIB, test "x$ac_cv_framework_PLIB" != "x")
591 AC_CHECK_HEADER(plib/ul.h)
592 if test "x$ac_cv_header_plib_ul_h" != "xyes"; then
594 echo "You *must* have the plib library installed on your system to build"
595 echo "the FGFS simulator!"
597 echo "Please see README.plib for more details."
599 echo "configure aborted."
603 echo "$DYLD_FRAMEWORK_PATH"
604 AC_MSG_CHECKING([for plib 1.8.5 or newer])
608 #define MIN_PLIB_VERSION 185
611 if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
620 [AC_MSG_RESULT(wrong version);
621 AC_MSG_ERROR([Install plib 1.8.5 or later first...])],
625 dnl If we get here then plib is available, so force use of plib
627 AC_DEFINE([ENABLE_PLIB_JOYSTICK], 1, [Define to enable plib joystick support])
629 # Find the OSG libraries. Note special handling for OS X frameworks
630 if test "x$with_osg_framework" = "x"; then
631 if test "x$enable_osgdebug" = "xyes"; then
632 AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion, , [AC_MSG_ERROR(OpenThreads library not found.)],)
633 AC_CHECK_LIB(osgd,osgGetVersion, , [AC_MSG_ERROR(OpenSceneGraph library not found.)],)
634 AC_CHECK_LIB(osgUtild,osgUtilGetVersion, , [AC_MSG_ERROR(OpenSceneGraph utility library not found.)],)
635 AC_CHECK_LIB(osgDBd,osgDBGetVersion, , [AC_MSG_ERROR(OpenSceneGraph database library not found.)],)
636 AC_CHECK_LIB(osgTextd,osgTextGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Text library not found.)],)
637 AC_CHECK_LIB(osgGAd,osgGAGetVersion, , [AC_MSG_ERROR(OpenSceneGraph GUI Abstraction library not found.)],)
638 AC_CHECK_LIB(osgViewerd,osgViewerGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Viewer library not found.)],)
639 AC_CHECK_LIB(osgSimd,osgSimGetVersion, , [AC_MSG_ERROR(OpenSceneGraph simulation library not found.)],)
640 AC_CHECK_LIB(osgParticled,osgParticleGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Particle library not found.)],)
641 AC_CHECK_LIB(osgFXd, osgFXGetVersion, , [AC_MSG_ERROR(OpenSceneGraph FX library not found.)],)
643 AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion, , [AC_MSG_ERROR(OpenThreads library not found.)],)
644 AC_CHECK_LIB(osg,osgGetVersion, , [AC_MSG_ERROR(OpenSceneGraph library not found.)],)
645 AC_CHECK_LIB(osgUtil,osgUtilGetVersion, , [AC_MSG_ERROR(OpenSceneGraph utility library not found.)],)
646 AC_CHECK_LIB(osgDB,osgDBGetVersion, , [AC_MSG_ERROR(OpenSceneGraph database library not found.)],)
647 AC_CHECK_LIB(osgText,osgTextGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Text library not found.)],)
648 AC_CHECK_LIB(osgGA,osgGAGetVersion, , [AC_MSG_ERROR(OpenSceneGraph GUI Abstraction library not found.)],)
649 AC_CHECK_LIB(osgViewer,osgViewerGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Viewer library not found.)],)
650 AC_CHECK_LIB(osgSim,osgSimGetVersion, , [AC_MSG_ERROR(OpenSceneGraph simulation library not found.)],)
651 AC_CHECK_LIB(osgParticle,osgParticleGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Particle library not found.)],)
652 AC_CHECK_LIB(osgFX, osgFXGetVersion, , [AC_MSG_ERROR(OpenSceneGraph FX library not found.)],)
655 # Checking osg frameworks.
656 AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework)
657 AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework)
658 AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework)
659 AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework)
660 AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework)
661 AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework)
662 AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework)
663 AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework)
664 AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework)
665 osg_FRAMEWORKS="$FRAMEWORKS"
667 AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework)
668 openthreads_FRAMEWORK="$FRAMEWORKS"
669 AC_SUBST(osg_FRAMEWORKS)
670 AC_SUBST(openthreads_FRAMEWORK)
672 AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x")
674 AC_CHECK_HEADER(osg/Version)
675 if test "x$ac_cv_header_osg_Version" != "xyes"; then
677 echo "You *must* have the OpenSceneGraph support library installed on your system"
678 echo "to build the FGFS simulator!"
680 echo "Please see README.OSG for more details."
682 echo "configure aborted."
687 AC_MSG_CHECKING([checking for osg::CullSettings::CLEAR_MASK])
689 [AC_LANG_PROGRAM([[#include <osg/CullSettings>]],
690 [[osg::CullSettings::VariablesMask mask = osg::CullSettings::CLEAR_MASK;]])],
691 [AC_DEFINE([HAVE_CULLSETTINGS_CLEAR_MASK],1,[define if OSG has CullSettings::CLEAR_MASK])
692 AC_MSG_RESULT([yes])],
693 [AC_MSG_RESULT([no])])
695 # Special handling for static version of OSG
696 if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_LIBRARY_STATIC" 2>/dev/null`" ; then
699 #***** Check image support (needed for static build) *****
700 AC_SEARCH_LIBS([jpeg_read_header], [jpeg], [CPPFLAGS="$CPPFLAGS -DOSG_JPEG_ENABLED"])
701 AC_SEARCH_LIBS([png_read_image], [png 'png -lz'], [CPPFLAGS="$CPPFLAGS -DOSG_PNG_ENABLED"])
702 AC_SEARCH_LIBS([TIFFOpen], [tiff], [CPPFLAGS="$CPPFLAGS -DOSG_TIFF_ENABLED"])
706 if test "x$with_osg" != "x" ; then
707 osg_prefix="$with_osg"
711 PKG_CHECK_EXISTS([openscenegraph], [osg_version="`$PKG_CONFIG --modversion openscenegraph 2>/dev/null`"])
712 LIBS="-L$osg_prefix/lib/osgPlugins-$osg_version -losgdb_bmp -losgdb_dds -losgdb_hdr -losgdb_pic -losgdb_pnm -losgdb_rgb -losgdb_tga \
713 -losgdb_3ds -losgdb_ac -losgdb_ive -losgdb_osg -losgdb_txf \
714 -losgVolume -losgTerrain $LIBS -losgUtil"
716 if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_JPEG_ENABLED" 2>/dev/null`" ; then
717 LIBS="$LIBS -losgdb_jpeg"
719 if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_PNG_ENABLED" 2>/dev/null`" ; then
720 LIBS="$LIBS -losgdb_png"
722 if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_TIFF_ENABLED" 2>/dev/null`" ; then
723 LIBS="$LIBS -losgdb_tiff"
726 LIBS="$LIBS $img_LIBS"
731 dnl Check for system installed zlib
732 AC_CHECK_HEADER(zlib.h)
733 if test "x$ac_cv_header_zlib_h" != "xyes"; then
735 echo "zlib library not found."
737 echo "If your OS does not provide an installable package for zlib"
738 echo "you will have to compile and install it first yourself. A copy"
739 echo "of zlib-1.1.4.tar.gz is included with SimGear. You will"
740 echo "have to untar this source code, and follow it's included instructions"
741 echo "to compile and install on your system."
743 echo "configure aborted."
747 dnl Check for Subversion library support
749 save_CPPFLAGS=$CPPFLAGS
750 LIBS="`apr-1-config --link-ld`"
751 CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes`"
752 AC_CHECK_HEADERS([svn_client.h])
753 if test "x$ac_cv_header_svn_client_h" != "xyes"; then
754 echo "TerraSync will shell out for command line subversion"
758 echo "TerraSync will use integrated subversion library"
759 AC_SEARCH_LIBS(svn_client_checkout, svn_client-1)
760 AC_SEARCH_LIBS(svn_cmdline_init, svn_subr-1)
762 svn_CPPFLAGS=$CPPFLAGS
764 AC_SUBST(svn_CPPFLAGS)
767 CPPFLAGS=$save_CPPFLAGS
769 AC_MSG_CHECKING([for feenableexcept])
770 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
771 #include <fenv.h>]], [[feenableexcept(FE_DIVBYZERO)]])],
772 [AC_DEFINE([HAVE_FEENABLEEXCEPT], 1, [define if system has fenableexcept])],
773 AC_MSG_RESULT([yes]),
776 dnl Checks for header files.
779 fcntl.h getopt.h malloc.h memory.h stdlib.h sys/param.h sys/stat.h \
780 sys/time.h sys/timeb.h unistd.h windows.h values.h )
782 dnl Checks for typedefs, structures, and compiler characteristics.
788 dnl Checks for library functions.
790 LIBS="$base_LIBS $network_LIBS $opengl_LIBS"
794 ftime gettimeofday timegm memcpy bcopy mktime strstr rand mkfifo \
795 random drand48 setitimer getitimer signal GetLocalTime rint getrusage \
799 AM_CONFIG_HEADER(src/Include/config.h)
811 scripts/debug/Makefile \
812 scripts/perl/Makefile \
813 scripts/perl/examples/Makefile \
814 scripts/python/Makefile \
816 src/Include/Makefile \
817 src/Include/version.h \
818 src/Aircraft/Makefile \
819 src/Airports/Makefile \
821 src/ATCDCL/Makefile \
822 src/Autopilot/Makefile \
823 src/Cockpit/Makefile \
824 src/Cockpit/built_in/Makefile \
825 src/Environment/Makefile \
826 src/FDM/ExternalNet/Makefile \
827 src/FDM/ExternalPipe/Makefile \
828 src/FDM/JSBSim/Makefile \
829 src/FDM/JSBSim/initialization/Makefile \
830 src/FDM/JSBSim/input_output/Makefile \
831 src/FDM/JSBSim/math/Makefile \
832 src/FDM/JSBSim/models/Makefile \
833 src/FDM/JSBSim/models/flight_control/Makefile \
834 src/FDM/JSBSim/models/atmosphere/Makefile \
835 src/FDM/JSBSim/models/propulsion/Makefile \
836 src/FDM/LaRCsim/Makefile \
837 src/FDM/SP/Makefile \
838 src/FDM/UIUCModel/Makefile \
839 src/FDM/YASim/Makefile \
843 src/Instrumentation/Makefile \
844 src/Instrumentation/KLN89/Makefile \
845 src/Instrumentation/HUD/Makefile \
848 src/Main/runfgfs.bat \
850 src/AIModel/Makefile \
851 src/MultiPlayer/Makefile \
852 src/Navaids/Makefile \
853 src/Network/Makefile \
854 src/Scenery/Makefile \
855 src/Scripting/Makefile \
857 src/Systems/Makefile \
859 src/Traffic/Makefile \
862 utils/GPSsmooth/Makefile \
863 utils/fgadmin/Makefile
864 utils/fgadmin/src/Makefile \
865 utils/js_server/Makefile \
866 utils/Modeller/Makefile \
867 utils/propmerge/Makefile \
868 utils/TerraSync/Makefile \
869 utils/xmlgrep/Makefile \
870 utils/fgviewer/Makefile
874 AC_OUTPUT_COMMANDS([chmod 755 src/Main/runfgfs])
877 echo "Configure Summary"
878 echo "================="
880 echo "Prefix: $prefix"
882 if test "x$with_logging" != "x"; then
883 echo "Debug messages: $with_logging"
885 echo "Debug messages: yes"
888 echo -n "Automake version: "
889 automake --version | head -n 1
891 if test "x$with_multiplayer" != "xno"; then
892 echo "Building with multiplayer support"
895 if test "x$with_threads" = "xyes"; then
901 if test "x$with_eventinput" = "xyes"; then
902 echo "event input: yes"
904 echo "event input: no"
907 if test "x$enable_sp_fdms" != "xno"; then
908 echo "Include special purpose flight models: yes"
910 echo "Include special purpose flight models: no"
913 if test "x$enable_atcdcl" = "xyes"; then
914 echo "Build depricated ATC/AI module: yes"
916 echo "Build depricated ATC/AI module: no"