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]
6 AC_INIT(Simulator/Aircraft/aircraft.cxx)
8 dnl Initialize the automake stuff
9 AM_INIT_AUTOMAKE(FlightGear, 0.56)
11 dnl Checks for programs.
19 dnl Initialize libtool
22 dnl Initialize maintainer mode
23 dnl AM_MAINTAINER_MODE
25 dnl This is needed for AC_TRY_COMPILE later
28 dnl Check to see if this `configure' is being run in the `Cygwin32' environment
31 dnl specify if we are building with "checker"
32 AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"])
34 if test "x$with_efence" = "xyes" ; then
35 echo "Building with efence"
36 LIBS= "$LIBS -lefence"
39 dnl specify the compiled flight model
40 AC_ARG_WITH(flight-model, [ --with-flight-model=xxx Specify the flight model (navion, cherokee)])
42 if test "x$with_flight_model" = "xcherokee" ; then
43 echo "Building with cherokee flight model"
45 echo "Building with navion flight model"
47 AM_CONDITIONAL(ENABLE_CHEROKEE, test "x$with_flight_model" = "xcherokee")
49 dnl Let the Win32 user specify if they want to build with the SGI
50 dnl opengl.dll as opposed to the more standard openg32.dll
51 AC_ARG_WITH(sgi-opengl, [ --with-sgi-opengl Build against SGI's opengl.dll glu.dll and glut.dll])
53 dnl Check for MS Windows environment
54 AC_CHECK_HEADER(windows.h)
56 dnl Using AM_CONDITIONAL is a step out of the protected little
57 dnl automake fold so it is potentially dangerous. But, we are
58 dnl beginning to run into cases where the standard checks are not
59 dnl enough. AM_CONDITIONALS are then referenced to conditionally
60 dnl build a Makefile.in from a Makefile.am which lets us define custom
61 dnl includes, compile alternative source files, etc.
63 dnl Check for external variables daylight and timezone.
65 AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes )
68 AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes )
70 dnl Check for Linux style audio support
71 AM_CONDITIONAL(ENABLE_AUDIO_SUPPORT, \
72 test -r /usr/include/soundcard.h \
73 -o -r /usr/include/linux/soundcard.h \
74 -o -r /usr/include/machine/soundcard.h \
75 -o -r /usr/include/audio.h \
76 -o "x$ac_cv_header_windows_h" = "xyes" )
78 AM_CONDITIONAL(ENABLE_IRIX_AUDIO, test -r /usr/include/audio.h)
80 AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
82 dnl Check for (currently Linux only style) joystick support
83 # AM_CONDITIONAL(ENABLE_JOYSTICK_SUPPORT, \
84 # test -r /usr/include/linux/joystick.h \
85 # -o "x$ac_cv_header_windows_h" = "xyes" )
87 AM_CONDITIONAL(ENABLE_LINUX_JOYSTICK, test -r /usr/include/linux/joystick.h )
89 # AM_CONDITIONAL(ENABLE_GLUT_JOYSTICK, "x$ac_cv_header_windows_h" = "xyes" )
91 dnl extra library and include directories
92 EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6"
94 if test "x$ac_cv_header_windows_h" = "xyes" ; then
95 EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
96 # elif test `uname -s` = "SunOS" ; then
97 # EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
99 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
101 dnl Check for X11 (fancy)
104 dnl Checks for libraries.
107 AC_CHECK_LIB(socket, socket)
108 AC_CHECK_LIB(X11, XCreateWindow)
109 AC_CHECK_LIB(Xext, XShmCreateImage)
110 AC_CHECK_LIB(Xi, XGetExtensionVersion)
111 AC_CHECK_LIB(ICE, IceOpenConnection)
112 AC_CHECK_LIB(SM, SmcOpenConnection)
113 AC_CHECK_LIB(Xt, XtMalloc)
114 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
116 dnl check for OpenGL related libraries
118 if test "x$ac_cv_header_windows_h" != "xyes" ; then
119 dnl Reasonable stuff non-windoze variants ... :-)
121 AC_CHECK_LIB(GLcore, glNewList)
122 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
123 dnl if no GLcore, check for GL
124 AC_CHECK_LIB(GL, glNewList)
125 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
126 dnl if no GL, check for MesaGL
127 AC_CHECK_LIB(MesaGL, glNewList)
130 dnl if GLcore found, then also check for GL
131 AC_CHECK_LIB(GL, glXCreateContext)
134 dnl if using mesa, check for xmesa.h
135 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
136 AC_CHECK_HEADER(GL/xmesa.h)
137 AM_CONDITIONAL(ENABLE_XMESA_FX, \
138 test "x$ac_cv_header_GL_xmesa_h" = "xyes")
140 dnl force a failed check
141 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
144 AC_CHECK_LIB(GLU, gluLookAt)
145 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
146 dnl if no GLU, check for MesaGLU
147 AC_CHECK_LIB(MesaGLU, gluLookAt)
151 AC_CHECK_LIB(glut, glutGetModifiers)
153 dnl test for glutGameModeString
154 AC_CHECK_LIB(glut, glutGameModeString)
156 dnl Win32 is a little wierd because it has to try to handle the various
157 dnl winbloze-isms. We'll just do this manually for now.
159 echo Win32 specific hacks...
162 dnl force a failed check since we will be building under windoze
163 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
165 if test "x$with_sgi_opengl" = "xyes" ; then
166 echo "Building with glut.dll, glu.dll, and opengl.dll"
171 echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
174 WIN32_OPENGL=opengl32
177 if test -f `pwd`/Win32/${WIN32_GLUT}.dll; then
178 echo " found ${WIN32_GLUT}.dll, adding -l${WIN32_GLUT}"
179 LIBS="$LIBS -l${WIN32_GLUT}"
181 echo " Cannot find ${WIN32_GLUT}.dll"
185 if test -f `pwd`/Win32/${WIN32_GLU}.dll; then
186 echo " found ${WIN32_GLU}.dll"
188 echo " Can't find ${WIN32_GLU}.dll, assuming it's someplace"
190 echo " adding -l${WIN32_GLU}"
191 LIBS="$LIBS -l${WIN32_GLU}"
193 if test -f `pwd`/Win32/${WIN32_OPENGL}.dll; then
194 echo " found ${WIN32_OPENGL}.dll"
196 echo " Can't find ${WIN32_OPENGL}.dll, assuming it's somplace"
198 echo " adding -l${WIN32_OPENGL}"
199 LIBS="$LIBS -l${WIN32_OPENGL}"
201 echo " adding -luser32 -lgdi32"
202 LIBS="$LIBS -luser32 -lgdi32"
203 ac_cv_lib_glut_glutGetModifiers="yes"
204 ac_cv_lib_glut_glutGameModeString="yes"
207 dnl Checks for header files.
210 fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
211 unistd.h windows.h winbase.h values.h )
213 dnl Checks for typedefs, structures, and compiler characteristics.
219 dnl Checks for library functions.
222 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
223 setitimer getitimer signal GetLocalTime rint getrusage )
225 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
227 echo "Unable to find the necessary OpenGL or GLUT libraries."
228 echo "See config.log for automated test details and results ..."
232 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
234 echo "Your version of glut doesn't support game mode."
235 echo "You need to fetch and install the latest version of glut from:"
237 echo " http://reality.sgi.com/opengl/glut3/glut3.html"
241 AM_CONFIG_HEADER(Include/config.h)
248 Lib/Audio/src/Makefile \
249 Lib/Audio/example/Makefile \
250 Lib/Bucket/Makefile \
260 Simulator/Aircraft/Makefile \
261 Simulator/Airports/Makefile \
262 Simulator/Astro/Makefile \
263 Simulator/Autopilot/Makefile \
264 Simulator/Cockpit/Makefile \
265 Simulator/Controls/Makefile \
266 Simulator/Flight/LaRCsim/Makefile \
267 Simulator/Flight/Slew/Makefile \
268 Simulator/Flight/Makefile \
269 Simulator/GUI/Makefile \
270 Simulator/Joystick/Makefile \
271 Simulator/Main/Makefile \
272 Simulator/Main/runfgfs \
273 Simulator/Main/runfgfs.bat \
275 Simulator/Objects/Makefile \
276 Simulator/Scenery/Makefile \
277 Simulator/Time/Makefile \
278 Simulator/Weather/Makefile \
280 Tools/Areas/Makefile \
281 Tools/AssemTris/Makefile \
282 Tools/Dem2node/Makefile \
283 Tools/DemInfo/Makefile \
284 Tools/DemRaw2ascii/Makefile \
285 Tools/FixNode/Makefile \
286 Tools/FixObj/Makefile \
287 Tools/GenAirports/Makefile \
288 Tools/Makedir/Makefile \
289 Tools/SplitTris/Makefile \
290 Tools/Stripe_w/Makefile \
291 Tools/Tri2obj/Makefile \
292 Tools/Triangle/Makefile \
296 AC_OUTPUT_COMMANDS([chmod 755 Simulator/Main/runfgfs])