source: libcaca/trunk/configure.ac @ 3599

Last change on this file since 3599 was 3599, checked in by sam, 5 years ago

Do not look for gmcs2. It is an abandoned abomination.

  • Property svn:keywords set to Id
File size: 17.7 KB
Line 
1# $Id$
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
49dnl FIXME: this no longer works because libtool is generated at the end
50AC_MSG_CHECKING(for library suffix)
51LT_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' | sed '/\.$/d;q'`"
52if test "$LT_SUFFIX" = ""; then
53  LT_SUFFIX=".so.$LT_MAJOR"
54  AC_MSG_RESULT([unknown, defaulting to $LT_SUFFIX])
55else
56  AC_MSG_RESULT($LT_SUFFIX)
57fi
58AC_SUBST(LT_SUFFIX)
59
60dnl output driver features
61AC_ARG_ENABLE(slang,
62  [  --enable-slang          slang graphics support (autodetected)])
63AC_ARG_ENABLE(ncurses,
64  [  --enable-ncurses        ncurses graphics support (autodetected)])
65AC_ARG_ENABLE(win32,
66  [  --enable-win32          Windows console support (autodetected)])
67AC_ARG_ENABLE(conio,
68  [  --enable-conio          DOS conio.h graphics support (autodetected)])
69AC_ARG_ENABLE(x11,
70  [  --enable-x11            X11 support (autodetected)])
71AC_ARG_ENABLE(gl,
72  [  --enable-gl             OpenGL support (autodetected)])
73AC_ARG_ENABLE(cocoa,
74  [  --enable-cocoa          Cocoa support (autodetected)])
75AC_ARG_ENABLE(network,
76  [  --enable-network        Network support (autodetected)])
77AC_ARG_ENABLE(vga,
78  [  --enable-vga            VGA support (default disabled)])
79
80dnl language bindings
81AC_ARG_ENABLE(csharp,
82  [  --enable-csharp         C# bindings (autodetected)])
83AC_ARG_ENABLE(cxx,
84  [  --enable-cxx            C++ bindings (autodetected)])
85AC_ARG_ENABLE(ruby,
86  [  --enable-ruby           Ruby bindings (autodetected)])
87
88dnl example programs features
89AC_ARG_ENABLE(imlib2,
90  [  --enable-imlib2         Imlib2 graphics support (autodetected)])
91
92dnl conditional builds
93AC_ARG_ENABLE(debug,
94  [  --enable-debug          build debug versions of the library (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 -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.4u.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_plugins}" = "yes"; then
325  ac_cv_my_have_plugins="yes"
326  AC_DEFINE(USE_PLUGINS, 1, Define to 1 to activate plugins)
327  CACA_LIBS="${CACA_LIBS} -ldl"
328else
329  CACA_CFLAGS="${CACA_CFLAGS} ${X11_CFLAGS} ${GL_CFLAGS} ${FTGL_CFLAGS}"
330  CACA_LIBS="${CACA_LIBS} ${X11_LIBS} ${GL_LIBS} ${FTGL_LIBS}"
331fi
332AM_CONDITIONAL(USE_PLUGINS, test "${ac_cv_my_have_plugins}" = "yes")
333
334AC_MSG_CHECKING(valid output drivers)
335if test -z "${CACA_DRIVERS}"; then
336  AC_MSG_RESULT(no)
337  AC_MSG_ERROR([no output drivers were selected!])
338else
339  CACA_DRIVERS="${CACA_DRIVERS# *}"
340  AC_MSG_RESULT([${CACA_DRIVERS}])
341fi
342
343AC_SUBST(MATH_LIBS)
344AC_SUBST(ZLIB_LIBS)
345AC_SUBST(GETOPT_LIBS)
346AC_SUBST(CACA_CFLAGS)
347AC_SUBST(CACA_LIBS)
348AC_SUBST(X11_CFLAGS)
349AC_SUBST(X11_LIBS)
350AC_SUBST(GL_CFLAGS)
351AC_SUBST(GL_LIBS)
352
353# How to get the C99 types. See caca/caca_types.h.in for details about
354# the CACA_TYPES variable
355if test "${ac_cv_my_have_vga}" = "yes"; then
356  CACA_TYPES=0
357else
358  AC_CHECK_HEADERS(stdint.h,
359    [CACA_TYPES=1],
360    [AC_CHECK_HEADERS(inttypes.h,
361      [CACA_TYPES=2],
362      [AC_CHECK_HEADERS(windows.h,
363        [CACA_TYPES=3],
364        [CACA_TYPES=0])])])
365fi
366AC_SUBST(CACA_TYPES)
367
368# Optimizations
369CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
370# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
371CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
372CXXFLAGS="${CXXFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare"
373
374CACA_BINDINGS=""
375
376# Build the C++ bindings?
377ac_cv_my_have_cxx="no"
378if test "${enable_cxx}" != "no"; then
379  AC_MSG_CHECKING([working <iostream>])
380  AC_LANG_PUSH(C++)
381  AC_TRY_COMPILE(
382   [#include <iostream>],
383   [],
384   [ac_cv_my_have_cxx="yes"
385    CACA_BINDINGS="${CACA_BINDINGS} C++"])
386  AC_LANG_POP(C++)
387  AC_MSG_RESULT([$ac_cv_my_have_cxx])
388fi
389AM_CONDITIONAL(USE_CXX, test "${ac_cv_my_have_cxx}" = "yes")
390
391# Build the .NET bindings?
392ac_cv_my_have_csharp="no"
393if test "${enable_csharp}" != "no"; then
394  AC_PATH_PROG(CSC, csc, no)
395  if test "$CSC" = "no"; then
396    AC_PATH_PROG(GMCS, gmcs, no)
397    CSC="$GMCS"
398  fi
399  AC_PATH_PROG(GACUTIL, gacutil, no)
400  if test "${CSC}" != "no" -a "${GACUTIL}" != "no"; then
401    ac_cv_my_have_csharp="yes"
402    CACA_BINDINGS="${CACA_BINDINGS} C#"
403  fi
404fi
405AM_CONDITIONAL(USE_CSHARP, test "${ac_cv_my_have_csharp}" = "yes")
406
407# Build the Ruby bindings?
408ac_cv_my_have_ruby="no"
409if test "${enable_ruby}" != "no"; then
410  AC_PATH_PROG(RUBY, ruby, no)
411  if test "${RUBY}" != "no"; then
412    RUBY_CFLAGS="-I$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"archdir"@:>@')"
413    RUBY_LIBS="-L$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"RUBY_SO_NAME"@:>@')"
414    RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'`
415    RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'`
416    AC_SUBST(RUBY_CFLAGS)
417    AC_SUBST(RUBY_LIBS)
418    AC_SUBST(RUBY_SITEARCHDIR)
419    AC_SUBST(RUBY_SITELIBDIR)
420    CPPFLAGS="${CPPFLAGS} ${RUBY_CFLAGS}"
421    AC_CHECK_HEADERS([ruby.h],
422     [ac_cv_my_have_ruby="yes"
423      CACA_BINDINGS="${CACA_BINDINGS} Ruby"])
424  fi
425fi
426AM_CONDITIONAL(USE_RUBY, test "${ac_cv_my_have_ruby}" = "yes")
427
428AC_MSG_CHECKING(available language bindings)
429if test -z "${CACA_BINDINGS}"; then
430  AC_MSG_RESULT(no)
431else
432  CACA_BINDINGS="${CACA_BINDINGS# *}"
433  AC_MSG_RESULT([${CACA_BINDINGS}])
434fi
435
436# Build cacaserver?
437ac_cv_my_have_network="no"
438AC_CHECK_HEADERS(sys/socket.h,
439 [ac_cv_my_have_network="yes"])
440AM_CONDITIONAL(USE_NETWORK, test "${ac_cv_my_have_network}" = "yes")
441
442# Use Imlib2?
443if test "${enable_imlib2}" != "no"; then
444  PKG_CHECK_MODULES(IMLIB2, imlib2, [IMLIB2="yes"], [IMLIB2="no"])
445  if test "${IMLIB2}" = "yes"; then
446    AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
447  fi
448fi
449
450# Build development tools?
451PKG_CHECK_MODULES(PANGOFT2, pangoft2, [PANGOFT2="yes"], [PANGOFT2="no"])
452AM_CONDITIONAL(USE_PANGO, test "${PANGOFT2}" = "yes")
453
454# Build documentation?
455DOXYGEN="no"
456LATEX="no"
457if test "${enable_doc}" != "no"; then
458  AC_PATH_PROG(DOXYGEN, doxygen, no)
459  if test "${DOXYGEN}" != "no"; then
460    # Build LaTeX documentation?
461    AC_PATH_PROG(LATEX, pdflatex, no)
462    AC_PATH_PROG(KPSEWHICH, kpsewhich, no)
463    AC_PATH_PROG(DVIPS, dvips, no)
464    if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no"; then
465      LATEX="no"
466    fi
467    if test "${LATEX}" != "no"; then
468      AC_MSG_CHECKING(for a4.sty and a4wide.sty)
469      if "${KPSEWHICH}" a4.sty >/dev/null 2>&1; then
470        if "${KPSEWHICH}" a4wide.sty >/dev/null 2>&1; then
471          AC_MSG_RESULT(yes)
472        else
473          LATEX="no"
474          AC_MSG_RESULT(no)
475        fi
476      else
477        LATEX="no"
478        AC_MSG_RESULT(no)
479      fi
480    fi
481  fi
482fi
483AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
484AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
485
486# Use cppunit for unit tests?
487PKG_CHECK_MODULES(CPPUNIT, cppunit, [CPPUNIT="yes"], [CPPUNIT="no"])
488AM_CONDITIONAL(USE_CPPUNIT, test "$CPPUNIT" = "yes")
489
490# Use zzuf for fuzzing tests?
491ZZUF="no"
492if test "${enable_zzuf}" != "no"; then
493  AC_PATH_PROG(ZZUF, zzuf, no)
494fi
495AM_CONDITIONAL(USE_ZZUF, test "${ZZUF}" != "no")
496
497AC_CONFIG_FILES([
498  Makefile
499  kernel/Makefile
500  caca/Makefile
501  src/Makefile
502  examples/Makefile
503  tests/Makefile
504  tools/Makefile
505  caca-sharp/Makefile
506  cxx/Makefile
507  python/Makefile
508  ruby/Makefile
509  doc/Makefile
510  win32/Makefile
511])
512AC_CONFIG_FILES([
513  caca/caca_types.h
514  caca/caca.pc
515  caca-sharp/caca-sharp.dll.config
516  cxx/caca++.pc
517  doc/doxygen.cfg
518])
519AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
520AC_OUTPUT
521
Note: See TracBrowser for help on using the repository browser.