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.8)
11 dnl Checks for programs.
19 if echo $includedir | egrep "simgear$" > /dev/null; then
20 echo "includedir is" $includedir "libdir is" $libdir
22 includedir="${includedir}/simgear"
23 echo "includedir changed to" $includedir "libdir is" $libdir
27 dnl Run configure in the gdbm subdir
28 dnl AC_CONFIG_SUBDIRS( simgear/gdbm )
31 dnl Specify if we want logging (testing build) or not (release build)
32 # set logging default value
34 AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
35 if test "x$with_logging" = "xno" ; then
39 dnl specify if we are building with "checker"
40 AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"])
42 if test "x$with_efence" = "xyes" ; then
43 echo "Building with efence"
44 LIBS= "$LIBS -lefence"
47 dnl Check for MS Windows environment
48 AC_CHECK_HEADER(windows.h)
50 dnl extra library and include directories
51 EXTRA_DIRS="/usr/local /usr/local/plib /usr/X11R6"
53 if test -d /opt/X11R6 ; then
54 EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
57 if test "x$ac_cv_header_windows_h" = "xyes" ; then
58 EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
59 # elif test `uname -s` = "SunOS" ; then
60 # EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
62 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
64 dnl Using AM_CONDITIONAL is a step out of the protected little
65 dnl automake fold so it is potentially dangerous. But, we are
66 dnl beginning to run into cases where the standard checks are not
67 dnl enough. AM_CONDITIONALS are then referenced to conditionally
68 dnl build a Makefile.in from a Makefile.am which lets us define custom
69 dnl includes, compile alternative source files, etc.
71 dnl Enable serial support on Unix type systems
72 AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
74 dnl Check for X11 (fancy)
77 dnl Checks for libraries.
85 AC_CHECK_LIB(socket, socket)
86 AC_CHECK_LIB(X11, XCreateWindow)
87 AC_CHECK_LIB(Xext, XShmCreateImage)
88 AC_CHECK_LIB(Xi, XGetExtensionVersion)
89 AC_CHECK_LIB(ICE, IceOpenConnection)
90 AC_CHECK_LIB(SM, SmcOpenConnection)
91 AC_CHECK_LIB(Xt, XtMalloc)
92 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
94 dnl check for OpenGL related libraries
96 if test "x$ac_cv_header_windows_h" != "xyes" ; then
97 dnl Reasonable stuff for non-windoze variants ... :-)
99 AC_CHECK_LIB(GLcore, glNewList)
100 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
101 dnl if no GLcore, check for GL
102 AC_CHECK_LIB(GL, glNewList)
103 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
104 dnl if no GL, check for MesaGL
105 AC_CHECK_LIB(MesaGL, glNewList)
108 dnl if GLcore found, then also check for GL
109 AC_CHECK_LIB(GL, glXCreateContext)
112 dnl if using mesa, check for xmesa.h
113 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
114 AC_CHECK_HEADER(GL/xmesa.h)
115 if test "x$ac_cv_header_GL_xmesa_h" = "xyes"; then
121 AC_CHECK_LIB(GLU, gluLookAt)
122 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
123 dnl if no GLU, check for MesaGLU
124 AC_CHECK_LIB(MesaGLU, gluLookAt)
128 AC_CHECK_LIB(glut, glutGetModifiers)
130 dnl test for glutGameModeString, but avoid adding glut a second time into
131 dnl the list of libraries
133 AC_CHECK_LIB(glut, glutGameModeString)
136 dnl Win32 is a little wierd because it has to try to handle the various
137 dnl winbloze-isms. We'll just do this manually for now.
139 echo Win32 specific hacks...
142 dnl force a failed check since we will be building under windoze
143 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
145 dnl just define these to true and hope for the best
146 ac_cv_lib_glut_glutGetModifiers="yes"
147 ac_cv_lib_glut_glutGameModeString="yes"
149 if test "x$with_sgi_opengl" = "xyes" ; then
150 echo "Building with glut.dll, glu.dll, and opengl.dll"
155 echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
158 WIN32_OPENGL=opengl32
161 LIBS="$LIBS -l${WIN32_GLUT} -l${WIN32_GLU} -l${WIN32_OPENGL}"
162 LIBS="$LIBS -luser32 -lgdi32"
163 echo "Will link apps with $LIBS"
166 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
168 echo "Unable to find the necessary OpenGL or GLUT libraries."
169 echo "See config.log for automated test details and results ..."
173 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
175 echo "Your version of glut doesn't support game mode."
176 echo "You need to fetch and install the latest version of glut from:"
178 echo " http://reality.sgi.com/opengl/glut3/glut3.html"
186 AC_SUBST(opengl_LIBS)
188 AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
190 dnl Check for "plib" without which we cannot go on
191 AC_CHECK_HEADER(plib/pu.h)
192 if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
194 echo "You *must* have the plib library installed on your system to build"
195 echo "the FGFS simulator!"
197 echo "Please see README.plib for more details."
199 echo "configure aborted."
203 dnl Check for system installed gdbm
204 AC_CHECK_HEADER(gdbm.h)
205 if test "x$ac_cv_header_gdbm_h" = "xyes"; then
206 AC_DEFINE( HAVE_GDBM )
208 echo "no gdbm found, configuring and building."
210 AM_CONDITIONAL(HAVE_GDBM, test "x$ac_cv_header_gdbm_h" = "xyes" )
212 dnl Check for system installed zlib
213 AC_CHECK_HEADER(zlib.h)
214 if test "x$ac_cv_header_zlib_h" = "xyes"; then
215 AC_DEFINE( HAVE_ZLIB )
217 echo "no zlib found, building."
219 AM_CONDITIONAL(HAVE_ZLIB, test "x$ac_cv_header_zlib_h" = "xyes" )
221 dnl Checks for header files.
224 fcntl.h getopt.h malloc.h memory.h stdlib.h sys/param.h sys/stat.h \
225 sys/time.h sys/timeb.h unistd.h windows.h winbase.h values.h )
227 dnl Checks for typedefs, structures, and compiler characteristics.
233 dnl Checks for library functions.
236 AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
237 random setitimer getitimer signal GetLocalTime rint getrusage )
239 AM_CONFIG_HEADER(simgear/config.h)
246 simgear/bucket/Makefile \
247 simgear/debug/Makefile \
248 simgear/gdbm/Makefile \
249 simgear/magvar/Makefile \
250 simgear/math/Makefile \
251 simgear/misc/Makefile \
252 simgear/screen/Makefile \
253 simgear/serial/Makefile \
254 simgear/xgl/Makefile \
255 simgear/zlib/Makefile \
259 if test "x$ac_cv_header_windows_h" = "xyes" ; then
260 cp simgear/gdbm/autoconf.h.cygwin32 simgear/gdbm/autoconf.h
265 echo "Configure Summary"
266 echo "================="
268 echo "Prefix: $prefix"
270 if test "x$with_logging" != "x"; then
271 echo "Debug messages: $with_logging"
273 echo "Debug messages: yes"
276 if test "x$with_efence" != "x"; then
277 echo "Electric fence: $with_efence"
279 echo "Electric fence: no"
282 if test "x$ac_cv_header_gdbm_h" != "xyes"; then
286 if test "x$ac_cv_header_zlib_h" != "xyes"; then