]> git.mxchange.org Git - flightgear.git/blob - configure.in
Minor cleanups and reorganizations.
[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.40)
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 extra library and include directories
27 if test "x$am_cv_cygwin32" = "xyes" ; then
28     wi_EXTRA_DIRS(no, /store /usr/local /local /user/local /usr/share \
29         /usr/X11R6 /opt/X11R6 `pwd`/Win32)
30 else
31     wi_EXTRA_DIRS(no, /store /usr/local /local /user/local /usr/share \
32         /usr/X11R6 /opt/X11R6)
33 fi
34
35 dnl Check for X11 (fancy)
36 AC_PATH_XTRA
37
38 dnl Checks for libraries.
39
40 AC_CHECK_LIB(m, cos)
41 AC_CHECK_LIB(socket, socket)
42 AC_CHECK_LIB(X11, XCreateWindow)
43 AC_CHECK_LIB(Xext, XShmCreateImage)
44 AC_CHECK_LIB(Xi, XGetExtensionVersion)
45 AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
46
47 AC_CHECK_LIB(GLcore, glNewList)
48 if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
49     dnl if no GLcore, check for GL
50     AC_CHECK_LIB(GL, glNewList)
51     if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
52         dnl if no GL, check for MesaGL
53         AC_CHECK_LIB(MesaGL, glNewList)
54     fi
55 else
56     dnl if GLcore found, then also check for GL
57     AC_CHECK_LIB(GL, glXCreateContext)
58 fi
59
60 AC_CHECK_LIB(GLU, gluLookAt)
61 if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
62     dnl if no GLU, check for MesaGLU
63     AC_CHECK_LIB(MesaGLU, gluLookAt)
64 fi
65
66 AC_CHECK_LIB(glut, glutGetModifiers)
67         
68 dnl cygwin32 is a little wierd because it has to try to handle the various
69 dnl winbloze-isms.  We'll just do this manually for now.
70 if test "x$am_cv_cygwin32" = "xyes" ; then
71     echo Cygnus Win32 specific hacks...
72     AC_DEFINE(WIN32)
73
74     dnl Note, the double square brackets are required becuase single brackets
75     dnl seem to get stripped out
76     if [[ -f `pwd`/Win32/glut.dll ]]; then
77         echo "    found glut.dll, adding -lglut"
78         LIBS="$LIBS -lglut"
79     else
80         echo "    Cannot find glut.dll"
81         exit 1
82     fi
83     if [[ -f `pwd`/Win32/glu.dll ]]; then
84         echo "    found glu.dll, adding -lglu"
85         LIBS="$LIBS -lglu"
86     else
87         echo "    Cannot find glu.dll"
88         exit 1
89     fi
90     if [[ -f `pwd`/Win32/opengl.dll ]]; then
91         echo "    found opengl.dll, adding -lopengl"
92         LIBS="$LIBS -lopengl"
93     else
94         echo "    Cannot find opengl.dll"
95         exit 1
96     fi
97     echo "    adding -luser32 -lgdi32"
98     LIBS="$LIBS -luser32 -lgdi32"
99     ac_cv_lib_glut_glutGetModifiers="yes"
100 fi
101
102 dnl Checks for header files.
103 AC_HEADER_STDC
104 AC_CHECK_HEADERS( fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \
105         unistd.h windows.h winbase.h values.h )
106
107 dnl Checks for typedefs, structures, and compiler characteristics.
108 AC_C_CONST
109 AC_TYPE_SIZE_T
110 AC_HEADER_TIME
111 AC_STRUCT_TM
112
113 dnl Checks for library functions.
114 AC_TYPE_SIGNAL
115 AC_FUNC_VPRINTF
116 AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \
117         setitimer getitimer signal GetLocalTime )
118
119 if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
120     echo 
121     echo "Unable to find the necessary GL libraries."
122     exit 1
123 fi
124
125 AM_CONFIG_HEADER(Simulator/Include/config.h)
126
127 AC_OUTPUT( \
128         Makefile \
129         Simulator/Aircraft/Makefile \
130         Simulator/Astro/Makefile \
131         Simulator/Cockpit/Makefile \
132         Simulator/Controls/Makefile \
133         Simulator/Flight/LaRCsim/Makefile \
134         Simulator/Flight/Makefile \
135         Simulator/Flight/Slew/Makefile \
136         Simulator/Include/Makefile \
137         Simulator/Joystick/Makefile \
138         Simulator/Linux/Makefile \
139         Simulator/Main/Makefile \
140         Simulator/Makefile \
141         Simulator/Math/Makefile \
142         Simulator/Scenery/Makefile \
143         Simulator/Time/Makefile \
144         Simulator/Weather/Makefile \
145         Simulator/XGL/Makefile \
146         )