You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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