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.48)
10 dnl Checks for programs.
17 dnl Initialize libtool
20 dnl Initialize maintainer mode
23 dnl Check to see if this `configure' is being run in the `Cygwin32' environment
26 dnl Using AM_CONDITIONAL is a step out of the protected little
27 dnl automake fold so it is potentially dangerous. But, we are
28 dnl beginning to run into cases where the standard checks are not
29 dnl enough. AM_CONDITIONALS are then referenced to conditionally
30 dnl build a Makefile.in from a Makefile.am which lets us define custom
31 dnl includes, compile alternative source files, etc.
32 dnl Check for Linux style audio support
34 AM_CONDITIONAL(HAVE_DAYLIGHT, grep daylight /usr/include/time.h )
36 AM_CONDITIONAL(HAVE_TIMEZONE, grep timezone /usr/include/time.h )
38 AM_CONDITIONAL(HAVE_OSS_AUDIO, \
39 test -r /usr/include/soundcard.h -o -r /usr/include/linux/soundcard.h )
41 AC_CHECK_HEADER(windows.h)
43 dnl extra library and include directories
44 EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6"
46 if test "x$ac_cv_header_windows_h" = "xyes" ; then
47 EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
48 # elif test `uname -s` = "SunOS" ; then
49 # EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
51 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
53 dnl Check for X11 (fancy)
56 dnl Checks for libraries.
59 AC_CHECK_LIB(socket, socket)
60 AC_CHECK_LIB(X11, XCreateWindow)
61 AC_CHECK_LIB(Xext, XShmCreateImage)
62 AC_CHECK_LIB(Xi, XGetExtensionVersion)
63 AC_CHECK_LIB(ICE, IceOpenConnection)
64 AC_CHECK_LIB(SM, SmcOpenConnection)
65 AC_CHECK_LIB(Xt, XtMalloc)
66 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
68 # dnl Solaris OpenGL pain
69 # AC_CHECK_LIB(eprintf, __eprintf)
71 AC_CHECK_LIB(GLcore, glNewList)
72 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
73 dnl if no GLcore, check for GL
74 AC_CHECK_LIB(GL, glNewList)
75 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
76 dnl if no GL, check for MesaGL
77 AC_CHECK_LIB(MesaGL, glNewList)
80 dnl if GLcore found, then also check for GL
81 AC_CHECK_LIB(GL, glXCreateContext)
84 AC_CHECK_LIB(GLU, gluLookAt)
85 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
86 dnl if no GLU, check for MesaGLU
87 AC_CHECK_LIB(MesaGLU, gluLookAt)
90 AC_CHECK_LIB(glut, glutGetModifiers)
92 dnl Win32 is a little wierd because it has to try to handle the various
93 dnl winbloze-isms. We'll just do this manually for now.
94 if test "x$ac_cv_header_windows_h" = "xyes" ; then
95 echo Win32 specific hacks...
98 dnl Note, the double square brackets are required becuase single brackets
99 dnl seem to get stripped out
100 if [[ -f `pwd`/Win32/glut.dll ]]; then
101 echo " found glut.dll, adding -lglut"
104 echo " Cannot find glut.dll"
107 if [[ -f `pwd`/Win32/glu.dll ]]; then
108 echo " found glu.dll"
110 echo " Can't find glu.dll, assuming it's someplace"
114 if [[ -f `pwd`/Win32/opengl.dll ]]; then
115 echo " found opengl.dll"
117 echo " Can't find opengl.dll, assuming it's somplace"
119 echo " adding -lopengl"
120 LIBS="$LIBS -lopengl"
121 echo " adding -luser32 -lgdi32"
122 LIBS="$LIBS -luser32 -lgdi32"
123 ac_cv_lib_glut_glutGetModifiers="yes"
126 dnl Checks for header files.
128 AC_CHECK_HEADERS( fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
129 unistd.h windows.h winbase.h values.h )
131 dnl Checks for typedefs, structures, and compiler characteristics.
137 dnl Checks for library functions.
140 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
141 setitimer getitimer signal GetLocalTime rint )
143 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
145 echo "Unable to find the necessary GL libraries."
149 AM_CONFIG_HEADER(Include/config.h)
156 Lib/Bucket/Makefile \
163 Simulator/Aircraft/Makefile \
164 Simulator/Astro/Makefile \
165 Simulator/Autopilot/Makefile \
166 Simulator/Cockpit/Makefile \
167 Simulator/Controls/Makefile \
168 Simulator/Flight/LaRCsim/Makefile \
169 Simulator/Flight/Slew/Makefile \
170 Simulator/Flight/Makefile \
171 Simulator/Joystick/Makefile \
172 Simulator/Main/Makefile \
173 Simulator/Main/runfg \
174 Simulator/Main/runfg.bat \
176 Simulator/Scenery/Makefile \
177 Simulator/Time/Makefile \
178 Simulator/Weather/Makefile \
180 Tools/AssemTris/Makefile \
181 Tools/Dem2node/Makefile \
182 Tools/DemInfo/Makefile \
183 Tools/DemRaw2ascii/Makefile \
184 Tools/FixNode/Makefile \
185 Tools/FixObj/Makefile \
186 Tools/SplitTris/Makefile \
187 Tools/Stripe_u/Makefile \
188 Tools/Tri2obj/Makefile \
189 Tools/Triangle/Makefile \