source: libcaca/trunk/configure.ac @ 3297

Last change on this file since 3297 was 3163, checked in by bsittler, 11 years ago

allow CC, CXX and MACOSX_SDK_FRAMEWORKS to be overridden using exported environment variables at configure-time

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