]> git.mxchange.org Git - flightgear.git/blob - configure.in
Added some additional checks for memory.h, bcopy, and memcopy.
[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.57)
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 /opt/X11R6"
99
100 if test "x$ac_cv_header_windows_h" = "xyes" ; then
101     EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
102 # elif test `uname -s` = "SunOS" ; then
103 #   EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
104 fi
105 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
106
107 dnl Check for X11 (fancy)
108 AC_PATH_XTRA
109
110 dnl Checks for libraries.
111
112 null_LIBS="$LIBS"
113
114 AC_CHECK_LIB(m, cos)
115
116 base_LIBS="$LIBS"
117
118 # AC_CHECK_LIB(socket, socket)
119 AC_CHECK_LIB(X11, XCreateWindow)
120 AC_CHECK_LIB(Xext, XShmCreateImage)
121 AC_CHECK_LIB(Xi, XGetExtensionVersion)
122 AC_CHECK_LIB(ICE, IceOpenConnection)
123 AC_CHECK_LIB(SM, SmcOpenConnection)
124 AC_CHECK_LIB(Xt, XtMalloc)
125 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
126
127 dnl check for OpenGL related libraries
128
129 if test "x$ac_cv_header_windows_h" != "xyes" ; then
130     dnl Reasonable stuff non-windoze variants ... :-)
131
132     AC_CHECK_LIB(GLcore, glNewList)
133     if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
134         dnl if no GLcore, check for GL
135         AC_CHECK_LIB(GL, glNewList)
136         if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
137             dnl if no GL, check for MesaGL
138             AC_CHECK_LIB(MesaGL, glNewList)
139         fi
140     else
141         dnl if GLcore found, then also check for GL
142         AC_CHECK_LIB(GL, glXCreateContext)
143     fi
144
145     dnl if using mesa, check for xmesa.h
146     if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
147         AC_CHECK_HEADER(GL/xmesa.h)
148         AM_CONDITIONAL(ENABLE_XMESA_FX, \
149                        test "x$ac_cv_header_GL_xmesa_h" = "xyes")
150     else
151         dnl force a failed check
152         AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
153     fi
154
155     AC_CHECK_LIB(GLU, gluLookAt)
156     if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
157         dnl if no GLU, check for MesaGLU
158         AC_CHECK_LIB(MesaGLU, gluLookAt)
159     fi
160
161     dnl check for glut
162     AC_CHECK_LIB(glut, glutGetModifiers)
163
164     dnl test for glutGameModeString, but avoid adding glut a second time into
165     dnl the list of libraries
166     save_LIBS="$LIBS"
167     AC_CHECK_LIB(glut, glutGameModeString)
168     LIBS="$save_LIBS"
169 else
170     dnl Win32 is a little wierd because it has to try to handle the various
171     dnl winbloze-isms.  We'll just do this manually for now.
172
173     echo Win32 specific hacks...
174     AC_DEFINE(WIN32)
175
176     dnl force a failed check since we will be building under windoze
177     AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
178
179     if test "x$with_sgi_opengl" = "xyes" ; then
180         echo "Building with glut.dll, glu.dll, and opengl.dll"
181         WIN32_GLUT=glut
182         WIN32_GLU=glu
183         WIN32_OPENGL=opengl
184     else 
185         echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
186         WIN32_GLUT=glut32
187         WIN32_GLU=glu32
188         WIN32_OPENGL=opengl32
189     fi
190
191     if test -f `pwd`/Win32/${WIN32_GLUT}.dll; then
192         echo "    found ${WIN32_GLUT}.dll, adding -l${WIN32_GLUT}"
193         LIBS="$LIBS -l${WIN32_GLUT}"
194     else
195         echo "    Cannot find ${WIN32_GLUT}.dll"
196         exit 1
197     fi
198
199     if test -f `pwd`/Win32/${WIN32_GLU}.dll; then
200         echo "    found ${WIN32_GLU}.dll"
201     else
202         echo "    Can't find ${WIN32_GLU}.dll, assuming it's someplace"
203     fi
204     echo "    adding -l${WIN32_GLU}"
205     LIBS="$LIBS -l${WIN32_GLU}"
206
207     if test -f `pwd`/Win32/${WIN32_OPENGL}.dll; then
208         echo "    found ${WIN32_OPENGL}.dll"
209     else
210         echo "    Can't find ${WIN32_OPENGL}.dll, assuming it's somplace"
211     fi
212     echo "    adding -l${WIN32_OPENGL}"
213     LIBS="$LIBS -l${WIN32_OPENGL}"
214
215     echo "    adding -luser32 -lgdi32"
216     LIBS="$LIBS -luser32 -lgdi32"
217     ac_cv_lib_glut_glutGetModifiers="yes"
218     ac_cv_lib_glut_glutGameModeString="yes"
219 fi
220
221 opengl_LIBS="$LIBS"
222 LIBS="$base_LIBS"
223
224 AC_SUBST(base_LIBS)
225 AC_SUBST(opengl_LIBS)
226
227
228 dnl Checks for header files.
229 AC_HEADER_STDC
230 AC_CHECK_HEADERS( \
231         fcntl.h getopt.h malloc.h memory.h stdlib.h sys/time.h sys/timeb.h \
232         unistd.h windows.h winbase.h values.h )
233
234 dnl Checks for typedefs, structures, and compiler characteristics.
235 AC_C_CONST
236 AC_TYPE_SIZE_T
237 AC_HEADER_TIME
238 AC_STRUCT_TM
239
240 dnl Checks for library functions.
241 AC_TYPE_SIGNAL
242 AC_FUNC_VPRINTF
243 AC_CHECK_FUNCS( ftime gettimeofday memcpy bcopy mktime strstr rand random \
244         setitimer getitimer signal GetLocalTime rint getrusage )
245
246 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
247     echo 
248     echo "Unable to find the necessary OpenGL or GLUT libraries."
249     echo "See config.log for automated test details and results ..."
250     exit 1
251 fi
252
253 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
254     echo
255     echo "Your version of glut doesn't support game mode."
256     echo "You need to fetch and install the latest version of glut from:"
257     echo
258     echo "    http://reality.sgi.com/opengl/glut3/glut3.html"
259     exit 1
260 fi
261
262 AM_CONFIG_HEADER(Include/config.h)
263
264 AC_OUTPUT( \
265         Makefile \
266         Include/Makefile \
267         Lib/Makefile \
268         Lib/Audio/Makefile \
269         Lib/Audio/src/Makefile \
270         Lib/Audio/example/Makefile \
271         Lib/Bucket/Makefile \
272         Lib/Debug/Makefile \
273         Lib/DEM/Makefile \
274         Lib/gpc/Makefile \
275         Lib/Math/Makefile \
276         Lib/Misc/Makefile \
277         Lib/PUI/Makefile \
278         Lib/Serial/Makefile \
279         Lib/XGL/Makefile \
280         Lib/zlib/Makefile \
281         Simulator/Makefile \
282         Simulator/Aircraft/Makefile \
283         Simulator/Airports/Makefile \
284         Simulator/Astro/Makefile \
285         Simulator/Autopilot/Makefile \
286         Simulator/Cockpit/Makefile \
287         Simulator/Controls/Makefile \
288         Simulator/Flight/External/Makefile \
289         Simulator/Flight/LaRCsim/Makefile \
290         Simulator/Flight/Slew/Makefile \
291         Simulator/Flight/Makefile \
292         Simulator/GUI/Makefile \
293         Simulator/Joystick/Makefile \
294         Simulator/Main/Makefile \
295         Simulator/Main/runfgfs \
296         Simulator/Main/runfgfs.bat \
297         Simulator/Makefile \
298         Simulator/Objects/Makefile \
299         Simulator/Scenery/Makefile \
300         Simulator/Time/Makefile \
301         Simulator/Weather/Makefile \
302         Tools/Makefile \
303         Tools/Areas/Makefile \
304         Tools/AssemTris/Makefile \
305         Tools/Dem2node/Makefile \
306         Tools/DemInfo/Makefile \
307         Tools/DemRaw2ascii/Makefile \
308         Tools/FixNode/Makefile \
309         Tools/FixObj/Makefile \
310         Tools/GenAirports/Makefile \
311         Tools/Makedir/Makefile \
312         Tools/SplitTris/Makefile \
313         Tools/Stripe_w/Makefile \
314         Tools/Tri2obj/Makefile \
315         Tools/Triangle/Makefile \
316         Tests/Makefile \
317 )
318
319 AC_OUTPUT_COMMANDS([chmod 755 Simulator/Main/runfgfs])
320