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.9)
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 # set logging default value
29 AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
30 if test "x$with_logging" = "xno" ; then
34 dnl specify if we are building with "checker"
35 AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"])
37 if test "x$with_efence" = "xyes" ; then
38 echo "Building with efence"
39 LIBS= "$LIBS -lefence"
42 dnl Check for MS Windows environment
43 AC_CHECK_HEADER(windows.h)
45 dnl extra library and include directories
46 EXTRA_DIRS="/usr/local /usr/local/plib /usr/X11R6"
48 if test -d /opt/X11R6 ; then
49 EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
52 if test "x$ac_cv_header_windows_h" = "xyes" ; then
53 EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
54 # elif test `uname -s` = "SunOS" ; then
55 # EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
57 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
59 dnl Using AM_CONDITIONAL is a step out of the protected little
60 dnl automake fold so it is potentially dangerous. But, we are
61 dnl beginning to run into cases where the standard checks are not
62 dnl enough. AM_CONDITIONALS are then referenced to conditionally
63 dnl build a Makefile.in from a Makefile.am which lets us define custom
64 dnl includes, compile alternative source files, etc.
66 dnl Enable serial support on Unix type systems
67 AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
69 dnl Check for X11 (fancy)
72 dnl Checks for libraries.
80 AC_CHECK_LIB(socket, socket)
81 AC_CHECK_LIB(X11, XCreateWindow)
82 AC_CHECK_LIB(Xext, XShmCreateImage)
83 AC_CHECK_LIB(Xi, XGetExtensionVersion)
84 AC_CHECK_LIB(ICE, IceOpenConnection)
85 AC_CHECK_LIB(SM, SmcOpenConnection)
86 AC_CHECK_LIB(Xt, XtMalloc)
87 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
89 dnl check for OpenGL related libraries
91 if test "x$ac_cv_header_windows_h" != "xyes" ; then
92 dnl Reasonable stuff for non-windoze variants ... :-)
94 AC_CHECK_LIB(GLcore, glNewList)
95 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
96 dnl if no GLcore, check for GL
97 AC_CHECK_LIB(GL, glNewList)
98 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
99 dnl if no GL, check for MesaGL
100 AC_CHECK_LIB(MesaGL, glNewList)
103 dnl if GLcore found, then also check for GL
104 AC_CHECK_LIB(GL, glXCreateContext)
107 dnl if using mesa, check for xmesa.h
108 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
109 AC_CHECK_HEADER(GL/xmesa.h)
110 if test "x$ac_cv_header_GL_xmesa_h" = "xyes"; then
116 AC_CHECK_LIB(GLU, gluLookAt)
117 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
118 dnl if no GLU, check for MesaGLU
119 AC_CHECK_LIB(MesaGLU, gluLookAt)
123 AC_CHECK_LIB(glut, glutGetModifiers)
125 dnl test for glutGameModeString, but avoid adding glut a second time into
126 dnl the list of libraries
128 AC_CHECK_LIB(glut, glutGameModeString)
131 dnl Win32 is a little wierd because it has to try to handle the various
132 dnl winbloze-isms. We'll just do this manually for now.
134 echo Win32 specific hacks...
137 dnl force a failed check since we will be building under windoze
138 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
140 dnl just define these to true and hope for the best
141 ac_cv_lib_glut_glutGetModifiers="yes"
142 ac_cv_lib_glut_glutGameModeString="yes"
144 if test "x$with_sgi_opengl" = "xyes" ; then
145 echo "Building with glut.dll, glu.dll, and opengl.dll"
150 echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
153 WIN32_OPENGL=opengl32
156 LIBS="$LIBS -l${WIN32_GLUT} -l${WIN32_GLU} -l${WIN32_OPENGL}"
157 LIBS="$LIBS -luser32 -lgdi32"
158 echo "Will link apps with $LIBS"
161 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
163 echo "Unable to find the necessary OpenGL or GLUT libraries."
164 echo "See config.log for automated test details and results ..."
168 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
170 echo "Your version of glut doesn't support game mode."
171 echo "You need to fetch and install the latest version of glut from:"
173 echo " http://reality.sgi.com/opengl/glut3/glut3.html"
181 AC_SUBST(opengl_LIBS)
183 AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
185 dnl Check for "plib" without which we cannot go on
186 AC_CHECK_HEADER(plib/pu.h)
187 if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
189 echo "You *must* have the plib library installed on your system to build"
190 echo "the FGFS simulator!"
192 echo "Please see README.plib for more details."
194 echo "configure aborted."
198 # dnl Check for system installed gdbm
199 # AC_CHECK_HEADER(gdbm.h)
200 # if test "x$ac_cv_header_gdbm_h" = "xyes"; then
201 # AC_DEFINE( HAVE_GDBM )
203 # echo "no gdbm found, configuring and building."
205 # AM_CONDITIONAL(HAVE_GDBM, test "x$ac_cv_header_gdbm_h" = "xyes" )
207 dnl Check for system installed metakit
208 AC_CHECK_HEADER(mk4.h)
209 if test "x$ac_cv_header_mk4_h" != "xyes"; then
210 echo "no metakit found, configuring and building."
211 # Run configure in the metakit subdir
212 AC_CONFIG_SUBDIRS( simgear/metakit/unix )
214 AM_CONDITIONAL(HAVE_METAKIT, test "x$ac_cv_header_mk4_h" = "xyes" )
217 dnl Specify if we want logging (testing build) or not (release build)
219 dnl Check for system installed zlib
220 AC_CHECK_HEADER(zlib.h)
221 if test "x$ac_cv_header_zlib_h" = "xyes"; then
222 AC_DEFINE( HAVE_ZLIB )
224 echo "no zlib found, building."
226 AM_CONDITIONAL(HAVE_ZLIB, test "x$ac_cv_header_zlib_h" = "xyes" )
228 dnl Checks for header files.
231 fcntl.h getopt.h malloc.h memory.h stdlib.h sys/param.h sys/stat.h \
232 sys/time.h sys/timeb.h unistd.h windows.h winbase.h values.h )
234 dnl Checks for typedefs, structures, and compiler characteristics.
240 dnl Checks for library functions.
243 AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
244 random setitimer getitimer signal GetLocalTime rint getrusage )
246 AM_CONFIG_HEADER(simgear/config.h)
253 simgear/bucket/Makefile \
254 simgear/debug/Makefile \
255 simgear/magvar/Makefile \
256 simgear/math/Makefile \
257 simgear/misc/Makefile \
258 simgear/screen/Makefile \
259 simgear/serial/Makefile \
260 simgear/xgl/Makefile \
261 simgear/zlib/Makefile \
265 # if test "x$ac_cv_header_windows_h" = "xyes" ; then
266 # cp simgear/gdbm/autoconf.h.cygwin32 simgear/gdbm/autoconf.h
271 echo "Configure Summary"
272 echo "================="
274 echo "Prefix: $prefix"
276 if test "x$with_logging" != "x"; then
277 echo "Debug messages: $with_logging"
279 echo "Debug messages: yes"
282 if test "x$with_efence" != "x"; then
283 echo "Electric fence: $with_efence"
285 echo "Electric fence: no"
288 # if test "x$ac_cv_header_gdbm_h" != "xyes"; then
289 # echo "Building gdbm"
292 if test "x$ac_cv_header_mk4_h" != "xyes"; then
293 echo "Building metakit"
296 if test "x$ac_cv_header_zlib_h" != "xyes"; then