]> git.mxchange.org Git - flightgear.git/blob - configure.in
...
[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.c)
7
8 dnl Initialize the automake stuff
9 AM_INIT_AUTOMAKE(FlightGear, 0.55)
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 are building with "checker"
32 AC_ARG_WITH(efence, [  --with-efence           Specify if we are building with "electric-fence"])
33
34 if test "x$with_efence" = "xyes" ; then
35     echo "Building with efence"
36     LIBS= "$LIBS -lefence"
37 fi
38
39 dnl specify the compiled flight model
40 AC_ARG_WITH(flight-model, [  --with-flight-model=xxx Specify the flight model (navion, cherokee)])
41
42 if test "x$with_flight_model" = "xcherokee" ; then
43     echo "Building with cherokee flight model"
44 else 
45     echo "Building with navion flight model"
46 fi
47 AM_CONDITIONAL(ENABLE_CHEROKEE, test "x$with_flight_model" = "xcherokee")
48
49 dnl Let the Win32 user specify if they want to build with the SGI
50 dnl opengl.dll as opposed to the more standard openg32.dll
51 AC_ARG_WITH(sgi-opengl, [  --with-sgi-opengl       Build against SGI's opengl.dll glu.dll and glut.dll])
52
53 dnl Check for MS Windows environment
54 AC_CHECK_HEADER(windows.h)
55
56 dnl Using AM_CONDITIONAL is a step out of the protected little 
57 dnl automake fold so it is potentially dangerous.  But, we are
58 dnl beginning to run into cases where the standard checks are not
59 dnl enough.  AM_CONDITIONALS are then referenced to conditionally
60 dnl build a Makefile.in from a Makefile.am which lets us define custom
61 dnl includes, compile alternative source files, etc.
62
63 dnl Check for external variables daylight and timezone.
64 AC_EXT_DAYLIGHT
65 AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes )
66
67 AC_EXT_TIMEZONE
68 AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes )
69
70 dnl Check for Linux style audio support
71 AM_CONDITIONAL(ENABLE_AUDIO_SUPPORT, \
72         test -r /usr/include/soundcard.h \
73                 -o -r /usr/include/linux/soundcard.h \
74                 -o -r /usr/include/machine/soundcard.h \
75                 -o -r /usr/include/audio.h \
76                 -o "x$ac_cv_header_windows_h" = "xyes" )
77
78 AM_CONDITIONAL(ENABLE_IRIX_AUDIO, test -r /usr/include/audio.h)
79
80 AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
81
82 dnl extra library and include directories
83 EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6"
84
85 if test "x$ac_cv_header_windows_h" = "xyes" ; then
86     EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
87 # elif test `uname -s` = "SunOS" ; then
88 #   EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
89 fi
90 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
91
92 dnl Check for X11 (fancy)
93 AC_PATH_XTRA
94
95 dnl Checks for libraries.
96
97 AC_CHECK_LIB(m, cos)
98 AC_CHECK_LIB(socket, socket)
99 AC_CHECK_LIB(X11, XCreateWindow)
100 AC_CHECK_LIB(Xext, XShmCreateImage)
101 AC_CHECK_LIB(Xi, XGetExtensionVersion)
102 AC_CHECK_LIB(ICE, IceOpenConnection)
103 AC_CHECK_LIB(SM, SmcOpenConnection)
104 AC_CHECK_LIB(Xt, XtMalloc)
105 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
106
107 dnl check for OpenGL related libraries
108
109 if test "x$ac_cv_header_windows_h" != "xyes" ; then
110     dnl Reasonable stuff non-windoze variants ... :-)
111
112     AC_CHECK_LIB(GLcore, glNewList)
113     if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
114         dnl if no GLcore, check for GL
115         AC_CHECK_LIB(GL, glNewList)
116         if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
117             dnl if no GL, check for MesaGL
118             AC_CHECK_LIB(MesaGL, glNewList)
119         fi
120     else
121         dnl if GLcore found, then also check for GL
122         AC_CHECK_LIB(GL, glXCreateContext)
123     fi
124
125     dnl if using mesa, check for xmesa.h
126     if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
127         AC_CHECK_HEADER(GL/xmesa.h)
128         AM_CONDITIONAL(ENABLE_XMESA_FX, \
129                        test "x$ac_cv_header_GL_xmesa_h" = "xyes")
130     else
131         dnl force a failed check
132         AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
133     fi
134
135     AC_CHECK_LIB(GLU, gluLookAt)
136     if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
137         dnl if no GLU, check for MesaGLU
138         AC_CHECK_LIB(MesaGLU, gluLookAt)
139     fi
140
141     dnl check for glut
142     AC_CHECK_LIB(glut, glutGetModifiers)
143
144     dnl test for glutGameModeString
145     AC_CHECK_LIB(glut, glutGameModeString)
146 else
147     dnl Win32 is a little wierd because it has to try to handle the various
148     dnl winbloze-isms.  We'll just do this manually for now.
149
150     echo Win32 specific hacks...
151     AC_DEFINE(WIN32)
152
153     dnl force a failed check since we will be building under windoze
154     AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
155
156     if test "x$with_sgi_opengl" = "xyes" ; then
157         echo "Building with glut.dll, glu.dll, and opengl.dll"
158         WIN32_GLUT=glut
159         WIN32_GLU=glu
160         WIN32_OPENGL=opengl
161     else 
162         echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
163         WIN32_GLUT=glut32
164         WIN32_GLU=glu32
165         WIN32_OPENGL=opengl32
166     fi
167
168     if test -f `pwd`/Win32/${WIN32_GLUT}.dll; then
169         echo "    found ${WIN32_GLUT}.dll, adding -l${WIN32_GLUT}"
170         LIBS="$LIBS -l${WIN32_GLUT}"
171     else
172         echo "    Cannot find ${WIN32_GLUT}.dll"
173         exit 1
174     fi
175
176     if test -f `pwd`/Win32/${WIN32_GLU}.dll; then
177         echo "    found ${WIN32_GLU}.dll"
178     else
179         echo "    Can't find ${WIN32_GLU}.dll, assuming it's someplace"
180     fi
181     echo "    adding -l${WIN32_GLU}"
182     LIBS="$LIBS -l${WIN32_GLU}"
183
184     if test -f `pwd`/Win32/${WIN32_OPENGL}.dll; then
185         echo "    found ${WIN32_OPENGL}.dll"
186     else
187         echo "    Can't find ${WIN32_OPENGL}.dll, assuming it's somplace"
188     fi
189     echo "    adding -l${WIN32_OPENGL}"
190     LIBS="$LIBS -l${WIN32_OPENGL}"
191
192     echo "    adding -luser32 -lgdi32"
193     LIBS="$LIBS -luser32 -lgdi32"
194     ac_cv_lib_glut_glutGetModifiers="yes"
195     ac_cv_lib_glut_glutGameModeString="yes"
196 fi
197
198 dnl Checks for header files.
199 AC_HEADER_STDC
200 AC_CHECK_HEADERS( \
201         fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
202         unistd.h windows.h winbase.h values.h )
203
204 dnl Checks for typedefs, structures, and compiler characteristics.
205 AC_C_CONST
206 AC_TYPE_SIZE_T
207 AC_HEADER_TIME
208 AC_STRUCT_TM
209
210 dnl Checks for library functions.
211 AC_TYPE_SIGNAL
212 AC_FUNC_VPRINTF
213 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
214         setitimer getitimer signal GetLocalTime rint getrusage )
215
216 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
217     echo 
218     echo "Unable to find the necessary OpenGL or GLUT libraries."
219     echo "See config.log for automated test details and results ..."
220     exit 1
221 fi
222
223 if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
224     echo
225     echo "Your version of glut doesn't support game mode."
226     echo "You need to fetch and install the latest version of glut from:"
227     echo
228     echo "    http://reality.sgi.com/opengl/glut3/glut3.html"
229     exit 1
230 fi
231
232 AM_CONFIG_HEADER(Include/config.h)
233
234 AC_OUTPUT( \
235         Makefile \
236         Include/Makefile \
237         Lib/Makefile \
238         Lib/Audio/Makefile \
239         Lib/Audio/src/Makefile \
240         Lib/Audio/example/Makefile \
241         Lib/Bucket/Makefile \
242         Lib/Debug/Makefile \
243         Lib/DEM/Makefile \
244         Lib/gpc/Makefile \
245         Lib/Math/Makefile \
246         Lib/Misc/Makefile \
247         Lib/PUI/Makefile \
248         Lib/XGL/Makefile \
249         Lib/zlib/Makefile \
250         Simulator/Makefile \
251         Simulator/Aircraft/Makefile \
252         Simulator/Airports/Makefile \
253         Simulator/Astro/Makefile \
254         Simulator/Autopilot/Makefile \
255         Simulator/Cockpit/Makefile \
256         Simulator/Controls/Makefile \
257         Simulator/Flight/LaRCsim/Makefile \
258         Simulator/Flight/Slew/Makefile \
259         Simulator/Flight/Makefile \
260         Simulator/GUI/Makefile \
261         Simulator/Joystick/Makefile \
262         Simulator/Main/Makefile \
263         Simulator/Main/runfgfs \
264         Simulator/Main/runfgfs.bat \
265         Simulator/Makefile \
266         Simulator/Objects/Makefile \
267         Simulator/Scenery/Makefile \
268         Simulator/Time/Makefile \
269         Simulator/Weather/Makefile \
270         Tools/Makefile \
271         Tools/Areas/Makefile \
272         Tools/AssemTris/Makefile \
273         Tools/Dem2node/Makefile \
274         Tools/DemInfo/Makefile \
275         Tools/DemRaw2ascii/Makefile \
276         Tools/FixNode/Makefile \
277         Tools/FixObj/Makefile \
278         Tools/GenAirports/Makefile \
279         Tools/SplitTris/Makefile \
280         Tools/Stripe_w/Makefile \
281         Tools/Tri2obj/Makefile \
282         Tools/Triangle/Makefile \
283         Tests/Makefile \
284 )
285
286 AC_OUTPUT_COMMANDS([chmod 755 Simulator/Main/runfgfs])