您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

496 行
16 KiB

  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.beta15)
  7. LT_MAJOR="0"
  8. LT_MINOR="99"
  9. LT_MICRO="13"
  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([],[asm("fsin\n\tfcos");],
  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([],[asm("fldln2; fldln2; fxch; fyl2x");],
  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. fi
  197. if test "${enable_cocoa}" != "no"; then
  198. ac_cv_my_have_cocoa="no"
  199. AC_CHECK_HEADERS(Cocoa/Cocoa.h,
  200. [ac_cv_my_have_cocoa="yes"])
  201. if test "${ac_cv_my_have_cocoa}" = "yes"; then
  202. case x${target} in
  203. xpowerpc*darwin*)
  204. # 10.3 needed to link with X11
  205. MACOSX_SDK=/Developer/SDKs/MacOSX10.3.9.sdk
  206. GCC_VERSION=3.3
  207. ARCH="-arch ppc"
  208. MACOSX_SDK_CFLAGS="-nostdinc -isystem ${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOSX_SDK}/usr/include"
  209. 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"
  210. MACOSX_SDK_LDFLAGS="-L${MACOSX_SDK}/usr/lib/gcc/darwin -L${MACOSX_SDK}/usr/lib/gcc/darwin/${GCC_VERSION} -L${MACOSX_SDK}/usr/lib"
  211. ;;
  212. x*86*darwin*)
  213. MACOSX_SDK=/Developer/SDKs/MacOSX10.4u.sdk
  214. GCC_VERSION=4.0
  215. ARCH="-arch i386"
  216. MACOSX_SDK_CFLAGS="-isysroot ${MACOSX_SDK}"
  217. MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CFLAGS}"
  218. ;;
  219. esac
  220. CC=gcc-${GCC_VERSION}
  221. CXX=g++-${GCC_VERSION}
  222. MACOSX_SDK_FRAMEWORKS="-F${MACOSX_SDK}/System/Library/Frameworks"
  223. CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}"
  224. CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS}"
  225. CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}"
  226. OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}"
  227. LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}"
  228. AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver)
  229. CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa"
  230. CACA_DRIVERS="${CACA_DRIVERS} cocoa"
  231. elif test "${enable_cocoa}" = "yes"; then
  232. AC_MSG_ERROR([cannot find Cocoa development files])
  233. fi
  234. fi
  235. AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes")
  236. if test "${enable_ncurses}" != "no"; then
  237. ac_cv_my_have_ncurses="no"
  238. AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses/ncurses.h ncurses.h curses.h,
  239. [ncurses="no"
  240. AC_CHECK_LIB(ncursesw, initscr,
  241. [ncurses="-lncursesw"],
  242. [AC_CHECK_LIB(ncurses, initscr,
  243. [ncurses="-lncurses"])])
  244. if test "${ncurses}" = "no"; then
  245. continue
  246. fi
  247. ac_cv_my_have_ncurses="yes"
  248. AC_DEFINE(USE_NCURSES, 1, Define to 1 to activate the ncurses backend driver)
  249. CACA_LIBS="${CACA_LIBS} ${ncurses}"
  250. CACA_DRIVERS="${CACA_DRIVERS} ncurses"
  251. dnl Check for resizeterm or resize_term
  252. SAVED_LIBS="${LIBS}"
  253. LIBS="${LIBS} ${ncurses}"
  254. AC_CHECK_FUNCS(resizeterm resize_term)
  255. LIBS="${SAVED_LIBS}"
  256. break])
  257. if test "${ac_cv_my_have_ncurses}" = "no" -a "${enable_ncurses}" = "yes"; then
  258. AC_MSG_ERROR([cannot find ncurses development files])
  259. fi
  260. fi
  261. if test "${enable_vga}" = "yes"; then
  262. ac_cv_my_have_vga="yes"
  263. CPPFLAGS="${CPPFLAGS} -I. -D__KERNEL__ -nostdinc -include kernel/kernel.h -fno-stack-protector"
  264. CFLAGS="${CFLAGS} -fno-builtin -O2 -Wall -fno-stack-protector"
  265. CCASFLAGS="${CCASFLAGS} -I. -fno-stack-protector"
  266. LDFLAGS="${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -fno-stack-protector"
  267. AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver)
  268. CACA_DRIVERS="${CACA_DRIVERS} vga"
  269. fi
  270. AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_vga}" = "yes")
  271. if test "${enable_debug}" = "yes"; then
  272. AC_DEFINE(DEBUG, 1, Define to 1 to activate debug)
  273. fi
  274. if test "${enable_plugins}" = "yes"; then
  275. ac_cv_my_have_plugins="yes"
  276. AC_DEFINE(USE_PLUGINS, 1, Define to 1 to activate plugins)
  277. CACA_LIBS="${CACA_LIBS} -ldl"
  278. else
  279. CACA_LIBS="${CACA_LIBS} ${X11_LIBS} ${GL_LIBS}"
  280. fi
  281. AM_CONDITIONAL(USE_PLUGINS, test "${ac_cv_my_have_plugins}" = "yes")
  282. AC_MSG_CHECKING(valid output drivers)
  283. if test -z "${CACA_DRIVERS}"; then
  284. AC_MSG_RESULT(no)
  285. AC_MSG_ERROR([no output drivers were selected!])
  286. else
  287. CACA_DRIVERS="${CACA_DRIVERS# *}"
  288. AC_MSG_RESULT([${CACA_DRIVERS}])
  289. fi
  290. AC_SUBST(MATH_LIBS)
  291. AC_SUBST(ZLIB_LIBS)
  292. AC_SUBST(GETOPT_LIBS)
  293. AC_SUBST(CACA_LIBS)
  294. AC_SUBST(X11_LIBS)
  295. AC_SUBST(GL_LIBS)
  296. # How to get the C99 types. See cucul/cucul_types.h.in for details about
  297. # the CUCUL_TYPES variable
  298. if test "${ac_cv_my_have_vga}" = "yes"; then
  299. CUCUL_TYPES=0
  300. else
  301. AC_CHECK_HEADERS(stdint.h,
  302. [CUCUL_TYPES=1],
  303. [AC_CHECK_HEADERS(inttypes.h,
  304. [CUCUL_TYPES=2],
  305. [AC_CHECK_HEADERS(windows.h,
  306. [CUCUL_TYPES=3],
  307. [CUCUL_TYPES=0])])])
  308. fi
  309. AC_SUBST(CUCUL_TYPES)
  310. # Optimizations
  311. CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  312. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  313. CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
  314. CACA_BINDINGS=""
  315. # Build the C++ bindings?
  316. ac_cv_my_have_cxx="no"
  317. if test "${enable_cxx}" != "no"; then
  318. AC_MSG_CHECKING([working <iostream>])
  319. AC_LANG_PUSH(C++)
  320. AC_TRY_COMPILE(
  321. [#include <iostream>],
  322. [],
  323. [ac_cv_my_have_cxx="yes"
  324. CACA_BINDINGS="${CACA_BINDINGS} C++"])
  325. AC_LANG_POP(C++)
  326. AC_MSG_RESULT([$ac_cv_my_have_cxx])
  327. fi
  328. AM_CONDITIONAL(USE_CXX, test "${ac_cv_my_have_cxx}" = "yes")
  329. # Build the .NET bindings?
  330. ac_cv_my_have_csharp="no"
  331. if test "${enable_csharp}" != "no"; then
  332. AC_PATH_PROG(GMCS, gmcs, no)
  333. AC_PATH_PROG(GACUTIL, gacutil, no)
  334. if test "${GMCS}" != "no" -a "${GACUTIL}" != "no"; then
  335. ac_cv_my_have_csharp="yes"
  336. CACA_BINDINGS="${CACA_BINDINGS} C#"
  337. fi
  338. fi
  339. AM_CONDITIONAL(USE_CSHARP, test "${ac_cv_my_have_csharp}" = "yes")
  340. # Build the Ruby bindings?
  341. ac_cv_my_have_ruby="no"
  342. if test "${enable_ruby}" != "no"; then
  343. AC_PATH_PROG(RUBY, ruby, no)
  344. if test "${RUBY}" != "no"; then
  345. RUBY_CFLAGS="-I$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"archdir"@:>@')"
  346. RUBY_LIBS="-L$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"RUBY_SO_NAME"@:>@')"
  347. RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'`
  348. RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'`
  349. AC_SUBST(RUBY_CFLAGS)
  350. AC_SUBST(RUBY_LIBS)
  351. AC_SUBST(RUBY_SITEARCHDIR)
  352. AC_SUBST(RUBY_SITELIBDIR)
  353. CPPFLAGS="${CPPFLAGS} ${RUBY_CFLAGS}"
  354. AC_CHECK_HEADERS([ruby.h],
  355. [ac_cv_my_have_ruby="yes"
  356. CACA_BINDINGS="${CACA_BINDINGS} Ruby"])
  357. fi
  358. fi
  359. AM_CONDITIONAL(USE_RUBY, test "${ac_cv_my_have_ruby}" = "yes")
  360. AC_MSG_CHECKING(available language bindings)
  361. if test -z "${CACA_BINDINGS}"; then
  362. AC_MSG_RESULT(no)
  363. else
  364. CACA_BINDINGS="${CACA_BINDINGS# *}"
  365. AC_MSG_RESULT([${CACA_BINDINGS}])
  366. fi
  367. # Build cacaserver?
  368. ac_cv_my_have_network="no"
  369. AC_CHECK_HEADERS(sys/socket.h,
  370. [ac_cv_my_have_network="yes"])
  371. AM_CONDITIONAL(USE_NETWORK, test "${ac_cv_my_have_network}" = "yes")
  372. # Use Imlib2?
  373. if test "${enable_imlib2}" != "no"; then
  374. PKG_CHECK_MODULES(IMLIB2, imlib2, [IMLIB2="yes"], [IMLIB2="no"])
  375. if test "${IMLIB2}" = "yes"; then
  376. AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
  377. fi
  378. fi
  379. # Build development tools?
  380. PKG_CHECK_MODULES(PANGOFT2, pangoft2, [PANGOFT2="yes"], [PANGOFT2="no"])
  381. AM_CONDITIONAL(USE_PANGO, test "${PANGOFT2}" = "yes")
  382. # Build documentation?
  383. DOXYGEN="no"
  384. LATEX="no"
  385. if test "${enable_doc}" != "no"; then
  386. AC_PATH_PROG(DOXYGEN, doxygen, no)
  387. if test "${DOXYGEN}" != "no"; then
  388. # Build LaTeX documentation?
  389. AC_PATH_PROG(LATEX, pdflatex, no)
  390. AC_PATH_PROG(KPSEWHICH, kpsewhich, no)
  391. AC_PATH_PROG(DVIPS, dvips, no)
  392. if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no"; then
  393. LATEX="no"
  394. fi
  395. if test "${LATEX}" != "no"; then
  396. AC_MSG_CHECKING(for a4.sty and a4wide.sty)
  397. if "${KPSEWHICH}" a4.sty >/dev/null 2>&1; then
  398. if "${KPSEWHICH}" a4wide.sty >/dev/null 2>&1; then
  399. AC_MSG_RESULT(yes)
  400. else
  401. LATEX="no"
  402. AC_MSG_RESULT(no)
  403. fi
  404. else
  405. LATEX="no"
  406. AC_MSG_RESULT(no)
  407. fi
  408. fi
  409. fi
  410. fi
  411. AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
  412. AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
  413. # Use cppunit for unit tests?
  414. PKG_CHECK_MODULES(CPPUNIT, cppunit, [CPPUNIT="yes"], [CPPUNIT="no"])
  415. AM_CONDITIONAL(USE_CPPUNIT, test "$CPPUNIT" = "yes")
  416. # Use zzuf for fuzzing tests?
  417. ZZUF="no"
  418. if test "${enable_zzuf}" != "no"; then
  419. AC_PATH_PROG(ZZUF, zzuf, no)
  420. fi
  421. AM_CONDITIONAL(USE_ZZUF, test "${ZZUF}" != "no")
  422. AC_CONFIG_FILES([
  423. Makefile
  424. kernel/Makefile
  425. cucul/Makefile
  426. caca/Makefile
  427. src/Makefile
  428. examples/Makefile
  429. tests/Makefile
  430. tools/Makefile
  431. csharp/Makefile
  432. cxx/Makefile
  433. python/Makefile
  434. ruby/Makefile
  435. doc/Makefile
  436. msvc/Makefile
  437. ])
  438. AC_CONFIG_FILES([
  439. cucul/cucul_types.h
  440. cucul/cucul.pc
  441. caca/caca.pc
  442. csharp/cucul-sharp.dll.config
  443. csharp/caca-sharp.dll.config
  444. cxx/cucul++.pc
  445. cxx/caca++.pc
  446. doc/doxygen.cfg
  447. ])
  448. AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
  449. AC_OUTPUT