1 dnl Process this file with autoconf to produce a configure script. -*-m4-*-
3 AC_INIT(libcelt/arch.h)
5 AM_CONFIG_HEADER([config.h])
11 CELT_VERSION=$CELT_MAJOR_VERSION.$CELT_MINOR_VERSION.$CELT_MICRO_VERSION$CELT_EXTRA_VERSION
18 AC_SUBST(CELT_LT_CURRENT)
19 AC_SUBST(CELT_LT_REVISION)
21 AC_SUBST(LIBCELT_SUFFIX)
27 AC_SUBST(CELT_VERSION)
29 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
41 AC_DEFINE([CELT_BUILD], [], [This is a build of CELT])
43 AC_MSG_CHECKING(for C99 variable-size arrays)
48 [has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
52 AC_MSG_RESULT($has_var_arrays)
54 AC_CHECK_HEADERS([alloca.h getopt.h])
55 AC_MSG_CHECKING(for alloca)
56 AC_TRY_COMPILE( [#include <alloca.h>], [
58 int *array = alloca(foo);
62 if test x$has_var_arrays = "xno" ; then
63 AC_DEFINE([USE_ALLOCA], [], [Make use of alloca])
68 AC_MSG_RESULT($has_alloca)
70 AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h)
72 AS_IF([test "x$with_ogg" != xno],
73 [XIPH_PATH_OGG([tools="tools"], [tools=""])],
79 # Check for getopt_long; if not found, use included source.
80 AC_CHECK_FUNCS([getopt_long],,
81 [# FreeBSD has a gnugetopt library.
82 AC_CHECK_LIB([gnugetopt],[getopt_long],
83 [AC_DEFINE([HAVE_GETOPT_LONG])],
84 [# Use the GNU replacement.
86 AC_LIBOBJ(getopt1)])])
88 AC_CHECK_LIB(winmm, main)
90 AC_DEFINE_UNQUOTED(CELT_VERSION, "${CELT_VERSION}", [Complete version string])
91 AC_DEFINE_UNQUOTED(CELT_MAJOR_VERSION, ${CELT_MAJOR_VERSION}, [Version major])
92 AC_DEFINE_UNQUOTED(CELT_MINOR_VERSION, ${CELT_MINOR_VERSION}, [Version minor])
93 AC_DEFINE_UNQUOTED(CELT_MICRO_VERSION, ${CELT_MICRO_VERSION}, [Version micro])
94 AC_DEFINE_UNQUOTED(CELT_EXTRA_VERSION, "${CELT_EXTRA_VERSION}", [Version extra])
98 #i[[3456]]86 | x86_64 | powerpc64 | powerpc32 | ia64)
99 # has_float_approx=yes
103 ac_enable_fixed="no";
104 AC_ARG_ENABLE(fixed-point, [ --enable-fixed-point compile as fixed-point],
105 [if test "$enableval" = yes; then
106 ac_enable_fixed="yes";
107 AC_DEFINE([FIXED_POINT], , [Compile as fixed-point])
109 AC_DEFINE([FLOATING_POINT], , [Compile as floating-point])
111 AC_DEFINE([FLOATING_POINT], , [Compile as floating-point]))
113 ac_enable_fixed_debug="no"
114 AC_ARG_ENABLE(fixed-point-debug, [ --enable-fixed-point-debug debug fixed-point implementation],
115 [if test "$enableval" = yes; then
116 ac_enable_fixed_debug="yes"
117 AC_DEFINE([FIXED_DEBUG], , [Debug fixed-point implementation])
120 float_approx=$has_float_approx
121 AC_ARG_ENABLE(float-approx, [ --disable-float-approx do not use fast approximations for floating point],
122 [ if test "$enableval" = yes; then
123 AC_WARN([Floating point approximations are not supported on all platforms.])
127 fi], [ float_approx=$has_float_approx ])
129 if test "x${float_approx}" = "xyes"; then
130 AC_DEFINE([FLOAT_APPROX], , [Float approximations])
133 ac_enable_static_modes="no"
134 AC_ARG_ENABLE(static-modes, [ --enable-static-modes use pre-computed codec configurations],
135 [if test "$enableval" = yes; then
136 ac_enable_static_modes="yes"
137 AC_DEFINE([STATIC_MODES], , [Static modes])
140 ac_enable_assertions="no"
141 AC_ARG_ENABLE(assertions, [ --enable-assertions enable additional software error checking],
142 [if test "$enableval" = yes; then
143 ac_enable_assertions="yes"
144 AC_DEFINE([ENABLE_ASSERTIONS], , [Assertions])
147 saved_CFLAGS="$CFLAGS"
148 CFLAGS="$CFLAGS -fvisibility=hidden"
149 AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden])
150 AC_COMPILE_IFELSE([char foo;],
151 [ AC_MSG_RESULT([yes])
152 SYMBOL_VISIBILITY="-fvisibility=hidden" ],
154 CFLAGS="$saved_CFLAGS $SYMBOL_VISIBILITY"
155 AC_SUBST(SYMBOL_VISIBILITY)
157 if test $ac_cv_c_compiler_gnu = yes ; then
158 CFLAGS="$CFLAGS -W -Wstrict-prototypes -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wno-parentheses -Wno-unused-parameter -Wno-sign-compare"
164 AC_CHECK_SIZEOF(short)
166 AC_CHECK_SIZEOF(long)
167 AC_CHECK_SIZEOF(long long)
169 if test x$has_char16 = "xyes" ; then
171 $ac_cv_sizeof_short) SIZE16="short";;
172 $ac_cv_sizeof_int) SIZE16="int";;
176 $ac_cv_sizeof_short) SIZE16="short";;
177 $ac_cv_sizeof_int) SIZE16="int";;
181 if test x$has_char16 = "xyes" ; then
183 $ac_cv_sizeof_int) SIZE32="int";;
184 $ac_cv_sizeof_long) SIZE32="long";;
185 $ac_cv_sizeof_short) SIZE32="short";;
189 $ac_cv_sizeof_int) SIZE32="int";;
190 $ac_cv_sizeof_long) SIZE32="long";;
191 $ac_cv_sizeof_short) SIZE32="short";;
198 AC_OUTPUT([Makefile libcelt/Makefile tests/Makefile
199 celt.pc tools/Makefile libcelt.spec ])
202 ------------------------------------------------------------------------
203 $PACKAGE $VERSION: Automatic configuration OK.
207 C99 var arrays: ................ ${has_var_arrays}
208 C99 lrintf: .................... ${ac_cv_c99_lrintf}
209 Alloca: ........................ ${has_alloca}
211 General configuration:
213 Fast float approximations: ..... ${float_approx}
214 Fixed point support: ........... ${ac_enable_fixed}
215 Fixed point debugging: ......... ${ac_enable_fixed_debug}
216 Static modes: .................. ${ac_enable_static_modes}
217 Assertion checking: ............ ${ac_enable_assertions}
218 ------------------------------------------------------------------------
221 if test "x$tools" = "x"; then
223 echo "You don't seem to have the development package for libogg (libogg-devel) available. Only the library will be built (no encoder/decoder executable)"
224 echo "You can download libogg from http://www.vorbis.com/download.psp"
227 echo "Type \"make; make install\" to compile and install";
228 echo "Type \"make check\" to run the test suite";