]> git.mxchange.org Git - flightgear.git/blob - utils/fgadmin/configure.ac
Updates in preparation for the v0.9.9 coming sometime [hopefully] soon.
[flightgear.git] / utils / fgadmin / configure.ac
1 dnl Process this file with autoget.sh to produce a working configure
2 dnl script.
3 dnl
4 dnl $Id$
5
6 AC_INIT
7 AC_CONFIG_SRCDIR([src/fgadmin.fl])
8
9 dnl Require at least automake 2.52
10 AC_PREREQ(2.52)
11
12 dnl Initialize the automake stuff
13 AM_INIT_AUTOMAKE(fgadmin, 1.0.0)
14
15 dnl Checks for programs.
16 AC_PROG_MAKE_SET
17 AC_PROG_CC
18 AC_PROG_CPP
19 AC_PROG_CXX
20 AC_PROG_RANLIB
21 AC_PROG_INSTALL
22 AC_PROG_LN_S
23
24 dnl set the $host variable based on local machine/os
25 AC_CANONICAL_HOST
26
27 case "${host}" in
28 *-*-irix*)
29     if test "$CXX" = "CC"; then
30         AR="CC -ar"
31         ARFLAGS="-o"
32         CXXFLAGS="$CXXFLAGS -I$with_simgear/include/simgear/compatibility"
33     else
34         AR="ar"
35         ARFLAGS="cru"
36     fi
37     ;;
38 *)
39     AR="ar"
40     ARFLAGS="cru"
41     ;;
42 esac
43 AC_SUBST(AR)
44 AC_SUBST(ARFLAGS)
45
46 # Check for MS Windows environment
47 AC_CHECK_HEADER(windows.h)
48
49 dnl Checks for libraries.
50
51 # The following are C++ items that need to be tested for with the c++
52 # compiler
53
54 AC_LANG_PUSH(C++)
55
56 AC_CHECK_LIB(fltk,main,LIBS="$LIBS `fltk-config --use-images --ldflags`"
57              LDFLAGS="$LDFLAGS `fltk-config --use-images --ldflags`"
58              CPPFLAGS="$CPPFLAGS `fltk-config --cxxflags`",
59   AC_MSG_ERROR(fltk library required get it at http://www.fltk.org))
60
61 # Check for "plib" without which we cannot go on
62 AC_CHECK_HEADER(plib/ul.h)
63 if test "x$ac_cv_header_plib_ul_h" != "xyes"; then
64     echo
65     echo "You *must* have the plib library installed on your system to build"
66     echo "the FGFS simulator!"
67     echo
68     echo "Please see README.plib for more details."
69     echo
70     echo "configure aborted."
71     exit
72 fi
73
74 AC_MSG_CHECKING([for plib 1.6.0 or newer])
75 AC_TRY_RUN([
76 #include <plib/ul.h>
77
78 #define MIN_PLIB_VERSION 160
79
80 int main() {
81     int major, minor, micro;
82
83     if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
84          return -1;
85     }
86
87     return 0;
88 }
89
90 ],
91   AC_MSG_RESULT(yes),
92   [AC_MSG_RESULT(wrong version);
93    AC_MSG_ERROR([Install plib 1.6.0 or later first...])],
94   AC_MSG_RESULT(yes)
95 )
96
97 dnl Check for the presence of SimGear
98 AC_CHECK_HEADER(simgear/version.h)
99 if test "x$ac_cv_header_simgear_version_h" != "xyes"; then
100     echo
101     echo "You *must* have the SimGear support library installed on your system"
102     echo "to build the FGFS simulator!"
103     echo
104     echo "Please see README.SimGear for more details."
105     echo
106     echo "configure aborted."
107     exit
108 fi
109
110 AC_MSG_CHECKING([for simgear 0.3.4 or newer])
111 AC_TRY_RUN([
112 #include <stdio.h>
113
114 #include <simgear/version.h>
115
116 #define STRINGIFY(X) XSTRINGIFY(X)
117 #define XSTRINGIFY(X) #X
118
119 #define MIN_MAJOR 0
120 #define MIN_MINOR 3
121 #define MIN_MICRO 4
122
123 int main() {
124     int major, minor, micro;
125
126     printf("%d.%d.%d or greater... ", MIN_MAJOR, MIN_MINOR, MIN_MICRO);
127
128     sscanf( STRINGIFY(SIMGEAR_VERSION), "%d.%d.%d", &major, &minor, &micro );
129
130     if ( major < MIN_MAJOR ) {
131          return -1;
132     } else if ( major == MIN_MAJOR && minor < MIN_MINOR ) {
133          return -1;
134     } else if ( major == MIN_MAJOR && minor == MIN_MINOR && micro < MIN_MICRO ){
135          return -1;
136     }
137
138     return 0;
139 }
140
141 ],
142   AC_MSG_RESULT(yes),
143   [AC_MSG_RESULT(wrong version);
144    AC_MSG_ERROR([Install latest simgear first...])],
145   AC_MSG_RESULT(yes)
146 )
147
148 AC_LANG_POP
149
150 dnl Check for system installed zlib
151 AC_CHECK_HEADER(zlib.h)
152 if test "x$ac_cv_header_zlib_h" != "xyes"; then
153     echo
154     echo "zlib library not found."
155     echo
156     echo "If your OS does not provide an installable package for zlib"
157     echo "you will have to compile and install it first yourself.  A copy"
158     echo "of zlib-1.1.4.tar.gz is included with SimGear.  You will"
159     echo "have to untar this source code, and follow it's included instructions"
160     echo "to compile and install on your system."
161     echo
162     echo "configure aborted."
163     echo
164     exit
165 else
166     AC_DEFINE([HAVE_ZLIB], 1, [Define to enable gz compressed tar archives])
167 fi
168
169 dnl Checks for header files.
170 AC_HEADER_STDC
171 AC_CHECK_HEADERS( errno.h fcntl.h sys/types.h sys/stat.h )
172
173 dnl Checks for typedefs, structures, and compiler characteristics.
174 AC_C_CONST
175 AC_TYPE_SIZE_T
176 AC_HEADER_TIME
177 AC_STRUCT_TM
178
179 AC_CHECK_FUNCS( [ rmdir unlink ] )
180
181 AM_CONFIG_HEADER(src/config.h)
182
183 AC_CONFIG_FILES([ \
184         Makefile \
185         src/Makefile \
186 ])
187
188 AC_OUTPUT