]> git.mxchange.org Git - flightgear.git/blob - configure.in
News updates ...
[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.50)
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
21 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(HAVE_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(HAVE_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 AC_CHECK_LIB(GLU, gluLookAt)
97 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
98     dnl if no GLU, check for MesaGLU
99     AC_CHECK_LIB(MesaGLU, gluLookAt)
100 fi
101
102 AC_CHECK_LIB(glut, glutGetModifiers)
103         
104 dnl Win32 is a little wierd because it has to try to handle the various
105 dnl winbloze-isms.  We'll just do this manually for now.
106 if test "x$ac_cv_header_windows_h" = "xyes" ; then
107     echo Win32 specific hacks...
108     AC_DEFINE(WIN32)
109
110     dnl Note, the double square brackets are required becuase single brackets
111     dnl seem to get stripped out
112     if [[ -f `pwd`/Win32/glut.dll ]]; then
113         echo "    found glut.dll, adding -lglut"
114         LIBS="$LIBS -lglut"
115     else
116         echo "    Cannot find glut.dll"
117         exit 1
118     fi
119     if [[ -f `pwd`/Win32/glu.dll ]]; then
120         echo "    found glu.dll"
121     else
122         echo "    Can't find glu.dll, assuming it's someplace"
123     fi
124     echo "    adding -lglu"
125     LIBS="$LIBS -lglu"
126     if [[ -f `pwd`/Win32/opengl.dll ]]; then
127         echo "    found opengl.dll"
128     else
129         echo "    Can't find opengl.dll, assuming it's somplace"
130     fi
131     echo "    adding -lopengl"
132     LIBS="$LIBS -lopengl"
133     echo "    adding -luser32 -lgdi32"
134     LIBS="$LIBS -luser32 -lgdi32"
135     ac_cv_lib_glut_glutGetModifiers="yes"
136 fi
137
138 dnl Checks for header files.
139 AC_HEADER_STDC
140 AC_CHECK_HEADERS( \
141         fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
142         unistd.h windows.h winbase.h values.h )
143
144 dnl Checks for typedefs, structures, and compiler characteristics.
145 AC_C_CONST
146 AC_TYPE_SIZE_T
147 AC_HEADER_TIME
148 AC_STRUCT_TM
149
150 dnl Checks for library functions.
151 AC_TYPE_SIGNAL
152 AC_FUNC_VPRINTF
153 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
154         setitimer getitimer signal GetLocalTime rint )
155
156 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
157     echo 
158     echo "Unable to find the necessary GL libraries."
159     exit 1
160 fi
161
162 AM_CONFIG_HEADER(Include/config.h)
163
164 AC_OUTPUT( \
165         Makefile \
166         Include/Makefile \
167         Lib/Makefile \
168         Lib/Audio/Makefile \
169         Lib/Audio/src/Makefile \
170         Lib/Audio/example/Makefile \
171         Lib/Bucket/Makefile \
172         Lib/Debug/Makefile \
173         Lib/DEM/Makefile \
174         Lib/Math/Makefile \
175         Lib/PUI/Makefile \
176         Lib/XGL/Makefile \
177         Lib/zlib/Makefile \
178         Simulator/Makefile \
179         Simulator/Aircraft/Makefile \
180         Simulator/Astro/Makefile \
181         Simulator/Autopilot/Makefile \
182         Simulator/Cockpit/Makefile \
183         Simulator/Controls/Makefile \
184         Simulator/Flight/LaRCsim/Makefile \
185         Simulator/Flight/Slew/Makefile \
186         Simulator/Flight/Makefile \
187         Simulator/GUI/Makefile \
188         Simulator/Joystick/Makefile \
189         Simulator/Main/Makefile \
190         Simulator/Main/runfg \
191         Simulator/Main/runfg.bat \
192         Simulator/Makefile \
193         Simulator/Scenery/Makefile \
194         Simulator/Time/Makefile \
195         Simulator/Weather/Makefile \
196         Tools/Makefile \
197         Tools/Areas/Makefile \
198         Tools/AssemTris/Makefile \
199         Tools/Dem2node/Makefile \
200         Tools/DemInfo/Makefile \
201         Tools/DemRaw2ascii/Makefile \
202         Tools/FixNode/Makefile \
203         Tools/FixObj/Makefile \
204         Tools/SplitTris/Makefile \
205         Tools/Stripe_w/Makefile \
206         Tools/Tri2obj/Makefile \
207         Tools/Triangle/Makefile \
208         Tests/Makefile \
209 )