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 dnl Initialize the automake stuff
9 AM_INIT_AUTOMAKE(SimGear, 0.0.17)
11 dnl Specify KAI C++ compiler and flags.
12 dnl Borrowed with slight modification from blitz distribution.
14 [ --with-cxx=COMPILER[:name-flags] set options for COMPILER (KCC)],
16 KCC*) # KAI C++ http://www.kai.com/
17 echo "Configuring for KAI C++"
18 AC_SG_SET_COMPILER($withval,"KCC","--restrict --strict_warnings")
19 CXX_OPTIMIZE_FLAGS=="+K3 -O3"
20 CXX_DEBUG_FLAGS="-g +K0"
28 dnl Checks for programs.
37 # Check to see if this `configure' is being run in the `Cygwin32' environment
44 if test "$OS" = "IRIX" -o "$OS" = "IRIX64"; then
45 if test "$CXX" = "CC"; then
51 if echo $includedir | egrep "simgear$" > /dev/null; then
52 echo "includedir is" $includedir "libdir is" $libdir
54 includedir="${includedir}/simgear"
55 echo "includedir changed to" $includedir "libdir is" $libdir
58 # Determine version of automake ... important because of
59 # incompatibilities between versions
60 AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\-p[[0-9]]$//' | sed -e 's/\.//'`
61 AM_CONDITIONAL(ANCIENT_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 14)
62 AM_CONDITIONAL(OLD_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 15)
64 # set logging default value
66 AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
67 if test "x$with_logging" = "xno" ; then
71 dnl specify if we are building with "electric fence"
72 AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"])
74 if test "x$with_efence" = "xyes" ; then
75 echo "Building with efence"
79 # Specify if we want to build with Norman's jpeg image server support.
80 # This requires libjpeg to be installed and available.
81 # Default to with_jpeg_server=no
83 AC_ARG_WITH(jpeg_factory, [ --with-jpeg-factory Include Norman's jpeg image factory support code])
84 if test "x$with_jpeg_factory" = "xyes" ; then
85 echo "Building with Norman's jpeg image factory support"
86 AC_CHECK_LIB(jpeg, jpeg_start_compress)
87 if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
89 echo "In order to build the jpeg factory code you need libjpeg installed."
90 echo "otherwise please configure with the --with-jpeg-sever=no option"
92 echo "libjpeg is available at :"
93 echo " ftp://ftp.uu.net in the directory graphics/jpeg"
97 echo "Building without Norman's jpeg image server support"
99 AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$with_jpeg_factory" = "xyes")
102 dnl Check for MS Windows environment
103 AC_CHECK_HEADER(windows.h)
105 if test "x$HOSTTYPE" != "xmacintosh" ; then
106 dnl extra library and include directories
107 EXTRA_DIRS="/usr/local /usr/local/plib /usr/X11R6"
109 if test -d /opt/X11R6 ; then
110 EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
113 if test "x$ac_cv_header_windows_h" = "xyes" ; then
114 if test -d /usr/mingw/usr ; then
115 EXTRA_DIRS="$EXTRA_DIRS /usr/mingw/usr"
120 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
122 dnl Using AM_CONDITIONAL is a step out of the protected little
123 dnl automake fold so it is potentially dangerous. But, we are
124 dnl beginning to run into cases where the standard checks are not
125 dnl enough. AM_CONDITIONALS are then referenced to conditionally
126 dnl build a Makefile.in from a Makefile.am which lets us define custom
127 dnl includes, compile alternative source files, etc.
129 dnl Enable serial support on Unix type systems
130 AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
132 dnl X11 might be installed on Mac OS X, don't want to use it if it is.
133 if test "x$HOSTTYPE" != "xmacintosh" ; then
134 dnl Check for X11 (fancy)
138 dnl Checks for libraries.
144 if test "x$ac_cv_mingw32" = "xyes" ; then
145 LIBS="$LIBS -lwsock32"
150 dnl Thread related checks
151 AC_CHECK_LIB(pthread, pthread_exit)
152 AC_CHECK_HEADER(pthread.h)
153 if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
154 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
155 CFLAGS="$CFLAGS -D_REENTRANT"
157 AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes")
159 AC_CHECK_LIB(socket, socket)
161 dnl X11 might be installed, but we don't want to use it for OSX -dw-
162 if test "x$HOSTTYPE" != "xmacintosh" ; then
163 AC_CHECK_LIB(X11, XCreateWindow)
164 AC_CHECK_LIB(Xext, XShmCreateImage)
165 AC_CHECK_LIB(Xi, XGetExtensionVersion)
166 AC_CHECK_LIB(ICE, IceOpenConnection)
167 AC_CHECK_LIB(SM, SmcOpenConnection)
168 AC_CHECK_LIB(Xt, XtMalloc)
169 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
172 dnl check for OpenGL related libraries
174 if test "x$HOSTTYPE" = "xmacintosh" ; then
176 LIBS="$LIBS -framework OpenGL -framework GLUT"
177 elif test "x$ac_cv_header_windows_h" != "xyes" ; then
178 dnl Reasonable stuff for X-Windows based machines
180 AC_CHECK_LIB(GLcore, glNewList)
181 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
182 dnl if no GLcore, check for GL
183 AC_CHECK_LIB(GL, glNewList)
184 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
185 dnl if no GL, check for MesaGL
186 AC_CHECK_LIB(MesaGL, glNewList)
189 dnl if GLcore found, then also check for GL
190 AC_CHECK_LIB(GL, glXCreateContext)
193 dnl if using mesa, check for xmesa.h
194 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
195 AC_CHECK_HEADER(GL/xmesa.h)
196 if test "x$ac_cv_header_GL_xmesa_h" = "xyes"; then
202 AC_CHECK_LIB(GLU, gluLookAt)
203 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
204 dnl if no GLU, check for MesaGLU
205 AC_CHECK_LIB(MesaGLU, gluLookAt)
209 AC_CHECK_LIB(glut, glutGetModifiers)
211 dnl test for glutGameModeString, but avoid adding glut a second time into
212 dnl the list of libraries
214 AC_CHECK_LIB(glut, glutGameModeString)
219 echo Win32 specific hacks...
222 dnl force a failed check since we will be building under windoze
223 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
225 dnl just define these to true and hope for the best
226 ac_cv_lib_glut_glutGetModifiers="yes"
227 ac_cv_lib_glut_glutGameModeString="yes"
229 if test "x$with_sgi_opengl" = "xyes" ; then
230 echo "Building with glut.dll, glu.dll, and opengl.dll"
235 echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
238 WIN32_OPENGL=opengl32
241 LIBS="$LIBS -l${WIN32_GLUT} -l${WIN32_GLU} -l${WIN32_OPENGL}"
242 LIBS="$LIBS -luser32 -lgdi32"
243 if test "x$ac_cv_mingw32" = "xyes" ; then
244 LIBS="$LIBS -wsock32"
246 echo "Will link apps with $LIBS"
249 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
251 echo "Unable to find the necessary OpenGL or GLUT libraries."
252 echo "See config.log for automated test details and results ..."
256 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
258 echo "Your version of glut doesn't support game mode."
259 echo "You need to fetch and install the latest version of glut from:"
261 echo " http://reality.sgi.com/opengl/glut3/glut3.html"
269 AC_SUBST(opengl_LIBS)
271 AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
273 dnl Check for "plib" without which we cannot go on
274 AC_CHECK_HEADER(plib/pu.h)
275 if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
277 echo "You *must* have the plib library installed on your system to build"
278 echo "the FGFS simulator!"
280 echo "Please see README.plib for more details."
282 echo "configure aborted."
286 dnl Check for system installed metakit
287 AC_CHECK_HEADER(mk4.h)
288 if test "x$ac_cv_header_mk4_h" != "xyes"; then
289 echo "Metakit not found, you will need to install this first."
290 echo "Please read the README.metakit for more information."
295 dnl Specify if we want logging (testing build) or not (release build)
297 dnl Check for system installed zlib
298 AC_CHECK_HEADER(zlib.h)
299 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 setitimer getitimer signal GetLocalTime rint getrusage )
327 AM_CONFIG_HEADER(simgear/simgear_config.h)
334 simgear/bucket/Makefile \
335 simgear/debug/Makefile \
336 simgear/ephemeris/Makefile \
337 simgear/io/Makefile \
338 simgear/magvar/Makefile \
339 simgear/math/Makefile \
340 simgear/metar/Makefile \
341 simgear/misc/Makefile \
342 simgear/route/Makefile \
343 simgear/screen/Makefile \
344 simgear/serial/Makefile \
345 simgear/sky/Makefile \
346 simgear/threads/Makefile \
347 simgear/timing/Makefile \
348 simgear/xgl/Makefile \
349 simgear/xml/Makefile \
352 # AC_OUTPUT_COMMANDS([])
355 echo "Configure Summary"
356 echo "================="
358 echo "Prefix: $prefix"
360 if test "x$with_logging" != "x"; then
361 echo "Debug messages: $with_logging"
363 echo "Debug messages: yes"
366 if test "x$with_efence" != "x"; then
367 echo "Electric fence: $with_efence"
369 echo "Electric fence: no"
372 echo -n "Automake version: ($AUTO_MAKE_VERSION) "
373 automake --version | head -1
375 if test "x$with_jpeg_factory" = "xyes"; then
376 echo "With JPEG Factory support"
378 echo "Without JPEG Factory support"
381 if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
382 echo "Threads: pthread lib found."
384 echo "Threads: no threads (pthread lib not found.)"
387 if test "$OS" = "IRIX" -o "$OS" = "IRIX64"; then
388 if test "$CXX" = "CC"; then
389 echo "\nRemember to run: sh ../FlightGear/irix-hack.sh!\07\n"