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.15)
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.
36 if echo $includedir | egrep "simgear$" > /dev/null; then
37 echo "includedir is" $includedir "libdir is" $libdir
39 includedir="${includedir}/simgear"
40 echo "includedir changed to" $includedir "libdir is" $libdir
44 # set logging default value
46 AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
47 if test "x$with_logging" = "xno" ; then
51 dnl specify if we are building with "checker"
52 AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"])
54 if test "x$with_efence" = "xyes" ; then
55 echo "Building with efence"
56 LIBS= "$LIBS -lefence"
59 dnl Check for MS Windows environment
60 AC_CHECK_HEADER(windows.h)
62 dnl extra library and include directories
63 EXTRA_DIRS="/usr/local /usr/local/plib /usr/X11R6"
65 if test -d /opt/X11R6 ; then
66 EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
69 if test "x$ac_cv_header_windows_h" = "xyes" ; then
70 EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
71 # elif test `uname -s` = "SunOS" ; then
72 # EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
74 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
76 dnl Using AM_CONDITIONAL is a step out of the protected little
77 dnl automake fold so it is potentially dangerous. But, we are
78 dnl beginning to run into cases where the standard checks are not
79 dnl enough. AM_CONDITIONALS are then referenced to conditionally
80 dnl build a Makefile.in from a Makefile.am which lets us define custom
81 dnl includes, compile alternative source files, etc.
83 dnl Enable serial support on Unix type systems
84 AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
86 dnl Check for X11 (fancy)
89 dnl Checks for libraries.
97 AC_CHECK_LIB(socket, socket)
98 AC_CHECK_LIB(X11, XCreateWindow)
99 AC_CHECK_LIB(Xext, XShmCreateImage)
100 AC_CHECK_LIB(Xi, XGetExtensionVersion)
101 AC_CHECK_LIB(ICE, IceOpenConnection)
102 AC_CHECK_LIB(SM, SmcOpenConnection)
103 AC_CHECK_LIB(Xt, XtMalloc)
104 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
106 dnl check for OpenGL related libraries
108 if test "x$ac_cv_header_windows_h" != "xyes" ; then
109 dnl Reasonable stuff for non-windoze variants ... :-)
111 AC_CHECK_LIB(GLcore, glNewList)
112 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
113 dnl if no GLcore, check for GL
114 AC_CHECK_LIB(GL, glNewList)
115 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
116 dnl if no GL, check for MesaGL
117 AC_CHECK_LIB(MesaGL, glNewList)
120 dnl if GLcore found, then also check for GL
121 AC_CHECK_LIB(GL, glXCreateContext)
124 dnl if using mesa, check for xmesa.h
125 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
126 AC_CHECK_HEADER(GL/xmesa.h)
127 if test "x$ac_cv_header_GL_xmesa_h" = "xyes"; then
133 AC_CHECK_LIB(GLU, gluLookAt)
134 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
135 dnl if no GLU, check for MesaGLU
136 AC_CHECK_LIB(MesaGLU, gluLookAt)
140 AC_CHECK_LIB(glut, glutGetModifiers)
142 dnl test for glutGameModeString, but avoid adding glut a second time into
143 dnl the list of libraries
145 AC_CHECK_LIB(glut, glutGameModeString)
148 dnl Win32 is a little wierd because it has to try to handle the various
149 dnl winbloze-isms. We'll just do this manually for now.
151 echo Win32 specific hacks...
154 dnl force a failed check since we will be building under windoze
155 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
157 dnl just define these to true and hope for the best
158 ac_cv_lib_glut_glutGetModifiers="yes"
159 ac_cv_lib_glut_glutGameModeString="yes"
161 if test "x$with_sgi_opengl" = "xyes" ; then
162 echo "Building with glut.dll, glu.dll, and opengl.dll"
167 echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
170 WIN32_OPENGL=opengl32
173 LIBS="$LIBS -l${WIN32_GLUT} -l${WIN32_GLU} -l${WIN32_OPENGL}"
174 LIBS="$LIBS -luser32 -lgdi32"
175 echo "Will link apps with $LIBS"
178 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
180 echo "Unable to find the necessary OpenGL or GLUT libraries."
181 echo "See config.log for automated test details and results ..."
185 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
187 echo "Your version of glut doesn't support game mode."
188 echo "You need to fetch and install the latest version of glut from:"
190 echo " http://reality.sgi.com/opengl/glut3/glut3.html"
198 AC_SUBST(opengl_LIBS)
200 AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
202 dnl Check for "plib" without which we cannot go on
203 AC_CHECK_HEADER(plib/pu.h)
204 if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
206 echo "You *must* have the plib library installed on your system to build"
207 echo "the FGFS simulator!"
209 echo "Please see README.plib for more details."
211 echo "configure aborted."
215 # dnl Check for system installed gdbm
216 # AC_CHECK_HEADER(gdbm.h)
217 # if test "x$ac_cv_header_gdbm_h" = "xyes"; then
218 # AC_DEFINE( HAVE_GDBM )
220 # echo "no gdbm found, configuring and building."
222 # AM_CONDITIONAL(HAVE_GDBM, test "x$ac_cv_header_gdbm_h" = "xyes" )
224 dnl Check for system installed metakit
225 AC_CHECK_HEADER(mk4.h)
226 if test "x$ac_cv_header_mk4_h" != "xyes"; then
227 echo "no metakit found, configuring and building."
228 # Run configure in the metakit subdir
229 AC_CONFIG_SUBDIRS( simgear/metakit/unix )
231 AM_CONDITIONAL(HAVE_METAKIT, test "x$ac_cv_header_mk4_h" = "xyes" )
234 dnl Specify if we want logging (testing build) or not (release build)
236 dnl Check for system installed zlib
237 AC_CHECK_HEADER(zlib.h)
238 if test "x$ac_cv_header_zlib_h" = "xyes"; then
239 AC_DEFINE( HAVE_ZLIB )
241 echo "no zlib found, building."
243 AM_CONDITIONAL(HAVE_ZLIB, test "x$ac_cv_header_zlib_h" = "xyes" )
245 dnl Checks for header files.
248 fcntl.h getopt.h malloc.h memory.h stdlib.h sys/param.h sys/stat.h \
249 sys/time.h sys/timeb.h unistd.h windows.h winbase.h values.h )
251 dnl Checks for typedefs, structures, and compiler characteristics.
257 dnl Checks for library functions.
260 AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
261 random setitimer getitimer signal GetLocalTime rint getrusage )
263 AM_CONFIG_HEADER(simgear/config.h)
270 simgear/bucket/Makefile \
271 simgear/debug/Makefile \
272 simgear/ephemeris/Makefile \
273 simgear/io/Makefile \
274 simgear/magvar/Makefile \
275 simgear/math/Makefile \
276 simgear/misc/Makefile \
277 simgear/route/Makefile \
278 simgear/screen/Makefile \
279 simgear/serial/Makefile \
280 simgear/sky/Makefile \
281 simgear/timing/Makefile \
282 simgear/xgl/Makefile \
283 simgear/xml/Makefile \
284 simgear/zlib/Makefile \
288 # if test "x$ac_cv_header_windows_h" = "xyes" ; then
289 # cp simgear/gdbm/autoconf.h.cygwin32 simgear/gdbm/autoconf.h
294 echo "Configure Summary"
295 echo "================="
297 echo "Prefix: $prefix"
299 if test "x$with_logging" != "x"; then
300 echo "Debug messages: $with_logging"
302 echo "Debug messages: yes"
305 if test "x$with_efence" != "x"; then
306 echo "Electric fence: $with_efence"
308 echo "Electric fence: no"
311 # if test "x$ac_cv_header_gdbm_h" != "xyes"; then
312 # echo "Building gdbm"
315 if test "x$ac_cv_header_mk4_h" != "xyes"; then
316 echo "Building metakit"
319 if test "x$ac_cv_header_zlib_h" != "xyes"; then