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