25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

499 lines
16 KiB

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