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