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