]> git.mxchange.org Git - flightgear.git/blob - configure.ac
Rvert last change. The Balloon and Magic Carpet are there. They didn't
[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" \
210    -a \( "x$enable_sdl" = "xyes" -o "x$enable_glut" = "xyes" \) \) \
211    -o \( "x$enable_sdl" = "xyes" -a "x$enable_glut" = "xyes" \); then
212    echo " Only one of --enable-osgviewer, --enable-sdl, or --enable -glut may"
213    echo " be supplied."
214    exit
215 fi
216 AC_DEFINE([PU_USE_NONE], 1, [Define to use application's pu callbacks])
217
218 AC_ARG_ENABLE(osgdebug, [  --enable-osgdebug              Use OSG debug libraries], [enable_osgdebug="$enableval"])
219
220 dnl check for OpenGL related libraries
221 case "${host}" in
222 *-*-cygwin* | *-*-mingw32*)
223     dnl CygWin under Windoze.
224
225     echo Win32 specific hacks...
226     AC_DEFINE([WIN32], 1, [Define for Win32 platforms])
227     AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms])
228
229     if test "x$enable_sdl" = "xyes"; then
230         AC_SEARCH_LIBS(SDL_Init, SDL)
231     else
232         LIBS="$LIBS -lglut32"
233     fi
234
235     LIBS="$LIBS -lglu32 -lopengl32 -luser32 -lgdi32"
236     joystick_LIBS="$joystick_LIBS -lwinmm"
237
238     dnl add -lwsock32 for mingwin
239     case "${host}" in
240     *-*-mingw32*)
241         echo "********** BUILDING FOR MINGW32 *************"
242         network_LIBS="$network_LIBS -lws2_32"
243         ;;
244     esac
245
246     echo "Will link apps with $LIBS"
247     ;;
248
249
250 *-apple-darwin*)
251     dnl Mac OS X
252
253     LIBS="$LIBS -framework GLUT -framework OpenGL -framework AGL -framework Carbon -lobjc"
254     joystick_LIBS="$joystick_LIBS -framework IOKit -framework CoreFoundation"
255     ;;
256
257 *)
258     dnl X-Windows based machines
259
260     dnl Skip X11 library tests if requested.
261     if test "x$no_x" != "xyes"; then
262         AC_SEARCH_LIBS(XCreateWindow, X11)
263         AC_SEARCH_LIBS(XShmCreateImage, Xext)
264         AC_SEARCH_LIBS(XGetExtensionVersion, Xi)
265         AC_SEARCH_LIBS(IceOpenConnection, ICE)
266         AC_SEARCH_LIBS(SmcOpenConnection, SM)
267         AC_SEARCH_LIBS(XtMalloc, Xt)
268         AC_SEARCH_LIBS(XmuLookupStandardColormap, Xmu)
269     fi
270
271     AC_SEARCH_LIBS(glNewList, [ GL GLcore MesaGL ])
272     if test "x$ac_cv_search_glNewList" = "x-lGLcore"; then
273         dnl if GLcore found, then also check for GL
274         AC_SEARCH_LIBS(glXCreateContext, GL)
275     fi
276
277     dnl if using mesa, check for xmesa.h
278     if test "x$ac_cv_search_glNewList" = "x-lMesaGL"; then
279         AC_CHECK_HEADER(GL/fxmesa.h)
280         if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then
281             AC_DEFINE([XMESA], 1, [Define for fxmesa])
282             AC_DEFINE([FX], 1, [Define for fxmesa])
283         fi
284     fi
285
286     AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
287     AC_SEARCH_LIBS(glutGetModifiers, [ glut freeglut ])
288     if test "x$enable_sdl" = "xyes"; then
289         AC_SEARCH_LIBS(SDL_Init, SDL)
290     fi
291     ;;
292
293 esac
294
295 opengl_LIBS="$LIBS"
296 LIBS="$base_LIBS $joystick_LIBS"
297
298 dnl check for OpenAL libraries
299 OPENAL_OK="no"
300 ALUT_OK="no"
301 case "${host}" in
302 *-*-cygwin* | *-*-mingw32*)
303     dnl CygWin under Windoze.
304     INCLUDES="$INCLUDES -I/usr/local/include/"
305     LIBS="$LIBS -L/usr/local/lib"
306     AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal ] )
307     AC_SEARCH_LIBS(alutInit, [ openal32 ALut alut ] )
308     LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
309     openal_LIBS="$LIBS"
310     OPENAL_OK="$ac_cv_search_alGenBuffers"
311     ALUT_OK="$ac_cv_search_alutInit"
312     ;;
313
314 *-apple-darwin*)
315     dnl Mac OS X
316
317     LIBS="$LIBS -framework IOKit -framework OpenAL"
318     openal_LIBS="$LIBS"
319     # not sure how to test if OpenAL exists on MacOS (does it come by default?)
320     OPENAL_OK="yes"
321     ALUT_OK="yes"
322     ;;
323
324 *)
325     dnl default unix style machines
326
327     save_LIBS=$LIBS
328     LIBS="$LIBS $thread_LIBS"
329     AC_SEARCH_LIBS(alGenBuffers, openal)
330     AC_SEARCH_LIBS(alutInit, [ alut openal ] )
331     OPENAL_OK="$ac_cv_search_alGenBuffers"
332     ALUT_OK="$ac_cv_search_alutInit"
333     openal_LIBS="$LIBS"
334     LIBS=$save_LIBS
335     ;;
336
337 esac
338
339 if test "$OPENAL_OK" == "no"; then
340     echo
341     echo "You *must* have the openal library installed on your system to build"
342     echo "SimGear!"
343     echo
344     echo "Please see README.OpenAL for more details."
345     echo
346     echo "configure aborted."
347     exit
348 fi
349
350 if test "$ALUT_OK" == "no"; then
351     echo
352     echo "You *must* have the alut library installed on your system to build"
353     echo "SimGear!"
354     echo
355     echo "Please see README.OpenAL for more details."
356     echo
357     echo "configure aborted."
358     exit
359 fi
360
361
362 LIBS="$base_LIBS"
363
364 AC_SUBST(base_LIBS)
365 AC_SUBST(openal_LIBS)
366 AC_SUBST(opengl_LIBS)
367 AC_SUBST(thread_LIBS)
368 AC_SUBST(network_LIBS)
369 AC_SUBST(joystick_LIBS)
370
371 # The following are C++ items that need to be tested for with the c++
372 # compiler
373
374 AC_LANG_PUSH(C++)
375
376 dnl Check for the presence of SimGear
377 if test "x$with_simgear" != "x"; then
378 AC_CHECK_HEADER($with_simgear/include/simgear/version.h, [ac_cv_header_simgear_version_h=yes], [ac_cv_header_simgear_version_h=no])
379 else
380 AC_CHECK_HEADER(simgear/version.h)
381 fi
382 if test "x$ac_cv_header_simgear_version_h" != "xyes"; then
383     echo
384     echo "You *must* have the SimGear support library installed on your system"
385     echo "to build the FGFS simulator!"
386     echo
387     echo "Please see README.SimGear for more details."
388     echo
389     echo "configure aborted."
390     exit
391 fi
392
393 AC_MSG_CHECKING([for simgear 0.3.10 or newer])
394 AC_TRY_RUN([
395 #include <stdio.h>
396
397 #include <simgear/version.h>
398
399 #define STRINGIFY(X) XSTRINGIFY(X)
400 #define XSTRINGIFY(X) #X
401
402 #define MIN_MAJOR 0
403 #define MIN_MINOR 3
404 #define MIN_MICRO 10
405
406 int main() {
407     int major, minor, micro;
408
409     /* printf("%d.%d.%d or greater, ", MIN_MAJOR, MIN_MINOR, MIN_MICRO); */
410     printf("[found %s] ... ", STRINGIFY(SIMGEAR_VERSION));
411
412     sscanf( STRINGIFY(SIMGEAR_VERSION), "%d.%d.%d", &major, &minor, &micro );
413
414     if ( (major < MIN_MAJOR) ||
415          (major == MIN_MAJOR && minor < MIN_MINOR) ||
416          (major == MIN_MAJOR && minor == MIN_MINOR && micro < MIN_MICRO) ) {
417          return -1;
418     }
419
420     return 0;
421 }
422
423 ],
424   AC_MSG_RESULT(yes),
425   [AC_MSG_RESULT(wrong version);
426    AC_MSG_ERROR([Install latest simgear first...])],
427   AC_MSG_RESULT(yes)
428 )
429
430 LIBS="$saved_LIBS"
431
432 dnl Check if SimGear was built with Norman's JPEG factory support
433 if test "x$with_simgear" != "x"; then
434 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])
435 else
436 AC_CHECK_HEADER(simgear/screen/jpgfactory.hxx)
437 fi
438 if test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes"; then
439     AC_CHECK_LIB(jpeg, jpeg_start_compress)
440     if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
441         echo
442         echo "The JPEG factory code was built and installed with SimGear."
443         echo "However it appears the libjpeg is no longer installed."
444         echo "You need to install libjpeg or remove jpgfactory support from"
445         echo "SimGear"
446         echo
447         echo "libjpeg is available at :"
448         echo "  ftp://ftp.uu.net in the directory graphics/jpeg"
449         exit 1
450     fi
451     AC_DEFINE([FG_JPEG_SERVER], 1,
452               [Define to build with jpeg screen shot server])
453 fi
454 AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$ac_cv_header_simgear_screen_jpgfactory_hxx" = "xyes")
455
456 # Check for "plib" without which we cannot go on
457 AC_CHECK_HEADER(plib/ul.h)
458 if test "x$ac_cv_header_plib_ul_h" != "xyes"; then
459     echo
460     echo "You *must* have the plib library installed on your system to build"
461     echo "the FGFS simulator!"
462     echo
463     echo "Please see README.plib for more details."
464     echo
465     echo "configure aborted."
466     exit
467 fi
468
469 AC_MSG_CHECKING([for plib 1.8.5 or newer])
470 AC_TRY_RUN([
471 #include <plib/ul.h>
472
473 #define MIN_PLIB_VERSION 185
474
475 int main() {
476     int major, minor, micro;
477
478     if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
479          return -1;
480     }
481
482     return 0;
483 }
484
485 ],
486   AC_MSG_RESULT(yes),
487   [AC_MSG_RESULT(wrong version);
488    AC_MSG_ERROR([Install plib 1.8.5 or later first...])],
489   AC_MSG_RESULT(yes)
490 )
491
492 dnl If we get here then plib is available, so force use of plib
493 dnl joystick lib
494 AC_DEFINE([ENABLE_PLIB_JOYSTICK], 1, [Define to enable plib joystick support])
495
496 AC_CHECK_HEADER(osg/Version)
497 if test "x$ac_cv_header_osg_Version" != "xyes"; then
498     echo
499     echo "You *must* have the OpenSceneGraph support library installed on your system"
500     echo "to build the FGFS simulator!"
501     echo
502     echo "Please see README.OSG for more details."
503     echo
504     echo "configure aborted."
505     exit
506 fi
507
508 # Find the OSG libraries.  Note special handling for OS X frameworks
509 case "${host}" in
510 *-apple-darwin*)
511
512     dnl Thank you Christian Bauer from SheepSaver
513     dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
514     AC_DEFUN([AC_CHECK_FRAMEWORK], [
515     AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
516     AC_CACHE_CHECK([whether compiler supports framework $1],
517         ac_Framework, [
518         saved_LIBS="$LIBS"
519         LIBS="$LIBS -framework $1"
520         AC_TRY_LINK(
521         [$2], [],
522         [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
523         )
524     ])
525     AS_IF([test AS_VAR_GET(ac_Framework) = yes],
526         [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
527     )
528     AS_VAR_POPDEF([ac_Framework])dnl
529     ])
530
531     if test "x$enable_osgdebug" = "xyes"; then
532         AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
533         AC_CHECK_LIB(osgGAd,osgGAGetVersion)
534         AC_CHECK_LIB(osgTextd,osgTextGetVersion)
535         LIBS="$LIBS -losgFXd"
536         AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
537         AC_CHECK_LIB(osgDBd,osgDBGetVersion)
538         AC_CHECK_LIB(osgSimd,osgSimGetVersion)
539         AC_CHECK_LIB(osgParticled,osgParticleGetVersion)
540         AC_CHECK_LIB(osgd,osgGetVersion)
541         AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
542     else
543         AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>])
544         AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>])
545         AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>])
546         AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>])
547         AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>])
548         AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>])
549         AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>])
550         AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>])
551         AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>])
552         AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>])
553     fi
554     ;;
555 *)
556     if test "x$enable_osgdebug" = "xyes"; then
557         AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
558         AC_CHECK_LIB(osgd,osgGetVersion)
559         AC_CHECK_LIB(osgUtild,osgUtilGetVersion)
560         AC_CHECK_LIB(osgDBd,osgDBGetVersion)
561         AC_CHECK_LIB(osgTextd,osgTextGetVersion)
562         AC_CHECK_LIB(osgGAd,osgGAGetVersion)
563         AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
564         AC_CHECK_LIB(osgSimd,osgSimGetVersion)
565         AC_CHECK_LIB(osgParticled,osgParticleGetVersion)
566         LIBS="$LIBS -losgFXd"
567     else
568         AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
569         AC_CHECK_LIB(osg,osgGetVersion)
570         AC_CHECK_LIB(osgUtil,osgUtilGetVersion)
571         AC_CHECK_LIB(osgDB,osgDBGetVersion)
572         AC_CHECK_LIB(osgText,osgTextGetVersion)
573         AC_CHECK_LIB(osgGA,osgGAGetVersion)
574         AC_CHECK_LIB(osgViewer,osgViewerGetVersion)
575         AC_CHECK_LIB(osgSim,osgSimGetVersion)
576         AC_CHECK_LIB(osgParticle,osgParticleGetVersion)
577         LIBS="$LIBS -losgFX"
578     fi
579     ;;
580 esac
581
582 AC_LANG_POP
583
584 dnl Check for system installed zlib
585 AC_CHECK_HEADER(zlib.h)
586 if test "x$ac_cv_header_zlib_h" != "xyes"; then
587     echo
588     echo "zlib library not found."
589     echo
590     echo "If your OS does not provide an installable package for zlib"
591     echo "you will have to compile and install it first yourself.  A copy"
592     echo "of zlib-1.1.4.tar.gz is included with SimGear.  You will"
593     echo "have to untar this source code, and follow it's included instructions"
594     echo "to compile and install on your system."
595     echo
596     echo "configure aborted."
597     echo
598 fi
599
600
601
602 dnl Checks for header files.
603 AC_HEADER_STDC
604 AC_CHECK_HEADERS( \
605         fcntl.h getopt.h malloc.h memory.h stdlib.h sys/param.h sys/stat.h \
606         sys/time.h sys/timeb.h unistd.h windows.h values.h )
607
608 dnl Checks for typedefs, structures, and compiler characteristics.
609 AC_C_CONST
610 AC_TYPE_SIZE_T
611 AC_HEADER_TIME
612 AC_STRUCT_TM
613
614 dnl Checks for library functions.
615 old_LIBS=$LIBS
616 LIBS="$base_LIBS $network_LIBS $opengl_LIBS"
617 AC_TYPE_SIGNAL
618 AC_FUNC_VPRINTF
619 AC_CHECK_FUNCS( [ \
620         ftime gettimeofday timegm memcpy bcopy mktime strstr rand mkfifo \
621         random drand48 setitimer getitimer signal GetLocalTime rint getrusage \
622         truncf ] )
623 LIBS=$old_LIBS
624
625 AM_CONFIG_HEADER(src/Include/config.h)
626
627 AC_CONFIG_FILES([ \
628         Makefile \
629         man/Makefile \
630         man/est-epsilon.1 \
631         man/fgfs.1 \
632         man/fgjs.1 \
633         man/gl-info.1 \
634         man/js_demo.1 \
635         man/pstest.1 \
636         scripts/Makefile \
637         scripts/debug/Makefile \
638         scripts/perl/Makefile \
639         scripts/perl/examples/Makefile \
640         scripts/python/Makefile \
641         src/Makefile \
642         src/Include/Makefile \
643         src/Include/version.h \
644         src/Include/config.h-msvc6 \
645         src/Include/config.h-msvc71 \
646         src/Include/config.h-msvc8 \
647         src/Aircraft/Makefile \
648         src/Airports/Makefile \
649         src/ATC/Makefile \
650         src/ATCDCL/Makefile \
651         src/Autopilot/Makefile \
652         src/Cockpit/Makefile \
653         src/Cockpit/built_in/Makefile \
654         src/Environment/Makefile \
655         src/FDM/ExternalNet/Makefile \
656         src/FDM/ExternalPipe/Makefile \
657         src/FDM/JSBSim/Makefile \
658         src/FDM/JSBSim/initialization/Makefile \
659         src/FDM/JSBSim/input_output/Makefile \
660         src/FDM/JSBSim/math/Makefile \
661         src/FDM/JSBSim/models/Makefile \
662         src/FDM/JSBSim/models/flight_control/Makefile \
663         src/FDM/JSBSim/models/atmosphere/Makefile \
664         src/FDM/JSBSim/models/propulsion/Makefile \
665         src/FDM/LaRCsim/Makefile \
666         src/FDM/SP/Makefile \
667         src/FDM/UIUCModel/Makefile \
668         src/FDM/YASim/Makefile \
669         src/FDM/Makefile \
670         src/GUI/Makefile \
671         src/Input/Makefile \
672         src/Instrumentation/Makefile \
673         src/Instrumentation/KLN89/Makefile \
674         src/Instrumentation/HUD/Makefile \
675         src/Main/Makefile \
676         src/Main/runfgfs \
677         src/Main/runfgfs.bat \
678         src/Model/Makefile \
679         src/AIModel/Makefile \
680         src/MultiPlayer/Makefile \
681         src/Navaids/Makefile \
682         src/Network/Makefile \
683         src/Scenery/Makefile \
684         src/Scripting/Makefile \
685         src/Sound/Makefile \
686         src/Systems/Makefile \
687         src/Time/Makefile \
688         src/Traffic/Makefile \
689         tests/Makefile \
690         utils/Makefile \
691         utils/GPSsmooth/Makefile \
692         utils/fgadmin/Makefile
693         utils/fgadmin/src/Makefile \
694         utils/js_server/Makefile \
695         utils/Modeller/Makefile \
696         utils/TerraSync/Makefile \
697         utils/xmlgrep/Makefile \
698 ])
699 AC_OUTPUT
700
701 AC_OUTPUT_COMMANDS([chmod 755 src/Main/runfgfs])
702
703 echo ""
704 echo "Configure Summary"
705 echo "================="
706
707 echo "Prefix: $prefix"
708
709 if test "x$with_logging" != "x"; then
710     echo "Debug messages: $with_logging"
711 else
712     echo "Debug messages: yes"
713 fi
714
715 echo -n "Automake version: "
716 automake --version | head -n 1
717
718 if test "x$with_multiplayer" != "xno"; then
719     echo "Building with multiplayer support"
720 fi
721
722 if test "x$with_threads" = "xyes"; then
723     echo "threads: yes"
724 else
725     echo "threads: no"
726 fi
727
728 if test "x$enable_sp_fdms" != "xno"; then
729     echo "Include special purpose flight models: yes"
730 else
731     echo "Include special purpose flight models: no"
732 fi
733