source: libcaca/trunk/configure.ac @ 2967

Last change on this file since 2967 was 2967, checked in by Sam Hocevar, 15 years ago

Bump soname versioning.

  • Property svn:keywords set to Id
File size: 16.8 KB
Line 
1# $Id: configure.ac 2967 2008-10-18 12:57:10Z sam $
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\n\tfcos":"=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=/Developer/SDKs/MacOSX10.3.9.sdk
244      GCC_VERSION=3.3
245      ARCH="-arch ppc"
246      MACOSX_SDK_CFLAGS="-nostdinc -isystem ${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOSX_SDK}/usr/include"
247      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="-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*darwin*)
251      MACOSX_SDK=/Developer/SDKs/MacOSX10.4u.sdk
252      GCC_VERSION=4.0
253      ARCH="-arch i386"
254      MACOSX_SDK_CFLAGS="-isysroot ${MACOSX_SDK}"
255      MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CFLAGS}"
256      ;;
257    esac
258    CC=gcc-${GCC_VERSION}
259    CXX=g++-${GCC_VERSION}
260    MACOSX_SDK_FRAMEWORKS="-F${MACOSX_SDK}/System/Library/Frameworks"
261    CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}"
262    CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS}"
263    CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}"
264    OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}"
265    LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}"
266    AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver)
267    CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa"
268    CACA_DRIVERS="${CACA_DRIVERS} cocoa"
269  elif test "${enable_cocoa}" = "yes"; then
270    AC_MSG_ERROR([cannot find Cocoa development files])
271  fi
272fi
273AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes")
274
275if test "${enable_ncurses}" != "no"; then
276  ac_cv_my_have_ncurses="no"
277  AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses/ncurses.h ncurses.h curses.h,
278   [ncurses="no"
279    AC_CHECK_LIB(ncursesw, initscr,
280     [ncurses="-lncursesw"],
281     [AC_CHECK_LIB(ncurses, initscr,
282       [ncurses="-lncurses"])])
283    if test "${ncurses}" = "no"; then
284      continue
285    fi
286    ac_cv_my_have_ncurses="yes"
287    AC_DEFINE(USE_NCURSES, 1, Define to 1 to activate the ncurses backend driver)
288    CACA_LIBS="${CACA_LIBS} ${ncurses}"
289    CACA_DRIVERS="${CACA_DRIVERS} ncurses"
290    dnl  Check for resizeterm or resize_term
291    SAVED_LIBS="${LIBS}"
292    LIBS="${LIBS} ${ncurses}"
293    AC_CHECK_FUNCS(resizeterm resize_term)
294    LIBS="${SAVED_LIBS}"
295    break])
296  if test "${ac_cv_my_have_ncurses}" = "no" -a "${enable_ncurses}" = "yes"; then
297    AC_MSG_ERROR([cannot find ncurses development files])
298  fi
299fi
300
301if test "${enable_vga}" = "yes"; then
302  ac_cv_my_have_vga="yes"
303  CPPFLAGS="${CPPFLAGS} -I. -D__KERNEL__ -nostdinc -include kernel/kernel.h -fno-stack-protector"
304  CFLAGS="${CFLAGS} -fno-builtin -O2 -Wall -fno-stack-protector"
305  CCASFLAGS="${CCASFLAGS} -I. -fno-stack-protector"
306  LDFLAGS="${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -fno-stack-protector"
307  AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver)
308  CACA_DRIVERS="${CACA_DRIVERS} vga"
309fi
310AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_vga}" = "yes")
311
312if test "${enable_debug}" = "yes"; then
313  AC_DEFINE(DEBUG, 1, Define to 1 to activate debug)
314fi
315
316if test "${enable_plugins}" = "yes"; then
317  ac_cv_my_have_plugins="yes"
318  AC_DEFINE(USE_PLUGINS, 1, Define to 1 to activate plugins)
319  CACA_LIBS="${CACA_LIBS} -ldl"
320else
321  CACA_CFLAGS="${CACA_CFLAGS} ${X11_CFLAGS} ${GL_CFLAGS} ${FTGL_CFLAGS}"
322  CACA_LIBS="${CACA_LIBS} ${X11_LIBS} ${GL_LIBS} ${FTGL_LIBS}"
323fi
324AM_CONDITIONAL(USE_PLUGINS, test "${ac_cv_my_have_plugins}" = "yes")
325
326AC_MSG_CHECKING(valid output drivers)
327if test -z "${CACA_DRIVERS}"; then
328  AC_MSG_RESULT(no)
329  AC_MSG_ERROR([no output drivers were selected!])
330else
331  CACA_DRIVERS="${CACA_DRIVERS# *}"
332  AC_MSG_RESULT([${CACA_DRIVERS}])
333fi
334
335AC_SUBST(MATH_LIBS)
336AC_SUBST(ZLIB_LIBS)
337AC_SUBST(GETOPT_LIBS)
338AC_SUBST(CACA_CFLAGS)
339AC_SUBST(CACA_LIBS)
340AC_SUBST(X11_CFLAGS)
341AC_SUBST(X11_LIBS)
342AC_SUBST(GL_CFLAGS)
343AC_SUBST(GL_LIBS)
344
345# How to get the C99 types. See caca/caca_types.h.in for details about
346# the CACA_TYPES variable
347if test "${ac_cv_my_have_vga}" = "yes"; then
348  CACA_TYPES=0
349else
350  AC_CHECK_HEADERS(stdint.h,
351    [CACA_TYPES=1],
352    [AC_CHECK_HEADERS(inttypes.h,
353      [CACA_TYPES=2],
354      [AC_CHECK_HEADERS(windows.h,
355        [CACA_TYPES=3],
356        [CACA_TYPES=0])])])
357fi
358AC_SUBST(CACA_TYPES)
359
360# Optimizations
361CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
362# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
363CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
364
365CACA_BINDINGS=""
366
367# Build the C++ bindings?
368ac_cv_my_have_cxx="no"
369if test "${enable_cxx}" != "no"; then
370  AC_MSG_CHECKING([working <iostream>])
371  AC_LANG_PUSH(C++)
372  AC_TRY_COMPILE(
373   [#include <iostream>],
374   [],
375   [ac_cv_my_have_cxx="yes"
376    CACA_BINDINGS="${CACA_BINDINGS} C++"])
377  AC_LANG_POP(C++)
378  AC_MSG_RESULT([$ac_cv_my_have_cxx])
379fi
380AM_CONDITIONAL(USE_CXX, test "${ac_cv_my_have_cxx}" = "yes")
381
382# Build the .NET bindings?
383ac_cv_my_have_csharp="no"
384if test "${enable_csharp}" != "no"; then
385  AC_PATH_PROG(GMCS, gmcs, no)
386  AC_PATH_PROG(GACUTIL, gacutil, no)
387  if test "${GMCS}" != "no" -a "${GACUTIL}" != "no"; then
388    ac_cv_my_have_csharp="yes"
389    CACA_BINDINGS="${CACA_BINDINGS} C#"
390  fi
391fi
392AM_CONDITIONAL(USE_CSHARP, test "${ac_cv_my_have_csharp}" = "yes")
393
394# Build the Ruby bindings?
395ac_cv_my_have_ruby="no"
396if test "${enable_ruby}" != "no"; then
397  AC_PATH_PROG(RUBY, ruby, no)
398  if test "${RUBY}" != "no"; then
399    RUBY_CFLAGS="-I$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"archdir"@:>@')"
400    RUBY_LIBS="-L$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"RUBY_SO_NAME"@:>@')"
401    RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'`
402    RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'`
403    AC_SUBST(RUBY_CFLAGS)
404    AC_SUBST(RUBY_LIBS)
405    AC_SUBST(RUBY_SITEARCHDIR)
406    AC_SUBST(RUBY_SITELIBDIR)
407    CPPFLAGS="${CPPFLAGS} ${RUBY_CFLAGS}"
408    AC_CHECK_HEADERS([ruby.h],
409     [ac_cv_my_have_ruby="yes"
410      CACA_BINDINGS="${CACA_BINDINGS} Ruby"])
411  fi
412fi
413AM_CONDITIONAL(USE_RUBY, test "${ac_cv_my_have_ruby}" = "yes")
414
415AC_MSG_CHECKING(available language bindings)
416if test -z "${CACA_BINDINGS}"; then
417  AC_MSG_RESULT(no)
418else
419  CACA_BINDINGS="${CACA_BINDINGS# *}"
420  AC_MSG_RESULT([${CACA_BINDINGS}])
421fi
422
423# Build cacaserver?
424ac_cv_my_have_network="no"
425AC_CHECK_HEADERS(sys/socket.h,
426 [ac_cv_my_have_network="yes"])
427AM_CONDITIONAL(USE_NETWORK, test "${ac_cv_my_have_network}" = "yes")
428
429# Use Imlib2?
430if test "${enable_imlib2}" != "no"; then
431  PKG_CHECK_MODULES(IMLIB2, imlib2, [IMLIB2="yes"], [IMLIB2="no"])
432  if test "${IMLIB2}" = "yes"; then
433    AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
434  fi
435fi
436
437# Build development tools?
438PKG_CHECK_MODULES(PANGOFT2, pangoft2, [PANGOFT2="yes"], [PANGOFT2="no"])
439AM_CONDITIONAL(USE_PANGO, test "${PANGOFT2}" = "yes")
440
441# Build documentation?
442DOXYGEN="no"
443LATEX="no"
444if test "${enable_doc}" != "no"; then
445  AC_PATH_PROG(DOXYGEN, doxygen, no)
446  if test "${DOXYGEN}" != "no"; then
447    # Build LaTeX documentation?
448    AC_PATH_PROG(LATEX, pdflatex, no)
449    AC_PATH_PROG(KPSEWHICH, kpsewhich, no)
450    AC_PATH_PROG(DVIPS, dvips, no)
451    if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no"; then
452      LATEX="no"
453    fi
454    if test "${LATEX}" != "no"; then
455      AC_MSG_CHECKING(for a4.sty and a4wide.sty)
456      if "${KPSEWHICH}" a4.sty >/dev/null 2>&1; then
457        if "${KPSEWHICH}" a4wide.sty >/dev/null 2>&1; then
458          AC_MSG_RESULT(yes)
459        else
460          LATEX="no"
461          AC_MSG_RESULT(no)
462        fi
463      else
464        LATEX="no"
465        AC_MSG_RESULT(no)
466      fi
467    fi
468  fi
469fi
470AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
471AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
472
473# Use cppunit for unit tests?
474PKG_CHECK_MODULES(CPPUNIT, cppunit, [CPPUNIT="yes"], [CPPUNIT="no"])
475AM_CONDITIONAL(USE_CPPUNIT, test "$CPPUNIT" = "yes")
476
477# Use zzuf for fuzzing tests?
478ZZUF="no"
479if test "${enable_zzuf}" != "no"; then
480  AC_PATH_PROG(ZZUF, zzuf, no)
481fi
482AM_CONDITIONAL(USE_ZZUF, test "${ZZUF}" != "no")
483
484AC_CONFIG_FILES([
485  Makefile
486  kernel/Makefile
487  caca/Makefile
488  src/Makefile
489  examples/Makefile
490  tests/Makefile
491  tools/Makefile
492  caca-sharp/Makefile
493  cxx/Makefile
494  python/Makefile
495  ruby/Makefile
496  doc/Makefile
497  win32/Makefile
498])
499AC_CONFIG_FILES([
500  caca/caca_types.h
501  caca/caca.pc
502  caca-sharp/caca-sharp.dll.config
503  cxx/caca++.pc
504  doc/doxygen.cfg
505])
506AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
507AC_OUTPUT
508
Note: See TracBrowser for help on using the repository browser.