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