1 dnl Process this file with autoconf to produce a configure script.
3 dnl The basis for this file was generated by autoscan(1) [pere 1998-03-19]
7 AC_INIT(Simulator/Aircraft/aircraft.cxx)
9 dnl Initialize the automake stuff
10 AM_INIT_AUTOMAKE(FlightGear, 0.6.1)
12 dnl configure other independant packages included with flight gear for
14 dnl AC_CONFIG_SUBDIRS( Lib/plib )
16 dnl Checks for programs.
24 dnl Initialize libtool
27 dnl Initialize maintainer mode
28 dnl AM_MAINTAINER_MODE
30 dnl This is needed for AC_TRY_COMPILE later
33 dnl Check to see if this `configure' is being run in the `Cygwin32' environment
36 dnl Specify if we want logging (testing build) or not (release build)
37 # set logging default value
39 AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
40 if test "x$with_logging" = "xno" ; then
45 dnl specify if we are building with "checker"
46 AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"])
48 if test "x$with_efence" = "xyes" ; then
49 echo "Building with efence"
50 LIBS= "$LIBS -lefence"
53 dnl specify the compiled flight model
54 AC_ARG_WITH(flight-model, [ --with-flight-model=xxx Specify the flight model (navion, cherokee)])
56 if test "x$with_flight_model" = "xcherokee" ; then
57 echo "Building with cherokee flight model"
59 echo "Building with navion flight model"
61 AM_CONDITIONAL(ENABLE_CHEROKEE, test "x$with_flight_model" = "xcherokee")
63 dnl Let the Win32 user specify if they want to build with the SGI
64 dnl opengl.dll as opposed to the more standard openg32.dll
65 AC_ARG_WITH(sgi-opengl, [ --with-sgi-opengl Build against SGI's opengl.dll glu.dll and glut.dll])
67 dnl Check for MS Windows environment
68 AC_CHECK_HEADER(windows.h)
70 dnl extra library and include directories
71 EXTRA_DIRS="/usr/local /usr/X11R6"
73 if test -d /opt/X11R6 ; then
74 EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
77 if test "x$ac_cv_header_windows_h" = "xyes" ; then
78 EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
79 # elif test `uname -s` = "SunOS" ; then
80 # EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
82 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
84 dnl Check for "plib" without which we cannot go on
85 AC_CHECK_HEADER(plib/pu.h)
86 if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
88 echo "You *must* have the plib library installed on your system to build"
89 echo "the FGFS simulator!"
91 echo "Please see README.plib for more details."
93 echo "configure aborted."
95 AM_CONDITIONAL(ENABLE_PLIB_JOYSTICK, false )
97 dnl Use plib joystick lib
98 AM_CONDITIONAL(ENABLE_PLIB_JOYSTICK, true )
101 dnl Using AM_CONDITIONAL is a step out of the protected little
102 dnl automake fold so it is potentially dangerous. But, we are
103 dnl beginning to run into cases where the standard checks are not
104 dnl enough. AM_CONDITIONALS are then referenced to conditionally
105 dnl build a Makefile.in from a Makefile.am which lets us define custom
106 dnl includes, compile alternative source files, etc.
108 dnl Check for external variables daylight and timezone.
110 AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes )
113 AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes )
115 dnl Check for Linux style audio support
116 AM_CONDITIONAL(ENABLE_AUDIO_SUPPORT, \
117 test -r /usr/include/soundcard.h \
118 -o -r /usr/include/linux/soundcard.h \
119 -o -r /usr/include/machine/soundcard.h \
120 -o -r /usr/include/audio.h \
121 -o "x$ac_cv_header_windows_h" = "xyes" )
123 AM_CONDITIONAL(ENABLE_IRIX_AUDIO, test -r /usr/include/audio.h)
125 AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
127 dnl Enable serial support on Unix type systems
128 AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
130 dnl Check for X11 (fancy)
133 dnl Checks for libraries.
141 AC_CHECK_LIB(socket, socket)
142 AC_CHECK_LIB(X11, XCreateWindow)
143 AC_CHECK_LIB(Xext, XShmCreateImage)
144 AC_CHECK_LIB(Xi, XGetExtensionVersion)
145 AC_CHECK_LIB(ICE, IceOpenConnection)
146 AC_CHECK_LIB(SM, SmcOpenConnection)
147 AC_CHECK_LIB(Xt, XtMalloc)
148 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
150 dnl check for OpenGL related libraries
152 if test "x$ac_cv_header_windows_h" != "xyes" ; then
153 dnl Reasonable stuff for non-windoze variants ... :-)
155 AC_CHECK_LIB(GLcore, glNewList)
156 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
157 dnl if no GLcore, check for GL
158 AC_CHECK_LIB(GL, glNewList)
159 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
160 dnl if no GL, check for MesaGL
161 AC_CHECK_LIB(MesaGL, glNewList)
164 dnl if GLcore found, then also check for GL
165 AC_CHECK_LIB(GL, glXCreateContext)
168 dnl if using mesa, check for xmesa.h
169 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
170 AC_CHECK_HEADER(GL/xmesa.h)
171 AM_CONDITIONAL(ENABLE_XMESA_FX, \
172 test "x$ac_cv_header_GL_xmesa_h" = "xyes")
174 dnl force a failed check
175 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
178 AC_CHECK_LIB(GLU, gluLookAt)
179 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
180 dnl if no GLU, check for MesaGLU
181 AC_CHECK_LIB(MesaGLU, gluLookAt)
185 AC_CHECK_LIB(glut, glutGetModifiers)
187 dnl test for glutGameModeString, but avoid adding glut a second time into
188 dnl the list of libraries
190 AC_CHECK_LIB(glut, glutGameModeString)
193 dnl Win32 is a little wierd because it has to try to handle the various
194 dnl winbloze-isms. We'll just do this manually for now.
196 echo Win32 specific hacks...
199 dnl force a failed check since we will be building under windoze
200 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
202 dnl just define these to true and hope for the best
203 ac_cv_lib_glut_glutGetModifiers="yes"
204 ac_cv_lib_glut_glutGameModeString="yes"
206 if test "x$with_sgi_opengl" = "xyes" ; then
207 echo "Building with glut.dll, glu.dll, and opengl.dll"
212 echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
215 WIN32_OPENGL=opengl32
218 LIBS="$LIBS -l${WIN32_GLUT} -l${WIN32_GLU} -l${WIN32_OPENGL}"
219 LIBS="$LIBS -luser32 -lgdi32"
220 echo "Will link apps with $LIBS"
223 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
225 echo "Unable to find the necessary OpenGL or GLUT libraries."
226 echo "See config.log for automated test details and results ..."
230 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
232 echo "Your version of glut doesn't support game mode."
233 echo "You need to fetch and install the latest version of glut from:"
235 echo " http://reality.sgi.com/opengl/glut3/glut3.html"
243 AC_SUBST(opengl_LIBS)
245 AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
247 dnl Check if Generic Polygon Clipping library is installed
248 dnl (from http://www.cs.man.ac.uk/aig/staff/alan/software/)
249 AC_CHECK_HEADERS( gpc.h )
250 if test "x$ac_cv_header_gpc_h" != "xyes"; then
252 echo "You need to have the GPC library installed on your system to build"
253 echo "some of the scenery generation tools, otherwise you won't be able."
254 echo "to create scenery."
256 echo "Please see README.gpc for more details."
258 echo "(pausing 5 seconds)"
263 dnl Check if Geographic Foundation Classes library is installed
264 dnl (from ftp://ftp.flightgear.org/pub/fgfs/Source/)
265 AC_CHECK_HEADERS( gfc/gdbf.h )
266 if test "x$ac_cv_header_gfc_gdbf_h" != "xyes"; then
268 echo "You need to have the GFC library installed on your system to build"
269 echo "some of the scenery generation tools, otherwise, they may fail."
271 echo "Please see README.gfc for more details."
273 echo "(pausing 5 seconds)"
278 dnl Checks for header files.
281 fcntl.h getopt.h malloc.h memory.h stdlib.h sys/stat.h sys/time.h \
282 sys/timeb.h unistd.h windows.h winbase.h values.h )
284 dnl Checks for typedefs, structures, and compiler characteristics.
290 dnl Checks for library functions.
293 AC_CHECK_FUNCS( ftime gettimeofday memcpy bcopy mktime strstr rand random \
294 setitimer getitimer signal GetLocalTime rint getrusage )
296 AM_CONFIG_HEADER(Include/config.h)
303 Lib/Bucket/Makefile \
307 Lib/Serial/Makefile \
311 Simulator/Aircraft/Makefile \
312 Simulator/Airports/Makefile \
313 Simulator/Astro/Makefile \
314 Simulator/Autopilot/Makefile \
315 Simulator/Cockpit/Makefile \
316 Simulator/Controls/Makefile \
317 Simulator/FDM/External/Makefile \
318 Simulator/FDM/JSBsim/Makefile \
319 Simulator/FDM/LaRCsim/Makefile \
320 Simulator/FDM/Slew/Makefile \
321 Simulator/FDM/Makefile \
322 Simulator/GUI/Makefile \
323 Simulator/Joystick/Makefile \
324 Simulator/Main/Makefile \
325 Simulator/Main/runfgfs \
326 Simulator/Main/runfgfs.bat \
328 Simulator/Objects/Makefile \
329 Simulator/Scenery/Makefile \
330 Simulator/Time/Makefile \
331 Simulator/Weather/Makefile \
333 Tools/Construct/Makefile \
334 Tools/Construct/Array/Makefile \
335 Tools/Construct/Clipper/Makefile \
336 Tools/Construct/Combine/Makefile \
337 Tools/Construct/GenOutput/Makefile \
338 Tools/Construct/Match/Makefile \
339 Tools/Construct/Triangulate/Makefile \
340 Tools/Construct/Main/Makefile \
341 Tools/Construct/Parallel/Makefile \
343 Tools/Lib/DEM/Makefile \
344 Tools/Lib/Polygon/Makefile \
345 Tools/Lib/Triangle/Makefile \
346 Tools/Prep/Makefile \
347 Tools/Prep/DemChop/Makefile \
348 Tools/Prep/DemInfo/Makefile \
349 Tools/Prep/DemRaw2ascii/Makefile \
350 Tools/Prep/GenAirports/Makefile \
351 Tools/Prep/ShapeFile/Makefile \
352 Tools/Utils/Makefile \
356 AC_OUTPUT_COMMANDS([chmod 755 Simulator/Main/runfgfs])