1 dnl Process this file with aclocal ; automake -a ; autoconf to produce a
2 dnl working configure script.
6 AC_INIT(simgear/bucket/newbucket.cxx)
8 # Require at least automake 2.13
11 dnl Initialize the automake stuff
12 AM_INIT_AUTOMAKE(SimGear, 0.0.19pre1)
14 dnl Specify KAI C++ compiler and flags.
15 dnl Borrowed with slight modification from blitz distribution.
17 [ --with-cxx=COMPILER[:name-flags] set options for COMPILER (KCC)],
19 KCC*) # KAI C++ http://www.kai.com/
20 echo "Configuring for KAI C++"
21 AC_SG_SET_COMPILER($withval,"KCC","--restrict --strict_warnings")
22 CXX_OPTIMIZE_FLAGS=="+K3 -O3"
23 CXX_DEBUG_FLAGS="-g +K0"
31 dnl Checks for programs.
42 if test "$OS" = "IRIX" -o "$OS" = "IRIX64"; then
43 if test "$CXX" = "CC"; then
49 if echo $includedir | egrep "simgear$" > /dev/null; then
50 echo "includedir is" $includedir "libdir is" $libdir
52 includedir="${includedir}/simgear"
53 echo "includedir changed to" $includedir "libdir is" $libdir
56 # Determine version of automake ... important because of
57 # incompatibilities between versions
58 AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\-p[[0-9]]$//' | sed -e 's/\.//'`
59 AM_CONDITIONAL(ANCIENT_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 14)
60 AM_CONDITIONAL(OLD_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 15)
62 # set logging default value
64 AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
65 if test "x$with_logging" = "xno" ; then
69 # Specify if we want to build with Norman's jpeg image server support.
70 # This requires libjpeg to be installed and available.
71 # Default to with_jpeg_server=no
73 AC_ARG_WITH(jpeg_factory, [ --with-jpeg-factory Include Norman's jpeg image factory support code])
74 if test "x$with_jpeg_factory" = "xyes" ; then
75 echo "Building with Norman's jpeg image factory support"
76 AC_CHECK_LIB(jpeg, jpeg_start_compress)
77 if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
79 echo "In order to build the jpeg factory code you need libjpeg installed."
80 echo "otherwise please configure with the --with-jpeg-sever=no option"
82 echo "libjpeg is available at :"
83 echo " ftp://ftp.uu.net in the directory graphics/jpeg"
87 echo "Building without Norman's jpeg image server support"
89 AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$with_jpeg_factory" = "xyes")
92 dnl Check for MS Windows environment
93 AC_CHECK_HEADER(windows.h)
99 ],is_mingw=yes, is_mingw=no)
101 echo "IS_MINGW = $is_mingw"
102 AM_CONDITIONAL(IS_MINGW, test "x$is_mingw" = "xyes")
108 ],is_cygwin=yes, is_cygwin=no)
110 echo "IS_CYGWIN = $is_cygwin"
111 AM_CONDITIONAL(IS_CYGWIN, test "x$is_cygwin" = "xyes")
113 if test "x$HOSTTYPE" != "xmacintosh" -a "x$is_mingw" != "xyes"; then
114 dnl extra library and include directories
115 EXTRA_DIRS="/usr/local /usr/local/plib /usr/X11R6"
117 if test -d /opt/X11R6 ; then
118 EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
122 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
124 dnl Using AM_CONDITIONAL is a step out of the protected little
125 dnl automake fold so it is potentially dangerous. But, we are
126 dnl beginning to run into cases where the standard checks are not
127 dnl enough. AM_CONDITIONALS are then referenced to conditionally
128 dnl build a Makefile.in from a Makefile.am which lets us define custom
129 dnl includes, compile alternative source files, etc.
131 dnl Enable serial support on Unix type systems
132 AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
134 dnl X11 might be installed on Mac OS X, don't want to use it if it is.
135 if test "x$HOSTTYPE" != "xmacintosh" ; then
136 dnl Check for X11 (fancy)
140 dnl Checks for libraries.
148 dnl Thread related checks
149 AC_CHECK_LIB(pthread, pthread_exit)
150 AC_CHECK_HEADER(pthread.h)
151 if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
152 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
153 CFLAGS="$CFLAGS -D_REENTRANT"
155 AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes")
157 AC_CHECK_LIB(socket, socket)
159 dnl X11 might be installed, but we don't want to use it for OSX -dw-
160 if test "x$HOSTTYPE" != "xmacintosh" ; then
161 AC_CHECK_LIB(X11, XCreateWindow)
162 AC_CHECK_LIB(Xext, XShmCreateImage)
163 AC_CHECK_LIB(Xi, XGetExtensionVersion)
164 AC_CHECK_LIB(ICE, IceOpenConnection)
165 AC_CHECK_LIB(SM, SmcOpenConnection)
166 AC_CHECK_LIB(Xt, XtMalloc)
167 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
170 dnl check for OpenGL related libraries
172 if test "x$HOSTTYPE" = "xmacintosh" ; then
174 LIBS="$LIBS -framework OpenGL -framework GLUT"
175 elif test "x$ac_cv_header_windows_h" != "xyes" ; then
176 dnl Reasonable stuff for X-Windows based machines
178 AC_CHECK_LIB(GLcore, glNewList)
179 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
180 dnl if no GLcore, check for GL
181 AC_CHECK_LIB(GL, glNewList)
182 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
183 dnl if no GL, check for MesaGL
184 AC_CHECK_LIB(MesaGL, glNewList)
187 dnl if GLcore found, then also check for GL
188 AC_CHECK_LIB(GL, glXCreateContext)
191 dnl if using mesa, check for xmesa.h
192 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
193 AC_CHECK_HEADER(GL/fxmesa.h)
194 if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then
200 AC_CHECK_LIB(GLU, gluLookAt)
201 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
202 dnl if no GLU, check for MesaGLU
203 AC_CHECK_LIB(MesaGLU, gluLookAt)
207 AC_CHECK_LIB(glut, glutGetModifiers)
209 dnl test for glutGameModeString, but avoid adding glut a second time into
210 dnl the list of libraries
212 AC_CHECK_LIB(glut, glutGameModeString)
217 echo Win32 specific hacks...
220 dnl force a failed check since we will be building under windoze
221 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
223 dnl just define these to true and hope for the best
224 ac_cv_lib_glut_glutGetModifiers="yes"
225 ac_cv_lib_glut_glutGameModeString="yes"
227 if test "x$with_sgi_opengl" = "xyes" ; then
228 echo "Building with glut.dll, glu.dll, and opengl.dll"
233 echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
236 WIN32_OPENGL=opengl32
239 LIBS="$LIBS -l${WIN32_GLUT} -l${WIN32_GLU} -l${WIN32_OPENGL}"
240 LIBS="$LIBS -luser32 -lgdi32"
241 if test "x$is_mingw" = "xyes" ; then
242 EXTRA_DIRS="${EXTRA_DIRS}"
244 echo "Will link apps with $LIBS"
247 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
249 echo "Unable to find the necessary OpenGL or GLUT libraries."
250 echo "See config.log for automated test details and results ..."
254 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
256 echo "Your version of glut doesn't support game mode."
257 echo "You need to fetch and install the latest version of glut from:"
259 echo " http://reality.sgi.com/opengl/glut3/glut3.html"
267 AC_SUBST(opengl_LIBS)
269 AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
271 dnl Check for "plib" without which we cannot go on
272 AC_CHECK_HEADER(plib/pu.h)
273 if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
275 echo "You *must* have the plib library installed on your system to build"
276 echo "the FGFS simulator!"
278 echo "Please see README.plib for more details."
280 echo "configure aborted."
284 dnl Check for system installed metakit
285 AC_CHECK_HEADER(mk4.h)
286 if test "x$ac_cv_header_mk4_h" != "xyes"; then
288 echo "Metakit not found, you will need to install this first."
289 echo "Please read the README.metakit for more information."
294 dnl Specify if we want logging (testing build) or not (release build)
296 dnl Check for system installed zlib
297 AC_CHECK_HEADER(zlib.h)
298 if test "x$ac_cv_header_zlib_h" != "xyes"; then
300 echo "zlib not found, you will need to install this first."
301 echo "Please read the README.zlib for more information."
305 dnl Checks for header files.
308 fcntl.h getopt.h malloc.h memory.h stdint.h stdlib.h sys/param.h \
309 sys/stat.h sys/time.h sys/timeb.h unistd.h windows.h winbase.h values.h )
311 if test "x$ac_cv_header_stdint_h" = "xyes"; then
312 AC_DEFINE(HAVE_STDINT_H)
315 dnl Checks for typedefs, structures, and compiler characteristics.
321 dnl Checks for library functions.
324 AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
325 random drand48 setitimer getitimer signal GetLocalTime rint getrusage )
327 AM_CONFIG_HEADER(simgear/simgear_config.h)
335 simgear/bucket/Makefile \
336 simgear/debug/Makefile \
337 simgear/ephemeris/Makefile \
338 simgear/interpreter/Makefile \
339 simgear/io/Makefile \
340 simgear/magvar/Makefile \
341 simgear/math/Makefile \
342 simgear/metar/Makefile \
343 simgear/misc/Makefile \
344 simgear/route/Makefile \
345 simgear/screen/Makefile \
346 simgear/serial/Makefile \
347 simgear/sky/Makefile \
348 simgear/threads/Makefile \
349 simgear/timing/Makefile \
350 simgear/xgl/Makefile \
351 simgear/xml/Makefile \
354 # AC_OUTPUT_COMMANDS([])
357 echo "Configure Summary"
358 echo "================="
360 echo "Prefix: $prefix"
362 if test "x$with_logging" != "x"; then
363 echo "Debug messages: $with_logging"
365 echo "Debug messages: yes"
368 echo -n "Automake version: ($AUTO_MAKE_VERSION) "
369 automake --version | head -1
371 if test "x$with_jpeg_factory" = "xyes"; then
372 echo "With JPEG Factory support"
374 echo "Without JPEG Factory support"
377 if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
378 echo "Threads: pthread lib found."
380 echo "Threads: no threads (pthread lib not found.)"