VS2008 project files.
[xiph/unicode.git] / theora-exp / configure.ac
blob44a59e3b1143c77598eec9fed7b05df7b535f687
1 dnl Process this file with autoconf to produce a configure script
2 AC_INIT(theora-exp, [0.1], [theora-dev@xiph.org])
4 AC_CANONICAL_HOST
5 AC_CANONICAL_TARGET
7 AM_CONFIG_HEADER([config.h])
8 AM_INIT_AUTOMAKE
10 V_LIB_CURRENT=0
11 V_LIB_REVISION=1
12 V_LIB_AGE=0
13 AC_SUBST(V_LIB_CURRENT)
14 AC_SUBST(V_LIB_REVISION)
15 AC_SUBST(V_LIB_AGE)
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
23 cflags_save="$CFLAGS"
24 AC_PROG_CC
25 AC_PROG_CPP
26 CFLAGS="$cflags_save"
28 AM_PROG_LIBTOOL
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)
37 dnl check for Ogg
38 HAVE_OGG=no
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"
45 then
46   PKG_CHECK_MODULES(OGG, ogg >= 1.1, HAVE_OGG=yes, HAVE_OGG=no)
48 if test "x$HAVE_OGG" = "xno"
49 then
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
54     obtain a copy.
55   ]))
56   cflags_save=$CFLAGS
57   libs_save=$LIBS
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])
62   ])
63   CFLAGS=$cflags_save
64   LIBS=$libs_save
67 dnl check for Vorbis
68 HAVE_VORBIS=no
70 dnl first check through pkg-config since it's more flexible
72 if test "x$HAVE_PKG_CONFIG" = "xyes"
73 then
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"
82 then
83   dnl fall back to the old school test
84   XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no)
87 AM_PATH_SDL(,[
88         HAVE_SDL=yes
89         SDL_LIBS=`$SDL_CONFIG --libs`
90 ],AC_MSG_WARN([*** Unable to find SDL -- Not compiling example players ***]))
92 AM_PATH_SDL(,[
93         HAVE_SDL=yes
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],[
99   HAVE_OSS=yes
100   break
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.
114 AC_HEADER_STDC
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.
118 AC_C_CONST
119 AC_TYPE_SIZE_T
120 AC_HEADER_TIME
122 dnl Checks for library functions.
123 AC_PROG_GCC_TRADITIONAL
124 AC_FUNC_MEMCMP
125 AC_TYPE_SIGNAL
126 AC_CHECK_FUNCS(gettimeofday select strstr)
128 dnl Check for optimization
129 ac_enable_x86asm=yes
130 AC_ARG_ENABLE(x86asm,
131     AS_HELP_STRING([--enable-x86asm],
132     [enable x86 assambler optimization, default=autodetect]),
133     []
136 if test "$enable_x86asm" != "no"; then
137     case "$target_cpu" in
138         i[[3456]]86)
139             AC_DEFINE([OC_X86ASM], [], [enable x86 assambler optimization])
140             AM_CONDITIONAL(OC_X86ASM,true)
141             ;;
142         x86_64) 
143             AC_DEFINE([OC_X86ASM], [], [enable x86 assambler optimization])
144             AM_CONDITIONAL(OC_X86ASM,true)
145             ;;
146         *) 
147             AM_CONDITIONAL(OC_X86ASM,false)
148             ;;
149     esac
150 else
151     AM_CONDITIONAL(OC_X86ASM,false)
152     ac_enable_x86asm=no
155 DEBUG="-g -Wall -DDEBUG -D__NO_MATH_INLINES"
156 PROFILE="-g -p -O3 -DDEBUG";
157 AC_SUBST(DEBUG)
158 AC_SUBST(PROFILE)
160 dnl enable experimental encoder
161 ac_enable_encode=no
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)
177 AC_OUTPUT([
178   Makefile
179   lib/Makefile
180   include/Makefile
181   include/theora/Makefile
182   include/theora/compat/Makefile
183   include/theora/compat/theora/Makefile
184   examples/Makefile
185   tests/Makefile
186   theoradec.pc
187   theoraenc.pc
188   theoracompat.pc
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)
199 AC_MSG_RESULT([
200 ------------------------------------------------------------------------
201   $PACKAGE $VERSION:  Automatic configuration OK.
203   General configuration:
205     x86 assambler optimization: ...... ${ac_enable_x86asm}
206     Encoding support(experimental): .. ${ac_enable_encode}
209   Installation paths:
211     libtheora: ....................... ${LIBDIR}
212     C header files: .................. ${INCLUDEDIR}/theora
213     Documentation: ................... ${DOCDIR}/$PACKAGE
215   Building:
217     Type 'make' to compile $PACKAGE.
219     Type 'make install' to install $PACKAGE.
221   Example programs will be built but not installed.
222 ------------------------------------------------------------------------