source: libcaca/trunk/configure.ac @ 3123

Last change on this file since 3123 was 3045, checked in by Jean-Yves Lamoureux, 12 years ago
  • Made compilation work only under Mac OS X 10.5 (Leopard) as it is the only test plateform available to me, waiting for something more clever
  • Property svn:keywords set to Id
File size: 16.8 KB
RevLine 
[71]1# $Id: configure.ac 3045 2008-10-19 14:44:25Z jylam $
[17]2
[2965]3AC_INIT(libcaca, 0.99.beta16)
[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"
[2967]14LT_MICRO="16"
[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
[2888]49AC_MSG_CHECKING(for library suffix)
[2895]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`"
[2888]51if test "$LT_SUFFIX" = ""; then
52  LT_SUFFIX=".so.$LT_MAJOR"
[2895]53  AC_MSG_RESULT([unknown, defaulting to $LT_SUFFIX])
[2888]54else
55  AC_MSG_RESULT($LT_SUFFIX)
56fi
57AC_SUBST(LT_SUFFIX)
58
[346]59dnl output driver features
[284]60AC_ARG_ENABLE(slang,
[285]61  [  --enable-slang          slang graphics support (autodetected)])
[231]62AC_ARG_ENABLE(ncurses,
[285]63  [  --enable-ncurses        ncurses graphics support (autodetected)])
[331]64AC_ARG_ENABLE(win32,
65  [  --enable-win32          Windows console support (autodetected)])
[155]66AC_ARG_ENABLE(conio,
[331]67  [  --enable-conio          DOS conio.h graphics support (autodetected)])
[251]68AC_ARG_ENABLE(x11,
[285]69  [  --enable-x11            X11 support (autodetected)])
[483]70AC_ARG_ENABLE(gl,
71  [  --enable-gl             OpenGL support (autodetected)])
[1396]72AC_ARG_ENABLE(cocoa,
73  [  --enable-cocoa          Cocoa support (autodetected)])
[554]74AC_ARG_ENABLE(network,
75  [  --enable-network        Network support (autodetected)])
[568]76AC_ARG_ENABLE(vga,
77  [  --enable-vga            VGA support (default disabled)])
[17]78
[801]79dnl language bindings
[2044]80AC_ARG_ENABLE(csharp,
81  [  --enable-csharp         C# bindings (autodetected)])
[899]82AC_ARG_ENABLE(cxx,
[2053]83  [  --enable-cxx            C++ bindings (autodetected)])
[1951]84AC_ARG_ENABLE(ruby,
[1953]85  [  --enable-ruby           Ruby bindings (autodetected)])
[781]86
[346]87dnl example programs features
88AC_ARG_ENABLE(imlib2,
[1398]89  [  --enable-imlib2         Imlib2 graphics support (autodetected)])
[346]90
91dnl conditional builds
[1360]92AC_ARG_ENABLE(debug,
[2101]93  [  --enable-debug          build debug versions of the library (default no)])
[1208]94AC_ARG_ENABLE(plugins,
[2101]95  [  --enable-plugins        make X11 and GL drivers plugins (default disabled)])
[346]96AC_ARG_ENABLE(doc,
97  [  --enable-doc            build documentation (needs doxygen and LaTeX)])
[2301]98AC_ARG_ENABLE(cppunit,
99  [  --enable-cppunit        use cppunit for unit tests (autodetected)])
[2101]100AC_ARG_ENABLE(zzuf,
101  [  --enable-zzuf           use zzuf for fuzzing tests (autodetected)])
[346]102
[2299]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)
[2144]104AC_CHECK_FUNCS(signal ioctl snprintf vsnprintf getenv putenv strcasecmp htons)
[1086]105AC_CHECK_FUNCS(usleep gettimeofday)
[348]106
[2248]107ac_cv_have_getopt_long="no"
[1207]108AC_CHECK_FUNCS(getopt_long,
[2248]109 [ac_cv_have_getopt_long="yes"],
[1207]110 [AC_CHECK_LIB(gnugetopt, getopt_long,
[2248]111   [ac_cv_have_getopt_long="yes"
[1207]112    GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
[2248]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")
[1207]117AC_SUBST(GETOPT_LIBS)
118
[338]119AC_MSG_CHECKING(for Sleep)
120AC_TRY_COMPILE([#include <windows.h>],[Sleep(42);],
121 [AC_MSG_RESULT(yes)
[610]122  AC_DEFINE(HAVE_SLEEP, 1, [Define to 1 if you have the `Sleep' function.])],
[338]123 [AC_MSG_RESULT(no)])
[657]124
[652]125AC_MSG_CHECKING(for fsin/fcos)
[2871]126AC_TRY_COMPILE([],[double x; asm volatile("fsin\n\tfcos":"=t"(x):);],
[652]127 [AC_MSG_RESULT(yes)
[2871]128  AC_DEFINE(HAVE_FSIN_FCOS, 1, [Define to 1 if you have the `fsin' and `fcos' instructions.])],
[652]129 [AC_MSG_RESULT(no)])
[657]130
131AC_MSG_CHECKING(for fldln2/fxch/fyl2x)
[2871]132AC_TRY_COMPILE([],[double x; asm volatile("fldln2; fldln2; fxch; fyl2x":"=t"(x):);],
[657]133 [AC_MSG_RESULT(yes)
[2871]134  AC_DEFINE(HAVE_FLDLN2, 1, [Define to 1 if you have the `fldln2' and other floating point instructions.])],
[657]135 [AC_MSG_RESULT(no)])
136
[2109]137AC_CHECK_HEADERS(zlib.h)
138AC_CHECK_LIB(z, gzopen, [ZLIB_LIBS="${ZLIB_LIBS} -lz"])
139
[333]140AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
[222]141
[2053]142CACA_DRIVERS=""
[284]143
[285]144if test "${enable_conio}" != "no"; then
[330]145  ac_cv_my_have_conio="no"
[285]146  AC_CHECK_HEADERS(conio.h,
[330]147   [AC_MSG_CHECKING(for ScreenUpdate in pc.h)
[331]148    AC_EGREP_HEADER(ScreenUpdate, pc.h,
[330]149     [ac_cv_my_have_conio="yes"
150      AC_MSG_RESULT(yes)
[285]151      AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
[610]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)
[330]154      CACA_DRIVERS="${CACA_DRIVERS} conio"],
155     [AC_MSG_RESULT(no)])])
[285]156  if test "${ac_cv_my_have_conio}" = "no" -a "${enable_conio}" = "yes"; then
157    AC_MSG_ERROR([cannot find conio.h])
158  fi
[265]159fi
160
[331]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,
[610]169                Define to 1 if <windows.h> defines AllocConsole.)
170      AC_DEFINE(USE_WIN32, 1, Define to 1 to activate the win32 backend driver)
[331]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
[284]178if test "${enable_slang}" != "no"; then
[330]179  ac_cv_my_have_slang="no"
[309]180  AC_CHECK_HEADERS(slang.h slang/slang.h,
[610]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])
[284]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
[265]192fi
193
[284]194if test "${enable_x11}" != "no"; then
[251]195  AC_PATH_X
196  AC_CHECK_LIB(X11, XOpenDisplay,
[284]197   [ac_cv_my_have_x11="yes"
[277]198    if test -n "${x_includes}"; then X_CFLAGS="-I${x_includes}"; fi
[994]199    if test -n "${x_libraries}"; then X_LIBS="-L${x_libraries}"; fi
[610]200    AC_DEFINE(USE_X11, 1, Define to 1 to activate the X11 backend driver)
[284]201    CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
[1208]202    X11_LIBS="${X11_LIBS} -lX11 ${X_LIBS}"
[284]203    CACA_DRIVERS="${CACA_DRIVERS} x11"],
204   [ac_cv_my_have_x11="no"],
[955]205   [[`if test -n "${x_libraries}"; then echo -L${x_libraries}; fi`]])
[324]206  AC_CHECK_HEADERS(X11/XKBlib.h)
[284]207  if test "${ac_cv_my_have_x11}" != "yes" -a "${enable_x11}" = "yes"; then
[251]208    AC_MSG_ERROR([cannot find X11 development files])
209  fi
[265]210fi
211
[483]212if test "${enable_gl}" != "no"; then
213  ac_cv_my_have_gl="no"
[697]214  AC_CHECK_HEADERS(GL/gl.h OpenGL/gl.h,
[610]215   [AC_CHECK_HEADERS(GL/glut.h,
[799]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,
[694]221       [ac_cv_my_have_gl="yes"
[697]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)
[1208]226    GL_LIBS="${GL_LIBS} -lGL -lglut"
[697]227    CACA_DRIVERS="${CACA_DRIVERS} gl"
228  elif test "${enable_gl}" = "yes"; then
[483]229    AC_MSG_ERROR([cannot find OpenGL+FreeGLUT development files])
230  fi
[2517]231  PKG_CHECK_MODULES(FTGL, ftgl >= 2.1.3, [FTGL="yes"], [FTGL="no"])
[483]232fi
[2539]233AM_CONDITIONAL(USE_FTGL, test "${FTGL}" = "yes")
[483]234
[1396]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
[1449]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*)
[3045]251      MACOSX_SDK=/Developer/SDKs/MacOSX10.5.sdk
[1449]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}"
[1396]266    AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver)
[1449]267    CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa"
[1396]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
[265]275if test "${enable_ncurses}" != "no"; then
[330]276  ac_cv_my_have_ncurses="no"
[629]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}"
[610]295    break])
[284]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
[17]299fi
300
[568]301if test "${enable_vga}" = "yes"; then
302  ac_cv_my_have_vga="yes"
[2265]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"
[610]307  AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver)
[568]308  CACA_DRIVERS="${CACA_DRIVERS} vga"
309fi
[570]310AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_vga}" = "yes")
[568]311
[1360]312if test "${enable_debug}" = "yes"; then
313  AC_DEFINE(DEBUG, 1, Define to 1 to activate debug)
314fi
315
[1208]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
[2517]321  CACA_CFLAGS="${CACA_CFLAGS} ${X11_CFLAGS} ${GL_CFLAGS} ${FTGL_CFLAGS}"
322  CACA_LIBS="${CACA_LIBS} ${X11_LIBS} ${GL_LIBS} ${FTGL_LIBS}"
[1208]323fi
324AM_CONDITIONAL(USE_PLUGINS, test "${ac_cv_my_have_plugins}" = "yes")
325
[284]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
[1198]331  CACA_DRIVERS="${CACA_DRIVERS# *}"
[284]332  AC_MSG_RESULT([${CACA_DRIVERS}])
333fi
334
[333]335AC_SUBST(MATH_LIBS)
[2109]336AC_SUBST(ZLIB_LIBS)
[1074]337AC_SUBST(GETOPT_LIBS)
[2517]338AC_SUBST(CACA_CFLAGS)
[244]339AC_SUBST(CACA_LIBS)
[2517]340AC_SUBST(X11_CFLAGS)
[1208]341AC_SUBST(X11_LIBS)
[2517]342AC_SUBST(GL_CFLAGS)
[1208]343AC_SUBST(GL_LIBS)
[17]344
[2821]345# How to get the C99 types. See caca/caca_types.h.in for details about
346# the CACA_TYPES variable
[2299]347if test "${ac_cv_my_have_vga}" = "yes"; then
[2821]348  CACA_TYPES=0
[2299]349else
350  AC_CHECK_HEADERS(stdint.h,
[2821]351    [CACA_TYPES=1],
[2299]352    [AC_CHECK_HEADERS(inttypes.h,
[2821]353      [CACA_TYPES=2],
[2312]354      [AC_CHECK_HEADERS(windows.h,
[2821]355        [CACA_TYPES=3],
356        [CACA_TYPES=0])])])
[2299]357fi
[2821]358AC_SUBST(CACA_TYPES)
[2299]359
[125]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
[1439]363CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
[125]364
[2053]365CACA_BINDINGS=""
366
[837]367# Build the C++ bindings?
[899]368ac_cv_my_have_cxx="no"
[1953]369if test "${enable_cxx}" != "no"; then
[2053]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])
[837]379fi
[899]380AM_CONDITIONAL(USE_CXX, test "${ac_cv_my_have_cxx}" = "yes")
[202]381
[2044]382# Build the .NET bindings?
383ac_cv_my_have_csharp="no"
384if test "${enable_csharp}" != "no"; then
[1954]385  AC_PATH_PROG(GMCS, gmcs, no)
[2072]386  AC_PATH_PROG(GACUTIL, gacutil, no)
387  if test "${GMCS}" != "no" -a "${GACUTIL}" != "no"; then
[2044]388    ac_cv_my_have_csharp="yes"
[2053]389    CACA_BINDINGS="${CACA_BINDINGS} C#"
[1954]390  fi
391fi
[2044]392AM_CONDITIONAL(USE_CSHARP, test "${ac_cv_my_have_csharp}" = "yes")
[1954]393
[1951]394# Build the Ruby bindings?
395ac_cv_my_have_ruby="no"
[1953]396if test "${enable_ruby}" != "no"; then
[1951]397  AC_PATH_PROG(RUBY, ruby, no)
398  if test "${RUBY}" != "no"; then
[2067]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"@:>@')"
[1962]401    RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'`
[2022]402    RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'`
[2067]403    AC_SUBST(RUBY_CFLAGS)
404    AC_SUBST(RUBY_LIBS)
[1962]405    AC_SUBST(RUBY_SITEARCHDIR)
[2022]406    AC_SUBST(RUBY_SITELIBDIR)
[2067]407    CPPFLAGS="${CPPFLAGS} ${RUBY_CFLAGS}"
408    AC_CHECK_HEADERS([ruby.h],
[2053]409     [ac_cv_my_have_ruby="yes"
410      CACA_BINDINGS="${CACA_BINDINGS} Ruby"])
[1951]411  fi
412fi
413AM_CONDITIONAL(USE_RUBY, test "${ac_cv_my_have_ruby}" = "yes")
414
[2053]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
[866]423# Build cacaserver?
[976]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")
[866]428
[288]429# Use Imlib2?
430if test "${enable_imlib2}" != "no"; then
[2302]431  PKG_CHECK_MODULES(IMLIB2, imlib2, [IMLIB2="yes"], [IMLIB2="no"])
432  if test "${IMLIB2}" = "yes"; then
[1398]433    AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
[288]434  fi
[224]435fi
[217]436
[747]437# Build development tools?
[2302]438PKG_CHECK_MODULES(PANGOFT2, pangoft2, [PANGOFT2="yes"], [PANGOFT2="no"])
439AM_CONDITIONAL(USE_PANGO, test "${PANGOFT2}" = "yes")
[747]440
[207]441# Build documentation?
[346]442DOXYGEN="no"
443LATEX="no"
444if test "${enable_doc}" != "no"; then
445  AC_PATH_PROG(DOXYGEN, doxygen, no)
[1398]446  if test "${DOXYGEN}" != "no"; then
447    # Build LaTeX documentation?
448    AC_PATH_PROG(LATEX, pdflatex, no)
[1912]449    AC_PATH_PROG(KPSEWHICH, kpsewhich, no)
[1398]450    AC_PATH_PROG(DVIPS, dvips, no)
[1912]451    if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no"; then
[1398]452      LATEX="no"
453    fi
[1912]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
[1829]463      else
464        LATEX="no"
465        AC_MSG_RESULT(no)
466      fi
[1398]467    fi
[346]468  fi
[313]469fi
[346]470AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
471AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
[207]472
[2301]473# Use cppunit for unit tests?
[2302]474PKG_CHECK_MODULES(CPPUNIT, cppunit, [CPPUNIT="yes"], [CPPUNIT="no"])
475AM_CONDITIONAL(USE_CPPUNIT, test "$CPPUNIT" = "yes")
[2301]476
[2101]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
[245]484AC_CONFIG_FILES([
[17]485  Makefile
[568]486  kernel/Makefile
[536]487  caca/Makefile
[538]488  src/Makefile
[2101]489  examples/Makefile
[2103]490  tests/Makefile
[742]491  tools/Makefile
[2955]492  caca-sharp/Makefile
[899]493  cxx/Makefile
[2060]494  python/Makefile
[1951]495  ruby/Makefile
[207]496  doc/Makefile
[2900]497  win32/Makefile
[17]498])
[729]499AC_CONFIG_FILES([
[2821]500  caca/caca_types.h
[729]501  caca/caca.pc
[2955]502  caca-sharp/caca-sharp.dll.config
[2425]503  cxx/caca++.pc
[729]504  doc/doxygen.cfg
505])
[245]506AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
507AC_OUTPUT
[17]508
Note: See TracBrowser for help on using the repository browser.