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]
5 AC_INIT(Simulator/Aircraft/aircraft.c)
7 dnl Initialize the automake stuff
8 AM_INIT_AUTOMAKE(FlightGear, 0.52)
10 dnl Checks for programs.
17 dnl Initialize libtool
20 dnl Initialize maintainer mode (I'm not sure what this does)
21 dnl AM_MAINTAINER_MODE
23 dnl This is needed for AC_TRY_COMPILE later
26 dnl Check to see if this `configure' is being run in the `Cygwin32' environment
29 dnl Check for MS Windows environment
30 AC_CHECK_HEADER(windows.h)
32 dnl Using AM_CONDITIONAL is a step out of the protected little
33 dnl automake fold so it is potentially dangerous. But, we are
34 dnl beginning to run into cases where the standard checks are not
35 dnl enough. AM_CONDITIONALS are then referenced to conditionally
36 dnl build a Makefile.in from a Makefile.am which lets us define custom
37 dnl includes, compile alternative source files, etc.
39 dnl Check for external variables daylight and timezone.
41 AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes )
44 AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes )
46 dnl Check for Linux style audio support
47 AM_CONDITIONAL(ENABLE_AUDIO_SUPPORT, \
48 test -r /usr/include/soundcard.h \
49 -o -r /usr/include/linux/soundcard.h \
50 -o -r /usr/include/machine/soundcard.h \
51 -o "x$ac_cv_header_windows_h" = "xyes" )
53 AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
55 dnl extra library and include directories
56 EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6"
58 if test "x$ac_cv_header_windows_h" = "xyes" ; then
59 EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
60 # elif test `uname -s` = "SunOS" ; then
61 # EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
63 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
65 dnl Check for X11 (fancy)
68 dnl Checks for libraries.
71 AC_CHECK_LIB(socket, socket)
72 AC_CHECK_LIB(X11, XCreateWindow)
73 AC_CHECK_LIB(Xext, XShmCreateImage)
74 AC_CHECK_LIB(Xi, XGetExtensionVersion)
75 AC_CHECK_LIB(ICE, IceOpenConnection)
76 AC_CHECK_LIB(SM, SmcOpenConnection)
77 AC_CHECK_LIB(Xt, XtMalloc)
78 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
80 # dnl Solaris OpenGL pain
81 # AC_CHECK_LIB(eprintf, __eprintf)
83 AC_CHECK_LIB(GLcore, glNewList)
84 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
85 dnl if no GLcore, check for GL
86 AC_CHECK_LIB(GL, glNewList)
87 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
88 dnl if no GL, check for MesaGL
89 AC_CHECK_LIB(MesaGL, glNewList)
92 dnl if GLcore found, then also check for GL
93 AC_CHECK_LIB(GL, glXCreateContext)
96 dnl if using mesa, check for xmesa.h
97 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
98 AC_CHECK_HEADER(GL/xmesa.h)
99 AM_CONDITIONAL(ENABLE_XMESA_FX, test "x$ac_cv_header_GL_xmesa_h" = "xyes")
101 dnl force a failed check
102 AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
105 AC_CHECK_LIB(GLU, gluLookAt)
106 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
107 dnl if no GLU, check for MesaGLU
108 AC_CHECK_LIB(MesaGLU, gluLookAt)
111 AC_CHECK_LIB(glut, glutGetModifiers)
113 dnl Win32 is a little wierd because it has to try to handle the various
114 dnl winbloze-isms. We'll just do this manually for now.
115 if test "x$ac_cv_header_windows_h" = "xyes" ; then
116 echo Win32 specific hacks...
119 dnl Note, the double square brackets are required becuase single brackets
120 dnl seem to get stripped out
121 if [[ -f `pwd`/Win32/glut.dll ]]; then
122 echo " found glut.dll, adding -lglut"
125 echo " Cannot find glut.dll"
128 if [[ -f `pwd`/Win32/glu.dll ]]; then
129 echo " found glu.dll"
131 echo " Can't find glu.dll, assuming it's someplace"
135 if [[ -f `pwd`/Win32/opengl.dll ]]; then
136 echo " found opengl.dll"
138 echo " Can't find opengl.dll, assuming it's somplace"
140 echo " adding -lopengl"
141 LIBS="$LIBS -lopengl"
142 echo " adding -luser32 -lgdi32"
143 LIBS="$LIBS -luser32 -lgdi32"
144 ac_cv_lib_glut_glutGetModifiers="yes"
147 dnl Checks for header files.
150 fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
151 unistd.h windows.h winbase.h values.h )
153 dnl Checks for typedefs, structures, and compiler characteristics.
159 dnl Checks for library functions.
162 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
163 setitimer getitimer signal GetLocalTime rint )
165 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
167 echo "Unable to find the necessary GL libraries."
171 AM_CONFIG_HEADER(Include/config.h)
178 Lib/Audio/src/Makefile \
179 Lib/Audio/example/Makefile \
180 Lib/Bucket/Makefile \
188 Simulator/Aircraft/Makefile \
189 Simulator/Astro/Makefile \
190 Simulator/Autopilot/Makefile \
191 Simulator/Cockpit/Makefile \
192 Simulator/Controls/Makefile \
193 Simulator/Flight/LaRCsim/Makefile \
194 Simulator/Flight/Slew/Makefile \
195 Simulator/Flight/Makefile \
196 Simulator/GUI/Makefile \
197 Simulator/Joystick/Makefile \
198 Simulator/Main/Makefile \
199 Simulator/Main/runfg \
200 Simulator/Main/runfg.bat \
202 Simulator/Scenery/Makefile \
203 Simulator/Time/Makefile \
204 Simulator/Weather/Makefile \
206 Tools/Areas/Makefile \
207 Tools/AssemTris/Makefile \
208 Tools/Dem2node/Makefile \
209 Tools/DemInfo/Makefile \
210 Tools/DemRaw2ascii/Makefile \
211 Tools/FixNode/Makefile \
212 Tools/FixObj/Makefile \
213 Tools/SplitTris/Makefile \
214 Tools/Stripe_w/Makefile \
215 Tools/Tri2obj/Makefile \
216 Tools/Triangle/Makefile \