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