source: libcaca/trunk/configure.ac @ 4104

Last change on this file since 4104 was 4094, checked in by Sam Hocevar, 11 years ago

Gather profiling information in caca_refresh_display() and caca_get_event().

  • Property svn:keywords set to Id
File size: 17.6 KB
RevLine 
[71]1# $Id: configure.ac 4094 2009-12-06 21:21:40Z sam $
[17]2
[3953]3AC_INIT(libcaca, 0.99.beta17)
[17]4AC_PREREQ(2.50)
[2316]5AC_CONFIG_AUX_DIR(.auto)
[17]6AC_CANONICAL_SYSTEM
[2864]7AM_INIT_AUTOMAKE([no-define tar-ustar])
8dnl AM_MAINTAINER_MODE
[17]9
[2864]10AM_CONFIG_HEADER(config.h)
11
[2087]12LT_MAJOR="0"
13LT_MINOR="99"
[3953]14LT_MICRO="17"
[2087]15AC_SUBST(LT_MAJOR)
16AC_SUBST(LT_MINOR)
17AC_SUBST(LT_MICRO)
18LT_VERSION="$LT_MAJOR:$LT_MINOR:$LT_MICRO"
[830]19AC_SUBST(LT_VERSION)
[17]20
21AM_PROG_CC_C_O
22AC_PROG_CPP
[781]23AC_PROG_CXX
[801]24AC_PROG_CXXCPP
[1396]25_AM_DEPENDENCIES([OBJC])
[1449]26OBJC="${CC}"
[1396]27AC_SUBST(OBJC)
28AC_SUBST(OBJCFLAGS)
[568]29AM_PROG_AS
[17]30
[475]31AC_LIBTOOL_WIN32_DLL
32AM_PROG_LIBTOOL
[781]33AC_LIBTOOL_CXX
[475]34
[344]35AC_C_CONST
36AC_C_INLINE
[348]37AC_TYPE_SIGNAL
[344]38
[157]39dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
[747]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.
[781]42AC_EGREP_CPP(yes, foo)
[747]43PKG_PROG_PKG_CONFIG()
[867]44m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
[1198]45if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
[867]46  export PKG_CONFIG_LIBDIR=/dev/null
47fi
[157]48
[3952]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)
[2888]56AC_SUBST(LT_SUFFIX)
57
[346]58dnl output driver features
[284]59AC_ARG_ENABLE(slang,
[285]60  [  --enable-slang          slang graphics support (autodetected)])
[231]61AC_ARG_ENABLE(ncurses,
[285]62  [  --enable-ncurses        ncurses graphics support (autodetected)])
[331]63AC_ARG_ENABLE(win32,
64  [  --enable-win32          Windows console support (autodetected)])
[155]65AC_ARG_ENABLE(conio,
[331]66  [  --enable-conio          DOS conio.h graphics support (autodetected)])
[251]67AC_ARG_ENABLE(x11,
[285]68  [  --enable-x11            X11 support (autodetected)])
[483]69AC_ARG_ENABLE(gl,
70  [  --enable-gl             OpenGL support (autodetected)])
[1396]71AC_ARG_ENABLE(cocoa,
72  [  --enable-cocoa          Cocoa support (autodetected)])
[554]73AC_ARG_ENABLE(network,
74  [  --enable-network        Network support (autodetected)])
[568]75AC_ARG_ENABLE(vga,
76  [  --enable-vga            VGA support (default disabled)])
[17]77
[801]78dnl language bindings
[2044]79AC_ARG_ENABLE(csharp,
80  [  --enable-csharp         C# bindings (autodetected)])
[899]81AC_ARG_ENABLE(cxx,
[2053]82  [  --enable-cxx            C++ bindings (autodetected)])
[1951]83AC_ARG_ENABLE(ruby,
[1953]84  [  --enable-ruby           Ruby bindings (autodetected)])
[781]85
[346]86dnl example programs features
87AC_ARG_ENABLE(imlib2,
[1398]88  [  --enable-imlib2         Imlib2 graphics support (autodetected)])
[346]89
90dnl conditional builds
[1360]91AC_ARG_ENABLE(debug,
[2101]92  [  --enable-debug          build debug versions of the library (default no)])
[4094]93AC_ARG_ENABLE(profiling,
94  [  --enable-profiling      activate built-in profiling (default no)])
[1208]95AC_ARG_ENABLE(plugins,
[2101]96  [  --enable-plugins        make X11 and GL drivers plugins (default disabled)])
[346]97AC_ARG_ENABLE(doc,
98  [  --enable-doc            build documentation (needs doxygen and LaTeX)])
[2301]99AC_ARG_ENABLE(cppunit,
100  [  --enable-cppunit        use cppunit for unit tests (autodetected)])
[2101]101AC_ARG_ENABLE(zzuf,
102  [  --enable-zzuf           use zzuf for fuzzing tests (autodetected)])
[346]103
[2299]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)
[2144]105AC_CHECK_FUNCS(signal ioctl snprintf vsnprintf getenv putenv strcasecmp htons)
[3588]106AC_CHECK_FUNCS(usleep gettimeofday atexit)
[348]107
[2248]108ac_cv_have_getopt_long="no"
[1207]109AC_CHECK_FUNCS(getopt_long,
[2248]110 [ac_cv_have_getopt_long="yes"],
[1207]111 [AC_CHECK_LIB(gnugetopt, getopt_long,
[2248]112   [ac_cv_have_getopt_long="yes"
[1207]113    GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
[2248]114if test "$ac_cv_have_getopt_long" != "no"; then
[3139]115  AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the ‘getopt_long’ function.)
[2248]116fi
117AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
[1207]118AC_SUBST(GETOPT_LIBS)
119
[338]120AC_MSG_CHECKING(for Sleep)
121AC_TRY_COMPILE([#include <windows.h>],[Sleep(42);],
122 [AC_MSG_RESULT(yes)
[3139]123  AC_DEFINE(HAVE_SLEEP, 1, [Define to 1 if you have the ‘Sleep’ function.])],
[338]124 [AC_MSG_RESULT(no)])
[657]125
[652]126AC_MSG_CHECKING(for fsin/fcos)
[3139]127AC_TRY_COMPILE([],[double x; asm volatile("fsin; fcos":"=t"(x):);],
[652]128 [AC_MSG_RESULT(yes)
[3139]129  AC_DEFINE(HAVE_FSIN_FCOS, 1, [Define to 1 if you have the ‘fsin’ and ‘fcos’ instructions.])],
[652]130 [AC_MSG_RESULT(no)])
[657]131
132AC_MSG_CHECKING(for fldln2/fxch/fyl2x)
[2871]133AC_TRY_COMPILE([],[double x; asm volatile("fldln2; fldln2; fxch; fyl2x":"=t"(x):);],
[657]134 [AC_MSG_RESULT(yes)
[3139]135  AC_DEFINE(HAVE_FLDLN2, 1, [Define to 1 if you have the ‘fldln2’ and other floating point instructions.])],
[657]136 [AC_MSG_RESULT(no)])
137
[2109]138AC_CHECK_HEADERS(zlib.h)
139AC_CHECK_LIB(z, gzopen, [ZLIB_LIBS="${ZLIB_LIBS} -lz"])
140
[333]141AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
[222]142
[2053]143CACA_DRIVERS=""
[284]144
[285]145if test "${enable_conio}" != "no"; then
[330]146  ac_cv_my_have_conio="no"
[285]147  AC_CHECK_HEADERS(conio.h,
[330]148   [AC_MSG_CHECKING(for ScreenUpdate in pc.h)
[331]149    AC_EGREP_HEADER(ScreenUpdate, pc.h,
[330]150     [ac_cv_my_have_conio="yes"
151      AC_MSG_RESULT(yes)
[285]152      AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
[610]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)
[330]155      CACA_DRIVERS="${CACA_DRIVERS} conio"],
156     [AC_MSG_RESULT(no)])])
[285]157  if test "${ac_cv_my_have_conio}" = "no" -a "${enable_conio}" = "yes"; then
158    AC_MSG_ERROR([cannot find conio.h])
159  fi
[265]160fi
161
[331]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,
[610]170                Define to 1 if <windows.h> defines AllocConsole.)
171      AC_DEFINE(USE_WIN32, 1, Define to 1 to activate the win32 backend driver)
[331]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
[284]179if test "${enable_slang}" != "no"; then
[330]180  ac_cv_my_have_slang="no"
[309]181  AC_CHECK_HEADERS(slang.h slang/slang.h,
[610]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,
[3139]185     [AC_DEFINE(HAVE_SLSMG_UTF8_ENABLE, 1, Define to 1 if you have the ‘SLsmg_utf8_enable’ function.)])
[610]186    CPPFLAGS="${CPPFLAGS} -DOPTIMISE_SLANG_PALETTE=1"
187    CACA_LIBS="${CACA_LIBS} -lslang"
188    CACA_DRIVERS="${CACA_DRIVERS} slang"
189    break])
[284]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
[265]193fi
194
[284]195if test "${enable_x11}" != "no"; then
[251]196  AC_PATH_X
197  AC_CHECK_LIB(X11, XOpenDisplay,
[284]198   [ac_cv_my_have_x11="yes"
[277]199    if test -n "${x_includes}"; then X_CFLAGS="-I${x_includes}"; fi
[994]200    if test -n "${x_libraries}"; then X_LIBS="-L${x_libraries}"; fi
[610]201    AC_DEFINE(USE_X11, 1, Define to 1 to activate the X11 backend driver)
[284]202    CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
[1208]203    X11_LIBS="${X11_LIBS} -lX11 ${X_LIBS}"
[284]204    CACA_DRIVERS="${CACA_DRIVERS} x11"],
205   [ac_cv_my_have_x11="no"],
[955]206   [[`if test -n "${x_libraries}"; then echo -L${x_libraries}; fi`]])
[324]207  AC_CHECK_HEADERS(X11/XKBlib.h)
[284]208  if test "${ac_cv_my_have_x11}" != "yes" -a "${enable_x11}" = "yes"; then
[251]209    AC_MSG_ERROR([cannot find X11 development files])
210  fi
[265]211fi
212
[483]213if test "${enable_gl}" != "no"; then
214  ac_cv_my_have_gl="no"
[697]215  AC_CHECK_HEADERS(GL/gl.h OpenGL/gl.h,
[610]216   [AC_CHECK_HEADERS(GL/glut.h,
[799]217     [AC_CHECK_LIB(glut, glutCloseFunc,
[3139]218       [AC_DEFINE(HAVE_GLUTCLOSEFUNC, 1, Define to 1 if you have the ‘glutCloseFunc’ function.)])
[799]219      AC_CHECK_LIB(glut, glutMainLoopEvent,
220       [ac_cv_my_have_gl="yes"])
221      AC_CHECK_LIB(glut, glutCheckLoop,
[694]222       [ac_cv_my_have_gl="yes"
[3139]223        AC_DEFINE(HAVE_GLUTCHECKLOOP, 1, Define to 1 if you have the ‘glutCheckLoop’ function.)])])
[697]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)
[1208]227    GL_LIBS="${GL_LIBS} -lGL -lglut"
[697]228    CACA_DRIVERS="${CACA_DRIVERS} gl"
229  elif test "${enable_gl}" = "yes"; then
[483]230    AC_MSG_ERROR([cannot find OpenGL+FreeGLUT development files])
231  fi
[2517]232  PKG_CHECK_MODULES(FTGL, ftgl >= 2.1.3, [FTGL="yes"], [FTGL="no"])
[483]233fi
[2539]234AM_CONDITIONAL(USE_FTGL, test "${FTGL}" = "yes")
[483]235
[1396]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
[1449]241    case x${target} in
242    xpowerpc*darwin*)
243      # 10.3 needed to link with X11
[3152]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}"
[1449]250      ;;
[3155]251    x*86_64*darwin*)
[3152]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}}"
[1449]257      ;;
[3155]258    x*86*darwin*)
[3909]259      MACOSX_SDK="${MACOSX_SDK:-/Developer/SDKs/MacOSX10.6.sdk}"
[3155]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      ;;
[1449]265    esac
[3163]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}"
[1449]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}"
[1396]274    AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver)
[1449]275    CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa"
[1396]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
[265]283if test "${enable_ncurses}" != "no"; then
[330]284  ac_cv_my_have_ncurses="no"
[629]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}"
[610]303    break])
[284]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
[17]307fi
308
[568]309if test "${enable_vga}" = "yes"; then
310  ac_cv_my_have_vga="yes"
[2265]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"
[610]315  AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver)
[568]316  CACA_DRIVERS="${CACA_DRIVERS} vga"
317fi
[570]318AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_vga}" = "yes")
[568]319
[1360]320if test "${enable_debug}" = "yes"; then
321  AC_DEFINE(DEBUG, 1, Define to 1 to activate debug)
322fi
323
[4094]324if test "${enable_profiling}" = "yes"; then
[3905]325  AC_DEFINE(PROF, 1, Define to 1 to activate profiling)
326fi
327
[1208]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
[2517]333  CACA_CFLAGS="${CACA_CFLAGS} ${X11_CFLAGS} ${GL_CFLAGS} ${FTGL_CFLAGS}"
334  CACA_LIBS="${CACA_LIBS} ${X11_LIBS} ${GL_LIBS} ${FTGL_LIBS}"
[1208]335fi
336AM_CONDITIONAL(USE_PLUGINS, test "${ac_cv_my_have_plugins}" = "yes")
337
[284]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
[1198]343  CACA_DRIVERS="${CACA_DRIVERS# *}"
[284]344  AC_MSG_RESULT([${CACA_DRIVERS}])
345fi
346
[333]347AC_SUBST(MATH_LIBS)
[2109]348AC_SUBST(ZLIB_LIBS)
[1074]349AC_SUBST(GETOPT_LIBS)
[2517]350AC_SUBST(CACA_CFLAGS)
[244]351AC_SUBST(CACA_LIBS)
[2517]352AC_SUBST(X11_CFLAGS)
[1208]353AC_SUBST(X11_LIBS)
[2517]354AC_SUBST(GL_CFLAGS)
[1208]355AC_SUBST(GL_LIBS)
[17]356
[2821]357# How to get the C99 types. See caca/caca_types.h.in for details about
358# the CACA_TYPES variable
[2299]359if test "${ac_cv_my_have_vga}" = "yes"; then
[2821]360  CACA_TYPES=0
[2299]361else
362  AC_CHECK_HEADERS(stdint.h,
[2821]363    [CACA_TYPES=1],
[2299]364    [AC_CHECK_HEADERS(inttypes.h,
[2821]365      [CACA_TYPES=2],
[2312]366      [AC_CHECK_HEADERS(windows.h,
[2821]367        [CACA_TYPES=3],
368        [CACA_TYPES=0])])])
[2299]369fi
[2821]370AC_SUBST(CACA_TYPES)
[2299]371
[125]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
[1439]375CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
[3512]376CXXFLAGS="${CXXFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare"
[125]377
[2053]378CACA_BINDINGS=""
379
[837]380# Build the C++ bindings?
[899]381ac_cv_my_have_cxx="no"
[1953]382if test "${enable_cxx}" != "no"; then
[2053]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])
[837]392fi
[899]393AM_CONDITIONAL(USE_CXX, test "${ac_cv_my_have_cxx}" = "yes")
[202]394
[2044]395# Build the .NET bindings?
396ac_cv_my_have_csharp="no"
397if test "${enable_csharp}" != "no"; then
[3593]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
[2072]403  AC_PATH_PROG(GACUTIL, gacutil, no)
[3593]404  if test "${CSC}" != "no" -a "${GACUTIL}" != "no"; then
[2044]405    ac_cv_my_have_csharp="yes"
[2053]406    CACA_BINDINGS="${CACA_BINDINGS} C#"
[1954]407  fi
408fi
[2044]409AM_CONDITIONAL(USE_CSHARP, test "${ac_cv_my_have_csharp}" = "yes")
[1954]410
[1951]411# Build the Ruby bindings?
412ac_cv_my_have_ruby="no"
[1953]413if test "${enable_ruby}" != "no"; then
[1951]414  AC_PATH_PROG(RUBY, ruby, no)
415  if test "${RUBY}" != "no"; then
[2067]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"@:>@')"
[1962]418    RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'`
[2022]419    RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'`
[2067]420    AC_SUBST(RUBY_CFLAGS)
421    AC_SUBST(RUBY_LIBS)
[1962]422    AC_SUBST(RUBY_SITEARCHDIR)
[2022]423    AC_SUBST(RUBY_SITELIBDIR)
[2067]424    CPPFLAGS="${CPPFLAGS} ${RUBY_CFLAGS}"
425    AC_CHECK_HEADERS([ruby.h],
[2053]426     [ac_cv_my_have_ruby="yes"
427      CACA_BINDINGS="${CACA_BINDINGS} Ruby"])
[1951]428  fi
429fi
430AM_CONDITIONAL(USE_RUBY, test "${ac_cv_my_have_ruby}" = "yes")
431
[2053]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
[866]440# Build cacaserver?
[976]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")
[866]445
[288]446# Use Imlib2?
447if test "${enable_imlib2}" != "no"; then
[2302]448  PKG_CHECK_MODULES(IMLIB2, imlib2, [IMLIB2="yes"], [IMLIB2="no"])
449  if test "${IMLIB2}" = "yes"; then
[1398]450    AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
[288]451  fi
[224]452fi
[217]453
[747]454# Build development tools?
[2302]455PKG_CHECK_MODULES(PANGOFT2, pangoft2, [PANGOFT2="yes"], [PANGOFT2="no"])
456AM_CONDITIONAL(USE_PANGO, test "${PANGOFT2}" = "yes")
[747]457
[207]458# Build documentation?
[346]459DOXYGEN="no"
460LATEX="no"
461if test "${enable_doc}" != "no"; then
462  AC_PATH_PROG(DOXYGEN, doxygen, no)
[1398]463  if test "${DOXYGEN}" != "no"; then
464    # Build LaTeX documentation?
465    AC_PATH_PROG(LATEX, pdflatex, no)
[1912]466    AC_PATH_PROG(KPSEWHICH, kpsewhich, no)
[1398]467    AC_PATH_PROG(DVIPS, dvips, no)
[1912]468    if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no"; then
[1398]469      LATEX="no"
470    fi
[1912]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
[1829]480      else
481        LATEX="no"
482        AC_MSG_RESULT(no)
483      fi
[1398]484    fi
[346]485  fi
[313]486fi
[346]487AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
488AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
[207]489
[2301]490# Use cppunit for unit tests?
[2302]491PKG_CHECK_MODULES(CPPUNIT, cppunit, [CPPUNIT="yes"], [CPPUNIT="no"])
492AM_CONDITIONAL(USE_CPPUNIT, test "$CPPUNIT" = "yes")
[2301]493
[2101]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
[245]501AC_CONFIG_FILES([
[17]502  Makefile
[568]503  kernel/Makefile
[536]504  caca/Makefile
[538]505  src/Makefile
[2101]506  examples/Makefile
[4044]507  test/Makefile
[742]508  tools/Makefile
[2955]509  caca-sharp/Makefile
[899]510  cxx/Makefile
[2060]511  python/Makefile
[1951]512  ruby/Makefile
[207]513  doc/Makefile
[2900]514  win32/Makefile
[17]515])
[729]516AC_CONFIG_FILES([
[2821]517  caca/caca_types.h
[729]518  caca/caca.pc
[2955]519  caca-sharp/caca-sharp.dll.config
[2425]520  cxx/caca++.pc
[729]521  doc/doxygen.cfg
522])
[245]523AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
524AC_OUTPUT
[17]525
Note: See TracBrowser for help on using the repository browser.