]> git.mxchange.org Git - flightgear.git/blob - configure.ac
Merge branch 'maint' into next
[flightgear.git] / configure.ac
1 dnl Process this file with autoget.sh to produce a working configure
2 dnl script.
3
4 AC_INIT
5 AC_CONFIG_SRCDIR([src/Aircraft/aircraft.cxx])
6
7 dnl Require at least automake 2.52
8 AC_PREREQ(2.52)
9
10 dnl Initialize the automake stuff
11 dnl set the $host variable based on local machine/os
12 AC_CANONICAL_TARGET
13 AM_INIT_AUTOMAKE(FlightGear, 1.9.1)
14
15 dnl Checks for programs.
16 AC_PROG_MAKE_SET
17 AC_PROG_CC
18 AC_PROG_CPP
19 AC_PROG_CXX
20 AC_PROG_RANLIB
21 AC_PROG_INSTALL
22 AC_PROG_LN_S
23 AX_BOOST_BASE([1.34.0])
24
25 if test "x$BOOST_CPPFLAGS" != "x-I/usr/include" ; then
26    CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
27 fi
28
29 # specify the simgear location
30 AC_ARG_WITH(simgear, [  --with-simgear=PREFIX   Specify the prefix path to SimGear])
31
32 if test "x$with_simgear" != "x" ; then
33     echo "SimGear prefix path is $with_simgear"
34     EXTRA_DIRS="${EXTRA_DIRS} $with_simgear"
35     CXXFLAGS="$CXXFLAGS -I$with_simgear"
36 fi
37
38 # specify the plib location
39 AC_ARG_WITH(plib, [  --with-plib=PREFIX      Specify the prefix path to plib])
40
41 if test "x$with_plib" != "x" ; then
42     echo "plib prefix is $with_plib"
43     EXTRA_DIRS="${EXTRA_DIRS} $with_plib"
44 fi
45
46 # specify the osg location
47 AC_ARG_WITH(osg, [  --with-osg=PREFIX       Specify the prefix path to osg])
48
49 if test "x$with_osg" != "x" ; then
50     echo "osg prefix is $with_osg"
51     EXTRA_DIRS="${EXTRA_DIRS} $with_osg"
52 fi
53
54 dnl Determine an extra directories to add to include/lib search paths
55 case "${host}" in
56 *-apple-darwin* | *-*-mingw32*)
57     echo no EXTRA_DIRS for $host
58     ;;
59
60 *-*-cygwin*)
61     if test -d /usr/local ; then
62         EXTRA_DIRS="${EXTRA_DIRS} /usr/local"
63     fi
64     ;;
65
66 *)
67     if test -d /usr/X11R6 ; then
68         EXTRA_DIR1="/usr/X11R6"
69     fi
70     if test -d /opt/X11R6 ; then
71         EXTRA_DIR2="/opt/X11R6"
72     fi
73     EXTRA_DIRS="${EXTRA_DIRS} $EXTRA_DIR1 $EXTRA_DIR2 /usr/local"
74     ;;
75
76 esac
77 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
78
79
80 case "${host}" in
81 *-*-irix*)
82     if test "$CXX" = "CC"; then
83         AR="CC -ar"
84         ARFLAGS="-o"
85         CXXFLAGS="$CXXFLAGS -c99 -I$with_simgear/include/simgear/compatibility"
86         CFLAGS="$CFLAGS -c99"
87     else
88         AR="ar"
89         ARFLAGS="cru"
90     fi
91     ;;
92 *)
93     AR="ar"
94     ARFLAGS="cru"
95     ;;
96 esac
97 AC_SUBST(AR)
98 AC_SUBST(ARFLAGS)
99
100 dnl set logging; default value of with_logging=yes
101 AC_ARG_WITH(logging, [  --with-logging          Include logging output (default)])
102 if test "x$with_logging" = "xno" ; then
103     AC_DEFINE([FG_NDEBUG], 1, [Define for no logging output])
104 fi
105
106 AC_ARG_ENABLE(sp_fdms, [  --enable-sp-fdms               Include special purpose Flight Models], [enable_sp_fdms="$enableval"] )
107 if test "x$enable_sp_fdms" != "xno"; then
108     AC_DEFINE([ENABLE_SP_FDM], 1, [Define to include special purpose FDMs])
109 else
110     AC_DEFINE([ENABLE_SP_FDM], 0, [Define to include special purpose FDMs])
111 fi
112 AM_CONDITIONAL(ENABLE_SP_FDM, test "x$enable_sp_fdms" != "xno")
113
114
115 dnl Thread related checks
116 # defaults to yes
117 AC_ARG_WITH(threads, [  --with-threads          Include tile loading threads [default=yes]], [], [with_threads=yes])
118 if test "x$with_threads" = "xyes"; then
119     AC_DEFINE([ENABLE_THREADS], 1, [Define to enable threaded tile paging])
120     CXXFLAGS="$CXXFLAGS -D_REENTRANT"
121     CFLAGS="$CFLAGS -D_REENTRANT"
122 fi
123 AC_CHECK_HEADER(pthread.h)
124 AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes")
125
126 dnl Used by JSBSim to conditionally compile in fgfs interface code
127 AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
128
129 # Check for MS Windows environment
130 AC_CHECK_HEADER(windows.h)
131
132 dnl Using AM_CONDITIONAL is a step out of the protected little 
133 dnl automake fold so it is potentially dangerous.  But, we are
134 dnl beginning to run into cases where the standard checks are not
135 dnl enough.  AM_CONDITIONALS are then referenced to conditionally
136 dnl build a Makefile.in from a Makefile.am which lets us define custom
137 dnl includes, compile alternative source files, etc.
138
139 dnl Check for external variables daylight and timezone.
140 AC_EXT_DAYLIGHT
141 if test "$have_daylight" = yes; then
142     AC_DEFINE([HAVE_DAYLIGHT], 1, [Define if system has daylight variable])
143 fi
144
145 AC_EXT_TIMEZONE
146 if test "$have_timezone" = yes; then
147     AC_DEFINE([HAVE_TIMEZONE], 1, [Define if system has timezone variable])
148 fi
149
150
151 dnl add joystick support libraries
152 dnl search for FreeBSD library
153 AC_SEARCH_LIBS(hid_init, usbhid)
154 joystick_LIBS="$LIBS"
155 LIBS=""
156
157
158 dnl ENABLE_AUDIO_SUPPORT could be depricated at any time in favor of
159 dnl just assuming we have audio support on all platform.  We can
160 dnl depend on plib to hide the details.
161 AC_DEFINE([ENABLE_AUDIO_SUPPORT], 1, [Define for audio support])
162
163 dnl X11 might be installed on Mac OS X or cygwin/mingwin, we don't want
164 dnl to use it if it is.
165 case "${host}" in
166 *-apple-darwin* | *-*-cygwin* | *-*-mingw32*)
167     echo no fancy X11 check
168     ;;
169
170 *)
171     AC_PATH_XTRA
172     ;;
173
174 esac
175
176 dnl Checks for libraries.
177
178 dnl Thread related checks
179 AC_SEARCH_LIBS(pthread_create, [pthread c_r])
180 if test "x$ac_cv_header_pthread_h" = "xyes"; then
181   if test "x$ac_cv_search_pthread_exit" = "x-lc_r"; then
182     CXXFLAGS="-pthread $CXXFLAGS"
183     CFLAGS="-pthread $CFLAGS"
184   fi
185 fi
186
187 thread_LIBS="$LIBS"
188 LIBS=""
189
190 dnl search for network related libraries
191 AC_SEARCH_LIBS(inet_addr, xnet)
192 AC_SEARCH_LIBS(socket, socket)
193 AC_SEARCH_LIBS(main, nsl)
194
195 network_LIBS="$LIBS"
196 LIBS=""
197
198 dnl check for some default libraries
199 AC_SEARCH_LIBS(sqrt, [am ffm fm fastm m])
200 AC_SEARCH_LIBS(ceil, m)
201 AC_SEARCH_LIBS(dlclose, dl)
202
203 base_LIBS="$LIBS"
204
205 dnl Check for SDL or glut if enabled.
206 AC_ARG_ENABLE(osgviewer, [  --enable-osgviewer                  Configure to use osgViewer(default)], [enable_osgviewer="$enableval"])
207 AC_ARG_ENABLE(sdl,  [  --enable-sdl                   Configure to use SDL], [enable_sdl="$enableval"])
208 AC_ARG_ENABLE(glut, [  --enable-glut                  Configure to use GLUT], [enable_glut="$enableval"])
209 AM_CONDITIONAL(USE_SDL, test "x$enable_sdl" = "xyes")
210 AM_CONDITIONAL(USE_GLUT, test "x$enable_glut" = "xyes")
211 if test "x$enable_sdl" != "xyes" -a "x$enable_glut" != "xyes" -a "x$enable_osgviewer" != "xno"; then
212    enable_osgviewer="yes"
213 fi
214 if test \( "x$enable_osgviewer" = "xyes" \
215    -a \( "x$enable_sdl" = "xyes" -o "x$enable_glut" = "xyes" \) \) \
216    -o \( "x$enable_sdl" = "xyes" -a "x$enable_glut" = "xyes" \); then
217    echo " Only one of --enable-osgviewer, --enable-sdl, or --enable -glut may"
218    echo " be supplied."
219    exit
220 fi
221 AC_DEFINE([PU_USE_NONE], 1, [Define to use application's pu callbacks])
222
223 AC_ARG_ENABLE(osgdebug, [  --enable-osgdebug              Use OSG debug libraries], [enable_osgdebug="$enableval"])
224
225 dnl check for OpenGL related libraries
226 case "${host}" in
227 *-*-cygwin* | *-*-mingw32*)
228     dnl CygWin under Windoze.
229
230     echo Win32 specific hacks...
231     AC_DEFINE([WIN32], 1, [Define for Win32 platforms])
232     AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms])
233
234     if test "x$enable_sdl" = "xyes"; then
235         AC_SEARCH_LIBS(SDL_Init, SDL)
236     else
237         LIBS="$LIBS -lglut32"
238     fi
239
240     LIBS="$LIBS -lglu32 -lopengl32 -luser32 -lgdi32"
241     joystick_LIBS="$joystick_LIBS -lwinmm"
242
243     dnl add -lwsock32 for mingwin
244     case "${host}" in
245     *-*-mingw32*)
246         echo "********** BUILDING FOR MINGW32 *************"
247         network_LIBS="$network_LIBS -lws2_32"
248         ;;
249     esac
250
251     echo "Will link apps with $LIBS"
252     ;;
253
254
255 *-apple-darwin*)
256     dnl Mac OS X
257
258     LIBS="$LIBS -framework GLUT -framework OpenGL -framework AGL -framework Carbon -lobjc"
259     joystick_LIBS="$joystick_LIBS -framework IOKit -framework CoreFoundation"
260     ;;
261
262 *)
263     dnl X-Windows based machines
264
265     dnl Skip X11 library tests if requested.
266     if test "x$no_x" != "xyes"; then
267         AC_SEARCH_LIBS(XCreateWindow, X11)
268         AC_SEARCH_LIBS(XShmCreateImage, Xext)
269         AC_SEARCH_LIBS(XGetExtensionVersion, Xi)
270         AC_SEARCH_LIBS(IceOpenConnection, ICE)
271         AC_SEARCH_LIBS(SmcOpenConnection, SM)
272         AC_SEARCH_LIBS(XtMalloc, Xt)
273         AC_SEARCH_LIBS(XmuLookupStandardColormap, Xmu)
274     fi
275
276     AC_SEARCH_LIBS(glNewList, [ GL GLcore MesaGL ])
277     if test "x$ac_cv_search_glNewList" = "x-lGLcore"; then
278         dnl if GLcore found, then also check for GL
279         AC_SEARCH_LIBS(glXCreateContext, GL)
280     fi
281
282     dnl if using mesa, check for xmesa.h
283     if test "x$ac_cv_search_glNewList" = "x-lMesaGL"; then
284         AC_CHECK_HEADER(GL/fxmesa.h)
285         if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then
286             AC_DEFINE([XMESA], 1, [Define for fxmesa])
287             AC_DEFINE([FX], 1, [Define for fxmesa])
288         fi
289     fi
290
291     AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
292     AC_SEARCH_LIBS(glutGetModifiers, [ glut freeglut ])
293     if test "x$enable_sdl" = "xyes"; then
294         AC_SEARCH_LIBS(SDL_Init, SDL)
295     fi
296     ;;
297
298 esac
299
300 opengl_LIBS="$LIBS"
301 LIBS="$base_LIBS $joystick_LIBS"
302
303 dnl check for OpenAL libraries
304 OPENAL_OK="no"
305 ALUT_OK="no"
306 case "${host}" in
307 *-*-cygwin* | *-*-mingw32*)
308     dnl CygWin under Windoze.
309     INCLUDES="$INCLUDES -I/usr/local/include/"
310     LIBS="$LIBS -L/usr/local/lib"
311     AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal ] )
312     AC_SEARCH_LIBS(alutInit, [ openal32 ALut alut ] )
313     LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
314     openal_LIBS="$LIBS"
315     OPENAL_OK="$ac_cv_search_alGenBuffers"
316     ALUT_OK="$ac_cv_search_alutInit"
317     ;;
318
319 *-apple-darwin*)
320     dnl Mac OS X
321
322     LIBS="$LIBS -framework IOKit -framework OpenAL"
323     openal_LIBS="$LIBS"
324     # not sure how to test if OpenAL exists on MacOS (does it come by default?)
325     OPENAL_OK="yes"
326     ALUT_OK="yes"
327     ;;
328
329 *)
330     dnl default unix style machines
331
332     save_LIBS=$LIBS
333     LIBS="$LIBS $thread_LIBS"
334     AC_SEARCH_LIBS(alGenBuffers, openal)
335     AC_SEARCH_LIBS(alutInit, [ alut openal ] )
336     OPENAL_OK="$ac_cv_search_alGenBuffers"
337     ALUT_OK="$ac_cv_search_alutInit"
338     openal_LIBS="$LIBS"
339     LIBS=$save_LIBS
340     ;;
341
342 esac
343
344 if test "$OPENAL_OK" == "no"; then
345     echo
346     echo "You *must* have the openal library installed on your system to build"
347     echo "SimGear!"
348     echo
349     echo "Please see README.OpenAL for more details."
350     echo
351     echo "configure aborted."
352     exit
353 fi
354
355 if test "$ALUT_OK" == "no"; then
356     echo
357     echo "You *must* have the alut library installed on your system to build"
358     echo "SimGear!"
359     echo
360     echo "Please see README.OpenAL for more details."
361     echo
362     echo "configure aborted."
363     exit
364 fi
365
366
367 LIBS="$base_LIBS"
368
369 AC_SUBST(base_LIBS)
370 AC_SUBST(openal_LIBS)
371 AC_SUBST(opengl_LIBS)
372 AC_SUBST(thread_LIBS)
373 AC_SUBST(network_LIBS)
374 AC_SUBST(joystick_LIBS)
375
376 # The following are C++ items that need to be tested for with the c++
377 # compiler
378
379 AC_LANG_PUSH(C++)
380
381 dnl Check for the presence of SimGear
382 if test "x$with_simgear" != "x"; then
383 AC_CHECK_HEADER($with_simgear/include/simgear/version.h, [ac_cv_header_simgear_version_h=yes], [ac_cv_header_simgear_version_h=no])
384 else
385 AC_CHECK_HEADER(simgear/version.h)
386 fi
387 if test "x$ac_cv_header_simgear_version_h" != "xyes"; then
388     echo
389     echo "You *must* have the SimGear support library installed on your system"
390     echo "to build the FGFS simulator!"
391     echo
392     echo "Please see README.SimGear for more details."
393     echo
394     echo "configure aborted."
395     exit
396 fi
397
398 AC_MSG_CHECKING([for SimGear 1.9.0 or newer])
399 AC_TRY_RUN([
400 #include <stdio.h>
401
402 #include <simgear/version.h>
403
404 #define STRINGIFY(X) XSTRINGIFY(X)
405 #define XSTRINGIFY(X) #X
406
407 #define MIN_MAJOR 1
408 #define MIN_MINOR 9
409 #define MIN_MICRO 0
410
411 int main() {
412     int major, minor, micro;
413
414     /* printf("%d.%d.%d or greater, ", MIN_MAJOR, MIN_MINOR, MIN_MICRO); */
415     printf("[found %s] ... ", STRINGIFY(SIMGEAR_VERSION));
416
417     sscanf( STRINGIFY(SIMGEAR_VERSION), "%d.%d.%d", &major, &minor, &micro );
418
419     if ( (major < MIN_MAJOR) ||
420          (major == MIN_MAJOR && minor < MIN_MINOR) ||
421          (major == MIN_MAJOR && minor == MIN_MINOR && micro < MIN_MICRO) ) {
422          return -1;
423     }
424
425     return 0;
426 }
427
428 ],
429   AC_MSG_RESULT(yes),
430   [AC_MSG_RESULT(wrong version);
431    AC_MSG_ERROR([Install latest SimGear first...])],
432   AC_MSG_RESULT(yes)
433 )
434
435 LIBS="$saved_LIBS"
436
437 dnl Check if SimGear was built with Norman's JPEG factory support
438 if test "x$with_simgear" != "x"; then
439 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])
440 else
441 AC_CHECK_HEADER(simgear/screen/jpgfactory.hxx)
442 fi
443 if test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes"; then
444     AC_CHECK_LIB(jpeg, jpeg_start_compress)
445     if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
446         echo
447         echo "The JPEG factory code was built and installed with SimGear."
448         echo "However it appears the libjpeg is no longer installed."
449         echo "You need to install libjpeg or remove jpgfactory support from"
450         echo "SimGear"
451         echo
452         echo "libjpeg is available at :"
453         echo "  ftp://ftp.uu.net in the directory graphics/jpeg"
454         exit 1
455     fi
456     AC_DEFINE([FG_JPEG_SERVER], 1,
457               [Define to build with jpeg screen shot server])
458 fi
459 AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes")
460
461 # Check for "plib" without which we cannot go on
462 AC_CHECK_HEADER(plib/ul.h)
463 if test "x$ac_cv_header_plib_ul_h" != "xyes"; then
464     echo
465     echo "You *must* have the plib library installed on your system to build"
466     echo "the FGFS simulator!"
467     echo
468     echo "Please see README.plib for more details."
469     echo
470     echo "configure aborted."
471     exit
472 fi
473
474 AC_MSG_CHECKING([for plib 1.8.5 or newer])
475 AC_TRY_RUN([
476 #include <plib/ul.h>
477
478 #define MIN_PLIB_VERSION 185
479
480 int main() {
481     int major, minor, micro;
482
483     if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
484          return -1;
485     }
486
487     return 0;
488 }
489
490 ],
491   AC_MSG_RESULT(yes),
492   [AC_MSG_RESULT(wrong version);
493    AC_MSG_ERROR([Install plib 1.8.5 or later first...])],
494   AC_MSG_RESULT(yes)
495 )
496
497 dnl If we get here then plib is available, so force use of plib
498 dnl joystick lib
499 AC_DEFINE([ENABLE_PLIB_JOYSTICK], 1, [Define to enable plib joystick support])
500
501 AC_CHECK_HEADER(osg/Version)
502 if test "x$ac_cv_header_osg_Version" != "xyes"; then
503     echo
504     echo "You *must* have the OpenSceneGraph support library installed on your system"
505     echo "to build the FGFS simulator!"
506     echo
507     echo "Please see README.OSG for more details."
508     echo
509     echo "configure aborted."
510     exit
511 fi
512
513 # Find the OSG libraries.  Note special handling for OS X frameworks
514 case "${host}" in
515 *-apple-darwin*)
516
517     dnl Thank you Christian Bauer from SheepSaver
518     dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
519     AC_DEFUN([AC_CHECK_FRAMEWORK], [
520     AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
521     AC_CACHE_CHECK([whether compiler supports framework $1],
522         ac_Framework, [
523         saved_LIBS="$LIBS"
524         LIBS="$LIBS -framework $1"
525         AC_TRY_LINK(
526         [$2], [],
527         [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
528         )
529     ])
530     AS_IF([test AS_VAR_GET(ac_Framework) = yes],
531         [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
532     )
533     AS_VAR_POPDEF([ac_Framework])dnl
534     ])
535
536     if test "x$enable_osgdebug" = "xyes"; then
537         AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
538         AC_CHECK_LIB(osgGAd,osgGAGetVersion)
539         AC_CHECK_LIB(osgTextd,osgTextGetVersion)
540         LIBS="$LIBS -losgFXd"
541         AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
542         AC_CHECK_LIB(osgDBd,osgDBGetVersion)
543         AC_CHECK_LIB(osgSimd,osgSimGetVersion)
544         AC_CHECK_LIB(osgParticled,osgParticleGetVersion)
545         AC_CHECK_LIB(osgd,osgGetVersion)
546         AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
547     else
548         AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>])
549         AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>])
550         AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>])
551         AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>])
552         AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>])
553         AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>])
554         AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>])
555         AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>])
556         AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>])
557         AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>])
558     fi
559     ;;
560 *)
561     if test "x$enable_osgdebug" = "xyes"; then
562         AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
563         AC_CHECK_LIB(osgd,osgGetVersion)
564         AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
565         AC_CHECK_LIB(osgDBd,osgDBGetVersion)
566         AC_CHECK_LIB(osgTextd,osgTextGetVersion)
567         AC_CHECK_LIB(osgGAd,osgGAGetVersion)
568         AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
569         AC_CHECK_LIB(osgSimd,osgSimGetVersion)
570         AC_CHECK_LIB(osgParticled,osgParticleGetVersion)
571         LIBS="$LIBS -losgFXd"
572     else
573         AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
574         AC_CHECK_LIB(osg,osgGetVersion)
575         AC_CHECK_LIB(osgUtil,osgUtilGetVersion)
576         AC_CHECK_LIB(osgDB,osgDBGetVersion)
577         AC_CHECK_LIB(osgText,osgTextGetVersion)
578         AC_CHECK_LIB(osgGA,osgGAGetVersion)
579         AC_CHECK_LIB(osgViewer,osgViewerGetVersion)
580         AC_CHECK_LIB(osgSim,osgSimGetVersion)
581         AC_CHECK_LIB(osgParticle,osgParticleGetVersion)
582         LIBS="$LIBS -losgFX"
583     fi
584     ;;
585 esac
586
587 AC_LANG_POP
588
589 dnl Check for system installed zlib
590 AC_CHECK_HEADER(zlib.h)
591 if test "x$ac_cv_header_zlib_h" != "xyes"; then
592     echo
593     echo "zlib library not found."
594     echo
595     echo "If your OS does not provide an installable package for zlib"
596     echo "you will have to compile and install it first yourself.  A copy"
597     echo "of zlib-1.1.4.tar.gz is included with SimGear.  You will"
598     echo "have to untar this source code, and follow it's included instructions"
599     echo "to compile and install on your system."
600     echo
601     echo "configure aborted."
602     echo
603 fi
604
605 dnl Check for Subversion library support
606 save_LIBS=$LIBS
607 save_CPPFLAGS=$CPPFLAGS
608 LIBS=""
609 CPPFLAGS="-I/usr/include/subversion-1 -I/usr/include/apr-1.0"
610 AC_CHECK_LIB(svn_client-1, svn_client_checkout3)
611 AC_CHECK_HEADERS([svn_client.h])
612 if test "x$ac_cv_header_svn_client_h" != "xyes"; then
613   echo "TerraSync will shell out for command line subversion"
614   svn_LIBS=""
615   svn_CPPFLAGS=""
616 else
617   echo "TerraSync will use integrated subversion library"
618   AC_SEARCH_LIBS(svn_client_checkout, svn_client-1)
619   svn_LIBS=$LIBS
620   svn_CPPFLAGS=$CPPFLAGS
621   AC_SUBST(svn_LIBS)
622   AC_SUBST(svn_CPPFLAGS)
623 fi
624 LIBS=$save_LIBS
625 CPPFLAGS=$save_CPPFLAGS
626
627 dnl Checks for header files.
628 AC_HEADER_STDC
629 AC_CHECK_HEADERS( \
630         fcntl.h getopt.h malloc.h memory.h stdlib.h sys/param.h sys/stat.h \
631         sys/time.h sys/timeb.h unistd.h windows.h values.h )
632
633 dnl Checks for typedefs, structures, and compiler characteristics.
634 AC_C_CONST
635 AC_TYPE_SIZE_T
636 AC_HEADER_TIME
637 AC_STRUCT_TM
638
639 dnl Checks for library functions.
640 old_LIBS=$LIBS
641 LIBS="$base_LIBS $network_LIBS $opengl_LIBS"
642 AC_TYPE_SIGNAL
643 AC_FUNC_VPRINTF
644 AC_CHECK_FUNCS( [ \
645         ftime gettimeofday timegm memcpy bcopy mktime strstr rand mkfifo \
646         random drand48 setitimer getitimer signal GetLocalTime rint getrusage \
647         truncf ] )
648 LIBS=$old_LIBS
649
650 AM_CONFIG_HEADER(src/Include/config.h)
651
652 AC_CONFIG_FILES([ \
653         Makefile \
654         man/Makefile \
655         man/est-epsilon.1 \
656         man/fgfs.1 \
657         man/fgjs.1 \
658         man/gl-info.1 \
659         man/js_demo.1 \
660         man/pstest.1 \
661         scripts/Makefile \
662         scripts/debug/Makefile \
663         scripts/perl/Makefile \
664         scripts/perl/examples/Makefile \
665         scripts/python/Makefile \
666         src/Makefile \
667         src/Include/Makefile \
668         src/Include/version.h \
669         src/Include/config.h-msvc6 \
670         src/Include/config.h-msvc71 \
671         src/Include/config.h-msvc8 \
672         src/Aircraft/Makefile \
673         src/Airports/Makefile \
674         src/ATC/Makefile \
675         src/ATCDCL/Makefile \
676         src/Autopilot/Makefile \
677         src/Cockpit/Makefile \
678         src/Cockpit/built_in/Makefile \
679         src/Environment/Makefile \
680         src/FDM/ExternalNet/Makefile \
681         src/FDM/ExternalPipe/Makefile \
682         src/FDM/JSBSim/Makefile \
683         src/FDM/JSBSim/initialization/Makefile \
684         src/FDM/JSBSim/input_output/Makefile \
685         src/FDM/JSBSim/math/Makefile \
686         src/FDM/JSBSim/models/Makefile \
687         src/FDM/JSBSim/models/flight_control/Makefile \
688         src/FDM/JSBSim/models/atmosphere/Makefile \
689         src/FDM/JSBSim/models/propulsion/Makefile \
690         src/FDM/LaRCsim/Makefile \
691         src/FDM/SP/Makefile \
692         src/FDM/UIUCModel/Makefile \
693         src/FDM/YASim/Makefile \
694         src/FDM/Makefile \
695         src/GUI/Makefile \
696         src/Input/Makefile \
697         src/Instrumentation/Makefile \
698         src/Instrumentation/KLN89/Makefile \
699         src/Instrumentation/HUD/Makefile \
700         src/Main/Makefile \
701         src/Main/runfgfs \
702         src/Main/runfgfs.bat \
703         src/Model/Makefile \
704         src/AIModel/Makefile \
705         src/MultiPlayer/Makefile \
706         src/Navaids/Makefile \
707         src/Network/Makefile \
708         src/Scenery/Makefile \
709         src/Scripting/Makefile \
710         src/Sound/Makefile \
711         src/Systems/Makefile \
712         src/Time/Makefile \
713         src/Traffic/Makefile \
714         tests/Makefile \
715         utils/Makefile \
716         utils/GPSsmooth/Makefile \
717         utils/fgadmin/Makefile
718         utils/fgadmin/src/Makefile \
719         utils/js_server/Makefile \
720         utils/Modeller/Makefile \
721         utils/propmerge/Makefile \
722         utils/TerraSync/Makefile \
723         utils/xmlgrep/Makefile \
724 ])
725 AC_OUTPUT
726
727 AC_OUTPUT_COMMANDS([chmod 755 src/Main/runfgfs])
728
729 echo ""
730 echo "Configure Summary"
731 echo "================="
732
733 echo "Prefix: $prefix"
734
735 if test "x$with_logging" != "x"; then
736     echo "Debug messages: $with_logging"
737 else
738     echo "Debug messages: yes"
739 fi
740
741 echo -n "Automake version: "
742 automake --version | head -n 1
743
744 if test "x$with_multiplayer" != "xno"; then
745     echo "Building with multiplayer support"
746 fi
747
748 if test "x$with_threads" = "xyes"; then
749     echo "threads: yes"
750 else
751     echo "threads: no"
752 fi
753
754 if test "x$enable_sp_fdms" != "xno"; then
755     echo "Include special purpose flight models: yes"
756 else
757     echo "Include special purpose flight models: no"
758 fi
759