]> git.mxchange.org Git - flightgear.git/blob - configure.in
Disable maintainer mode (what ever that does.)
[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 AC_INIT(Simulator/Aircraft/aircraft.c)
6
7 dnl Initialize the automake stuff
8 AM_INIT_AUTOMAKE(FlightGear, 0.52)
9
10 dnl Checks for programs.
11
12 AC_PROG_MAKE_SET
13 AC_PROG_CC
14 AC_PROG_CXX
15 AC_PROG_INSTALL
16 AC_PROG_LN_S
17 dnl Initialize libtool
18 AM_PROG_LIBTOOL
19
20 dnl Initialize maintainer mode (I'm not sure what this does)
21 dnl AM_MAINTAINER_MODE
22
23 dnl This is needed for AC_TRY_COMPILE later
24 AC_ISC_POSIX
25
26 dnl Check to see if this `configure' is being run in the `Cygwin32' environment
27 dnl AM_CYGWIN32
28
29 dnl Check for MS Windows environment
30 AC_CHECK_HEADER(windows.h)
31
32 dnl Using AM_CONDITIONAL is a step out of the protected little 
33 dnl automake fold so it is potentially dangerous.  But, we are
34 dnl beginning to run into cases where the standard checks are not
35 dnl enough.  AM_CONDITIONALS are then referenced to conditionally
36 dnl build a Makefile.in from a Makefile.am which lets us define custom
37 dnl includes, compile alternative source files, etc.
38
39 dnl Check for external variables daylight and timezone.
40 AC_EXT_DAYLIGHT
41 AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes )
42
43 AC_EXT_TIMEZONE
44 AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes )
45
46 dnl Check for Linux style audio support
47 AM_CONDITIONAL(ENABLE_AUDIO_SUPPORT, \
48         test -r /usr/include/soundcard.h \
49                 -o -r /usr/include/linux/soundcard.h \
50                 -o -r /usr/include/machine/soundcard.h \
51                 -o "x$ac_cv_header_windows_h" = "xyes" )
52
53 AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
54
55 dnl extra library and include directories
56 EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6"
57
58 if test "x$ac_cv_header_windows_h" = "xyes" ; then
59     EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
60 # elif test `uname -s` = "SunOS" ; then
61 #   EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
62 fi
63 wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
64
65 dnl Check for X11 (fancy)
66 AC_PATH_XTRA
67
68 dnl Checks for libraries.
69
70 AC_CHECK_LIB(m, cos)
71 AC_CHECK_LIB(socket, socket)
72 AC_CHECK_LIB(X11, XCreateWindow)
73 AC_CHECK_LIB(Xext, XShmCreateImage)
74 AC_CHECK_LIB(Xi, XGetExtensionVersion)
75 AC_CHECK_LIB(ICE, IceOpenConnection)
76 AC_CHECK_LIB(SM, SmcOpenConnection)
77 AC_CHECK_LIB(Xt, XtMalloc)
78 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
79
80 # dnl Solaris OpenGL pain
81 # AC_CHECK_LIB(eprintf, __eprintf)
82
83 AC_CHECK_LIB(GLcore, glNewList)
84 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
85     dnl if no GLcore, check for GL
86     AC_CHECK_LIB(GL, glNewList)
87     if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
88         dnl if no GL, check for MesaGL
89         AC_CHECK_LIB(MesaGL, glNewList)
90     fi
91 else
92     dnl if GLcore found, then also check for GL
93     AC_CHECK_LIB(GL, glXCreateContext)
94 fi
95
96 dnl if using mesa, check for xmesa.h
97 if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
98     AC_CHECK_HEADER(GL/xmesa.h)
99     AM_CONDITIONAL(ENABLE_XMESA_FX, test "x$ac_cv_header_GL_xmesa_h" = "xyes")
100 else
101     dnl force a failed check
102     AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
103 fi
104
105 AC_CHECK_LIB(GLU, gluLookAt)
106 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
107     dnl if no GLU, check for MesaGLU
108     AC_CHECK_LIB(MesaGLU, gluLookAt)
109 fi
110
111 AC_CHECK_LIB(glut, glutGetModifiers)
112         
113 dnl Win32 is a little wierd because it has to try to handle the various
114 dnl winbloze-isms.  We'll just do this manually for now.
115 if test "x$ac_cv_header_windows_h" = "xyes" ; then
116     echo Win32 specific hacks...
117     AC_DEFINE(WIN32)
118
119     dnl Note, the double square brackets are required becuase single brackets
120     dnl seem to get stripped out
121     if [[ -f `pwd`/Win32/glut.dll ]]; then
122         echo "    found glut.dll, adding -lglut"
123         LIBS="$LIBS -lglut"
124     else
125         echo "    Cannot find glut.dll"
126         exit 1
127     fi
128     if [[ -f `pwd`/Win32/glu.dll ]]; then
129         echo "    found glu.dll"
130     else
131         echo "    Can't find glu.dll, assuming it's someplace"
132     fi
133     echo "    adding -lglu"
134     LIBS="$LIBS -lglu"
135     if [[ -f `pwd`/Win32/opengl.dll ]]; then
136         echo "    found opengl.dll"
137     else
138         echo "    Can't find opengl.dll, assuming it's somplace"
139     fi
140     echo "    adding -lopengl"
141     LIBS="$LIBS -lopengl"
142     echo "    adding -luser32 -lgdi32"
143     LIBS="$LIBS -luser32 -lgdi32"
144     ac_cv_lib_glut_glutGetModifiers="yes"
145 fi
146
147 dnl Checks for header files.
148 AC_HEADER_STDC
149 AC_CHECK_HEADERS( \
150         fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
151         unistd.h windows.h winbase.h values.h )
152
153 dnl Checks for typedefs, structures, and compiler characteristics.
154 AC_C_CONST
155 AC_TYPE_SIZE_T
156 AC_HEADER_TIME
157 AC_STRUCT_TM
158
159 dnl Checks for library functions.
160 AC_TYPE_SIGNAL
161 AC_FUNC_VPRINTF
162 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
163         setitimer getitimer signal GetLocalTime rint )
164
165 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
166     echo 
167     echo "Unable to find the necessary GL libraries."
168     exit 1
169 fi
170
171 AM_CONFIG_HEADER(Include/config.h)
172
173 AC_OUTPUT( \
174         Makefile \
175         Include/Makefile \
176         Lib/Makefile \
177         Lib/Audio/Makefile \
178         Lib/Audio/src/Makefile \
179         Lib/Audio/example/Makefile \
180         Lib/Bucket/Makefile \
181         Lib/Debug/Makefile \
182         Lib/DEM/Makefile \
183         Lib/Math/Makefile \
184         Lib/PUI/Makefile \
185         Lib/XGL/Makefile \
186         Lib/zlib/Makefile \
187         Simulator/Makefile \
188         Simulator/Aircraft/Makefile \
189         Simulator/Astro/Makefile \
190         Simulator/Autopilot/Makefile \
191         Simulator/Cockpit/Makefile \
192         Simulator/Controls/Makefile \
193         Simulator/Flight/LaRCsim/Makefile \
194         Simulator/Flight/Slew/Makefile \
195         Simulator/Flight/Makefile \
196         Simulator/GUI/Makefile \
197         Simulator/Joystick/Makefile \
198         Simulator/Main/Makefile \
199         Simulator/Main/runfg \
200         Simulator/Main/runfg.bat \
201         Simulator/Makefile \
202         Simulator/Scenery/Makefile \
203         Simulator/Time/Makefile \
204         Simulator/Weather/Makefile \
205         Tools/Makefile \
206         Tools/Areas/Makefile \
207         Tools/AssemTris/Makefile \
208         Tools/Dem2node/Makefile \
209         Tools/DemInfo/Makefile \
210         Tools/DemRaw2ascii/Makefile \
211         Tools/FixNode/Makefile \
212         Tools/FixObj/Makefile \
213         Tools/SplitTris/Makefile \
214         Tools/Stripe_w/Makefile \
215         Tools/Tri2obj/Makefile \
216         Tools/Triangle/Makefile \
217         Tests/Makefile \
218 )