-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
347 lines (231 loc) · 6.84 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
gdnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
ifdef([m4_pattern_allow],
[m4_pattern_allow([^AC_.*])])
AC_INIT(electricsheep,2.7b33-svn,http://code.google.com/p/electricsheep/issues/list)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([1.9 tar-pax dist-bzip2 foreign])
AM_MAINTAINER_MODE
dnl Uncomment next line to have it build in /usr by default rather than /usr/local
dnl AC_PREFIX_DEFAULT(/usr)
AC_GNU_SOURCE
AC_ISC_POSIX
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_CXX
AC_CONFIG_MACRO_DIR([m4])
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AM_PROG_CC_STDC
AM_PROG_CC_C_O
AC_HEADER_STDC
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_SYS_LARGEFILE
AM_PROG_AS
ACX_PTHREAD(PTHREAD_OK=true,PTHREAD_OK=false)
IS_LINUX_GNU="false"
case "{$target_os}" in
*linux-gnu*)
IS_LINUX_GNU="true"
echo "O/S is GNU/Linux"
;;
*)
;;
esac
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG = xno; then
AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
fi
AM_CONDITIONAL(IS_LINUX_GNU,$IS_LINUX_GNU)
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
dnl Check for WXWidgets
WX_VER_291=""
AC_PATH_PROGS(WX_CONFIG, [wx-config-2.9 wx-config], no)
if test x$WX_CONFIG != xno; then
WX_VERSION=`$WX_CONFIG --version`
WX_MAJOR=${WX_VERSION%%.*};
WX_MINOR=${WX_VERSION#*.};
WX_MINOR=${WX_MINOR%%.*};
WX_MICRO=${WX_VERSION##*.};
if test $WX_MAJOR -gt 2; then
WX_VER_291=yes
else
if test $WX_MAJOR -eq 2; then
if test $WX_MINOR -gt 9; then
WX_VER_291=yes
else
if test $WX_MINOR -eq 9; then
if test $WX_MICRO -ge 1; then
WX_VER_291=yes
fi
fi
fi
fi
fi
fi
if test "$WX_VER_291" != "yes"; then
dnl Use static version
echo "installed version of wx is too old,"
AC_MSG_ERROR([Please install development libraries for wxWidgets 2.9.1 or higher, and then run this configure script again.])
fi
WX_CXXFLAGS="`$WX_CONFIG --cxxflags`"
WX_LIBS="-static `$WX_CONFIG --libs` `$WX_CONFIG --libs richtext`"
echo "WX_CXXFLAGS is $WX_CXXFLAGS"
echo "WX_LIBS is $WX_LIBS"
WX_LDADD="$WX_LIBS"
AC_SUBST(WX_CXXFLAGS)
AC_SUBST(WX_LDADD)
dnl Check for avcodec
PKG_CHECK_MODULES([AVCODEC],[libavcodec])
dnl Check for avcodec_decode_video2
AC_CHECK_LIB([avcodec],[avcodec_decode_video2],HAVE_AVC_VID2=true,HAVE_AVC_VID2=false)
AM_CONDITIONAL(HAVE_AVC_VID2,$HAVE_AVC_VID2)
AC_SUBST(AVCODEC_CFLAGS)
AC_SUBST(AVCODEC_LIBS)
dnl Check for avformat
PKG_CHECK_MODULES(AVFORMAT,libavformat)
AC_SUBST(AVFORMAT_CFLAGS)
AC_SUBST(AVFORMAT_LIBS)
AC_CHECK_LIB([avformat], [av_open_input_file], AC_DEFINE([USE_OLD_FFMPEG_API]), AC_DEFINE([USE_NEW_FFMPEG_API]))
dnl Check for swscale
PKG_CHECK_MODULES(SWSCALE,libswscale)
AC_SUBST(SWSCALE_CFLAGS)
AC_SUBST(SWSCALE_LIBS)
dnl Check for avutil
PKG_CHECK_MODULES(AVUTIL,libavutil)
AC_SUBST(AVUTIL_CFLAGS)
AC_SUBST(AVUTIL_LIBS)
dnl Check for lua
PKG_CHECK_MODULES([LUA], [lua5.1],,
[PKG_CHECK_MODULES([LUA], [lua >= 5.1])
])
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIBS)
dnl Check for glee
PKG_CHECK_MODULES([GLEE],[glee], [HAVE_GLEE=true] , [HAVE_GLEE=false] )
if test "$HAVE_GLEE" = "false"; then
PKG_CHECK_MODULES([GLEE],[GLee], [HAVE_GLEE=true] , [HAVE_GLEE=false] )
if test "$HAVE_GLEE" = "false"; then
AC_MSG_CHECKING(for GLee.h)
AC_CHECK_HEADERS(GLee.h GL/GLee.h)
if test "x$ac_cv_header_GLee_h" = "xno"; then
if test "xac_cv_header_GL_GLee_h" = "xno"; then
AC_MSG_ERROR([neither GLee.h nor GL/GLee.h were found. Please make sure you have GLee.h installed in your include path.])
fi
dnl found GLee.h in GL subdir
GLEE_CFLAGS="-I $includedir/GL -I/usr/include/GL"
fi
AC_CHECK_LIB([GLee],[main],GLEE_LIBS="-lGLee",
AC_CHECK_LIB([glee],[main],GLEE_LIBS="-lglee",,))
fi
fi
AC_SUBST(GLEE_CFLAGS)
AC_SUBST(GLEE_LIBS)
dnl Check for curl
PKG_CHECK_MODULES(CURL,libcurl)
AC_SUBST(CURL_CFLAGS)
AC_SUBST(CURL_LIBS)
dnl Check for libpng
PKG_CHECK_MODULES(PNG,libpng)
AC_SUBST(PNG_CFLAGS)
AC_SUBST(PNG_LIBS)
dnl Check for Xrender
PKG_CHECK_MODULES(XRENDER,xrender)
AC_SUBST(XRENDER_CFLAGS)
AC_SUBST(XRENDER_LIBS)
# Check for flam3-animate
AC_PATH_PROG(FLAM3_ANIMATE, flam3-animate, no)
if test x$FLAM3_ANIMATE = xno; then
AC_MSG_ERROR([Cannot find flam3-animate, make sure it is installed and in your PATH])
fi
dnl Check for libgtop-2.0
PKG_CHECK_MODULES(LIBGTOP,libgtop-2.0)
AC_SUBST(LIBGTOP_CFLAGS)
AC_SUBST(LIBGTOP_LIBS)
dnl Checks for boost
AC_LANG_PUSH([C++])
dnl Check boost version
REQ_BOOST_VERSION=103900
AC_MSG_CHECKING(for libboost >= 1.39)
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[
#include <boost/version.hpp>
#include <fstream>
],
[dnl
#if BOOST_VERSION >= $REQ_BOOST_VERSION
std::ofstream ofs("conftest.out");
ofs << BOOST_VERSION / 100000 << '.' << BOOST_VERSION / 100 % 1000;
#else
# error Boost version is too old
#endif
])],
[
BOOST_VERSION=`cat conftest.out`
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],
[])
AC_LANG_POP([C++])
dnl Check result of boost version
if test "x$succeeded" != "xyes"; then
AC_MSG_ERROR([libboost version 1.41 or higher is required to compile electricsheep.])
fi
AC_LANG_PUSH([C++])
dnl Check for boost/thread.hpp
AC_CHECK_HEADER([boost/thread.hpp],,
[AC_MSG_ERROR([you must install libboost-thread to compile electricsheep.])
])
AC_CHECK_LIB([boost_thread],[main],,
[AC_MSG_ERROR([you must install libboost-thread to compile electricsheep.])
])
dnl Check for boost/filesystem.hpp
AC_CHECK_HEADER([boost/filesystem.hpp],,
[AC_MSG_ERROR([you must install libboost-filesystem to compile electricsheep.])
])
AC_CHECK_LIB([boost_filesystem],[main],,
[AC_MSG_ERROR([you must install libboost-filesystem to compile electricsheep.])
])
dnl Check for boost/system/config.hpp
AC_CHECK_HEADER([boost/system/config.hpp],,
[AC_MSG_ERROR([you must install libboost-system to compile electricsheep.])
])
AC_CHECK_LIB([boost_system],[main],,
[AC_MSG_ERROR([you must install libboost-system to compile electricsheep.])
])
AC_LANG_POP([C++])
BOOST_LDADD="-lboost_system"
AC_SUBST(BOOST_LDADD)
dnl Check for libtinyxml
AC_CHECK_LIB([tinyxml],[main],,
[AC_MSG_ERROR([you must install libtinyxml dev to compile electricsheep.])
])
dnl Check for libglut
AC_CHECK_LIB([glut],[glutMainLoop],,
[AC_MSG_ERROR([you must install libglut dev to compile electricsheep.])
])
AC_CHECK_LIB([GL],[glXCreateNewContext],,
[AC_MSG_ERROR([you must install libGL to compile electricsheep.])
])
AC_CHECK_LIB([rt],[clock_gettime],,
[AC_MSG_ERROR([you must install librt to compile electricsheep.])
])
AC_OUTPUT([
Makefile
Client/Makefile
MSVC/SettingsGUI/Makefile
])