1 dnl Process this file with autoconf to produce a configure script. -*-m4-*-
3 AC_INIT(libspeex/speex.c)
5 AM_CONFIG_HEADER([config.h])
10 SPEEX_EXTRA_VERSION=-git
12 #SPEEX_VERSION=$SPEEX_MAJOR_VERSION.$SPEEX_MINOR_VERSION.$SPEEX_MICRO_VERSION$SPEEX_EXTRA_VERSION
13 SPEEX_VERSION="1.2rc1"
19 AC_SUBST(SPEEX_LT_CURRENT)
20 AC_SUBST(SPEEX_LT_REVISION)
21 AC_SUBST(SPEEX_LT_AGE)
24 VERSION=$SPEEX_VERSION
27 AC_SUBST(SPEEX_VERSION)
29 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
42 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)
63 int *array = alloca(foo);
67 if test x$has_var_arrays = "xno" ; then
68 AC_DEFINE([USE_ALLOCA], [], [Make use of alloca])
73 AC_MSG_RESULT($has_alloca)
75 AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
78 #include <xmmintrin.h>
79 __m128 testfunc(float *a, float *b) {
80 return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
90 AC_MSG_RESULT($has_sse)
93 CFLAGS="$CFLAGS -fvisibility=hidden"
94 AC_MSG_CHECKING(for ELF visibility)
97 #pragma GCC visibility push(hidden)
98 __attribute__((visibility("default")))
103 AC_DEFINE([EXPORT], [__attribute__((visibility("default")))], [Symbol visibility prefix])
107 AC_DEFINE([EXPORT], [], [Symbol visibility prefix])
108 CFLAGS="$SAVE_CFLAGS"
111 AC_MSG_RESULT($has_visibility)
113 AC_ARG_WITH([gpl-fftw3], [AS_HELP_STRING([--with-gpl-fftw3@<:@=PATH@:>@],[enable experimental support for FFTW3 library for FFT. @<:@default=no@:>@])],[],[with_gpl_fftw3=no])
115 AS_IF([test "x$with_gpl_fftw3" != "xno"],
116 [if test "x$with_gpl_fftw3" != "xyes"; then
117 export PKG_CONFIG_PATH=$with_gpl_fftw3:$with_gpl_fftw3/lib/pkgconfig:$PKG_CONFIG_PATH
119 PKG_CHECK_MODULES(FFTW3, fftw3f, [
120 AC_DEFINE([USE_GPL_FFTW3], [], [Use FFTW3 for FFT])
121 AC_SUBST([FFTW3_PKGCONFIG], [fftw3f])
125 AC_ARG_WITH([intel-mkl], [AS_HELP_STRING([--with-intel-mkl],[enable experimental support for Intel Math Kernel Library for FFT])],[],[with_intel_mkl=no])
126 AS_IF([test "x$with_intel_mkl" != "xno"],[
127 AC_MSG_CHECKING(for valid MKL)
132 DFTI_DESCRIPTOR_HANDLE h;
133 MKL_LONG result=DftiCreateDescriptor(&h, DFTI_SINGLE, DFTI_REAL, 0);
137 AC_DEFINE([USE_INTEL_MKL], [], [Use Intel Math Kernel Library for FFT])
141 AC_MSG_FAILURE([Failed to compile MKL test program. Make sure you set CFLAGS to include the include directory and set LDFLAGS to include the library directory and all necesarry libraries.])
146 AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h)
148 XIPH_PATH_OGG([src="src"], [src=""])
153 # Check for getopt_long; if not found, use included source.
154 AC_CHECK_FUNCS([getopt_long],,
155 [# FreeBSD has a gnugetopt library.
156 AC_CHECK_LIB([gnugetopt],[getopt_long],
157 [AC_DEFINE([HAVE_GETOPT_LONG])],
158 [# Use the GNU replacement.
160 AC_LIBOBJ(getopt1)])])
162 AC_CHECK_LIB(winmm, main)
164 AC_DEFINE_UNQUOTED(SPEEX_VERSION, "${SPEEX_VERSION}", [Complete version string])
165 AC_DEFINE_UNQUOTED(SPEEX_MAJOR_VERSION, ${SPEEX_MAJOR_VERSION}, [Version major])
166 AC_DEFINE_UNQUOTED(SPEEX_MINOR_VERSION, ${SPEEX_MINOR_VERSION}, [Version minor])
167 AC_DEFINE_UNQUOTED(SPEEX_MICRO_VERSION, ${SPEEX_MICRO_VERSION}, [Version micro])
168 AC_DEFINE_UNQUOTED(SPEEX_EXTRA_VERSION, "${SPEEX_EXTRA_VERSION}", [Version extra])
170 AC_ARG_ENABLE(valgrind, [ --enable-valgrind Enable valgrind extra checks],
171 [if test "$enableval" = yes; then
172 AC_DEFINE([ENABLE_VALGRIND], , [Enable valgrind extra checks])
175 AC_ARG_ENABLE(sse, [ --enable-sse Enable SSE support], [
176 if test "x$enableval" != xno; then
178 CFLAGS="$CFLAGS -O3 -msse"
184 if test "$has_sse" = yes; then
185 AC_DEFINE([_USE_SSE], , [Enable SSE support])
188 AC_ARG_ENABLE(fixed-point, [ --enable-fixed-point Compile as fixed-point],
189 [if test "$enableval" = yes; then
190 AC_DEFINE([FIXED_POINT], , [Compile as fixed-point])
192 AC_DEFINE([FLOATING_POINT], , [Compile as floating-point])
194 AC_DEFINE([FLOATING_POINT], , [Compile as floating-point]))
196 AC_ARG_ENABLE(float-api, [ --disable-float-api Disable the floating-point API],
197 [if test "$enableval" = no; then
198 AC_DEFINE([DISABLE_FLOAT_API], , [Disable all parts of the API that are using floats])
201 AC_ARG_ENABLE(vbr, [ --disable-vbr Disable VBR and VAD from the codec],
202 [if test "$enableval" = no; then
203 AC_DEFINE([DISABLE_VBR], , [Disable VBR and VAD from the codec])
206 AC_ARG_ENABLE(arm4-asm, [ --enable-arm4-asm Make use of ARM4 assembly optimizations],
207 [if test "$enableval" = yes; then
208 AC_DEFINE([ARM4_ASM], , [Make use of ARM4 assembly optimizations])
211 AC_ARG_ENABLE(arm5e-asm, [ --enable-arm5e-asm Make use of ARM5E assembly optimizations],
212 [if test "$enableval" = yes; then
213 AC_DEFINE([ARM5E_ASM], , [Make use of ARM5E assembly optimizations])
216 AC_ARG_ENABLE(blackfin-asm, [ --enable-blackfin-asm Make use of Blackfin assembly optimizations],
217 [if test "$enableval" = yes; then
218 AC_DEFINE([BFIN_ASM], , [Make use of Blackfin assembly optimizations])
219 LDFLAGS="-Wl,-elf2flt=-s100000"
222 AC_ARG_ENABLE(fixed-point-debug, [ --enable-fixed-point-debug Debug fixed-point implementation],
223 [if test "$enableval" = yes; then
224 AC_DEFINE([FIXED_DEBUG], , [Debug fixed-point implementation])
227 AC_ARG_ENABLE(ti-c55x, [ --enable-ti-c55x Enable support for TI C55X DSP],
228 [if test "$enableval" = yes; then
230 AC_DEFINE([TI_C55X], , [Enable support for TI C55X DSP])
233 AC_CHECK_SIZEOF(short)
235 AC_CHECK_SIZEOF(long)
237 if test x$has_char16 = "xyes" ; then
239 $ac_cv_sizeof_short) SIZE16="short";;
240 $ac_cv_sizeof_int) SIZE16="int";;
244 $ac_cv_sizeof_short) SIZE16="short";;
245 $ac_cv_sizeof_int) SIZE16="int";;
249 if test x$has_char16 = "xyes" ; then
251 $ac_cv_sizeof_int) SIZE32="int";;
252 $ac_cv_sizeof_long) SIZE32="long";;
253 $ac_cv_sizeof_short) SIZE32="short";;
257 $ac_cv_sizeof_int) SIZE32="int";;
258 $ac_cv_sizeof_long) SIZE32="long";;
259 $ac_cv_sizeof_short) SIZE32="short";;
266 AC_OUTPUT([Makefile libspeex/Makefile src/Makefile doc/Makefile Speex.spec
267 include/Makefile include/speex/Makefile speex.pc speexdsp.pc
268 win32/Makefile win32/libspeex/Makefile win32/speexenc/Makefile
269 win32/speexdec/Makefile symbian/Makefile
270 win32/VS2003/Makefile
271 win32/VS2003/tests/Makefile
272 win32/VS2003/libspeex/Makefile
273 win32/VS2003/libspeexdsp/Makefile
274 win32/VS2003/speexdec/Makefile
275 win32/VS2003/speexenc/Makefile
276 win32/VS2005/Makefile
277 win32/VS2005/libspeex/Makefile
278 win32/VS2005/speexdec/Makefile
279 win32/VS2005/speexenc/Makefile
280 win32/VS2005/libspeexdsp/Makefile
281 win32/VS2005/tests/Makefile
282 win32/VS2008/libspeexdsp/Makefile
283 win32/VS2008/Makefile
284 win32/VS2008/speexdec/Makefile
285 win32/VS2008/tests/Makefile
286 win32/VS2008/libspeex/Makefile
287 win32/VS2008/speexenc/Makefile
288 include/speex/speex_config_types.h ti/Makefile
289 ti/speex_C54_test/Makefile ti/speex_C55_test/Makefile
290 ti/speex_C64_test/Makefile ])
292 if test "x$src" = "x"; then
294 echo "You don't seem to have the development package for libogg (libogg-devel) installed. Only the Speex library (libspeex) will be built (no encoder/decoder executable)"
295 echo "You can download libogg from http://downloads.xiph.org/releases/ogg/"
298 echo "Type \"make; make install\" to compile and install Speex";