]> git.mxchange.org Git - flightgear.git/blob - configure.in
Version 0.6.0
[flightgear.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 dnl The basis for this file was generated by autoscan(1) [pere 1998-03-19]
4 dnl
5
6 AC_INIT(Simulator/Aircraft/aircraft.cxx)
7
8 dnl Initialize the automake stuff
9 AM_INIT_AUTOMAKE(FlightGear, 0.6.0)
10
11 dnl Checks for programs.
12 AC_PROG_MAKE_SET
13 AC_PROG_CC
14 AC_PROG_CXX
15 AC_PROG_RANLIB
16 AC_PROG_INSTALL
17 AC_PROG_LN_S
18
19 dnl Initialize libtool
20 dnl AM_PROG_LIBTOOL
21
22 dnl Initialize maintainer mode
23 dnl AM_MAINTAINER_MODE
24
25 dnl This is needed for AC_TRY_COMPILE later
26 dnl AC_ISC_POSIX
27
28 dnl Check to see if this `configure' is being run in the `Cygwin32' environment
29 dnl AM_CYGWIN32
30
31 dnl Specify if we want logging (testing build) or not (release build)
32 # set logging default value
33 # with_logging=yes
34 AC_ARG_WITH(logging, [  --with-logging          Include logging output (default)])
35 if test "x$with_logging" = "xno" ; then
36     AC_DEFINE(FG_NDEBUG)
37 fi
38
39
40 dnl specify if we are building with "checker"
41 AC_ARG_WITH(efence, [  --with-efence           Specify if we are building with "electric-fence"])
42
43 if test "x$with_efence" = "xyes" ; then
44     echo "Building with efence"
45     LIBS= "$LIBS -lefence"
46 fi
47
48 dnl specify the compiled flight model
49 AC_ARG_WITH(flight-model, [  --with-flight-model=xxx Specify the flight model (navion, cherokee)])
50
51 if test "x$with_flight_model" = "xcherokee" ; then
52     echo "Building with cherokee flight model"
53 else 
54     echo "Building with navion flight model"
55 fi
56 AM_CONDITIONAL(ENABLE_CHEROKEE, test "x$with_flight_model" = "xcherokee")
57
58 dnl Let the Win32 user specify if they want to build with the SGI
59 dnl opengl.dll as opposed to the more standard openg32.dll
60 AC_ARG_WITH(sgi-opengl, [  --with-sgi-opengl       Build against SGI's opengl.dll glu.dll and glut.dll])
61
62 dnl Check for MS Windows environment
63 AC_CHECK_HEADER(windows.h)
64
65 dnl Using AM_CONDITIONAL is a step out of the protected little 
66 dnl automake fold so it is potentially dangerous.  But, we are
67 dnl beginning to run into cases where the standard checks are not
68 dnl enough.  AM_CONDITIONALS are then referenced to conditionally
69 dnl build a Makefile.in from a Makefile.am which lets us define custom
70 dnl includes, compile alternative source files, etc.
71
72 dnl Check for external variables daylight and timezone.
73 AC_EXT_DAYLIGHT
74 AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes )
75
76 AC_EXT_TIMEZONE
77 AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes )
78
79 dnl Check for Linux style audio support
80 AM_CONDITIONAL(ENABLE_AUDIO_SUPPORT, \
81         test -r /usr/include/soundcard.h \
82                 -o -r /usr/include/linux/soundcard.h \
83                 -o -r /usr/include/machine/soundcard.h \
84                 -o -r /usr/include/audio.h \
85                 -o "x$ac_cv_header_windows_h" = "xyes" )
86
87 AM_CONDITIONAL(ENABLE_IRIX_AUDIO, test -r /usr/include/audio.h)
88
89 AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
90
91 dnl Check for (currently Linux only style) joystick support
92 AM_CONDITIONAL(ENABLE_LINUX_JOYSTICK, test -r /usr/include/linux/joystick.h )
93
94 dnl Enable serial support on Unix type systems
95 AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
96
97 dnl extra library and include directories
98 EXTRA_DIRS="/usr/local /usr/X11R6"
99
100 if test -d /opt/X11R6 ; then
101      EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
102 fi
103
104 if test "x$ac_cv_header_windows_h" = "xyes" ; then
105     EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
106 # elif test `uname -s` = "SunOS" ; then
107 #   EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
108 fi
109 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
110
111 dnl Check for X11 (fancy)
112 AC_PATH_XTRA
113
114 dnl Checks for libraries.
115
116 null_LIBS="$LIBS"
117
118 AC_CHECK_LIB(m, cos)
119
120 base_LIBS="$LIBS"
121
122 AC_CHECK_LIB(socket, socket)
123 AC_CHECK_LIB(X11, XCreateWindow)
124 AC_CHECK_LIB(Xext, XShmCreateImage)
125 AC_CHECK_LIB(Xi, XGetExtensionVersion)
126 AC_CHECK_LIB(ICE, IceOpenConnection)
127 AC_CHECK_LIB(SM, SmcOpenConnection)
128 AC_CHECK_LIB(Xt, XtMalloc)
129 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
130
131 dnl check for OpenGL related libraries
132
133 if test "x$ac_cv_header_windows_h" != "xyes" ; then
134     dnl Reasonable stuff non-windoze variants ... :-)
135
136     AC_CHECK_LIB(GLcore, glNewList)
137     if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
138         dnl if no GLcore, check for GL
139         AC_CHECK_LIB(GL, glNewList)
140         if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
141             dnl if no GL, check for MesaGL
142             AC_CHECK_LIB(MesaGL, glNewList)
143         fi
144     else
145         dnl if GLcore found, then also check for GL
146         AC_CHECK_LIB(GL, glXCreateContext)
147     fi
148
149     dnl if using mesa, check for xmesa.h
150     if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
151         AC_CHECK_HEADER(GL/xmesa.h)
152         AM_CONDITIONAL(ENABLE_XMESA_FX, \
153                        test "x$ac_cv_header_GL_xmesa_h" = "xyes")
154     else
155         dnl force a failed check
156         AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
157     fi
158
159     AC_CHECK_LIB(GLU, gluLookAt)
160     if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
161         dnl if no GLU, check for MesaGLU
162         AC_CHECK_LIB(MesaGLU, gluLookAt)
163     fi
164
165     dnl check for glut
166     AC_CHECK_LIB(glut, glutGetModifiers)
167
168     dnl test for glutGameModeString, but avoid adding glut a second time into
169     dnl the list of libraries
170     save_LIBS="$LIBS"
171     AC_CHECK_LIB(glut, glutGameModeString)
172     LIBS="$save_LIBS"
173 else
174     dnl Win32 is a little wierd because it has to try to handle the various
175     dnl winbloze-isms.  We'll just do this manually for now.
176
177     echo Win32 specific hacks...
178     AC_DEFINE(WIN32)
179
180     dnl force a failed check since we will be building under windoze
181     AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
182
183     if test "x$with_sgi_opengl" = "xyes" ; then
184         echo "Building with glut.dll, glu.dll, and opengl.dll"
185         WIN32_GLUT=glut
186         WIN32_GLU=glu
187         WIN32_OPENGL=opengl
188     else 
189         echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
190         WIN32_GLUT=glut32
191         WIN32_GLU=glu32
192         WIN32_OPENGL=opengl32
193     fi
194
195     if test -f `pwd`/Win32/${WIN32_GLUT}.dll; then
196         echo "    found ${WIN32_GLUT}.dll, adding -l${WIN32_GLUT}"
197         LIBS="$LIBS -l${WIN32_GLUT}"
198     else
199         echo "    Cannot find ${WIN32_GLUT}.dll"
200         exit 1
201     fi
202
203     if test -f `pwd`/Win32/${WIN32_GLU}.dll; then
204         echo "    found ${WIN32_GLU}.dll"
205     else
206         echo "    Can't find ${WIN32_GLU}.dll, assuming it's someplace"
207     fi
208     echo "    adding -l${WIN32_GLU}"
209     LIBS="$LIBS -l${WIN32_GLU}"
210
211     if test -f `pwd`/Win32/${WIN32_OPENGL}.dll; then
212         echo "    found ${WIN32_OPENGL}.dll"
213     else
214         echo "    Can't find ${WIN32_OPENGL}.dll, assuming it's somplace"
215     fi
216     echo "    adding -l${WIN32_OPENGL}"
217     LIBS="$LIBS -l${WIN32_OPENGL}"
218
219     echo "    adding -luser32 -lgdi32"
220     LIBS="$LIBS -luser32 -lgdi32"
221     ac_cv_lib_glut_glutGetModifiers="yes"
222     ac_cv_lib_glut_glutGameModeString="yes"
223 fi
224
225 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
226     echo 
227     echo "Unable to find the necessary OpenGL or GLUT libraries."
228     echo "See config.log for automated test details and results ..."
229     exit 1
230 fi
231
232 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
233     echo
234     echo "Your version of glut doesn't support game mode."
235     echo "You need to fetch and install the latest version of glut from:"
236     echo
237     echo "    http://reality.sgi.com/opengl/glut3/glut3.html"
238     exit 1
239 fi
240
241 opengl_LIBS="$LIBS"
242 LIBS="$base_LIBS"
243
244 AC_SUBST(base_LIBS)
245 AC_SUBST(opengl_LIBS)
246
247
248 dnl Check if Generic Polygon Clipping library is installed
249 dnl (from http://www.cs.man.ac.uk/aig/staff/alan/software/)
250 AC_CHECK_HEADERS( gpc.h )
251 if test "x$ac_cv_header_gpc_h" != "xyes"; then
252     echo
253     echo "You need to have the GPC library installed on your system to build"
254     echo "some of the scenery generation tools, otherwise, they may fail."
255     echo
256     echo "You can get the library from:"
257     echo 
258     echo "    http://www.cs.man.ac.uk/aig/staff/alan/software/"
259     echo
260 fi
261
262 dnl Check if  Geographic Foundation Classes library is installed
263 dnl (from http://www.geog.psu.edu/~qian/gfc/index.html)
264 AC_CHECK_HEADERS( gfc/gdbf.h )
265 if test "x$ac_cv_header_gfc_gdbf_h" != "xyes"; then
266     echo
267     echo "You need to have the GFC library installed on your system to build"
268     echo "some of the scenery generation tools, otherwise, they may fail."
269     echo
270     echo "You can get the library from:"
271     echo 
272     echo "    http://www.geog.psu.edu/~qian/gfc/index.html"
273     echo
274 fi
275
276 dnl Checks for header files.
277 AC_HEADER_STDC
278 AC_CHECK_HEADERS( \
279         fcntl.h getopt.h malloc.h memory.h stdlib.h sys/stat.h sys/time.h \
280         sys/timeb.h unistd.h windows.h winbase.h values.h )
281
282 dnl Checks for typedefs, structures, and compiler characteristics.
283 AC_C_CONST
284 AC_TYPE_SIZE_T
285 AC_HEADER_TIME
286 AC_STRUCT_TM
287
288 dnl Checks for library functions.
289 AC_TYPE_SIGNAL
290 AC_FUNC_VPRINTF
291 AC_CHECK_FUNCS( ftime gettimeofday memcpy bcopy mktime strstr rand random \
292         setitimer getitimer signal GetLocalTime rint getrusage )
293
294 AM_CONFIG_HEADER(Include/config.h)
295
296 AC_OUTPUT( \
297         VERSION \
298         Makefile \
299         Include/Makefile \
300         Lib/Makefile \
301         Lib/Audio/Makefile \
302         Lib/Audio/src/Makefile \
303         Lib/Audio/example/Makefile \
304         Lib/Bucket/Makefile \
305         Lib/Debug/Makefile \
306         Lib/Math/Makefile \
307         Lib/Misc/Makefile \
308         Lib/PUI/Makefile \
309         Lib/Serial/Makefile \
310         Lib/XGL/Makefile \
311         Lib/zlib/Makefile \
312         Simulator/Makefile \
313         Simulator/Aircraft/Makefile \
314         Simulator/Airports/Makefile \
315         Simulator/Astro/Makefile \
316         Simulator/Autopilot/Makefile \
317         Simulator/Cockpit/Makefile \
318         Simulator/Controls/Makefile \
319         Simulator/FDM/External/Makefile \
320         Simulator/FDM/JSBsim/Makefile \
321         Simulator/FDM/LaRCsim/Makefile \
322         Simulator/FDM/Slew/Makefile \
323         Simulator/FDM/Makefile \
324         Simulator/GUI/Makefile \
325         Simulator/Joystick/Makefile \
326         Simulator/Main/Makefile \
327         Simulator/Main/runfgfs \
328         Simulator/Main/runfgfs.bat \
329         Simulator/Makefile \
330         Simulator/Objects/Makefile \
331         Simulator/Scenery/Makefile \
332         Simulator/Time/Makefile \
333         Simulator/Weather/Makefile \
334         Tools/Makefile \
335         Tools/Construct/Makefile \
336         Tools/Construct/Array/Makefile \
337         Tools/Construct/Clipper/Makefile \
338         Tools/Construct/Combine/Makefile \
339         Tools/Construct/GenOutput/Makefile \
340         Tools/Construct/Triangulate/Makefile \
341         Tools/Construct/Main/Makefile \
342         Tools/Lib/Makefile \
343         Tools/Lib/DEM/Makefile \
344         Tools/Lib/Polygon/Makefile \
345         Tools/Lib/Triangle/Makefile \
346         Tools/Prep/Makefile \
347         Tools/Prep/DemChop/Makefile \
348         Tools/Prep/DemInfo/Makefile \
349         Tools/Prep/DemRaw2ascii/Makefile \
350         Tools/Prep/GenAirports/Makefile \
351         Tools/Prep/ShapeFile/Makefile \
352         Tools/Utils/Makefile \
353         Tools/Utils/Makedir/Makefile \
354         Tools/Areas/Makefile \
355         Tools/AssemTris/Makefile \
356         Tools/FixObj/Makefile \
357         Tools/SplitTris/Makefile \
358         Tools/Stripe_w/Makefile \
359         Tools/Tri2obj/Makefile \
360         Tests/Makefile \
361 )
362
363 AC_OUTPUT_COMMANDS([chmod 755 Simulator/Main/runfgfs])
364