1 dnl Process this file with autoconf to produce a configure script
2 AC_INIT(theora-exp, [0.1], [theora-dev@xiph.org])
7 AM_CONFIG_HEADER([config.h])
13 AC_SUBST(V_LIB_CURRENT)
14 AC_SUBST(V_LIB_REVISION)
17 dnl --------------------------------------------------
18 dnl Check for programs
19 dnl --------------------------------------------------
21 dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
22 dnl if $CFLAGS is blank
30 dnl Add parameters for aclocal
31 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
33 dnl Check for sdl-config
34 AC_CHECK_PROG(HAVE_SDL_CONFIG, sdl-config, true, false)
35 AM_CONDITIONAL(HAVE_SDL_CONFIG,$HAVE_SDL_CONFIG)
40 dnl first check through pkg-config since it's more flexible
42 dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
43 AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
44 if test "x$HAVE_PKG_CONFIG" = "xyes"
46 PKG_CHECK_MODULES(OGG, ogg >= 1.1, HAVE_OGG=yes, HAVE_OGG=no)
48 if test "x$HAVE_OGG" = "xno"
50 dnl fall back to the old school test
51 XIPH_PATH_OGG(, AC_MSG_ERROR([
52 libogg is required to build this package!
53 please see http://www.xiph.org/ for how to
58 CFLAGS="$CFLAGS $OGG_CFLAGS"
59 LIBS="$LIBS $OGG_LIBS"
60 AC_CHECK_FUNC(oggpackB_read, , [
61 AC_MSG_ERROR([newer libogg version (>1.0) required])
70 dnl first check through pkg-config since it's more flexible
72 if test "x$HAVE_PKG_CONFIG" = "xyes"
74 PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0.1, HAVE_VORBIS=yes, HAVE_VORBIS=no)
75 dnl also set VORBISENC_LIBS since an examples needs it
76 dnl the old .m4 sets this to a value to use on top of VORBIS_LIBS,
77 dnl so we do the same here.
78 VORBISENC_LIBS="-lvorbisenc"
79 AC_SUBST(VORBISENC_LIBS)
81 if test "x$HAVE_VORBIS" = "xno"
83 dnl fall back to the old school test
84 XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no)
89 SDL_LIBS=`$SDL_CONFIG --libs`
90 ],AC_MSG_WARN([*** Unable to find SDL -- Not compiling example players ***]))
94 SDL_LIBS=`$SDL_CONFIG --libs`
95 ],AC_MSG_WARN([*** Unable to find SDL -- Not compiling example players ***]))
98 AC_CHECK_HEADERS([sys/soundcard.h soundcard.h machine/soundcard.h],[
102 if test x$HAVE_OSS != xyes; then
103 AC_MSG_WARN([OSS audio support not found -- not compiling player_example])
106 if test x$HAVE_SDL = xyes -a x$HAVE_OSS = xyes; then
107 BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES player_example"
109 AC_SUBST(BUILDABLE_EXAMPLES)
111 dnl Checks for libraries.
113 dnl Checks for header files.
115 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h)
117 dnl Checks for typedefs, structures, and compiler characteristics.
122 dnl Checks for library functions.
123 AC_PROG_GCC_TRADITIONAL
126 AC_CHECK_FUNCS(gettimeofday select strstr)
128 dnl Check for optimization
130 AC_ARG_ENABLE(x86asm,
131 AS_HELP_STRING([--enable-x86asm],
132 [enable x86 assambler optimization, default=autodetect]),
136 if test "$enable_x86asm" != "no"; then
137 case "$target_cpu" in
139 AC_DEFINE([OC_X86ASM], [], [enable x86 assambler optimization])
140 AM_CONDITIONAL(OC_X86ASM,true)
143 AC_DEFINE([OC_X86ASM], [], [enable x86 assambler optimization])
144 AM_CONDITIONAL(OC_X86ASM,true)
147 AM_CONDITIONAL(OC_X86ASM,false)
151 AM_CONDITIONAL(OC_X86ASM,false)
155 DEBUG="-g -Wall -DDEBUG -D__NO_MATH_INLINES"
156 PROFILE="-g -p -O3 -DDEBUG";
160 dnl enable experimental encoder
162 AC_ARG_ENABLE(encode,
163 [ --enable-encode enable encoding support(experimental) ],
164 [ ac_enable_encode=$enableval ], [ ac_enable_encode=no] )
166 if test "x${ac_enable_encode}" != xno ; then
167 AC_DEFINE([TH_ENCODER], [], [ enable experimental encoder])
168 BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES encoder_example"
170 AM_CONDITIONAL(TH_ENCODER, [test "x${ac_enable_encode}" != xno])
173 dnl Enable some opzimization for gcc
174 OPTIMIZATION_CFLAGS="-O3 -fforce-addr -fomit-frame-pointer"
175 AC_SUBST(OPTIMIZATION_CFLAGS)
181 include/theora/Makefile
182 include/theora/compat/Makefile
183 include/theora/compat/theora/Makefile
189 theoradec-uninstalled.pc
190 theoraenc-uninstalled.pc
191 theoracompat-uninstalled.pc
194 AS_AC_EXPAND(LIBDIR, ${libdir})
195 AS_AC_EXPAND(INCLUDEDIR, ${includedir})
196 AS_AC_EXPAND(BINDIR, ${bindir})
197 AS_AC_EXPAND(DOCDIR, ${datadir}/doc)
200 ------------------------------------------------------------------------
201 $PACKAGE $VERSION: Automatic configuration OK.
203 General configuration:
205 x86 assambler optimization: ...... ${ac_enable_x86asm}
206 Encoding support(experimental): .. ${ac_enable_encode}
211 libtheora: ....................... ${LIBDIR}
212 C header files: .................. ${INCLUDEDIR}/theora
213 Documentation: ................... ${DOCDIR}/$PACKAGE
217 Type 'make' to compile $PACKAGE.
219 Type 'make install' to install $PACKAGE.
221 Example programs will be built but not installed.
222 ------------------------------------------------------------------------