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