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