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.7)
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 Specify if we want logging (testing build) or not (release build)
28 # set logging default value
30 AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
31 if test "x$with_logging" = "xno" ; then
35 dnl specify if we are building with "checker"
36 AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"])
38 if test "x$with_efence" = "xyes" ; then
39 echo "Building with efence"
40 LIBS= "$LIBS -lefence"
43 dnl Check for MS Windows environment
44 AC_CHECK_HEADER(windows.h)
46 dnl extra library and include directories
47 EXTRA_DIRS="/usr/local /usr/local/plib /usr/X11R6"
49 if test -d /opt/X11R6 ; then
50 EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
53 if test "x$ac_cv_header_windows_h" = "xyes" ; then
54 EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
55 # elif test `uname -s` = "SunOS" ; then
56 # EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
58 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
60 dnl Using AM_CONDITIONAL is a step out of the protected little
61 dnl automake fold so it is potentially dangerous. But, we are
62 dnl beginning to run into cases where the standard checks are not
63 dnl enough. AM_CONDITIONALS are then referenced to conditionally
64 dnl build a Makefile.in from a Makefile.am which lets us define custom
65 dnl includes, compile alternative source files, etc.
67 dnl Enable serial support on Unix type systems
68 AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
70 dnl Check for X11 (fancy)
73 dnl Checks for libraries.
81 AC_CHECK_LIB(socket, socket)
82 AC_CHECK_LIB(X11, XCreateWindow)
83 AC_CHECK_LIB(Xext, XShmCreateImage)
84 AC_CHECK_LIB(Xi, XGetExtensionVersion)
85 AC_CHECK_LIB(ICE, IceOpenConnection)
86 AC_CHECK_LIB(SM, SmcOpenConnection)
87 AC_CHECK_LIB(Xt, XtMalloc)
88 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
90 dnl check for OpenGL related libraries
92 if test "x$ac_cv_header_windows_h" != "xyes" ; then
93 dnl Reasonable stuff for non-windoze variants ... :-)
95 AC_CHECK_LIB(GLcore, glNewList)
96 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
97 dnl if no GLcore, check for GL
98 AC_CHECK_LIB(GL, glNewList)
99 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
100 dnl if no GL, check for MesaGL
101 AC_CHECK_LIB(MesaGL, glNewList)
104 dnl if GLcore found, then also check for GL
105 AC_CHECK_LIB(GL, glXCreateContext)
108 dnl if using mesa, check for xmesa.h
109 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
110 AC_CHECK_HEADER(GL/xmesa.h)
111 if test "x$ac_cv_header_GL_xmesa_h" = "xyes"; then
117 AC_CHECK_LIB(GLU, gluLookAt)
118 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
119 dnl if no GLU, check for MesaGLU
120 AC_CHECK_LIB(MesaGLU, gluLookAt)
124 AC_CHECK_LIB(glut, glutGetModifiers)
126 dnl test for glutGameModeString, but avoid adding glut a second time into
127 dnl the list of libraries
129 AC_CHECK_LIB(glut, glutGameModeString)
132 dnl Win32 is a little wierd because it has to try to handle the various
133 dnl winbloze-isms. We'll just do this manually for now.
135 echo Win32 specific hacks...
138 dnl force a failed check since we will be building under windoze
139 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
141 dnl just define these to true and hope for the best
142 ac_cv_lib_glut_glutGetModifiers="yes"
143 ac_cv_lib_glut_glutGameModeString="yes"
145 if test "x$with_sgi_opengl" = "xyes" ; then
146 echo "Building with glut.dll, glu.dll, and opengl.dll"
151 echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
154 WIN32_OPENGL=opengl32
157 LIBS="$LIBS -l${WIN32_GLUT} -l${WIN32_GLU} -l${WIN32_OPENGL}"
158 LIBS="$LIBS -luser32 -lgdi32"
159 echo "Will link apps with $LIBS"
162 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
164 echo "Unable to find the necessary OpenGL or GLUT libraries."
165 echo "See config.log for automated test details and results ..."
169 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
171 echo "Your version of glut doesn't support game mode."
172 echo "You need to fetch and install the latest version of glut from:"
174 echo " http://reality.sgi.com/opengl/glut3/glut3.html"
182 AC_SUBST(opengl_LIBS)
184 AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
186 dnl Check for "plib" without which we cannot go on
187 AC_CHECK_HEADER(plib/pu.h)
188 if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
190 echo "You *must* have the plib library installed on your system to build"
191 echo "the FGFS simulator!"
193 echo "Please see README.plib for more details."
195 echo "configure aborted."
199 dnl Check for system installed zlib
200 AC_CHECK_HEADER(zlib.h)
201 if test "x$ac_cv_header_zlib_h" = "xyes"; then
202 AC_DEFINE( HAVE_ZLIB )
204 echo "no zlib found, building."
206 AM_CONDITIONAL(HAVE_ZLIB, test "x$ac_cv_header_zlib_h" = "xyes" )
208 dnl Checks for header files.
211 fcntl.h getopt.h malloc.h memory.h stdlib.h sys/param.h sys/stat.h \
212 sys/time.h sys/timeb.h unistd.h windows.h winbase.h values.h )
214 dnl Checks for typedefs, structures, and compiler characteristics.
220 dnl Checks for library functions.
223 AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
224 random setitimer getitimer signal GetLocalTime rint getrusage )
226 AM_CONFIG_HEADER(simgear/config.h)
232 simgear/bucket/Makefile \
233 simgear/debug/Makefile \
234 simgear/magvar/Makefile \
235 simgear/math/Makefile \
236 simgear/misc/Makefile \
237 simgear/screen/Makefile \
238 simgear/serial/Makefile \
239 simgear/xgl/Makefile \
240 simgear/zlib/Makefile \
243 # AC_OUTPUT_COMMANDS([./mksymlinks.sh])
246 echo "Configure Summary"
247 echo "================="
249 echo "Prefix: $prefix"
251 if test "x$with_logging" != "x"; then
252 echo "Debug messages: $with_logging"
254 echo "Debug messages: yes"
257 if test "x$with_efence" != "x"; then
258 echo "Electric fence: $with_efence"
260 echo "Electric fence: no"