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