1 | # $Id: configure.ac 2302 2008-04-19 19:25:37Z sam $ |
---|
2 | |
---|
3 | AC_INIT(caca/caca.c) |
---|
4 | |
---|
5 | AC_PREREQ(2.50) |
---|
6 | AC_CONFIG_AUX_DIR(autotools) |
---|
7 | AC_CANONICAL_SYSTEM |
---|
8 | |
---|
9 | AM_INIT_AUTOMAKE(libcaca, 0.99.beta14) |
---|
10 | LT_MAJOR="0" |
---|
11 | LT_MINOR="99" |
---|
12 | LT_MICRO="13" |
---|
13 | AC_SUBST(LT_MAJOR) |
---|
14 | AC_SUBST(LT_MINOR) |
---|
15 | AC_SUBST(LT_MICRO) |
---|
16 | LT_VERSION="$LT_MAJOR:$LT_MINOR:$LT_MICRO" |
---|
17 | AC_SUBST(LT_VERSION) |
---|
18 | AM_CONFIG_HEADER(config.h) |
---|
19 | |
---|
20 | AM_PROG_CC_C_O |
---|
21 | AC_PROG_CPP |
---|
22 | AC_PROG_CXX |
---|
23 | AC_PROG_CXXCPP |
---|
24 | _AM_DEPENDENCIES([OBJC]) |
---|
25 | OBJC="${CC}" |
---|
26 | AC_SUBST(OBJC) |
---|
27 | AC_SUBST(OBJCFLAGS) |
---|
28 | AM_PROG_AS |
---|
29 | |
---|
30 | AC_LIBTOOL_WIN32_DLL |
---|
31 | AM_PROG_LIBTOOL |
---|
32 | AC_LIBTOOL_CXX |
---|
33 | |
---|
34 | AC_C_CONST |
---|
35 | AC_C_INLINE |
---|
36 | AC_TYPE_SIGNAL |
---|
37 | |
---|
38 | dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right |
---|
39 | dnl now otherwise it might be set in an obscure if statement. Same thing for |
---|
40 | dnl PKG_PROG_PKG_CONFIG which needs to be called first. |
---|
41 | AC_EGREP_CPP(yes, foo) |
---|
42 | PKG_PROG_PKG_CONFIG() |
---|
43 | m4_pattern_allow([^PKG_CONFIG_LIBDIR$]) |
---|
44 | if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then |
---|
45 | export PKG_CONFIG_LIBDIR=/dev/null |
---|
46 | fi |
---|
47 | |
---|
48 | dnl output driver features |
---|
49 | AC_ARG_ENABLE(slang, |
---|
50 | [ --enable-slang slang graphics support (autodetected)]) |
---|
51 | AC_ARG_ENABLE(ncurses, |
---|
52 | [ --enable-ncurses ncurses graphics support (autodetected)]) |
---|
53 | AC_ARG_ENABLE(win32, |
---|
54 | [ --enable-win32 Windows console support (autodetected)]) |
---|
55 | AC_ARG_ENABLE(conio, |
---|
56 | [ --enable-conio DOS conio.h graphics support (autodetected)]) |
---|
57 | AC_ARG_ENABLE(x11, |
---|
58 | [ --enable-x11 X11 support (autodetected)]) |
---|
59 | AC_ARG_ENABLE(gl, |
---|
60 | [ --enable-gl OpenGL support (autodetected)]) |
---|
61 | AC_ARG_ENABLE(cocoa, |
---|
62 | [ --enable-cocoa Cocoa support (autodetected)]) |
---|
63 | AC_ARG_ENABLE(network, |
---|
64 | [ --enable-network Network support (autodetected)]) |
---|
65 | AC_ARG_ENABLE(vga, |
---|
66 | [ --enable-vga VGA support (default disabled)]) |
---|
67 | |
---|
68 | dnl language bindings |
---|
69 | AC_ARG_ENABLE(csharp, |
---|
70 | [ --enable-csharp C# bindings (autodetected)]) |
---|
71 | AC_ARG_ENABLE(cxx, |
---|
72 | [ --enable-cxx C++ bindings (autodetected)]) |
---|
73 | AC_ARG_ENABLE(ruby, |
---|
74 | [ --enable-ruby Ruby bindings (autodetected)]) |
---|
75 | |
---|
76 | dnl example programs features |
---|
77 | AC_ARG_ENABLE(imlib2, |
---|
78 | [ --enable-imlib2 Imlib2 graphics support (autodetected)]) |
---|
79 | |
---|
80 | dnl conditional builds |
---|
81 | AC_ARG_ENABLE(debug, |
---|
82 | [ --enable-debug build debug versions of the library (default no)]) |
---|
83 | AC_ARG_ENABLE(plugins, |
---|
84 | [ --enable-plugins make X11 and GL drivers plugins (default disabled)]) |
---|
85 | AC_ARG_ENABLE(doc, |
---|
86 | [ --enable-doc build documentation (needs doxygen and LaTeX)]) |
---|
87 | AC_ARG_ENABLE(cppunit, |
---|
88 | [ --enable-cppunit use cppunit for unit tests (autodetected)]) |
---|
89 | AC_ARG_ENABLE(zzuf, |
---|
90 | [ --enable-zzuf use zzuf for fuzzing tests (autodetected)]) |
---|
91 | |
---|
92 | AC_CHECK_HEADERS(stdio.h stdarg.h signal.h sys/ioctl.h sys/time.h endian.h unistd.h arpa/inet.h netinet/in.h winsock2.h errno.h locale.h getopt.h dlfcn.h termios.h) |
---|
93 | AC_CHECK_FUNCS(signal ioctl snprintf vsnprintf getenv putenv strcasecmp htons) |
---|
94 | AC_CHECK_FUNCS(usleep gettimeofday) |
---|
95 | |
---|
96 | ac_cv_have_getopt_long="no" |
---|
97 | AC_CHECK_FUNCS(getopt_long, |
---|
98 | [ac_cv_have_getopt_long="yes"], |
---|
99 | [AC_CHECK_LIB(gnugetopt, getopt_long, |
---|
100 | [ac_cv_have_getopt_long="yes" |
---|
101 | GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])]) |
---|
102 | if test "$ac_cv_have_getopt_long" != "no"; then |
---|
103 | AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.) |
---|
104 | fi |
---|
105 | AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no") |
---|
106 | AC_SUBST(GETOPT_LIBS) |
---|
107 | |
---|
108 | AC_MSG_CHECKING(for Sleep) |
---|
109 | AC_TRY_COMPILE([#include <windows.h>],[Sleep(42);], |
---|
110 | [AC_MSG_RESULT(yes) |
---|
111 | AC_DEFINE(HAVE_SLEEP, 1, [Define to 1 if you have the `Sleep' function.])], |
---|
112 | [AC_MSG_RESULT(no)]) |
---|
113 | |
---|
114 | AC_MSG_CHECKING(for fsin/fcos) |
---|
115 | AC_TRY_COMPILE([],[asm("fsin\n\tfcos");], |
---|
116 | [AC_MSG_RESULT(yes) |
---|
117 | AC_DEFINE(HAVE_FSIN_FCOS, 1, [Define to 1 if you have the `fsin' and `fcos' operands.])], |
---|
118 | [AC_MSG_RESULT(no)]) |
---|
119 | |
---|
120 | AC_MSG_CHECKING(for fldln2/fxch/fyl2x) |
---|
121 | AC_TRY_COMPILE([],[asm("fldln2; fldln2; fxch; fyl2x");], |
---|
122 | [AC_MSG_RESULT(yes) |
---|
123 | AC_DEFINE(HAVE_FLDLN2, 1, [Define to 1 if you have the `fldln2' and other floating points operands.])], |
---|
124 | [AC_MSG_RESULT(no)]) |
---|
125 | |
---|
126 | AC_CHECK_HEADERS(zlib.h) |
---|
127 | AC_CHECK_LIB(z, gzopen, [ZLIB_LIBS="${ZLIB_LIBS} -lz"]) |
---|
128 | |
---|
129 | AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm") |
---|
130 | |
---|
131 | CACA_DRIVERS="" |
---|
132 | |
---|
133 | if test "${enable_conio}" != "no"; then |
---|
134 | ac_cv_my_have_conio="no" |
---|
135 | AC_CHECK_HEADERS(conio.h, |
---|
136 | [AC_MSG_CHECKING(for ScreenUpdate in pc.h) |
---|
137 | AC_EGREP_HEADER(ScreenUpdate, pc.h, |
---|
138 | [ac_cv_my_have_conio="yes" |
---|
139 | AC_MSG_RESULT(yes) |
---|
140 | AC_DEFINE(SCREENUPDATE_IN_PC_H, 1, |
---|
141 | Define to 1 if <pc.h> defines ScreenUpdate.) |
---|
142 | AC_DEFINE(USE_CONIO, 1, Define to 1 to activate the conio.h backend driver) |
---|
143 | CACA_DRIVERS="${CACA_DRIVERS} conio"], |
---|
144 | [AC_MSG_RESULT(no)])]) |
---|
145 | if test "${ac_cv_my_have_conio}" = "no" -a "${enable_conio}" = "yes"; then |
---|
146 | AC_MSG_ERROR([cannot find conio.h]) |
---|
147 | fi |
---|
148 | fi |
---|
149 | |
---|
150 | if test "${enable_win32}" != "no"; then |
---|
151 | ac_cv_my_have_win32="no" |
---|
152 | AC_CHECK_HEADERS(windows.h, |
---|
153 | [AC_MSG_CHECKING(for AllocConsole in windows.h) |
---|
154 | AC_EGREP_HEADER(AllocConsole, windows.h, |
---|
155 | [ac_cv_my_have_win32="yes" |
---|
156 | AC_MSG_RESULT(yes) |
---|
157 | AC_DEFINE(ALLOCCONSOLE_IN_WINDOWS_H, 1, |
---|
158 | Define to 1 if <windows.h> defines AllocConsole.) |
---|
159 | AC_DEFINE(USE_WIN32, 1, Define to 1 to activate the win32 backend driver) |
---|
160 | CACA_DRIVERS="${CACA_DRIVERS} win32"], |
---|
161 | [AC_MSG_RESULT(no)])]) |
---|
162 | if test "${ac_cv_my_have_win32}" = "no" -a "${enable_win32}" = "yes"; then |
---|
163 | AC_MSG_ERROR([cannot find win32 console development files]) |
---|
164 | fi |
---|
165 | fi |
---|
166 | |
---|
167 | if test "${enable_slang}" != "no"; then |
---|
168 | ac_cv_my_have_slang="no" |
---|
169 | AC_CHECK_HEADERS(slang.h slang/slang.h, |
---|
170 | [ac_cv_my_have_slang="yes" |
---|
171 | AC_DEFINE(USE_SLANG, 1, Define to 1 to activate the slang backend driver) |
---|
172 | AC_CHECK_LIB(slang, SLsmg_utf8_enable, |
---|
173 | [AC_DEFINE(HAVE_SLSMG_UTF8_ENABLE, 1, Define to 1 if you have the `SLsmg_utf8_enable' function.)]) |
---|
174 | CPPFLAGS="${CPPFLAGS} -DOPTIMISE_SLANG_PALETTE=1" |
---|
175 | CACA_LIBS="${CACA_LIBS} -lslang" |
---|
176 | CACA_DRIVERS="${CACA_DRIVERS} slang" |
---|
177 | break]) |
---|
178 | if test "${ac_cv_my_have_slang}" = "no" -a "${enable_slang}" = "yes"; then |
---|
179 | AC_MSG_ERROR([cannot find slang development files]) |
---|
180 | fi |
---|
181 | fi |
---|
182 | |
---|
183 | if test "${enable_x11}" != "no"; then |
---|
184 | AC_PATH_X |
---|
185 | AC_CHECK_LIB(X11, XOpenDisplay, |
---|
186 | [ac_cv_my_have_x11="yes" |
---|
187 | if test -n "${x_includes}"; then X_CFLAGS="-I${x_includes}"; fi |
---|
188 | if test -n "${x_libraries}"; then X_LIBS="-L${x_libraries}"; fi |
---|
189 | AC_DEFINE(USE_X11, 1, Define to 1 to activate the X11 backend driver) |
---|
190 | CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}" |
---|
191 | X11_LIBS="${X11_LIBS} -lX11 ${X_LIBS}" |
---|
192 | CACA_DRIVERS="${CACA_DRIVERS} x11"], |
---|
193 | [ac_cv_my_have_x11="no"], |
---|
194 | [[`if test -n "${x_libraries}"; then echo -L${x_libraries}; fi`]]) |
---|
195 | AC_CHECK_HEADERS(X11/XKBlib.h) |
---|
196 | if test "${ac_cv_my_have_x11}" != "yes" -a "${enable_x11}" = "yes"; then |
---|
197 | AC_MSG_ERROR([cannot find X11 development files]) |
---|
198 | fi |
---|
199 | fi |
---|
200 | |
---|
201 | if test "${enable_gl}" != "no"; then |
---|
202 | ac_cv_my_have_gl="no" |
---|
203 | AC_CHECK_HEADERS(GL/gl.h OpenGL/gl.h, |
---|
204 | [AC_CHECK_HEADERS(GL/glut.h, |
---|
205 | [AC_CHECK_LIB(glut, glutCloseFunc, |
---|
206 | [AC_DEFINE(HAVE_GLUTCLOSEFUNC, 1, Define to 1 if you have the `glutCloseFunc' function.)]) |
---|
207 | AC_CHECK_LIB(glut, glutMainLoopEvent, |
---|
208 | [ac_cv_my_have_gl="yes"]) |
---|
209 | AC_CHECK_LIB(glut, glutCheckLoop, |
---|
210 | [ac_cv_my_have_gl="yes" |
---|
211 | AC_DEFINE(HAVE_GLUTCHECKLOOP, 1, Define to 1 if you have the `glutCheckLoop' function.)])]) |
---|
212 | break]) |
---|
213 | if test "${ac_cv_my_have_gl}" = "yes"; then |
---|
214 | AC_DEFINE(USE_GL, 1, Define to 1 to activate the OpenGL backend driver) |
---|
215 | GL_LIBS="${GL_LIBS} -lGL -lglut" |
---|
216 | CACA_DRIVERS="${CACA_DRIVERS} gl" |
---|
217 | elif test "${enable_gl}" = "yes"; then |
---|
218 | AC_MSG_ERROR([cannot find OpenGL+FreeGLUT development files]) |
---|
219 | fi |
---|
220 | fi |
---|
221 | |
---|
222 | if test "${enable_cocoa}" != "no"; then |
---|
223 | ac_cv_my_have_cocoa="no" |
---|
224 | AC_CHECK_HEADERS(Cocoa/Cocoa.h, |
---|
225 | [ac_cv_my_have_cocoa="yes"]) |
---|
226 | if test "${ac_cv_my_have_cocoa}" = "yes"; then |
---|
227 | case x${target} in |
---|
228 | xpowerpc*darwin*) |
---|
229 | # 10.3 needed to link with X11 |
---|
230 | MACOSX_SDK=/Developer/SDKs/MacOSX10.3.9.sdk |
---|
231 | GCC_VERSION=3.3 |
---|
232 | ARCH="-arch ppc" |
---|
233 | MACOSX_SDK_CFLAGS="-nostdinc -isystem ${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOSX_SDK}/usr/include" |
---|
234 | MACOSX_SDK_CXXFLAGS="-nostdinc++ -I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++ -I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/ppc-darwin -I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/backward" |
---|
235 | MACOSX_SDK_LDFLAGS="-L${MACOSX_SDK}/usr/lib/gcc/darwin -L${MACOSX_SDK}/usr/lib/gcc/darwin/${GCC_VERSION} -L${MACOSX_SDK}/usr/lib" |
---|
236 | ;; |
---|
237 | x*86*darwin*) |
---|
238 | MACOSX_SDK=/Developer/SDKs/MacOSX10.4u.sdk |
---|
239 | GCC_VERSION=4.0 |
---|
240 | ARCH="-arch i386" |
---|
241 | MACOSX_SDK_CFLAGS="-isysroot ${MACOSX_SDK}" |
---|
242 | MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CFLAGS}" |
---|
243 | ;; |
---|
244 | esac |
---|
245 | CC=gcc-${GCC_VERSION} |
---|
246 | CXX=g++-${GCC_VERSION} |
---|
247 | MACOSX_SDK_FRAMEWORKS="-F${MACOSX_SDK}/System/Library/Frameworks" |
---|
248 | CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}" |
---|
249 | CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS}" |
---|
250 | CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}" |
---|
251 | OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}" |
---|
252 | LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}" |
---|
253 | AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver) |
---|
254 | CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa" |
---|
255 | CACA_DRIVERS="${CACA_DRIVERS} cocoa" |
---|
256 | elif test "${enable_cocoa}" = "yes"; then |
---|
257 | AC_MSG_ERROR([cannot find Cocoa development files]) |
---|
258 | fi |
---|
259 | fi |
---|
260 | AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes") |
---|
261 | |
---|
262 | if test "${enable_ncurses}" != "no"; then |
---|
263 | ac_cv_my_have_ncurses="no" |
---|
264 | AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses/ncurses.h ncurses.h curses.h, |
---|
265 | [ncurses="no" |
---|
266 | AC_CHECK_LIB(ncursesw, initscr, |
---|
267 | [ncurses="-lncursesw"], |
---|
268 | [AC_CHECK_LIB(ncurses, initscr, |
---|
269 | [ncurses="-lncurses"])]) |
---|
270 | if test "${ncurses}" = "no"; then |
---|
271 | continue |
---|
272 | fi |
---|
273 | ac_cv_my_have_ncurses="yes" |
---|
274 | AC_DEFINE(USE_NCURSES, 1, Define to 1 to activate the ncurses backend driver) |
---|
275 | CACA_LIBS="${CACA_LIBS} ${ncurses}" |
---|
276 | CACA_DRIVERS="${CACA_DRIVERS} ncurses" |
---|
277 | dnl Check for resizeterm or resize_term |
---|
278 | SAVED_LIBS="${LIBS}" |
---|
279 | LIBS="${LIBS} ${ncurses}" |
---|
280 | AC_CHECK_FUNCS(resizeterm resize_term) |
---|
281 | LIBS="${SAVED_LIBS}" |
---|
282 | break]) |
---|
283 | if test "${ac_cv_my_have_ncurses}" = "no" -a "${enable_ncurses}" = "yes"; then |
---|
284 | AC_MSG_ERROR([cannot find ncurses development files]) |
---|
285 | fi |
---|
286 | fi |
---|
287 | |
---|
288 | if test "${enable_vga}" = "yes"; then |
---|
289 | ac_cv_my_have_vga="yes" |
---|
290 | CPPFLAGS="${CPPFLAGS} -I. -D__KERNEL__ -nostdinc -include kernel/kernel.h -fno-stack-protector" |
---|
291 | CFLAGS="${CFLAGS} -fno-builtin -O2 -Wall -fno-stack-protector" |
---|
292 | CCASFLAGS="${CCASFLAGS} -I. -fno-stack-protector" |
---|
293 | LDFLAGS="${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -fno-stack-protector" |
---|
294 | AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver) |
---|
295 | CACA_DRIVERS="${CACA_DRIVERS} vga" |
---|
296 | fi |
---|
297 | AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_vga}" = "yes") |
---|
298 | |
---|
299 | if test "${enable_debug}" = "yes"; then |
---|
300 | AC_DEFINE(DEBUG, 1, Define to 1 to activate debug) |
---|
301 | fi |
---|
302 | |
---|
303 | if test "${enable_plugins}" = "yes"; then |
---|
304 | ac_cv_my_have_plugins="yes" |
---|
305 | AC_DEFINE(USE_PLUGINS, 1, Define to 1 to activate plugins) |
---|
306 | CACA_LIBS="${CACA_LIBS} -ldl" |
---|
307 | else |
---|
308 | CACA_LIBS="${CACA_LIBS} ${X11_LIBS} ${GL_LIBS}" |
---|
309 | fi |
---|
310 | AM_CONDITIONAL(USE_PLUGINS, test "${ac_cv_my_have_plugins}" = "yes") |
---|
311 | |
---|
312 | AC_MSG_CHECKING(valid output drivers) |
---|
313 | if test -z "${CACA_DRIVERS}"; then |
---|
314 | AC_MSG_RESULT(no) |
---|
315 | AC_MSG_ERROR([no output drivers were selected!]) |
---|
316 | else |
---|
317 | CACA_DRIVERS="${CACA_DRIVERS# *}" |
---|
318 | AC_MSG_RESULT([${CACA_DRIVERS}]) |
---|
319 | fi |
---|
320 | |
---|
321 | AC_SUBST(MATH_LIBS) |
---|
322 | AC_SUBST(ZLIB_LIBS) |
---|
323 | AC_SUBST(GETOPT_LIBS) |
---|
324 | AC_SUBST(CACA_LIBS) |
---|
325 | AC_SUBST(X11_LIBS) |
---|
326 | AC_SUBST(GL_LIBS) |
---|
327 | |
---|
328 | # How to get the C99 types. See cucul/cucul_types.h.in for details about |
---|
329 | # the CUCUL_TYPES variable |
---|
330 | if test "${ac_cv_my_have_vga}" = "yes"; then |
---|
331 | CUCUL_TYPES=0 |
---|
332 | else |
---|
333 | AC_CHECK_HEADERS(stdint.h, |
---|
334 | [CUCUL_TYPES=1], |
---|
335 | [AC_CHECK_HEADERS(inttypes.h, |
---|
336 | [CUCUL_TYPES=2], |
---|
337 | [CUCUL_TYPES=0])]) |
---|
338 | fi |
---|
339 | AC_SUBST(CUCUL_TYPES) |
---|
340 | |
---|
341 | # Optimizations |
---|
342 | CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" |
---|
343 | # Code qui fait des warnings == code de porc == deux baffes dans ta gueule |
---|
344 | CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" |
---|
345 | |
---|
346 | CACA_BINDINGS="" |
---|
347 | |
---|
348 | # Build the C++ bindings? |
---|
349 | ac_cv_my_have_cxx="no" |
---|
350 | if test "${enable_cxx}" != "no"; then |
---|
351 | AC_MSG_CHECKING([working <iostream>]) |
---|
352 | AC_LANG_PUSH(C++) |
---|
353 | AC_TRY_COMPILE( |
---|
354 | [#include <iostream>], |
---|
355 | [], |
---|
356 | [ac_cv_my_have_cxx="yes" |
---|
357 | CACA_BINDINGS="${CACA_BINDINGS} C++"]) |
---|
358 | AC_LANG_POP(C++) |
---|
359 | AC_MSG_RESULT([$ac_cv_my_have_cxx]) |
---|
360 | fi |
---|
361 | AM_CONDITIONAL(USE_CXX, test "${ac_cv_my_have_cxx}" = "yes") |
---|
362 | |
---|
363 | # Build the .NET bindings? |
---|
364 | ac_cv_my_have_csharp="no" |
---|
365 | if test "${enable_csharp}" != "no"; then |
---|
366 | AC_PATH_PROG(GMCS, gmcs, no) |
---|
367 | AC_PATH_PROG(GACUTIL, gacutil, no) |
---|
368 | if test "${GMCS}" != "no" -a "${GACUTIL}" != "no"; then |
---|
369 | ac_cv_my_have_csharp="yes" |
---|
370 | CACA_BINDINGS="${CACA_BINDINGS} C#" |
---|
371 | fi |
---|
372 | fi |
---|
373 | AM_CONDITIONAL(USE_CSHARP, test "${ac_cv_my_have_csharp}" = "yes") |
---|
374 | |
---|
375 | # Build the Ruby bindings? |
---|
376 | ac_cv_my_have_ruby="no" |
---|
377 | if test "${enable_ruby}" != "no"; then |
---|
378 | AC_PATH_PROG(RUBY, ruby, no) |
---|
379 | if test "${RUBY}" != "no"; then |
---|
380 | RUBY_CFLAGS="-I$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"archdir"@:>@')" |
---|
381 | RUBY_LIBS="-L$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"RUBY_SO_NAME"@:>@')" |
---|
382 | RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'` |
---|
383 | RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'` |
---|
384 | AC_SUBST(RUBY_CFLAGS) |
---|
385 | AC_SUBST(RUBY_LIBS) |
---|
386 | AC_SUBST(RUBY_SITEARCHDIR) |
---|
387 | AC_SUBST(RUBY_SITELIBDIR) |
---|
388 | CPPFLAGS="${CPPFLAGS} ${RUBY_CFLAGS}" |
---|
389 | AC_CHECK_HEADERS([ruby.h], |
---|
390 | [ac_cv_my_have_ruby="yes" |
---|
391 | CACA_BINDINGS="${CACA_BINDINGS} Ruby"]) |
---|
392 | fi |
---|
393 | fi |
---|
394 | AM_CONDITIONAL(USE_RUBY, test "${ac_cv_my_have_ruby}" = "yes") |
---|
395 | |
---|
396 | AC_MSG_CHECKING(available language bindings) |
---|
397 | if test -z "${CACA_BINDINGS}"; then |
---|
398 | AC_MSG_RESULT(no) |
---|
399 | else |
---|
400 | CACA_BINDINGS="${CACA_BINDINGS# *}" |
---|
401 | AC_MSG_RESULT([${CACA_BINDINGS}]) |
---|
402 | fi |
---|
403 | |
---|
404 | # Build cacaserver? |
---|
405 | ac_cv_my_have_network="no" |
---|
406 | AC_CHECK_HEADERS(sys/socket.h, |
---|
407 | [ac_cv_my_have_network="yes"]) |
---|
408 | AM_CONDITIONAL(USE_NETWORK, test "${ac_cv_my_have_network}" = "yes") |
---|
409 | |
---|
410 | # Use Imlib2? |
---|
411 | if test "${enable_imlib2}" != "no"; then |
---|
412 | PKG_CHECK_MODULES(IMLIB2, imlib2, [IMLIB2="yes"], [IMLIB2="no"]) |
---|
413 | if test "${IMLIB2}" = "yes"; then |
---|
414 | AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2) |
---|
415 | fi |
---|
416 | fi |
---|
417 | |
---|
418 | # Build development tools? |
---|
419 | PKG_CHECK_MODULES(PANGOFT2, pangoft2, [PANGOFT2="yes"], [PANGOFT2="no"]) |
---|
420 | AM_CONDITIONAL(USE_PANGO, test "${PANGOFT2}" = "yes") |
---|
421 | |
---|
422 | # Build documentation? |
---|
423 | DOXYGEN="no" |
---|
424 | LATEX="no" |
---|
425 | if test "${enable_doc}" != "no"; then |
---|
426 | AC_PATH_PROG(DOXYGEN, doxygen, no) |
---|
427 | if test "${DOXYGEN}" != "no"; then |
---|
428 | # Build LaTeX documentation? |
---|
429 | AC_PATH_PROG(LATEX, pdflatex, no) |
---|
430 | AC_PATH_PROG(KPSEWHICH, kpsewhich, no) |
---|
431 | AC_PATH_PROG(DVIPS, dvips, no) |
---|
432 | if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no"; then |
---|
433 | LATEX="no" |
---|
434 | fi |
---|
435 | if test "${LATEX}" != "no"; then |
---|
436 | AC_MSG_CHECKING(for a4.sty and a4wide.sty) |
---|
437 | if "${KPSEWHICH}" a4.sty >/dev/null 2>&1; then |
---|
438 | if "${KPSEWHICH}" a4wide.sty >/dev/null 2>&1; then |
---|
439 | AC_MSG_RESULT(yes) |
---|
440 | else |
---|
441 | LATEX="no" |
---|
442 | AC_MSG_RESULT(no) |
---|
443 | fi |
---|
444 | else |
---|
445 | LATEX="no" |
---|
446 | AC_MSG_RESULT(no) |
---|
447 | fi |
---|
448 | fi |
---|
449 | fi |
---|
450 | fi |
---|
451 | AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no") |
---|
452 | AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no") |
---|
453 | |
---|
454 | # Use cppunit for unit tests? |
---|
455 | PKG_CHECK_MODULES(CPPUNIT, cppunit, [CPPUNIT="yes"], [CPPUNIT="no"]) |
---|
456 | AM_CONDITIONAL(USE_CPPUNIT, test "$CPPUNIT" = "yes") |
---|
457 | |
---|
458 | # Use zzuf for fuzzing tests? |
---|
459 | ZZUF="no" |
---|
460 | if test "${enable_zzuf}" != "no"; then |
---|
461 | AC_PATH_PROG(ZZUF, zzuf, no) |
---|
462 | fi |
---|
463 | AM_CONDITIONAL(USE_ZZUF, test "${ZZUF}" != "no") |
---|
464 | |
---|
465 | AC_CONFIG_FILES([ |
---|
466 | Makefile |
---|
467 | kernel/Makefile |
---|
468 | cucul/Makefile |
---|
469 | caca/Makefile |
---|
470 | src/Makefile |
---|
471 | examples/Makefile |
---|
472 | tests/Makefile |
---|
473 | tools/Makefile |
---|
474 | csharp/Makefile |
---|
475 | cxx/Makefile |
---|
476 | python/Makefile |
---|
477 | ruby/Makefile |
---|
478 | doc/Makefile |
---|
479 | msvc/Makefile |
---|
480 | ]) |
---|
481 | AC_CONFIG_FILES([ |
---|
482 | cucul/cucul_types.h |
---|
483 | cucul/cucul.pc |
---|
484 | caca/caca.pc |
---|
485 | csharp/cucul-sharp.dll.config |
---|
486 | csharp/caca-sharp.dll.config |
---|
487 | doc/doxygen.cfg |
---|
488 | ]) |
---|
489 | AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config]) |
---|
490 | AC_OUTPUT |
---|
491 | |
---|