1 dnl Process this file with autogen.sh to produce a working configure
4 AC_INIT(FlightGear, m4_esyscmd([cat ./version | tr -d '\n']), [http://www.flightgear.org])
6 dnl Ensure touching the version causes autoconf to re-run
7 AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/version'])
9 AC_CONFIG_SRCDIR([src/Airports/simple.cxx])
11 dnl Require at least automake 2.52
14 dnl Initialize the automake stuff
15 dnl set the $host variable based on local machine/os
17 AM_INIT_AUTOMAKE([dist-bzip2])
19 # variables for version.h
20 AC_DEFINE([HAVE_VERSION_H], 1, [Set if version.h is generated])
22 # are we running under Hudson? (defines BUILD_ID, BUILD_NUMBER in the environment)
23 if test "x$BUILD_ID" != "x" ; then
24 AC_SUBST([HUDSON_BUILD_ID], $BUILD_ID)
25 AC_SUBST([HUDSON_BUILD_NUMBER], $BUILD_NUMBER)
27 AC_SUBST([HUDSON_BUILD_ID], [none])
28 AC_SUBST([HUDSON_BUILD_NUMBER], 0)
31 AC_CHECK_PROG([HAVE_GIT], git, 1)
32 if test "x$HAVE_GIT" != "x" ; then
33 # git might be installed, but we might be building from a tarball
34 if git rev-parse ; then
35 AC_SUBST([REVISION], `git rev-parse HEAD`)
37 AC_SUBST([REVISION], [none])
40 AC_SUBST([REVISION], [none])
43 dnl Checks for programs.
52 AX_BOOST_BASE([1.37.0])
54 # Show all compiler warnings by default
55 CXXFLAGS="$CXXFLAGS -Wall"
56 CFLAGS="$CFLAGS -Wall"
58 if test "x$BOOST_CPPFLAGS" != "x-I/usr/include" ; then
59 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
62 # specify the simgear location
63 AC_ARG_WITH(simgear, [ --with-simgear=PREFIX Specify the prefix path to SimGear])
65 if test "x$with_simgear" != "x" ; then
66 echo "SimGear prefix path is $with_simgear"
67 EXTRA_DIRS="${EXTRA_DIRS} $with_simgear"
68 CXXFLAGS="$CXXFLAGS -I$with_simgear"
71 # specify the plib location
72 AC_ARG_WITH(plib, [ --with-plib=PREFIX Specify the prefix path to plib])
74 if test "x$with_plib" != "x" ; then
75 echo "plib prefix is $with_plib"
76 EXTRA_DIRS="${EXTRA_DIRS} $with_plib"
79 # specify the osg location
80 AC_ARG_WITH(osg, [ --with-osg=PREFIX Specify the prefix path to osg])
82 if test "x$with_osg" != "x" ; then
83 echo "osg prefix is $with_osg"
84 EXTRA_DIRS="${EXTRA_DIRS} $with_osg"
87 # specify framework related locations for Mac OS X
91 dnl Thank you Christian Bauer from SheepSaver
92 dnl Modified by Tatsuhiro Nishioka for accepting a given framework path
93 dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES, $3=FRAMEWORK_PATH, $4=ACTION_IF_FOUND) ;
94 AC_DEFUN([AC_CHECK_FRAMEWORK], [
95 AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
96 AC_CACHE_CHECK([whether compiler supports framework $1],
99 FRAMEWORKS="$FRAMEWORKS -framework $1"
100 if test "$3" = ""; then
101 FRAMEWORKS="$FRAMEWORKS $ADD2LD"
102 elif test "`echo $FRAMEWORKS | grep -- -F$3`" = ""; then
103 FRAMEWORKS="$FRAMEWORKS -F$3"
104 CXXFLAGS="$CXXFLAGS -F$3"
105 CCFLAGS="$CCFLAGS -F$3"
106 CPPFLAGS="$CPPFLAGS -F$3"
107 dnl This is needed for AC_TRY_LINK when a framework path is specified
108 export DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}:$3"
112 [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
115 AS_IF([test AS_VAR_GET(ac_Framework) = yes],
116 [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
118 AS_IF([test AS_VAR_GET(ac_Framework) = yes], $4)
119 AS_VAR_POPDEF([ac_Framework])dnl
122 # Mac OS X specific configure options
123 AC_ARG_WITH(cocoa_framework, [ --with-cocoa-framework Use the Cocoa rather than Carbon])
124 if test "x$with_cocoa_framework" != "x" ; then
126 AC_MSG_NOTICE([Using Cocoa framework])
129 AC_MSG_NOTICE([Using Carbon framework])
132 AC_ARG_WITH(osg_framework, [ --with-osg-framework=PREFIX Specify the prefix path to osg frameworks [default=standard framework paths]])
133 if test "x$with_osg_framework" != "x" ; then
134 echo "osg prefix is $with_osg_framework"
135 export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$with_osg_framework"
138 AC_ARG_WITH(plib_framework, [ --with-plib-framework=PREFIX Specify the prefix path to PLIB framework [default=standard framework paths]])
139 if test "x$with_plib_framework" != "x" ; then
140 echo "plib prefix is $with_plib_framework"
141 export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$with_plib_framework"
144 AC_ARG_WITH(alut_framework, [ --with-alut-framework=PREFIX Specify the prefix path to ALUT.framework ])
145 if test "x$with_alut_framework" != "x"; then
146 echo "ALUT framework prefix is $with_alut_framework"
152 dnl Determine an extra directories to add to include/lib search paths
154 *-apple-darwin* | *-*-mingw32*)
155 echo no EXTRA_DIRS for $host
159 if test -d /usr/local ; then
160 EXTRA_DIRS="${EXTRA_DIRS} /usr/local"
165 if test -d /usr/X11R6 ; then
166 EXTRA_DIR1="/usr/X11R6"
168 if test -d /opt/X11R6 ; then
169 EXTRA_DIR2="/opt/X11R6"
171 EXTRA_DIRS="${EXTRA_DIRS} $EXTRA_DIR1 $EXTRA_DIR2 /usr/local"
175 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
180 if test "$CXX" = "CC"; then
183 CXXFLAGS="$CXXFLAGS -c99 -I$with_simgear/include/simgear/compatibility"
184 CFLAGS="$CFLAGS -c99"
198 dnl set logging; default value of with_logging=yes
199 AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
200 if test "x$with_logging" = "xno" ; then
201 AC_DEFINE([FG_NDEBUG], 1, [Define for no logging output])
204 AC_ARG_ENABLE(sp_fdms, [ --enable-sp-fdms Include special purpose Flight Models], [enable_sp_fdms="$enableval"] )
205 if test "x$enable_sp_fdms" != "xno"; then
206 AC_DEFINE([ENABLE_SP_FDM], 1, [Define to include special purpose FDMs])
208 AC_DEFINE([ENABLE_SP_FDM], 0, [Define to include special purpose FDMs])
210 AM_CONDITIONAL(ENABLE_SP_FDM, test "x$enable_sp_fdms" != "xno")
212 dnl EXPERIMENTAL generic event driven input device
214 AC_ARG_WITH(eventinput, [ --with-eventinput Include event driven input (EXPERIMENTAL) [default=no]], [], [with_eventinput=no])
215 if test "x$with_eventinput" = "xyes"; then
216 AC_DEFINE([WITH_EVENTINPUT], 1, [Define to enable generic event driven input device])
218 dnl OS specific sources for event driven input
219 dnl Linux and Mac OS X are supported at this moment
221 eventinput_EXTRA_OBJS="FGMacOSXEventInput.o"
222 eventinput_INCUDES=""
227 dnl FIXME: include paths for dbus are hard-coded at this moment.
228 dnl FIXME: these must be found in configure
230 eventinput_EXTRA_OBJS="FGLinuxEventInput.o"
231 eventinput_INCLUDES="-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib/dbus-1.0/include"
232 eventinput_LIBS="-ldbus-1 -lhal"
235 echo "Event driven input is not supported on ${host}."
238 AC_SUBST(eventinput_EXTRA_OBJS)
239 AC_SUBST(eventinput_INCLUDES)
240 AC_SUBST(eventinput_LIBS)
242 AM_CONDITIONAL(WITH_EVENTINPUT, test "x$with_eventinput" = "xyes")
244 dnl Thread related checks
246 AC_ARG_WITH(threads, [ --with-threads Include tile loading threads [default=yes]], [], [with_threads=yes])
247 if test "x$with_threads" = "xyes"; then
248 AC_DEFINE([ENABLE_THREADS], 1, [Define to enable threaded tile paging])
249 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
250 CFLAGS="$CFLAGS -D_REENTRANT"
252 AC_CHECK_HEADER(pthread.h)
254 dnl Configure HLA support
255 AC_ARG_WITH(rti13, [ --with-rti13[[=PATH]] Enable the HLA/RTI 1.3 interface, set a path to the RTI13 RTI libraries (default=no)])
256 if test "x$with_rti13" != "xno"; then
257 if test "x$with_rti13" != "xyes"; then
258 AC_SUBST(HLA_CPPFLAGS, "-I$with_rti13/include")
259 AC_SUBST(HLA_LDFLAGS, "-L$with_rti13/lib")
262 dnl Configure HLA support
263 AC_MSG_CHECKING([for simgear HLA/RTI support])
266 #include <simgear/hla/HLAFederate.hxx>
268 new simgear::HLAFederate;
269 ], simgear_hla=yes, simgear_hla=no)
270 AC_MSG_RESULT($simgear_hla)
271 if test "x$simgear_hla" = "xyes" ; then
272 AC_MSG_CHECKING([for hla libraries])
274 saved_LDFLAGS="$LDFLAGS"
276 for rti13libs in "-lRTI-NG -lFedTime" "-lRTI-NGd -lFedTimed" ; do
277 if test "x$hla_libs" = "x" ; then
278 LIBS="-lsghla -lsgrti13 -lsgrti -lsgxml -lsgstructure -lsgmath -lsgdebug -lsgtiming $rti13libs -lrt $saved_LIBS"
279 LDFLAGS="$HLA_LDFLAGS $saved_LDFLAGS"
281 #include <simgear/hla/HLAFederate.hxx>
283 new simgear::HLAFederate;
284 ], [hla_libs="$rti13libs"; have_rti13=yes],)
288 LDFLAGS="$saved_LDFLAGS"
289 AC_MSG_RESULT($have_rti13)
293 dnl Currently only the rti13 variant, but in the future also rti1516
294 AM_CONDITIONAL(WITH_HLA, test "x$have_rti13" = "xyes")
295 if test "x$have_rti13" = "xyes" ; then
296 AC_DEFINE([FG_HAVE_HLA], 1, [Define if HLA/RTI is available.])
297 AC_SUBST(HLA_LIBS, "-lsghla -lsgrti13 -lsgrti $hla_libs")
300 dnl EXPERIMENTAL fgpanel application
302 AC_ARG_WITH(fgpanel, [ --with-fgpanel Include fgpanel application (EXPERIMENTAL) [default=no]], [], [with_fgpanel=no])
303 if test "x$with_fgpanel" = "xyes"; then
304 AC_DEFINE([WITH_FGPANEL], 1, [Define to enable fgpanel application])
306 AM_CONDITIONAL(WITH_FGPANEL, test "x$with_fgpanel" = "xyes")
308 dnl Used by JSBSim to conditionally compile in fgfs interface code
309 AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
311 # Check for MS Windows environment
312 AC_CHECK_HEADER(windows.h)
314 dnl Using AM_CONDITIONAL is a step out of the protected little
315 dnl automake fold so it is potentially dangerous. But, we are
316 dnl beginning to run into cases where the standard checks are not
317 dnl enough. AM_CONDITIONALS are then referenced to conditionally
318 dnl build a Makefile.in from a Makefile.am which lets us define custom
319 dnl includes, compile alternative source files, etc.
321 dnl Check for external variables daylight and timezone.
323 if test "$have_daylight" = yes; then
324 AC_DEFINE([HAVE_DAYLIGHT], 1, [Define if system has daylight variable])
328 if test "$have_timezone" = yes; then
329 AC_DEFINE([HAVE_TIMEZONE], 1, [Define if system has timezone variable])
333 dnl add joystick support libraries
334 dnl search for FreeBSD library
335 AC_SEARCH_LIBS(hid_init, usbhid)
336 joystick_LIBS="$LIBS"
340 dnl ENABLE_AUDIO_SUPPORT could be depricated at any time in favor of
341 dnl just assuming we have audio support on all platform. We can
342 dnl depend on plib to hide the details.
343 AC_DEFINE([ENABLE_AUDIO_SUPPORT], 1, [Define for audio support])
345 dnl X11 might be installed on Mac OS X or cygwin/mingwin, we don't want
346 dnl to use it if it is.
348 *-apple-darwin* | *-*-cygwin* | *-*-mingw32*)
349 echo no fancy X11 check
358 dnl Checks for libraries.
360 dnl Thread related checks
361 AC_SEARCH_LIBS(pthread_create, [pthread c_r])
362 if test "x$ac_cv_header_pthread_h" = "xyes"; then
363 if test "x$ac_cv_search_pthread_exit" = "x-lc_r"; then
364 CXXFLAGS="-pthread $CXXFLAGS"
365 CFLAGS="-pthread $CFLAGS"
366 LIBS="-lsgthreads $LIBS"
373 dnl search for network related libraries
374 AC_SEARCH_LIBS(inet_addr, xnet)
375 AC_SEARCH_LIBS(socket, socket)
376 AC_SEARCH_LIBS(main, nsl)
381 dnl check for some default libraries
382 AC_SEARCH_LIBS(sqrt, [am ffm fm fastm m])
383 AC_SEARCH_LIBS(ceil, m)
384 AC_SEARCH_LIBS(dlclose, dl)
385 AC_SEARCH_LIBS(clock_gettime, rt)
389 dnl Check for SDL or glut if enabled.
390 AC_ARG_ENABLE(osgviewer, [ --enable-osgviewer Configure to use osgViewer (default)], [enable_osgviewer="$enableval"])
391 AC_ARG_ENABLE(sdl, [ --enable-sdl Configure to use SDL], [enable_sdl="$enableval"])
392 AC_ARG_ENABLE(glut, [ --enable-glut Configure to use GLUT], [enable_glut="$enableval"])
393 AM_CONDITIONAL(USE_SDL, test "x$enable_sdl" = "xyes")
394 AM_CONDITIONAL(USE_GLUT, test "x$enable_glut" = "xyes")
395 if test "x$enable_sdl" != "xyes" -a "x$enable_glut" != "xyes" -a "x$enable_osgviewer" != "xno"; then
396 enable_osgviewer="yes"
398 if test \( "x$enable_osgviewer" = "xyes" \
399 -a \( "x$enable_sdl" = "xyes" -o "x$enable_glut" = "xyes" \) \) \
400 -o \( "x$enable_sdl" = "xyes" -a "x$enable_glut" = "xyes" \); then
401 echo " Only one of --enable-osgviewer, --enable-sdl, or --enable -glut may"
405 AC_DEFINE([PU_USE_NONE], 1, [Define to use application's pu callbacks])
407 AC_ARG_ENABLE(osgdebug, [ --enable-osgdebug Use OSG debug libraries], [enable_osgdebug="$enableval"])
409 dnl check for OpenGL related libraries
411 *-*-cygwin* | *-*-mingw32*)
412 dnl CygWin under Windoze.
414 echo Win32 specific hacks...
415 AC_DEFINE([WIN32], 1, [Define for Win32 platforms])
416 AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms])
418 if test "x$enable_sdl" = "xyes"; then
419 AC_SEARCH_LIBS(SDL_Init, SDL)
421 LIBS="$LIBS -lglut32"
424 LIBS="$LIBS -lglu32 -lopengl32 -luser32 -lgdi32"
425 joystick_LIBS="$joystick_LIBS -lwinmm"
427 dnl add -lwsock32 for mingwin
430 echo "********** BUILDING FOR MINGW32 *************"
431 network_LIBS="$network_LIBS -lws2_32"
435 echo "Will link apps with $LIBS"
442 LIBS="$LIBS -framework GLUT -framework OpenGL -framework AGL -framework $macAPI -lobjc"
443 LDFLAGS="$LDFLAGS -headerpad_max_install_names"
444 joystick_LIBS="$joystick_LIBS -framework IOKit -framework CoreFoundation"
448 dnl X-Windows based machines
450 dnl Skip X11 library tests if requested.
451 if test "x$no_x" != "xyes"; then
452 AC_SEARCH_LIBS(XCreateWindow, X11)
453 AC_SEARCH_LIBS(XShmCreateImage, Xext)
454 AC_SEARCH_LIBS(XGetExtensionVersion, Xi)
455 AC_SEARCH_LIBS(IceOpenConnection, ICE)
456 AC_SEARCH_LIBS(SmcOpenConnection, SM)
457 AC_SEARCH_LIBS(XtMalloc, Xt)
458 AC_SEARCH_LIBS(XmuLookupStandardColormap, Xmu)
461 AC_SEARCH_LIBS(glNewList, [ GL GLcore MesaGL ])
462 if test "x$ac_cv_search_glNewList" = "x-lGLcore"; then
463 dnl if GLcore found, then also check for GL
464 AC_SEARCH_LIBS(glXCreateContext, GL)
467 dnl if using mesa, check for xmesa.h
468 if test "x$ac_cv_search_glNewList" = "x-lMesaGL"; then
469 AC_CHECK_HEADER(GL/fxmesa.h)
470 if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then
471 AC_DEFINE([XMESA], 1, [Define for fxmesa])
472 AC_DEFINE([FX], 1, [Define for fxmesa])
476 AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
477 AC_SEARCH_LIBS(glutGetModifiers, [ glut freeglut ])
478 if test "x$enable_sdl" = "xyes"; then
479 AC_SEARCH_LIBS(SDL_Init, SDL)
486 LIBS="$base_LIBS $joystick_LIBS"
488 dnl check for OpenAL libraries
492 *-*-cygwin* | *-*-mingw32*)
493 dnl CygWin under Windoze.
494 INCLUDES="$INCLUDES -I/usr/local/include/"
495 LIBS="$LIBS -L/usr/local/lib"
496 AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal 'openal -ldsound -lwinmm' ] )
497 AC_SEARCH_LIBS(alutInit, [ openal32 ALut alut ] )
498 LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
500 OPENAL_OK="$ac_cv_search_alGenBuffers"
501 ALUT_OK="$ac_cv_search_alutInit"
507 # Mac OS X has OpenAL.framework, but no ALUT, by default, so we
508 # require use of a non-Apple ALUT.framework which we provide
509 openal_LIBS="-framework IOKit -framework OpenAL"
511 AC_CHECK_FRAMEWORK(OpenAL, [#include <OpenAL/al.h>], "", [OPENAL_OK="yes"])
512 AC_CHECK_FRAMEWORK(ALUT, [#include <ALUT/alut.h>], $with_alut_framework, [
514 openal_LIBS="$openal_LIBS -framework ALUT"
519 dnl default unix style machines
522 LIBS="$LIBS $thread_LIBS"
523 AC_SEARCH_LIBS(alGenBuffers, openal)
524 AC_SEARCH_LIBS(alutInit, [ alut openal ] )
525 OPENAL_OK="$ac_cv_search_alGenBuffers"
526 ALUT_OK="$ac_cv_search_alutInit"
533 if test "$OPENAL_OK" = "no"; then
535 echo "You *must* have the openal library installed on your system to build"
538 echo "Please see README.OpenAL for more details."
540 echo "configure aborted."
544 if test "$ALUT_OK" = "no"; then
546 echo "You *must* have the alut library installed on your system to build"
549 echo "Please see README.OpenAL for more details."
551 echo "configure aborted."
559 AC_SUBST(openal_LIBS)
560 AC_SUBST(opengl_LIBS)
561 AC_SUBST(thread_LIBS)
562 AC_SUBST(network_LIBS)
563 AC_SUBST(joystick_LIBS)
565 # The following are C++ items that need to be tested for with the c++
570 dnl Check for the presence of SimGear
571 if test "x$with_simgear" != "x"; then
572 AC_CHECK_HEADER($with_simgear/include/simgear/version.h, [ac_cv_header_simgear_version_h=yes], [ac_cv_header_simgear_version_h=no])
574 AC_CHECK_HEADER(simgear/version.h)
576 if test "x$ac_cv_header_simgear_version_h" != "xyes"; then
578 echo "You *must* have the SimGear support library installed on your system"
579 echo "to build the FGFS simulator!"
581 echo "Please see README.SimGear for more details."
583 echo "configure aborted."
587 AC_MSG_CHECKING([for SimGear 2.5.0 or newer])
591 #include <simgear/version.h>
593 #define STRINGIFY(X) XSTRINGIFY(X)
594 #define XSTRINGIFY(X) #X
601 int major, minor, micro;
603 /* printf("%d.%d.%d or greater, ", MIN_MAJOR, MIN_MINOR, MIN_MICRO); */
604 printf("[found %s] ... ", STRINGIFY(SIMGEAR_VERSION));
606 sscanf( STRINGIFY(SIMGEAR_VERSION), "%d.%d.%d", &major, &minor, µ );
608 if ( (major < MIN_MAJOR) ||
609 (major == MIN_MAJOR && minor < MIN_MINOR) ||
610 (major == MIN_MAJOR && minor == MIN_MINOR && micro < MIN_MICRO) ) {
619 [AC_MSG_RESULT(wrong version);
620 AC_MSG_ERROR([Install latest SimGear first...])],
626 dnl Check if SimGear was built with Norman's JPEG factory support
627 if test "x$with_simgear" != "x"; then
628 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])
630 AC_CHECK_HEADER(simgear/screen/jpgfactory.hxx)
632 if test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes"; then
633 AC_CHECK_LIB(jpeg, jpeg_start_compress)
634 if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
636 echo "The JPEG factory code was built and installed with SimGear."
637 echo "However it appears the libjpeg is no longer installed."
638 echo "You need to install libjpeg or remove jpgfactory support from"
641 echo "libjpeg is available at :"
642 echo " ftp://ftp.uu.net in the directory graphics/jpeg"
645 AC_DEFINE([FG_JPEG_SERVER], 1,
646 [Define to build with jpeg screen shot server])
648 AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes")
650 # Check for "plib" without which we cannot go on
653 if test "x$with_plib_framework" != "x"; then
654 AC_CHECK_FRAMEWORK(PLIB, [#include <plib/ul.h>], $with_plib_framework, no)
655 plib_FRAMEWORK="$FRAMEWORKS"
656 AC_SUBST(plib_FRAMEWORK)
661 AM_CONDITIONAL(HAVE_FRAMEWORK_PLIB, test "x$ac_cv_framework_PLIB" != "x")
663 AC_CHECK_HEADER(plib/ul.h)
664 if test "x$ac_cv_header_plib_ul_h" != "xyes"; then
666 echo "You *must* have the plib library installed on your system to build"
667 echo "the FGFS simulator!"
669 echo "Please see README.plib for more details."
671 echo "configure aborted."
675 echo "$DYLD_FRAMEWORK_PATH"
676 AC_MSG_CHECKING([for plib 1.8.5 or newer])
680 #define MIN_PLIB_VERSION 185
683 if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
692 [AC_MSG_RESULT(wrong version);
693 AC_MSG_ERROR([Install plib 1.8.5 or later first...])],
697 dnl If we get here then plib is available, so force use of plib
699 AC_DEFINE([ENABLE_PLIB_JOYSTICK], 1, [Define to enable plib joystick support])
701 # Find the OSG libraries. Note special handling for OS X frameworks
702 if test "x$with_osg_framework" = "x"; then
703 if test "x$enable_osgdebug" = "xyes"; then
704 AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion, , [AC_MSG_ERROR(OpenThreads library not found.)],)
705 AC_CHECK_LIB(osgd,osgGetVersion, , [AC_MSG_ERROR(OpenSceneGraph library not found.)],)
706 AC_CHECK_LIB(osgUtild,osgUtilGetVersion, , [AC_MSG_ERROR(OpenSceneGraph utility library not found.)],)
707 AC_CHECK_LIB(osgDBd,osgDBGetVersion, , [AC_MSG_ERROR(OpenSceneGraph database library not found.)],)
708 AC_CHECK_LIB(osgTextd,osgTextGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Text library not found.)],)
709 AC_CHECK_LIB(osgGAd,osgGAGetVersion, , [AC_MSG_ERROR(OpenSceneGraph GUI Abstraction library not found.)],)
710 AC_CHECK_LIB(osgViewerd,osgViewerGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Viewer library not found.)],)
711 AC_CHECK_LIB(osgSimd,osgSimGetVersion, , [AC_MSG_ERROR(OpenSceneGraph simulation library not found.)],)
712 AC_CHECK_LIB(osgParticled,osgParticleGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Particle library not found.)],)
713 AC_CHECK_LIB(osgFXd, osgFXGetVersion, , [AC_MSG_ERROR(OpenSceneGraph FX library not found.)],)
715 AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion, , [AC_MSG_ERROR(OpenThreads library not found.)],)
716 AC_CHECK_LIB(osg,osgGetVersion, , [AC_MSG_ERROR(OpenSceneGraph library not found.)],)
717 AC_CHECK_LIB(osgUtil,osgUtilGetVersion, , [AC_MSG_ERROR(OpenSceneGraph utility library not found.)],)
718 AC_CHECK_LIB(osgDB,osgDBGetVersion, , [AC_MSG_ERROR(OpenSceneGraph database library not found.)],)
719 AC_CHECK_LIB(osgText,osgTextGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Text library not found.)],)
720 AC_CHECK_LIB(osgGA,osgGAGetVersion, , [AC_MSG_ERROR(OpenSceneGraph GUI Abstraction library not found.)],)
721 AC_CHECK_LIB(osgViewer,osgViewerGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Viewer library not found.)],)
722 AC_CHECK_LIB(osgSim,osgSimGetVersion, , [AC_MSG_ERROR(OpenSceneGraph simulation library not found.)],)
723 AC_CHECK_LIB(osgParticle,osgParticleGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Particle library not found.)],)
724 AC_CHECK_LIB(osgFX, osgFXGetVersion, , [AC_MSG_ERROR(OpenSceneGraph FX library not found.)],)
727 # Checking osg frameworks.
728 AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework)
729 AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework)
730 AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework)
731 AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework)
732 AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework)
733 AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework)
734 AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework)
735 AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework)
736 AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework)
737 osg_FRAMEWORKS="$FRAMEWORKS"
739 AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework)
740 openthreads_FRAMEWORK="$FRAMEWORKS"
741 AC_SUBST(osg_FRAMEWORKS)
742 AC_SUBST(openthreads_FRAMEWORK)
744 AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x")
746 AC_CHECK_HEADER(osg/Version)
747 if test "x$ac_cv_header_osg_Version" != "xyes"; then
749 echo "You *must* have the OpenSceneGraph support library installed on your system"
750 echo "to build the FGFS simulator!"
752 echo "Please see README.OSG for more details."
754 echo "configure aborted."
759 AC_MSG_CHECKING([checking for osg::CullSettings::CLEAR_MASK])
761 [AC_LANG_PROGRAM([[#include <osg/CullSettings>]],
762 [[osg::CullSettings::VariablesMask mask = osg::CullSettings::CLEAR_MASK;]])],
763 [AC_DEFINE([HAVE_CULLSETTINGS_CLEAR_MASK],1,[define if OSG has CullSettings::CLEAR_MASK])
764 AC_MSG_RESULT([yes])],
765 [AC_MSG_RESULT([no])])
767 # Special handling for static version of OSG
768 if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_LIBRARY_STATIC" 2>/dev/null`" ; then
771 #***** Check image support (needed for static build) *****
772 AC_SEARCH_LIBS([jpeg_read_header], [jpeg], [CPPFLAGS="$CPPFLAGS -DOSG_JPEG_ENABLED"])
773 AC_SEARCH_LIBS([png_read_image], [png 'png -lz'], [CPPFLAGS="$CPPFLAGS -DOSG_PNG_ENABLED"])
774 AC_SEARCH_LIBS([TIFFOpen], [tiff], [CPPFLAGS="$CPPFLAGS -DOSG_TIFF_ENABLED"])
778 if test "x$with_osg" != "x" ; then
779 osg_prefix="$with_osg"
783 PKG_CHECK_EXISTS([openscenegraph], [osg_version="`$PKG_CONFIG --modversion openscenegraph 2>/dev/null`"])
784 LIBS="-L$osg_prefix/lib/osgPlugins-$osg_version -losgdb_bmp -losgdb_dds -losgdb_hdr -losgdb_pic -losgdb_pnm -losgdb_rgb -losgdb_tga \
785 -losgdb_3ds -losgdb_ac -losgdb_ive -losgdb_osg -losgdb_txf \
786 -losgVolume -losgTerrain $LIBS -losgUtil"
788 if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_JPEG_ENABLED" 2>/dev/null`" ; then
789 LIBS="$LIBS -losgdb_jpeg"
791 if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_PNG_ENABLED" 2>/dev/null`" ; then
792 LIBS="$LIBS -losgdb_png"
794 if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_TIFF_ENABLED" 2>/dev/null`" ; then
795 LIBS="$LIBS -losgdb_tiff"
798 LIBS="$LIBS $img_LIBS"
803 dnl Check for system installed zlib
804 AC_CHECK_HEADER(zlib.h)
805 if test "x$ac_cv_header_zlib_h" != "xyes"; then
807 echo "zlib library not found."
809 echo "If your OS does not provide an installable package for zlib"
810 echo "you will have to compile and install it first yourself. A copy"
811 echo "of zlib-1.1.4.tar.gz is included with SimGear. You will"
812 echo "have to untar this source code, and follow it's included instructions"
813 echo "to compile and install on your system."
815 echo "configure aborted."
819 dnl Check for Subversion library support
820 # libsvn support defaults to yes
822 save_CPPFLAGS=$CPPFLAGS
823 AC_ARG_WITH(libsvn, [ --without-libsvn Do not use built-in subversion (libsvn) for terrasync/fgfs [default=no]], [], [with_libsvn=yes])
824 if test "x$with_libsvn" = "xyes"; then
825 LIBS="`apr-1-config --link-ld`"
826 CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes --cppflags`"
827 AC_CHECK_HEADERS([svn_client.h])
828 if test "x$ac_cv_header_svn_client_h" = "xyes"; then
829 echo "Using built-in subversion (libsvn) for scenery downloads."
830 AC_SEARCH_LIBS(svn_client_checkout, svn_client-1,
831 [AC_DEFINE([HAVE_LIBSVN_CLIENT_1], [1], [Define to 1 if you have libsvn_client-1])],
832 [AC_MSG_ERROR(svn_client-1 library not found.)],)
833 AC_SEARCH_LIBS(svn_cmdline_init, svn_subr-1, , [AC_MSG_ERROR(svn_subr-1 library not found.)],)
834 AC_SEARCH_LIBS(svn_ra_initialize, svn_ra-1, , [AC_MSG_ERROR(svn_ra-1 library not found.)],)
836 svn_CPPFLAGS=$CPPFLAGS
838 AC_SUBST(svn_CPPFLAGS)
840 echo "Libsvn not found. Will use command line subversion for scenery downloads."
845 echo "Libsvn explicitly disabled. Will use command line subversion for scenery downloads."
850 CPPFLAGS=$save_CPPFLAGS
852 AC_MSG_CHECKING([for feenableexcept])
853 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
854 #include <fenv.h>]], [[feenableexcept(FE_DIVBYZERO)]])],
855 [AC_DEFINE([HAVE_FEENABLEEXCEPT], 1, [define if system has fenableexcept])],
856 AC_MSG_RESULT([yes]),
859 dnl Checks for header files.
862 fcntl.h getopt.h malloc.h memory.h stdlib.h sys/param.h sys/stat.h \
863 sys/time.h sys/timeb.h unistd.h windows.h values.h )
865 dnl Checks for typedefs, structures, and compiler characteristics.
871 dnl Checks for library functions.
873 LIBS="$base_LIBS $network_LIBS $opengl_LIBS"
877 ftime gettimeofday timegm memcpy bcopy mktime strstr rand mkfifo \
878 random drand48 setitimer getitimer signal GetLocalTime rint getrusage \
882 AM_CONFIG_HEADER(src/Include/config.h)
894 scripts/debug/Makefile \
895 scripts/perl/Makefile \
896 scripts/perl/examples/Makefile \
897 scripts/perl/traffic/Makefile \
898 scripts/python/Makefile \
900 src/Include/Makefile \
901 src/Include/version.h \
902 src/Aircraft/Makefile \
903 src/Airports/Makefile \
905 src/ATCDCL/Makefile \
906 src/Autopilot/Makefile \
907 src/Cockpit/Makefile \
908 src/Cockpit/built_in/Makefile \
909 src/Environment/Makefile \
910 src/FDM/ExternalNet/Makefile \
911 src/FDM/ExternalPipe/Makefile \
912 src/FDM/JSBSim/Makefile \
913 src/FDM/JSBSim/initialization/Makefile \
914 src/FDM/JSBSim/input_output/Makefile \
915 src/FDM/JSBSim/math/Makefile \
916 src/FDM/JSBSim/models/Makefile \
917 src/FDM/JSBSim/models/flight_control/Makefile \
918 src/FDM/JSBSim/models/atmosphere/Makefile \
919 src/FDM/JSBSim/models/propulsion/Makefile \
920 src/FDM/LaRCsim/Makefile \
921 src/FDM/SP/Makefile \
922 src/FDM/UIUCModel/Makefile \
923 src/FDM/YASim/Makefile \
927 src/Instrumentation/Makefile \
928 src/Instrumentation/KLN89/Makefile \
929 src/Instrumentation/HUD/Makefile \
932 src/Main/runfgfs.bat \
934 src/AIModel/Makefile \
935 src/MultiPlayer/Makefile \
936 src/Navaids/Makefile \
937 src/Network/Makefile \
938 src/Network/HLA/Makefile \
939 src/Scenery/Makefile \
940 src/Scripting/Makefile \
942 src/Systems/Makefile \
944 src/Traffic/Makefile \
947 utils/GPSsmooth/Makefile \
948 utils/fgadmin/Makefile
949 utils/fgadmin/src/Makefile \
950 utils/js_server/Makefile \
951 utils/Modeller/Makefile \
952 utils/propmerge/Makefile \
953 utils/TerraSync/Makefile \
954 utils/xmlgrep/Makefile \
955 utils/fgviewer/Makefile \
956 utils/fgpanel/Makefile
960 AC_OUTPUT_COMMANDS([chmod 755 src/Main/runfgfs])
963 echo "Configure Summary"
964 echo "================="
966 echo "Prefix: $prefix"
968 if test "x$with_logging" != "x"; then
969 echo "Log messages: $with_logging"
971 echo "Log messages: yes"
974 echo -n "Automake version: "
975 automake --version | head -n 1
977 if test "x$with_multiplayer" != "xno"; then
978 echo "Building with multiplayer support"
981 if test "x$with_threads" = "xyes"; then
987 if test "x$with_eventinput" = "xyes"; then
988 echo "Event input: yes"
990 echo "Event input: no"
993 if test "x$with_fgpanel" = "xyes"; then
999 if test "x$enable_sp_fdms" != "xno"; then
1000 echo "Include special purpose flight models: yes"
1002 echo "Include special purpose flight models: no"