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