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.c)
8 dnl specify the compiled flight model
9 AC_ARG_WITH(flight-model, [ --with-flight-model Specify the compiled in flight model (navion, cherokee)])
11 if test "x$with_flight_model" = "xcherokee" ; then
12 echo "Building with cherokee flight model"
14 echo "Building with navion flight model"
16 AM_CONDITIONAL(ENABLE_CHEROKEE, test "x$with_flight_model" = "xcherokee")
18 dnl Let the Win32 user specify if they want to build with the SGI
19 dnl opengl.dll as opposed to the more standard openg32.dll
20 AC_ARG_WITH(sgiopengl, [ --with-sgiopengl Build against opengl.dll glu.dll and glut.dll])
22 dnl Initialize the automake stuff
23 AM_INIT_AUTOMAKE(FlightGear, 0.52)
25 dnl Checks for programs.
33 dnl Initialize libtool
36 dnl Initialize maintainer mode
37 dnl AM_MAINTAINER_MODE
39 dnl This is needed for AC_TRY_COMPILE later
42 dnl Check to see if this `configure' is being run in the `Cygwin32' environment
45 dnl Check for MS Windows environment
46 AC_CHECK_HEADER(windows.h)
48 dnl Using AM_CONDITIONAL is a step out of the protected little
49 dnl automake fold so it is potentially dangerous. But, we are
50 dnl beginning to run into cases where the standard checks are not
51 dnl enough. AM_CONDITIONALS are then referenced to conditionally
52 dnl build a Makefile.in from a Makefile.am which lets us define custom
53 dnl includes, compile alternative source files, etc.
55 dnl Check for external variables daylight and timezone.
57 AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes )
60 AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes )
62 dnl Check for Linux style audio support
63 AM_CONDITIONAL(ENABLE_AUDIO_SUPPORT, \
64 test -r /usr/include/soundcard.h \
65 -o -r /usr/include/linux/soundcard.h \
66 -o -r /usr/include/machine/soundcard.h \
67 -o -r /usr/include/audio.h \
68 -o "x$ac_cv_header_windows_h" = "xyes" )
70 AM_CONDITIONAL(ENABLE_IRIX_AUDIO, test -r /usr/include/audio.h)
72 AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
74 dnl extra library and include directories
75 EXTRA_DIRS="/usr/local /usr/X11R6 /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 X11 (fancy)
87 dnl Checks for libraries.
90 AC_CHECK_LIB(socket, socket)
91 AC_CHECK_LIB(X11, XCreateWindow)
92 AC_CHECK_LIB(Xext, XShmCreateImage)
93 AC_CHECK_LIB(Xi, XGetExtensionVersion)
94 AC_CHECK_LIB(ICE, IceOpenConnection)
95 AC_CHECK_LIB(SM, SmcOpenConnection)
96 AC_CHECK_LIB(Xt, XtMalloc)
97 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
99 dnl check for OpenGL related libraries
101 if test "x$ac_cv_header_windows_h" != "xyes" ; then
102 dnl Reasonable stuff non-windoze variants ... :-)
104 AC_CHECK_LIB(GLcore, glNewList)
105 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
106 dnl if no GLcore, check for GL
107 AC_CHECK_LIB(GL, glNewList)
108 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
109 dnl if no GL, check for MesaGL
110 AC_CHECK_LIB(MesaGL, glNewList)
113 dnl if GLcore found, then also check for GL
114 AC_CHECK_LIB(GL, glXCreateContext)
117 dnl if using mesa, check for xmesa.h
118 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
119 AC_CHECK_HEADER(GL/xmesa.h)
120 AM_CONDITIONAL(ENABLE_XMESA_FX, \
121 test "x$ac_cv_header_GL_xmesa_h" = "xyes")
123 dnl force a failed check
124 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
127 AC_CHECK_LIB(GLU, gluLookAt)
128 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
129 dnl if no GLU, check for MesaGLU
130 AC_CHECK_LIB(MesaGLU, gluLookAt)
133 AC_CHECK_LIB(glut, glutGetModifiers)
135 dnl Win32 is a little wierd because it has to try to handle the various
136 dnl winbloze-isms. We'll just do this manually for now.
138 echo Win32 specific hacks...
141 dnl force a failed check since we will be building under windoze
142 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
144 if test "x$with_sgiopengl" = "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 if test -f `pwd`/Win32/${WIN32_GLUT}.dll; then
157 echo " found ${WIN32_GLUT}.dll, adding -l${WIN32_GLUT}"
158 LIBS="$LIBS -l${WIN32_GLUT}"
160 echo " Cannot find ${WIN32_GLUT}.dll"
164 if test -f `pwd`/Win32/${WIN32_GLU}.dll; then
165 echo " found ${WIN32_GLU}.dll"
167 echo " Can't find ${WIN32_GLU}.dll, assuming it's someplace"
169 echo " adding -l${WIN32_GLU}"
170 LIBS="$LIBS -l${WIN32_GLU}"
172 if test -f `pwd`/Win32/${WIN32_OPENGL}.dll; then
173 echo " found ${WIN32_OPENGL}.dll"
175 echo " Can't find ${WIN32_OPENGL}.dll, assuming it's somplace"
177 echo " adding -l${WIN32_OPENGL}"
178 LIBS="$LIBS -l${WIN32_OPENGL}"
180 echo " adding -luser32 -lgdi32"
181 LIBS="$LIBS -luser32 -lgdi32"
182 ac_cv_lib_glut_glutGetModifiers="yes"
185 dnl Checks for header files.
188 fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
189 unistd.h windows.h winbase.h values.h )
191 dnl Checks for typedefs, structures, and compiler characteristics.
197 dnl Checks for library functions.
200 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
201 setitimer getitimer signal GetLocalTime rint getrusage )
203 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
205 echo "Unable to find the necessary OpenGL or GLUT libraries."
206 echo "See config.log for automated test details and results ..."
210 AM_CONFIG_HEADER(Include/config.h)
217 Lib/Audio/src/Makefile \
218 Lib/Audio/example/Makefile \
219 Lib/Bucket/Makefile \
228 Simulator/Aircraft/Makefile \
229 Simulator/Astro/Makefile \
230 Simulator/Autopilot/Makefile \
231 Simulator/Cockpit/Makefile \
232 Simulator/Controls/Makefile \
233 Simulator/Flight/LaRCsim/Makefile \
234 Simulator/Flight/Slew/Makefile \
235 Simulator/Flight/Makefile \
236 Simulator/GUI/Makefile \
237 Simulator/Joystick/Makefile \
238 Simulator/Main/Makefile \
239 Simulator/Main/runfg \
240 Simulator/Main/runfg.bat \
242 Simulator/Scenery/Makefile \
243 Simulator/Time/Makefile \
244 Simulator/Weather/Makefile \
246 Tools/Areas/Makefile \
247 Tools/AssemTris/Makefile \
248 Tools/Dem2node/Makefile \
249 Tools/DemInfo/Makefile \
250 Tools/DemRaw2ascii/Makefile \
251 Tools/FixNode/Makefile \
252 Tools/FixObj/Makefile \
253 Tools/SplitTris/Makefile \
254 Tools/Stripe_w/Makefile \
255 Tools/Tri2obj/Makefile \
256 Tools/Triangle/Makefile \
260 AC_OUTPUT_COMMANDS([chmod 755 Simulator/Main/runfg])