configure.ac 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. dnl Process this file with autoconf to produce a configure script
  2. dnl ------------------------------------------------
  3. dnl Initialization and Versioning
  4. dnl ------------------------------------------------
  5. AC_INIT([libtheora],[1.2.0alpha1+git],[theora-dev@xiph.org])
  6. AC_CANONICAL_HOST
  7. AC_CONFIG_SRCDIR([lib/fdct.c])
  8. AM_INIT_AUTOMAKE
  9. AM_MAINTAINER_MODE([enable])
  10. dnl we use doc_DATA in doc/Makefile.am which requires autoconf >= 2.60
  11. dnl to define docdir for us.
  12. AC_PREREQ(2.60)
  13. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  14. dnl Library versioning
  15. dnl CURRENT, REVISION, AGE
  16. dnl - library source changed -> increment REVISION
  17. dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
  18. dnl - interfaces added -> increment AGE
  19. dnl - interfaces removed -> AGE = 0
  20. TH_LIB_CURRENT=4
  21. TH_LIB_REVISION=0
  22. TH_LIB_AGE=4
  23. AC_SUBST(TH_LIB_CURRENT)
  24. AC_SUBST(TH_LIB_REVISION)
  25. AC_SUBST(TH_LIB_AGE)
  26. THDEC_LIB_CURRENT=2
  27. THDEC_LIB_REVISION=5
  28. THDEC_LIB_AGE=1
  29. AC_SUBST(THDEC_LIB_CURRENT)
  30. AC_SUBST(THDEC_LIB_REVISION)
  31. AC_SUBST(THDEC_LIB_AGE)
  32. THENC_LIB_CURRENT=3
  33. THENC_LIB_REVISION=0
  34. THENC_LIB_AGE=2
  35. AC_SUBST(THENC_LIB_CURRENT)
  36. AC_SUBST(THENC_LIB_REVISION)
  37. AC_SUBST(THENC_LIB_AGE)
  38. dnl Extra linker options (for version script)
  39. THEORA_LDFLAGS=""
  40. dnl --------------------------------------------------
  41. dnl Check for programs
  42. dnl --------------------------------------------------
  43. AM_PROG_AS
  44. dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
  45. dnl if $CFLAGS is blank
  46. cflags_save="$CFLAGS"
  47. AC_PROG_CC
  48. AC_PROG_CPP
  49. CFLAGS="$cflags_save"
  50. AM_PROG_CC_C_O
  51. AC_LIBTOOL_WIN32_DLL
  52. LT_INIT
  53. dnl Add parameters for aclocal
  54. AC_CONFIG_MACRO_DIR([m4])
  55. dnl Check for doxygen
  56. AC_ARG_ENABLE([doc],
  57. AS_HELP_STRING([--disable-doc], [Do not build API documentation]),
  58. [ac_enable_doc=$enableval], [ac_enable_doc=auto])
  59. if test "x$ac_enable_doc" != "xno"; then
  60. AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
  61. if test "x$HAVE_DOXYGEN" = "xfalse" -a "x$ac_enable_doc" = "xyes"; then
  62. AC_MSG_ERROR([*** API documentation explicitly requested but Doxygen not found])
  63. fi
  64. else
  65. HAVE_DOXYGEN=false
  66. fi
  67. AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
  68. if test $HAVE_DOXYGEN = "false"; then
  69. AC_MSG_WARN([*** doxygen not found, API documentation will not be built])
  70. fi
  71. dnl Check for tools used to build the format specification
  72. BUILD_SPEC="false"
  73. ac_build_spec=yes
  74. AC_ARG_ENABLE(spec,
  75. AS_HELP_STRING([--disable-spec], [Do not build the specification]),
  76. [
  77. if test "x$enableval" = "xno"; then
  78. ac_build_spec=$enableval
  79. fi
  80. ], [
  81. ac_build_spec=yes
  82. ] )
  83. if test "x$ac_build_spec" = "xyes"; then
  84. AC_CHECK_PROG(HAVE_PDFLATEX, pdflatex, yes)
  85. AC_CHECK_PROG(HAVE_BIBTEX, bibtex, yes)
  86. AC_CHECK_PROG(HAVE_TRANSFIG, fig2dev, yes)
  87. AC_MSG_NOTICE([Checking for packages in ${srcdir}/doc/spec/spec.tex...])
  88. if test -r ${srcdir}/doc/spec/spec.tex; then
  89. if test "x$HAVE_PDFLATEX" = "xyes"; then
  90. if test "x$HAVE_BIBTEX" = "xyes"; then
  91. if test "x$HAVE_TRANSFIG" = "xyes"; then
  92. tex_pkg_list=`fgrep usepackage ${srcdir}/doc/spec/spec.tex | grep \{ | grep -v ltablex`
  93. tex_pkg_ok="yes"
  94. for pkg_line in $tex_pkg_list; do
  95. pkg_name=`echo $pkg_line | sed -e 's/.*{\(.*\)}.*/\1/'`
  96. AC_MSG_CHECKING([for Tex package $pkg_name])
  97. cat >conftest.tex <<_ACEOF
  98. \\documentclass{book}
  99. $pkg_line
  100. \\begin{document}
  101. Hello World.
  102. \\end{document}
  103. _ACEOF
  104. if pdflatex -interaction batchmode -halt-on-error conftest < /dev/null > /dev/null 2>&1; then
  105. AC_MSG_RESULT([ok])
  106. else
  107. tex_pkg_ok="no"
  108. AC_MSG_RESULT([no])
  109. fi
  110. done
  111. if test -w conftest.tex; then rm conftest.tex; fi
  112. if test -w conftest.tex; then rm conftest.aux; fi
  113. if test -w conftest.pdf; then rm conftest.pdf; fi
  114. if test "x$tex_pkg_ok" = "xyes"; then
  115. BUILD_SPEC="true"
  116. fi
  117. fi
  118. fi
  119. fi
  120. fi
  121. fi
  122. AM_CONDITIONAL(BUILD_SPEC, $BUILD_SPEC)
  123. if test $BUILD_SPEC = "false"; then
  124. AC_MSG_WARN([*** Format Specification will not built.])
  125. fi
  126. dnl Check for valgrind
  127. VALGRIND_ENVIRONMENT=""
  128. ac_enable_valgrind=no
  129. AC_ARG_ENABLE(valgrind-testing,
  130. AS_HELP_STRING([--enable-valgrind-testing], [Enable running of tests inside Valgrind]),
  131. [ ac_enable_valgrind=$enableval ], [ ac_enable_valgrind=no] )
  132. if test "x${ac_enable_valgrind}" = xyes ; then
  133. if test "x${enable_shared}" = xyes ; then
  134. VALGRIND_ENVIRONMENT="libtool --mode=execute "
  135. fi
  136. AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
  137. if test "x$HAVE_VALGRIND" = xyes ; then
  138. VALGRIND_ENVIRONMENT="$VALGRIND_ENVIRONMENT valgrind -q --leak-check=yes --show-reachable=yes --num-callers=100"
  139. AC_SUBST(VALGRIND_ENVIRONMENT)
  140. TESTS_INFO="Type 'make check' to run test suite. Tests will be run under:
  141. ${VALGRIND_ENVIRONMENT}"
  142. else
  143. TESTS_INFO="Type 'make check' to run test suite (Valgrind not found)"
  144. fi
  145. else
  146. TESTS_INFO="Type 'make check' to run test suite (Valgrind testing not enabled)"
  147. fi
  148. dnl --------------------------------------------------
  149. dnl Set build flags based on environment
  150. dnl --------------------------------------------------
  151. dnl Set some host options
  152. cflags_save="$CFLAGS"
  153. if test -z "$GCC"; then
  154. case $host in
  155. *)
  156. DEBUG="-g -DDEBUG"
  157. CFLAGS="-O"
  158. PROFILE="-g -p -DDEBUG" ;;
  159. esac
  160. else
  161. case $host in
  162. *)
  163. DEBUG="-g -Wall -Wno-parentheses -DDEBUG -D__NO_MATH_INLINES"
  164. CFLAGS="-Wall -Wno-parentheses -O3 -fomit-frame-pointer -finline-functions -funroll-loops"
  165. PROFILE="-Wall -Wno-parentheses -pg -g -O3 -fno-inline-functions -DDEBUG";;
  166. esac
  167. fi
  168. CFLAGS="$CFLAGS $cflags_save"
  169. cpu_x86_64=no
  170. cpu_x86_32=no
  171. cpu_arm=no
  172. cpu_c64x=no
  173. AC_ARG_ENABLE(asm,
  174. AS_HELP_STRING([--disable-asm], [Disable assembly optimizations]),
  175. [ ac_enable_asm=$enableval ], [ ac_enable_asm=yes] )
  176. if test "x${ac_enable_asm}" = xyes; then
  177. cpu_optimization="no optimization for your platform, please send a patch"
  178. case $host_cpu in
  179. i[[3456]]86)
  180. cpu_x86_32=yes
  181. cpu_optimization="32 bit x86"
  182. AC_DEFINE([OC_X86_ASM], [], [make use of x86 asm optimization])
  183. if test "x$host_vendor" = "xapple"; then
  184. THEORA_LDFLAGS="$THEORA_LDFLAGS -Wl,-read_only_relocs,suppress"
  185. fi
  186. ;;
  187. x86_64)
  188. cpu_x86_64=yes
  189. cpu_optimization="64 bit x86"
  190. AC_DEFINE([OC_X86_ASM], [], [make use of x86 asm optimization])
  191. AC_DEFINE([OC_X86_64_ASM], [], [make use of x86_64 asm optimization])
  192. ;;
  193. arm*)
  194. cpu_arm=yes
  195. cpu_optimization="ARM"
  196. AC_DEFINE([OC_ARM_ASM], [], [make use of arm asm optimization])
  197. AC_ARG_ENABLE(asflag-probe,
  198. AS_HELP_STRING([--disable-asflag-probe], [Disable instructions not supported by the default ASFLAGS (ARM only).]),
  199. [ ac_enable_asflag_probe=$enableval ], [ ac_enable_asflag_probe=yes] )
  200. dnl our ARM assembly requires perl to run the arm2gnu reformatter
  201. AC_CHECK_PROG([HAVE_PERL], perl, yes, no)
  202. if test "x$HAVE_PERL" = "xno"; then
  203. AC_MSG_WARN([*** ARM assembly requires perl -- disabling optimizations])
  204. cpu_arm=no
  205. cpu_optimization="(missing perl dependency for ARM)"
  206. fi
  207. dnl AC_TRY_ASSEMBLE uses CFLAGS instead of CCASFLAGS
  208. save_CFLAGS="$CFLAGS"
  209. ARM_CCASFLAGS=
  210. dnl Test for instruction set support with the default CCASFLAGS.
  211. AS_ASM_ARM_NEON([HAVE_ARM_ASM_NEON=1],[HAVE_ARM_ASM_NEON=0])
  212. AS_ASM_ARM_MEDIA([HAVE_ARM_ASM_MEDIA=1],[HAVE_ARM_ASM_MEDIA=0])
  213. AS_ASM_ARM_EDSP([HAVE_ARM_ASM_EDSP=1],[HAVE_ARM_ASM_EDSP=0])
  214. dnl gas will not assemble instructions unless the architecture explicitly
  215. dnl supports it (unlike on x86).
  216. dnl Try to speculatively add ASFLAGS to enable usage of these instructions
  217. dnl at assembly time (actual support is detected at runtime).
  218. dnl If the user has already specified -march or -mcpu flags, this may give
  219. dnl some spurious warnings (use --disable-asflag-probe to avoid this if
  220. dnl you don't want run-time support for instructions not available on the
  221. dnl architecture you specified).
  222. dnl Order here is important.
  223. if test "x${ac_enable_asflag_probe}" = xyes; then
  224. if test x$HAVE_ARM_ASM_NEON != x1 ; then
  225. dnl Try to set some flags to enable NEON instructions.
  226. AC_MSG_NOTICE([trying custom CCASFLAGS to enable NEON instructions...])
  227. ARM_CCASFLAGS="-mfpu=neon -march=armv7-a"
  228. CFLAGS="$save_CFLAGS $ARM_CCASFLAGS"
  229. AS_ASM_ARM_NEON([HAVE_ARM_ASM_NEON=1],[HAVE_ARM_ASM_NEON=0])
  230. if test x$HAVE_ARM_ASM_NEON != x1 ; then
  231. ARM_CCASFLAGS=
  232. CFLAGS="$save_CFLAGS"
  233. fi
  234. fi
  235. if test x$HAVE_ARM_ASM_MEDIA != x1 ; then
  236. dnl Try to set some flags to enable ARMv6 media instructions.
  237. AC_MSG_NOTICE([trying custom CCASFLAGS to enable ARMv6 media instructions...])
  238. ARM_CCASFLAGS="-march=armv6j"
  239. CFLAGS="$save_CFLAGS $ARM_CCASFLAGS"
  240. AS_ASM_ARM_MEDIA([HAVE_ARM_ASM_MEDIA=1],[HAVE_ARM_ASM_MEDIA=0])
  241. if test x$HAVE_ARM_ASM_MEDIA != x1 ; then
  242. ARM_CCASFLAGS=
  243. CFLAGS="$save_CFLAGS"
  244. fi
  245. fi
  246. if test x$HAVE_ARM_ASM_EDSP != x1 ; then
  247. dnl Try to set some flags to enable EDSP instructions.
  248. AC_MSG_NOTICE([trying custom CCASFLAGS to enable EDSP compilation...])
  249. ARM_CCASFLAGS="-march=armv5e"
  250. CFLAGS="$save_CFLAGS $ARM_CCASFLAGS"
  251. AS_ASM_ARM_EDSP([HAVE_ARM_ASM_EDSP=1],[HAVE_ARM_ASM_EDSP=0])
  252. if test x$HAVE_ARM_ASM_MEDIA != x1 ; then
  253. ARM_CCASFLAGS=
  254. CFLAGS="$save_CFLAGS"
  255. fi
  256. fi
  257. fi
  258. dnl Only enable if we passed the perl test above
  259. if test x$cpu_arm = xyes; then
  260. if test x$HAVE_ARM_ASM_EDSP = x1 ; then
  261. AC_DEFINE(OC_ARM_ASM_EDSP, 1,
  262. [Define if assembler supports EDSP instructions])
  263. cpu_optimization="$cpu_optimization (EDSP)"
  264. fi
  265. AC_SUBST(HAVE_ARM_ASM_EDSP)
  266. if test x$HAVE_ARM_ASM_MEDIA = x1 ; then
  267. AC_DEFINE(OC_ARM_ASM_MEDIA, 1,
  268. [Define if assembler supports ARMv6 media instructions])
  269. cpu_optimization="$cpu_optimization (Media)"
  270. fi
  271. AC_SUBST(HAVE_ARM_ASM_MEDIA)
  272. if test x$HAVE_ARM_ASM_NEON = x1 ; then
  273. AC_DEFINE(OC_ARM_ASM_NEON, 1,
  274. [Define if compiler supports NEON instructions])
  275. cpu_optimization="$cpu_optimization (NEON)"
  276. fi
  277. AC_SUBST(HAVE_ARM_ASM_NEON)
  278. fi
  279. CFLAGS="$save_CFLAGS"
  280. CCASFLAGS="$CCASFLAGS $ARM_CCASFLAGS"
  281. ;;
  282. tic6x)
  283. cpu_c64x=yes
  284. cpu_optimization="TI C64x+"
  285. AC_DEFINE([OC_C64X_ASM], [], [make use of c64x+ asm optimization])
  286. ;;
  287. esac
  288. else
  289. cpu_optimization="disabled"
  290. fi
  291. AM_CONDITIONAL([CPU_x86_64], [test x$cpu_x86_64 = xyes])
  292. AM_CONDITIONAL([CPU_x86_32], [test x$cpu_x86_32 = xyes])
  293. AM_CONDITIONAL([CPU_arm], [test x$cpu_arm = xyes])
  294. AM_CONDITIONAL([CPU_c64x], [test x$cpu_c64x = xyes])
  295. # Test whenever ld supports -version-script
  296. AC_PROG_LD
  297. AC_PROG_LD_GNU
  298. AC_MSG_CHECKING([how to control symbol export])
  299. THDEC_VERSION_ARG=""
  300. THENC_VERSION_ARG=""
  301. TH_VERSION_ARG=""
  302. if test "x$lt_cv_prog_gnu_ld" = "xyes"; then
  303. case "$host_os" in
  304. *mingw*)
  305. THEORA_LDFLAGS="$THEORA_LDFLAGS -no-undefined"
  306. THDEC_VERSION_ARG="-export-symbols \$(top_srcdir)/win32/xmingw32/libtheoradec-all.def"
  307. THENC_VERSION_ARG="-export-symbols \$(top_srcdir)/win32/xmingw32/libtheoraenc-all.def"
  308. THENC_VERSION_ARG="$THENC_VERSION_ARG -ltheoradec"
  309. THC_VERSION_ARG="-export-symbols \$(top_srcdir)/win32/libtheora.def"
  310. AC_MSG_RESULT([-export-symbols])
  311. ;;
  312. linux* | solaris* | gnu* | k*bsd*-gnu)
  313. THDEC_VERSION_ARG='-Wl,--version-script=$(srcdir)/Version_script-dec'
  314. THENC_VERSION_ARG='-Wl,--version-script=$(srcdir)/Version_script-enc'
  315. TH_VERSION_ARG='-Wl,--version-script=$(srcdir)/Version_script'
  316. AC_MSG_RESULT([--version-script])
  317. ;;
  318. *)
  319. # build without versioning
  320. AC_MSG_RESULT([no])
  321. ;;
  322. esac
  323. else
  324. case "$host_os" in
  325. darwin*)
  326. THDEC_VERSION_ARG='-Wl,-exported_symbols_list,$(srcdir)/theoradec.exp'
  327. THENC_VERSION_ARG='-Wl,-exported_symbols_list,$(srcdir)/theoraenc.exp'
  328. TH_VERSION_ARG='-Wl,-exported_symbols_list,$(srcdir)/theora.exp'
  329. AC_MSG_RESULT([-exported_symbols_list])
  330. ;;
  331. *)
  332. # build without versioning
  333. AC_MSG_RESULT([no])
  334. ;;
  335. esac
  336. fi
  337. THEORADEC_LDFLAGS="$THEORA_LDFLAGS $THDEC_VERSION_ARG"
  338. THEORAENC_LDFLAGS="$THEORA_LDFLAGS $THENC_VERSION_ARG"
  339. THEORA_LDFLAGS="$THEORA_LDFLAGS $TH_VERSION_ARG"
  340. AC_SUBST(THEORADEC_LDFLAGS)
  341. AC_SUBST(THEORAENC_LDFLAGS)
  342. AC_SUBST(THEORA_LDFLAGS)
  343. dnl --------------------------------------------------
  344. dnl Checks for support libraries and headers
  345. dnl --------------------------------------------------
  346. dnl check for Ogg
  347. HAVE_OGG=no
  348. dnl first check through pkg-config since it's more flexible
  349. dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
  350. AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
  351. if test "x$HAVE_PKG_CONFIG" = "xyes"
  352. then
  353. PKG_CHECK_MODULES(OGG, ogg >= 1.1, HAVE_OGG=yes, HAVE_OGG=no)
  354. fi
  355. if test "x$HAVE_OGG" = "xno"
  356. then
  357. dnl fall back to the old school test
  358. XIPH_PATH_OGG(, AC_MSG_ERROR([
  359. libogg is required to build this package!
  360. please see http://www.xiph.org/ for how to
  361. obtain a copy.
  362. ]))
  363. cflags_save=$CFLAGS
  364. libs_save=$LIBS
  365. CFLAGS="$CFLAGS $OGG_CFLAGS"
  366. LIBS="$LIBS $OGG_LIBS"
  367. AC_CHECK_FUNC(oggpackB_read, , [
  368. AC_MSG_ERROR([newer libogg version (1.1 or later) required])
  369. ])
  370. CFLAGS=$cflags_save
  371. LIBS=$libs_save
  372. fi
  373. dnl check for Vorbis
  374. HAVE_VORBIS=no
  375. dnl first check through pkg-config since it's more flexible
  376. if test "x$HAVE_PKG_CONFIG" = "xyes"
  377. then
  378. PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0.1, HAVE_VORBIS=yes, HAVE_VORBIS=no)
  379. dnl also set VORBISENC_LIBS since an examples needs it
  380. dnl the old .m4 sets this to a value to use on top of VORBIS_LIBS,
  381. dnl so we do the same here.
  382. VORBISENC_LIBS="-lvorbisenc"
  383. AC_SUBST(VORBISENC_LIBS)
  384. fi
  385. if test "x$HAVE_VORBIS" = "xno"
  386. then
  387. dnl fall back to the old school test
  388. XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no)
  389. fi
  390. dnl check for SDL
  391. HAVE_SDL=no
  392. if test "x$HAVE_PKG_CONFIG" = "xyes"
  393. then
  394. PKG_CHECK_MODULES(SDL, sdl, HAVE_SDL=yes, [
  395. HAVE_SDL=no
  396. AC_MSG_WARN([*** Unable to find SDL -- Not compiling example players ***])])
  397. fi
  398. dnl check for OSS
  399. HAVE_OSS=no
  400. AC_CHECK_HEADERS([sys/soundcard.h soundcard.h machine/soundcard.h],[
  401. HAVE_OSS=yes
  402. break
  403. ])
  404. if test x$HAVE_OSS != xyes; then
  405. AC_MSG_WARN([OSS audio support not found -- not compiling player_example])
  406. fi
  407. dnl OpenBSD needs -lossaudio to use the oss interface
  408. OSS_LIBS=
  409. case "$host_os" in
  410. openbsd*)
  411. OSS_LIBS='-lossaudio'
  412. ;;
  413. esac
  414. AC_SUBST(OSS_LIBS)
  415. dnl check for libpng
  416. HAVE_PNG=no
  417. if test "x$HAVE_PKG_CONFIG" = "xyes"
  418. then
  419. PKG_CHECK_MODULES(PNG, libpng, HAVE_PNG=yes, HAVE_PNG=no)
  420. fi
  421. AC_SUBST(PNG_CFLAGS)
  422. AC_SUBST(PNG_LIBS)
  423. dnl check for libtiff
  424. HAVE_TIFF=no
  425. TIFF_CFLAGS=''
  426. TIFF_LIBS=''
  427. AC_CHECK_LIB([tiff], [TIFFReadRGBAImage], [
  428. TIFF_LIBS='-ltiff'
  429. AC_CHECK_HEADER([tiffio.h], [
  430. HAVE_TIFF=yes
  431. ])
  432. ])
  433. AC_SUBST(HAVE_TIFF)
  434. AC_SUBST(TIFF_CFLAGS)
  435. AC_SUBST(TIFF_LIBS)
  436. dnl check for libcairo
  437. HAVE_CAIRO=no
  438. AC_ARG_ENABLE(telemetry,
  439. AS_HELP_STRING([--enable-telemetry], [Enable debugging output controls]),
  440. [ ac_enable_telemetry=$enableval ], [ ac_enable_telemetry=no] )
  441. if test "x${ac_enable_telemetry}" = xyes; then
  442. if test "x$HAVE_PKG_CONFIG" = "xyes"
  443. then
  444. PKG_CHECK_MODULES(CAIRO, cairo, HAVE_CAIRO=yes, HAVE_CAIRO=no)
  445. AC_DEFINE([HAVE_CAIRO], [], [libcairo is available for visual debugging output])
  446. fi
  447. if test x$HAVE_CAIRO != xyes; then
  448. AC_MSG_WARN([libcairo not found -- not compiling telemetry output support ])
  449. fi
  450. AC_SUBST(CAIRO_CFLAGS)
  451. AC_SUBST(CAIRO_LIBS)
  452. fi
  453. dnl --------------------------------------------------
  454. dnl Overall build configuration options
  455. dnl --------------------------------------------------
  456. dnl Configuration option for building of encoding support.
  457. ac_enable_encode=yes
  458. AC_ARG_ENABLE(encode,
  459. AS_HELP_STRING([--disable-encode], [Disable encoding support]),
  460. [ ac_enable_encode=$enableval ], [ ac_enable_encode=yes] )
  461. if test "x${ac_enable_encode}" != xyes ; then
  462. AC_DEFINE([THEORA_DISABLE_ENCODE], [],
  463. [Define to exclude encode support from the build])
  464. else
  465. if test x$HAVE_VORBIS = xyes; then
  466. BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES encoder_example\$(EXEEXT)"
  467. else
  468. AC_MSG_NOTICE([Vorbis missing, cannot build example encoder])
  469. fi
  470. fi
  471. AM_CONDITIONAL(THEORA_DISABLE_ENCODE, [test "x${ac_enable_encode}" != xyes])
  472. dnl Configuration option for examples
  473. ac_enable_examples=yes
  474. AC_ARG_ENABLE(examples,
  475. AS_HELP_STRING([--disable-examples], [Disable examples]),
  476. [ ac_enable_examples=$enableval ], [ ac_enable_examples=yes] )
  477. AM_CONDITIONAL(THEORA_ENABLE_EXAMPLES, [test "x${ac_enable_examples}" != xno])
  478. dnl --------------------------------------------------
  479. dnl Check for headers
  480. dnl --------------------------------------------------
  481. dnl none here
  482. dnl --------------------------------------------------
  483. dnl Check for typedefs, structures, etc
  484. dnl --------------------------------------------------
  485. dnl none
  486. dnl --------------------------------------------------
  487. dnl Check for library functions
  488. dnl --------------------------------------------------
  489. dnl OpenBSD needs -lcompat for ftime() used by dump_video.c
  490. AC_CHECK_LIB([compat], [ftime], [COMPAT_LIBS='-lcompat'])
  491. AC_SUBST(COMPAT_LIBS)
  492. dnl substitute the included getopt if the system doesn't support long options
  493. AC_CHECK_FUNC(getopt_long,
  494. [GETOPT_OBJS=''],
  495. [GETOPT_OBJS='getopt.$(OBJEXT) getopt1.$(OBJEXT)'])
  496. AC_SUBST(GETOPT_OBJS)
  497. if test x$HAVE_SDL = xyes -a x$HAVE_OSS = xyes -a x$HAVE_VORBIS = xyes; then
  498. BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES player_example\$(EXEEXT)"
  499. fi
  500. if test x$HAVE_PNG = xyes; then
  501. BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES png2theora\$(EXEEXT)"
  502. fi
  503. if test x$HAVE_TIFF = xyes; then
  504. BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES tiff2theora\$(EXEEXT)"
  505. fi
  506. AC_SUBST(BUILDABLE_EXAMPLES)
  507. dnl --------------------------------------------------
  508. dnl Do substitutions
  509. dnl --------------------------------------------------
  510. AC_SUBST(DEBUG)
  511. AC_SUBST(PROFILE)
  512. AC_CONFIG_FILES([
  513. Makefile
  514. lib/Makefile
  515. lib/arm/armopts.s
  516. include/Makefile include/theora/Makefile
  517. examples/Makefile
  518. doc/Makefile doc/Doxyfile doc/spec/Makefile
  519. tests/Makefile
  520. m4/Makefile
  521. libtheora.spec
  522. theora.pc
  523. theora-uninstalled.pc
  524. theoradec.pc
  525. theoradec-uninstalled.pc
  526. theoraenc.pc
  527. theoraenc-uninstalled.pc
  528. ])
  529. AC_CONFIG_HEADERS([config.h])
  530. AC_OUTPUT
  531. AS_AC_EXPAND(LIBDIR, ${libdir})
  532. AS_AC_EXPAND(INCLUDEDIR, ${includedir})
  533. AS_AC_EXPAND(BINDIR, ${bindir})
  534. AS_AC_EXPAND(DOCDIR, ${docdir})
  535. if test $HAVE_DOXYGEN = "false"; then
  536. doc_build="no"
  537. else
  538. doc_build="yes"
  539. fi
  540. if test $BUILD_SPEC = "false"; then
  541. spec_build="no"
  542. else
  543. spec_build="yes"
  544. fi
  545. AC_MSG_RESULT([
  546. ------------------------------------------------------------------------
  547. $PACKAGE $VERSION: Automatic configuration OK.
  548. General configuration:
  549. Encoding support: ........... ${ac_enable_encode}
  550. Assembly optimization: ...... ${cpu_optimization}
  551. Debugging telemetry: ........ ${ac_enable_telemetry}
  552. Build example code: ......... ${ac_enable_examples}
  553. API Documentation: .......... ${doc_build}
  554. Format Documentation: ....... ${spec_build}
  555. Installation paths:
  556. libtheora: ................... ${LIBDIR}
  557. C header files: .............. ${INCLUDEDIR}/theora
  558. Documentation: ............... ${DOCDIR}
  559. Building:
  560. Type 'make' to compile $PACKAGE.
  561. Type 'make install' to install $PACKAGE.
  562. ${TESTS_INFO}
  563. Example programs will be built but not installed.
  564. ------------------------------------------------------------------------
  565. ])