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 Let the Win32 user specify if they want to build with the SGI
9 dnl opengl.dll as opposed to the more standard openg32.dll
10 AC_ARG_WITH(sgiopengl, [ --with-sgiopengl Build against opengl.dll glu.dll and glut.dll])
12 dnl Initialize the automake stuff
13 AM_INIT_AUTOMAKE(FlightGear, 0.52)
15 dnl Checks for programs.
23 dnl Initialize libtool
26 dnl Initialize maintainer mode
27 dnl AM_MAINTAINER_MODE
29 dnl This is needed for AC_TRY_COMPILE later
32 dnl Check to see if this `configure' is being run in the `Cygwin32' environment
35 dnl Check for MS Windows environment
36 AC_CHECK_HEADER(windows.h)
38 dnl Using AM_CONDITIONAL is a step out of the protected little
39 dnl automake fold so it is potentially dangerous. But, we are
40 dnl beginning to run into cases where the standard checks are not
41 dnl enough. AM_CONDITIONALS are then referenced to conditionally
42 dnl build a Makefile.in from a Makefile.am which lets us define custom
43 dnl includes, compile alternative source files, etc.
45 dnl Check for external variables daylight and timezone.
47 AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes )
50 AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes )
52 dnl Check for Linux style audio support
53 AM_CONDITIONAL(ENABLE_AUDIO_SUPPORT, \
54 test -r /usr/include/soundcard.h \
55 -o -r /usr/include/linux/soundcard.h \
56 -o -r /usr/include/machine/soundcard.h \
57 -o -r /usr/include/audio.h \
58 -o "x$ac_cv_header_windows_h" = "xyes" )
60 AM_CONDITIONAL(ENABLE_IRIX_AUDIO, test -r /usr/include/audio.h)
62 AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
64 dnl extra library and include directories
65 EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6"
67 if test "x$ac_cv_header_windows_h" = "xyes" ; then
68 EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
69 # elif test `uname -s` = "SunOS" ; then
70 # EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
72 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
74 dnl Check for X11 (fancy)
77 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 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 AM_CONDITIONAL(ENABLE_XMESA_FX, \
111 test "x$ac_cv_header_GL_xmesa_h" = "xyes")
113 dnl force a failed check
114 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
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)
123 AC_CHECK_LIB(glut, glutGetModifiers)
125 dnl Win32 is a little wierd because it has to try to handle the various
126 dnl winbloze-isms. We'll just do this manually for now.
128 echo Win32 specific hacks...
131 dnl force a failed check since we will be building under windoze
132 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
134 if test "x$with_sgiopengl" = "xyes" ; then
135 echo "Building with glut.dll, glu.dll, and opengl.dll"
140 echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
143 WIN32_OPENGL=opengl32
146 if test -f `pwd`/Win32/${WIN32_GLUT}.dll; then
147 echo " found ${WIN32_GLUT}.dll, adding -l${WIN32_GLUT}"
148 LIBS="$LIBS -l${WIN32_GLUT}"
150 echo " Cannot find ${WIN32_GLUT}.dll"
154 if test -f `pwd`/Win32/${WIN32_GLU}.dll; then
155 echo " found ${WIN32_GLU}.dll"
157 echo " Can't find ${WIN32_GLU}.dll, assuming it's someplace"
159 echo " adding -l${WIN32_GLU}"
160 LIBS="$LIBS -l${WIN32_GLU}"
162 if test -f `pwd`/Win32/${WIN32_OPENGL}.dll; then
163 echo " found ${WIN32_OPENGL}.dll"
165 echo " Can't find ${WIN32_OPENGL}.dll, assuming it's somplace"
167 echo " adding -l${WIN32_OPENGL}"
168 LIBS="$LIBS -l${WIN32_OPENGL}"
170 echo " adding -luser32 -lgdi32"
171 LIBS="$LIBS -luser32 -lgdi32"
172 ac_cv_lib_glut_glutGetModifiers="yes"
175 dnl Checks for header files.
178 fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
179 unistd.h windows.h winbase.h values.h )
181 dnl Checks for typedefs, structures, and compiler characteristics.
187 dnl Checks for library functions.
190 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
191 setitimer getitimer signal GetLocalTime rint )
193 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
195 echo "Unable to find the necessary OpenGL or GLUT libraries."
196 echo "See config.log for automated test details and results ..."
200 AM_CONFIG_HEADER(Include/config.h)
207 Lib/Audio/src/Makefile \
208 Lib/Audio/example/Makefile \
209 Lib/Bucket/Makefile \
217 Simulator/Aircraft/Makefile \
218 Simulator/Astro/Makefile \
219 Simulator/Autopilot/Makefile \
220 Simulator/Cockpit/Makefile \
221 Simulator/Controls/Makefile \
222 Simulator/Flight/LaRCsim/Makefile \
223 Simulator/Flight/Slew/Makefile \
224 Simulator/Flight/Makefile \
225 Simulator/GUI/Makefile \
226 Simulator/Joystick/Makefile \
227 Simulator/Main/Makefile \
228 Simulator/Main/runfg \
229 Simulator/Main/runfg.bat \
231 Simulator/Scenery/Makefile \
232 Simulator/Time/Makefile \
233 Simulator/Weather/Makefile \
235 Tools/Areas/Makefile \
236 Tools/AssemTris/Makefile \
237 Tools/Dem2node/Makefile \
238 Tools/DemInfo/Makefile \
239 Tools/DemRaw2ascii/Makefile \
240 Tools/FixNode/Makefile \
241 Tools/FixObj/Makefile \
242 Tools/SplitTris/Makefile \
243 Tools/Stripe_w/Makefile \
244 Tools/Tri2obj/Makefile \
245 Tools/Triangle/Makefile \
249 AC_OUTPUT_COMMANDS([chmod 755 Simulator/Main/runfg])