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.50)
10 dnl Checks for programs.
17 dnl Initialize libtool
20 dnl Initialize 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(HAVE_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(HAVE_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 AC_CHECK_LIB(GLU, gluLookAt)
97 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
98 dnl if no GLU, check for MesaGLU
99 AC_CHECK_LIB(MesaGLU, gluLookAt)
102 AC_CHECK_LIB(glut, glutGetModifiers)
104 dnl Win32 is a little wierd because it has to try to handle the various
105 dnl winbloze-isms. We'll just do this manually for now.
106 if test "x$ac_cv_header_windows_h" = "xyes" ; then
107 echo Win32 specific hacks...
110 dnl Note, the double square brackets are required becuase single brackets
111 dnl seem to get stripped out
112 if [[ -f `pwd`/Win32/glut.dll ]]; then
113 echo " found glut.dll, adding -lglut"
116 echo " Cannot find glut.dll"
119 if [[ -f `pwd`/Win32/glu.dll ]]; then
120 echo " found glu.dll"
122 echo " Can't find glu.dll, assuming it's someplace"
126 if [[ -f `pwd`/Win32/opengl.dll ]]; then
127 echo " found opengl.dll"
129 echo " Can't find opengl.dll, assuming it's somplace"
131 echo " adding -lopengl"
132 LIBS="$LIBS -lopengl"
133 echo " adding -luser32 -lgdi32"
134 LIBS="$LIBS -luser32 -lgdi32"
135 ac_cv_lib_glut_glutGetModifiers="yes"
138 dnl Checks for header files.
140 AC_CHECK_HEADERS( fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
141 unistd.h windows.h winbase.h values.h )
143 dnl Checks for typedefs, structures, and compiler characteristics.
149 dnl Checks for library functions.
152 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
153 setitimer getitimer signal GetLocalTime rint )
155 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
157 echo "Unable to find the necessary GL libraries."
161 AM_CONFIG_HEADER(Include/config.h)
168 Lib/Audio/src/Makefile \
169 Lib/Audio/example/Makefile \
170 Lib/Bucket/Makefile \
178 Simulator/Aircraft/Makefile \
179 Simulator/Astro/Makefile \
180 Simulator/Autopilot/Makefile \
181 Simulator/Cockpit/Makefile \
182 Simulator/Controls/Makefile \
183 Simulator/Flight/LaRCsim/Makefile \
184 Simulator/Flight/Slew/Makefile \
185 Simulator/Flight/Makefile \
186 Simulator/GUI/Makefile \
187 Simulator/Joystick/Makefile \
188 Simulator/Main/Makefile \
189 Simulator/Main/runfg \
190 Simulator/Main/runfg.bat \
192 Simulator/Scenery/Makefile \
193 Simulator/Time/Makefile \
194 Simulator/Weather/Makefile \
196 Tools/Areas/Makefile \
197 Tools/AssemTris/Makefile \
198 Tools/Dem2node/Makefile \
199 Tools/DemInfo/Makefile \
200 Tools/DemRaw2ascii/Makefile \
201 Tools/FixNode/Makefile \
202 Tools/FixObj/Makefile \
203 Tools/SplitTris/Makefile \
204 Tools/Stripe_w/Makefile \
205 Tools/Tri2obj/Makefile \
206 Tools/Triangle/Makefile \