]> git.mxchange.org Git - simgear.git/blob - configure.ac
Stuart Buchanan:
[simgear.git] / configure.ac
1 dnl Process this file with autogen.sh to produce a working configure
2 dnl script.
3
4 AC_INIT(SimGear, m4_esyscmd([cat ./version | tr -d '\n']), [http://www.flightgear.org])
5
6 dnl Ensure touching the version causes autoconf to re-run
7 AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/version'])
8
9 AC_CONFIG_SRCDIR([simgear/bucket/newbucket.cxx])
10
11 dnl Require at least automake 2.52
12 AC_PREREQ(2.52)
13
14 dnl Initialize the automake stuff
15 dnl Specify KAI C++ compiler and flags.
16 dnl Borrowed with slight modification from blitz distribution.
17 AC_ARG_WITH(cxx,
18   [  --with-cxx=COMPILER[:name-flags] set options for COMPILER (KCC)],
19   [case "$withval" in
20     KCC*)    # KAI C++ http://www.kai.com/
21       echo "Configuring for KAI C++"
22       AC_SG_SET_COMPILER($withval,"KCC","--restrict --strict_warnings")
23       CXX_OPTIMIZE_FLAGS=="+K3 -O3"
24       CXX_DEBUG_FLAGS="-g +K0"
25     ;;
26   esac
27 ])
28 dnl set the $host variable based on local machine/os
29 AC_CANONICAL_TARGET
30 AM_INIT_AUTOMAKE([dist-bzip2])
31
32 AC_ARG_ENABLE(headless,
33         AS_HELP_STRING([--enable-headless],[Enable only packages for headless build]))
34
35 AC_ARG_ENABLE(osgdebug,
36                 AS_HELP_STRING([--enable-osgdebug],[Enable debug OSG libraries]))
37                 
38 AC_MSG_CHECKING([for headless mode])
39 AC_MSG_RESULT([$enable_headless])
40
41 AM_CONDITIONAL(WANT_HEADLESS,[test "x$enable_headless" = "xyes"])
42
43 AC_MSG_CHECKING([CXX])
44 AC_MSG_RESULT([$CXX])
45 AC_MSG_CHECKING([CC])
46 AC_MSG_RESULT([$CC])
47
48 dnl Checks for programs.
49 AC_PROG_MAKE_SET
50 AC_PROG_CC
51 AC_PROG_CPP
52 AC_PROG_CXX
53 AC_PROG_CXXCPP
54 AC_PROG_RANLIB
55 AC_PROG_INSTALL
56 AC_PROG_LN_S
57 AX_BOOST_BASE([1.37.0])
58
59 if test "x$BOOST_CPPFLAGS" != "x-I/usr/include" ; then
60    CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
61 fi
62
63 dnl set the $host variable based on local machine/os
64 AC_CANONICAL_HOST
65
66 dnl Used on the Irix platform
67 case "${host}" in
68 *-*-irix*)
69     if test "x$CXX" = "xCC" -o "x$CXX" = "xccache CC"; then
70         AR="$CXX -ar"
71         ARFLAGS="-o"
72         CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility/MIPSpro740"
73         compatibility_DIR="compatibility"
74         MIPSpro_DIRS="MIPSpro740"
75         AC_MSG_CHECKING([for MIPSpro compiler version 7.4 or newer])
76         AC_TRY_RUN([
77            int main() {
78               if ( _COMPILER_VERSION < 740 ) {
79                  return -1;
80               }
81               return 0;
82            }
83
84         ], AC_MSG_RESULT(yes),
85         [  AC_MSG_RESULT(no)
86            CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility/MIPSpro721"
87            MIPSpro_DIRS="$(MIPSpro_DIRS) MIPSpro721"
88            AC_MSG_WARN([Using our own subset of the STL headers])
89         ], AC_MSG_RESULT(yes))
90         AC_SUBST(MIPSpro_DIRS)
91     fi
92     ;;
93 *)
94     AR="ar"
95     ARFLAGS="cru"
96     compatibility_DIR=
97     ;;
98 esac
99 AC_SUBST(AR)
100 AC_SUBST(ARFLAGS)
101 AC_SUBST(compatibility_DIR)
102
103 # Show all compiler warnings by default
104 CXXFLAGS="$CXXFLAGS -Wall"
105 CFLAGS="$CFLAGS -Wall"
106
107 if echo $includedir | egrep "simgear$" > /dev/null; then
108     echo "includedir is" $includedir "libdir is" $libdir
109 else
110     includedir="${includedir}/simgear"
111     echo "includedir changed to" $includedir "libdir is" $libdir
112 fi
113
114 dnl set logging; default value of with_logging=yes
115 AC_ARG_WITH(logging, [  --with-logging          Include logging output (default)])
116 if test "x$with_logging" = "xno" ; then
117     AC_DEFINE([FG_NDEBUG], 1, [Define for no logging output])
118 fi
119
120 # Specify if we want to build with Norman's jpeg image server support.
121 # This requires libjpeg to be installed and available.
122 # Default to with_jpeg_server=no
123 JPEGLIB=''
124 AC_ARG_WITH(jpeg_factory, [  --with-jpeg-factory     Include Norman's jpeg image factory support code])
125 if test "x$with_jpeg_factory" = "xyes" ; then
126     echo "Building with Norman's jpeg image factory support"
127     AC_CHECK_LIB(jpeg, jpeg_start_compress)
128     if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
129         echo
130         echo "In order to build the jpeg factory code you need libjpeg installed."
131         echo "otherwise please configure with the --with-jpeg-sever=no option"
132         echo
133         echo "libjpeg is available at :"
134         echo "  ftp://ftp.uu.net in the directory graphics/jpeg"
135         exit 1
136     fi
137 else
138     echo "Building without Norman's jpeg image server support"
139 fi
140 AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$with_jpeg_factory" = "xyes")
141
142 # specify the osg location
143 AC_ARG_WITH(osg, [  --with-osg=PREFIX       Specify the prefix path to osg])
144
145 if test "x$with_osg" != "x" ; then
146     echo "osg prefix is $with_osg"
147     EXTRA_DIRS="${EXTRA_DIRS} $with_osg"
148 fi
149
150 AC_ARG_WITH(osg_framework, [  --with-osg-framework=PREFIX     Specify the prefix path to OSG.framework ])
151
152 if test "x$with_osg_framework" != "x"; then
153     echo "osg framework prefix is $with_osg_framework"
154     CPPFLAGS = "$CPPFLAGS -F$with-osg-framework"
155     export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$with_osg_framework"
156 fi
157
158 dnl specifying ALUT.framework (for user provided ALUT.framework)
159 AC_ARG_WITH(alut_framework, [  --with-alut-framework=PREFIX    Specify the prefix path to ALUT.framework ])
160
161 if test "x$with_alut_framework" != "x"; then
162     echo "ALUT framework prefix is $with_alut_framework"
163 fi
164
165 # specify the rti13 location
166 AC_ARG_WITH(rti13, [  --with-rti13=PREFIX       Specify the prefix path to a HLA13 rti])
167
168 if test "x$with_rti13" != "x" ; then
169     echo "rti13 prefix is $with_rti13"
170     EXTRA_DIRS="${EXTRA_DIRS} $with_rti13"
171 fi
172
173 # specify the rti13 location
174 AC_ARG_WITH(rti1516, [  --with-rti1516=PREFIX     Specify the prefix path to a HLA1516 rti])
175
176 if test "x$with_rti1516" != "x" ; then
177     echo "rti1516 prefix is $with_rti1516"
178     EXTRA_DIRS="${EXTRA_DIRS} $with_rti1516"
179 fi
180
181 dnl Determine an extra directories to add to include/lib search paths
182 case "${host}" in
183 *-apple-darwin* | *-*-cygwin* | *-*-mingw32*)
184     echo no EXTRA_DIRS for $host
185     ;;
186
187 *)
188     if test -d /usr/X11R6 ; then
189         EXTRA_DIR1="/usr/X11R6"
190     fi
191     if test -d /opt/X11R6 ; then
192         EXTRA_DIR2="/opt/X11R6"
193     fi
194     EXTRA_DIRS="${EXTRA_DIRS} $EXTRA_DIR1 $EXTRA_DIR2"
195     ;;
196
197 esac
198 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
199
200
201 dnl Using AM_CONDITIONAL is a step out of the protected little
202 dnl automake fold so it is potentially dangerous.  But, we are
203 dnl beginning to run into cases where the standard checks are not
204 dnl enough.  AM_CONDITIONALS are then referenced to conditionally
205 dnl build a Makefile.in from a Makefile.am which lets us define custom
206 dnl includes, compile alternative source files, etc.
207
208 dnl X11 might be installed on Mac OS X or cygwin/mingwin, we don't want
209 dnl to use it if it is.
210 case "${host}" in
211 *-apple-darwin* | *-*-cygwin* | *-*-mingw32*)
212     echo no fancy X11 check
213     ;;
214
215 *)
216     AC_PATH_XTRA
217     ;;
218
219 esac
220
221 dnl Checks for libraries.
222
223 dnl Thread related checks
224 AC_CHECK_HEADER(pthread.h)
225 AC_SEARCH_LIBS(pthread_exit, [pthread c_r])
226 if test "x$ac_cv_header_pthread_h" = "xyes"; then
227     CXXFLAGS="$CXXFLAGS -D_REENTRANT"
228     CFLAGS="$CFLAGS -D_REENTRANT"
229
230   if test "x$ac_cv_search_pthread_exit" = "x-lc_r"; then
231     CXXFLAGS="-pthread $CXXFLAGS"
232     CFLAGS="-pthread $CFLAGS"
233   fi
234 fi
235
236 AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_header_pthread_h" = "xyes")
237
238 thread_LIBS="$LIBS"
239 LIBS=""
240
241 dnl search for network related libraries
242 AC_SEARCH_LIBS(inet_addr, xnet)
243 AC_SEARCH_LIBS(socket, socket)
244
245 network_LIBS="$LIBS"
246 LIBS=""
247
248 dnl check for some default libraries
249 AC_SEARCH_LIBS(cos, m)
250 AC_SEARCH_LIBS(clock_gettime, rt)
251
252 base_LIBS="$LIBS"
253
254 dnl check for OpenGL related libraries
255 case "${host}" in
256 *-*-cygwin* | *-*-mingw32*)
257     dnl CygWin under Windoze.
258
259     echo Win32 specific hacks...
260     AC_DEFINE([WIN32], 1, [Define for Win32 platforms])
261     AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms])
262
263     LIBS="$LIBS -lglu32 -lopengl32"
264     LIBS="$LIBS -luser32 -lgdi32 -lwinmm"
265
266     dnl add -lwsock32 for mingwin
267     case "${host}" in
268     *-*-mingw32*)
269         base_LIBS="$base_LIBS -lws2_32"
270         ;;
271     esac
272
273     echo "Will link apps with $LIBS"
274     ;;
275
276 *-apple-darwin*)
277     dnl Mac OS X
278
279     LIBS="$LIBS -framework OpenGL -framework Carbon -lobjc"
280     ;;
281
282 *)
283     dnl X-Windows based machines
284
285     AC_SEARCH_LIBS(XCreateWindow, X11)
286     AC_SEARCH_LIBS(XShmCreateImage, Xext)
287     AC_SEARCH_LIBS(XGetExtensionVersion, Xi)
288     AC_SEARCH_LIBS(IceOpenConnection, ICE)
289     AC_SEARCH_LIBS(SmcOpenConnection, SM)
290     AC_SEARCH_LIBS(XtMalloc, Xt)
291     AC_SEARCH_LIBS(XmuLookupStandardColormap, Xmu)
292
293     AC_SEARCH_LIBS(glNewList, [ GL GLcore MesaGL ])
294     if test "x$ac_cv_search_glNewList" = "x-lGLcore"; then
295         dnl if GLcore found, then also check for GL
296         AC_SEARCH_LIBS(glXCreateContext, GL)
297     fi
298
299     dnl if using mesa, check for xmesa.h
300     if test "x$ac_cv_search_glNewList" = "x-lMesaGL"; then
301         AC_CHECK_HEADER(GL/fxmesa.h)
302         if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then
303             AC_DEFINE([XMESA], 1, [Define for fxmesa])
304             AC_DEFINE([FX], 1, [Define for fxmesa])
305         fi
306     fi
307
308     AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
309     ;;
310
311 esac
312
313 opengl_LIBS="$LIBS"
314 LIBS="$base_LIBS"
315
316 dnl check for OpenAL libraries
317 OPENAL_OK="no"
318 ALUT_OK="no"
319 case "${host}" in
320 *-*-cygwin* | *-*-mingw32*)
321     dnl CygWin under Windoze.
322     INCLUDES="$INCLUDES -I/usr/local/include/"
323     LIBS="$LIBS -L/usr/local/lib"
324     AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal 'openal -ldsound -lwinmm' ] )
325     AC_SEARCH_LIBS(alutInit, [ openal32 ALut alut ] )
326     LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
327     openal_LIBS="$LIBS"
328     OPENAL_OK="$ac_cv_search_alGenBuffers"
329     ALUT_OK="$ac_cv_search_alutInit"
330     ;;
331
332 *-apple-darwin*)
333     dnl Mac OS X
334
335     LIBS="$LIBS -framework IOKit -framework OpenAL -framework ALUT"
336     openal_LIBS="$LIBS"
337
338     if test "x$with_openal_lib" != "x"; then
339         echo "libopenal is not supported on Mac OS platform."
340         openal_LIBS=""
341     fi
342
343     AC_CHECK_HEADERS([OpenAL/al.h],[OPENAL_OK="yes"])
344     # Looking for alut.h
345     AC_CHECK_HEADERS([ALUT/alut.h],[ALUT_OK="yes"])
346
347     dnl Thank you Christian Bauer from SheepSaver
348     dnl Modified by Tatsuhiro Nishioka for accepting a given framework path
349     dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES, $3=FRAMEWORK_PATH, $4=ACTION_IF_TRUE) ; $3 is optional
350     AC_DEFUN([AC_CHECK_FRAMEWORK], [
351     AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
352     AC_CACHE_CHECK([whether compiler supports framework $1],
353         ac_Framework, [
354         saved_LIBS="$LIBS"
355         FRAMEWORKS="$FRAMEWORKS -framework $1"
356         if test "$3" = ""; then
357             FRAMEWORKS="$FRAMEWORKS $ADD2LD"
358         elif test "`echo $FRAMEWORKS | grep -- -F$3`" = ""; then
359             FRAMEWORKS="$FRAMEWORKS -F$3"
360             CXXFLAGS="$CXXFLAGS -F$3"
361             CPPFLAGS="$CPPFLAGS -F$3"
362             CCFLAGS="$CCFLAGS -F$3"
363             dnl This is needed for AC_TRY_LINK when a framework path is specified
364             export DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}:$3"
365         fi
366         AC_TRY_LINK(
367         [$2], [],
368         [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
369         )
370     ])
371     AS_IF([test AS_VAR_GET(ac_Framework) = yes],
372         [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
373     )
374     AS_IF([test AS_VAR_GET(ac_Framework) = yes], $4)
375
376     AS_VAR_POPDEF([ac_Framework])dnl
377     ])
378
379     dnl Check for ALUT.framework when --with-alut-framework is specified
380     if test "x$with_alut_framework" != "x"; then
381       AC_CHECK_FRAMEWORK(ALUT, [#include <ALUT/alut.h>], $with_alut_framework, [ALUT_OK="yes"])
382     fi
383
384     ;;
385
386 *)
387     dnl default unix style machines
388
389     save_LIBS=$LIBS
390     LIBS="$LIBS $thread_LIBS"
391     AC_SEARCH_LIBS(alGenBuffers, openal)
392     AC_SEARCH_LIBS(alutInit, [ alut openal ] )
393     OPENAL_OK="$ac_cv_search_alGenBuffers"
394     ALUT_OK="$ac_cv_search_alutInit"
395     openal_LIBS="$LIBS"
396     LIBS=$save_LIBS
397     ;;
398
399 esac
400
401 if test "$OPENAL_OK" = "no" -a "x$enable_headless" != "xyes"; then
402     echo
403     echo "You *must* have the openal library installed on your system to build"
404     echo "SimGear!"
405     echo
406     echo "Please see README.OpenAL for more details."
407     echo
408     echo "configure aborted."
409     exit
410 fi
411
412 if test "$ALUT_OK" = "no" -a "x$enable_headless" != "xyes"; then
413     echo
414     echo "You *must* have the alut library installed on your system to build"
415     echo "SimGear!"
416     echo
417     echo "Please see README.OpenAL for more details."
418     echo
419     echo "configure aborted."
420     exit
421 fi
422
423
424
425 LIBS="$base_LIBS"
426
427 AC_SUBST(base_LIBS)
428 AC_SUBST(openal_LIBS)
429 AC_SUBST(opengl_LIBS)
430 AC_SUBST(thread_LIBS)
431 AC_SUBST(network_LIBS)
432
433 dnl Check for MS Windows environment
434 AC_CHECK_HEADER(windows.h)
435 AM_CONDITIONAL(EXTGL_NEEDED, test "x$ac_cv_header_windows_h" = "xyes")
436
437 # The following are C++ items that need to be tested for with the c++
438 # compiler
439
440 CXXCPP="g++ -E"
441 AC_LANG_PUSH(C++)
442
443 LIBS="$base_LIBS"
444
445 # OpenSceneGraph
446 case "${host}" in
447 *-apple-darwin*)
448     if test "x$with_osg_framework" != "x"; then
449 #       AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework)
450 #       AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework)
451 #       AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework)
452 #       AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework)
453 #       AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework)
454 #       AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework)
455 #       AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework)
456 #       AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework)
457         AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework)
458 #       osg_FRAMEWORKS="$FRAMEWORKS"
459 #       FRAMEWORKS=""
460 #       AC_SUBST(osg_FRAMEWORKS)
461         AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework)
462         openthreads_FRAMEWORK="$FRAMEWORKS"
463         FRAMEWORKS=""
464         AC_SUBST(openthreads_FRAMEWORK)
465     else
466         dnl
467         dnl This is needed when osg dynamic libs are specified
468         dnl instead of OSG frameworks on Mac OS X
469         dnl
470         AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
471     fi
472     ;;
473 *)
474     if test "x$enable_osgdebug" = "xyes"; then
475         AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
476     else
477         AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
478     fi
479     ;;
480 esac
481
482 AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x")
483
484 AC_CHECK_HEADER(osg/Version)
485
486 if test "x$ac_cv_header_osg_Version" != "xyes" -o "x$ac_cv_lib_OpenThreads_OpenThreadsGetVersion" != "xyes"; then
487   if test "x$ac_cv_framework_osg" != "xyes"; then
488     echo
489     echo "You *must* have the OpenThreads library installed on your system"
490     echo "to build this version of SimGear!"
491     echo "   Maybe you need to specify --with-osg=DIR."
492     echo "   Maybe you need to specify some LDFLAGS to help the linker."
493     echo
494     echo "     LIBS: '$LIBS'"
495     echo "  LDFLAGS: '$LDFLAGS'"
496     echo " CPPFLAGS: '$CPPFLAGS'"
497     echo
498     echo "Please see README.OSG for more details."
499     echo
500     echo "configure aborted."
501     exit
502   fi
503 fi
504
505 osg_LIBS="$LIBS"
506 AC_SUBST(osg_LIBS)
507 LIBS="$base_LIBS"
508
509 AC_CHECK_HEADER(boost/version.hpp)
510 if test "x$ac_cv_header_boost_version_hpp" != "xyes"; then
511     echo
512     echo "You *must* have the Boost library installed on your system"
513     echo "to build this version of SimGear!"
514     echo
515     echo "     LIBS: '$LIBS'"
516     echo "  LDFLAGS: '$LDFLAGS'"
517     echo " CPPFLAGS: '$CPPFLAGS'"
518     echo
519     echo "configure aborted."
520     exit
521 fi
522
523 dnl Check for a HLA13 rti.
524 dnl This is really tricky because of the ancient iostream stuff in RTI13
525 saved_CPPFLAGS="$CPPFLAGS"
526 CPPFLAGS="$CPPFLAGS -DRTI_USES_STD_FSTREAM"
527 AC_CHECK_HEADER(RTI.hh)
528 CPPFLAGS="${saved_CPPFLAGS}"
529
530 dnl Up to now only RTI13
531 AM_CONDITIONAL(ENABLE_HLA, test "x$ac_cv_header_RTI_hh" = "xyes")
532 AM_CONDITIONAL(ENABLE_HLA13, test "x$ac_cv_header_RTI_hh" = "xyes")
533
534 AC_LANG_POP
535
536 dnl Check for system installed zlib
537 AC_CHECK_HEADER(zlib.h)
538 if test "x$ac_cv_header_zlib_h" != "xyes"; then
539     echo
540     echo "zlib library not found."
541     echo
542     echo "If your OS does not provide an installable package for zlib"
543     echo "you will have to compile and install it first yourself.  A copy"
544     echo "of zlib-1.1.4.tar.gz is included with SimGear.  You will"
545     echo "have to untar this source code, and follow its included instructions"
546     echo "to compile and install on your system."
547     echo
548     echo "configure aborted."
549     echo
550 fi
551
552 dnl Check for Subversion library support
553 # libsvn support defaults to yes
554 save_LIBS=$LIBS
555 save_CPPFLAGS=$CPPFLAGS
556 AC_ARG_WITH(libsvn, [  --without-libsvn        Do not use built-in subversion (libsvn) for simgear [default=no]], [], [with_libsvn=yes])
557 if test "x$with_libsvn" = "xyes"; then
558     LIBS="`apr-1-config --link-ld`"
559     CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes --cppflags`"
560     AC_CHECK_HEADERS([svn_client.h])
561        if test "x$ac_cv_header_svn_client_h" = "xyes"; then
562         echo "Using built-in subversion (libsvn) for scenery downloads."
563         AC_SEARCH_LIBS(svn_client_checkout, svn_client-1,
564                        [AC_DEFINE([HAVE_LIBSVN_CLIENT_1], [1], [Define to 1 if you have libsvn_client-1])],
565                        [AC_MSG_ERROR(svn_client-1 library not found.)],)
566         AC_SEARCH_LIBS(svn_cmdline_init, svn_subr-1, , [AC_MSG_ERROR(svn_subr-1 library not found.)],)
567         AC_SEARCH_LIBS(svn_ra_initialize, svn_ra-1, , [AC_MSG_ERROR(svn_ra-1 library not found.)],)
568         svn_LIBS=$LIBS
569         svn_CPPFLAGS=$CPPFLAGS
570         AC_SUBST(svn_LIBS)
571         AC_SUBST(svn_CPPFLAGS)
572        else
573         echo "Libsvn not found. Will use command line subversion for scenery downloads."
574         svn_LIBS=""
575         svn_CPPFLAGS=""
576        fi
577 else
578 echo "Libsvn explicitly disabled. Will use command line subversion for scenery downloads."
579   svn_LIBS=""
580   svn_CPPFLAGS=""
581 fi
582 LIBS=$save_LIBS
583 CPPFLAGS=$save_CPPFLAGS
584
585 dnl Checks for header files.
586 AC_HEADER_STDC
587 AC_CHECK_HEADERS( \
588         fcntl.h getopt.h malloc.h memory.h stdint.h stdlib.h sys/param.h \
589         sys/stat.h sys/time.h sys/timeb.h unistd.h values.h )
590
591 if test "x$ac_cv_header_stdint_h" = "xyes"; then
592     AC_DEFINE([HAVE_STDINT_H], 1, [Define if stdint.h exists])
593 fi
594
595 dnl Checks for typedefs, structures, and compiler characteristics.
596 AC_C_CONST
597 AC_TYPE_SIZE_T
598 AC_TYPE_MODE_T
599 AC_HEADER_TIME
600 AC_STRUCT_TM
601
602 dnl Checks for library functions.
603 old_LIBS=$LIBS
604 LIBS="$base_LIBS $network_LIBS $opengl_LIBS"
605 AC_TYPE_SIGNAL
606 AC_FUNC_VPRINTF
607 AC_CHECK_FUNCS( [ \
608         ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
609         random drand48 setitimer getitimer signal GetLocalTime rint getrusage ] )
610 LIBS=$old_LIBS
611
612 AM_CONFIG_HEADER(simgear/simgear_config.h)
613
614 AC_CONFIG_FILES([ \
615         Makefile \
616         SimGear.spec \
617         simgear/Makefile \
618         simgear/version.h \
619         simgear/compatibility/Makefile \
620         simgear/compatibility/MIPSpro721/Makefile \
621         simgear/compatibility/MIPSpro740/Makefile \
622         simgear/bucket/Makefile \
623         simgear/debug/Makefile \
624         simgear/ephemeris/Makefile \
625         simgear/hla/Makefile \
626         simgear/io/Makefile \
627         simgear/magvar/Makefile \
628         simgear/math/Makefile \
629         simgear/environment/Makefile \
630         simgear/misc/Makefile \
631         simgear/nasal/Makefile \
632         simgear/props/Makefile \
633         simgear/route/Makefile \
634         simgear/scene/Makefile \
635         simgear/scene/bvh/Makefile \
636         simgear/scene/material/Makefile \
637         simgear/scene/model/Makefile \
638         simgear/scene/sky/Makefile \
639         simgear/scene/tgdb/Makefile \
640         simgear/scene/util/Makefile \
641         simgear/scene/tsync/Makefile \
642         simgear/screen/Makefile \
643         simgear/serial/Makefile \
644         simgear/sound/Makefile \
645         simgear/structure/Makefile \
646         simgear/threads/Makefile \
647         simgear/timing/Makefile \
648         simgear/xml/Makefile \
649 ])
650 AC_OUTPUT
651
652
653 echo ""
654 echo "Configure Summary"
655 echo "================="
656
657 echo "Prefix: $prefix"
658
659 if test "x$with_logging" != "x"; then
660     echo "Debug messages: $with_logging"
661 else
662     echo "Debug messages: yes"
663 fi
664
665 echo -n "Automake version: "
666 automake --version | head -1
667
668 if test "x$with_jpeg_factory" = "xyes"; then
669    echo "With JPEG Factory support"
670 else
671    echo "Without JPEG Factory support"
672 fi
673
674 if test "x$ac_cv_header_pthread_h" = "xyes"; then
675    echo "Threads: pthread lib found."
676 else
677    echo "Threads: no threads (pthread lib not found.)"
678 fi
679