source: libcaca/trunk/configure.ac @ 4149

Last change on this file since 4149 was 4144, checked in by Sam Hocevar, 10 years ago

Explicitly link with -lGLU because freeglut may not provide it. Fixes #61.

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