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])
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_CHECK_HEADERS(sys/soundcard.h sys/audioio.h)
115 XIPH_PATH_OGG([src="src"], [src=""])
120 # Check for getopt_long; if not found, use included source.
121 AC_CHECK_FUNCS([getopt_long],,
122 [# FreeBSD has a gnugetopt library.
123 AC_CHECK_LIB([gnugetopt],[getopt_long],
124 [AC_DEFINE([HAVE_GETOPT_LONG])],
125 [# Use the GNU replacement.
127 AC_LIBOBJ(getopt1)])])
129 AC_CHECK_LIB(winmm, main)
131 AC_DEFINE_UNQUOTED(SPEEX_VERSION, "${SPEEX_VERSION}", [Complete version string])
132 AC_DEFINE_UNQUOTED(SPEEX_MAJOR_VERSION, ${SPEEX_MAJOR_VERSION}, [Version major])
133 AC_DEFINE_UNQUOTED(SPEEX_MINOR_VERSION, ${SPEEX_MINOR_VERSION}, [Version minor])
134 AC_DEFINE_UNQUOTED(SPEEX_MICRO_VERSION, ${SPEEX_MICRO_VERSION}, [Version micro])
135 AC_DEFINE_UNQUOTED(SPEEX_EXTRA_VERSION, "${SPEEX_EXTRA_VERSION}", [Version extra])
137 AC_ARG_ENABLE(valgrind, [ --enable-valgrind Enable valgrind extra checks],
138 [if test "$enableval" = yes; then
139 AC_DEFINE([ENABLE_VALGRIND], , [Enable valgrind extra checks])
142 AC_ARG_ENABLE(sse, [ --enable-sse Enable SSE support], [
143 if test "x$enableval" != xno; then
145 CFLAGS="$CFLAGS -O3 -msse"
154 AC_ARG_ENABLE(fixed-point, [ --enable-fixed-point Compile as fixed-point],
155 [if test "$enableval" = yes; then
158 AC_DEFINE([FIXED_POINT], , [Compile as fixed-point])
160 AC_DEFINE([FLOATING_POINT], , [Compile as floating-point])
162 AC_DEFINE([FLOATING_POINT], , [Compile as floating-point]))
164 if test "$has_sse" = yes; then
165 AC_DEFINE([_USE_SSE], , [Enable SSE support])
168 AC_ARG_ENABLE(float-api, [ --disable-float-api Disable the floating-point API],
169 [if test "$enableval" = no; then
170 AC_DEFINE([DISABLE_FLOAT_API], , [Disable all parts of the API that are using floats])
173 AC_ARG_ENABLE(vbr, [ --disable-vbr Disable VBR and VAD from the codec],
174 [if test "$enableval" = no; then
175 AC_DEFINE([DISABLE_VBR], , [Disable VBR and VAD from the codec])
178 AC_ARG_ENABLE(arm4-asm, [ --enable-arm4-asm Make use of ARM4 assembly optimizations],
179 [if test "$enableval" = yes; then
180 AC_DEFINE([ARM4_ASM], , [Make use of ARM4 assembly optimizations])
183 AC_ARG_ENABLE(arm5e-asm, [ --enable-arm5e-asm Make use of ARM5E assembly optimizations],
184 [if test "$enableval" = yes; then
185 AC_DEFINE([ARM5E_ASM], , [Make use of ARM5E assembly optimizations])
188 AC_ARG_ENABLE(blackfin-asm, [ --enable-blackfin-asm Make use of Blackfin assembly optimizations],
189 [if test "$enableval" = yes; then
190 AC_DEFINE([BFIN_ASM], , [Make use of Blackfin assembly optimizations])
191 LDFLAGS="-Wl,-elf2flt=-s100000"
194 AC_ARG_ENABLE(fixed-point-debug, [ --enable-fixed-point-debug Debug fixed-point implementation],
195 [if test "$enableval" = yes; then
196 AC_DEFINE([FIXED_DEBUG], , [Debug fixed-point implementation])
199 AC_ARG_ENABLE(ti-c55x, [ --enable-ti-c55x Enable support for TI C55X DSP],
200 [if test "$enableval" = yes; then
202 AC_DEFINE([TI_C55X], , [Enable support for TI C55X DSP])
205 AC_ARG_WITH([fft], [AS_HELP_STRING([--with-fft=choice],[use an alternate FFT implementation. The available choices are
206 kiss (default fixed point), smallft (default floating point), gpl-fftw3 and proprietary-intel-mkl])],
213 AC_DEFINE([USE_KISS_FFT], [], [Use KISS Fast Fourier Transform])
216 AC_DEFINE([USE_SMALLFT], [], [Use FFT from OggVorbis])
219 AC_DEFINE([USE_GPL_FFTW3], [], [Use FFTW3 for FFT])
220 PKG_CHECK_MODULES(FFT, fftw3f)
222 [proprietary-intel-mkl], [
223 AC_DEFINE([USE_INTEL_MKL], [], [Use Intel Math Kernel Library for FFT])
224 AC_MSG_CHECKING(for valid MKL)
229 DFTI_DESCRIPTOR_HANDLE h;
230 MKL_LONG result=DftiCreateDescriptor(&h, DFTI_SINGLE, DFTI_REAL, 0);
232 [AC_MSG_RESULT(yes)],
233 [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.])]
236 [AC_MSG_FAILURE([Unknown FFT $FFT specified for --with-fft])]
238 AM_CONDITIONAL(BUILD_KISS_FFT, [test "$FFT" = "kiss"])
239 AM_CONDITIONAL(BUILD_SMALLFT, [test "$FFT" = "smallft"])
240 AC_SUBST(FFT_PKGCONFIG)
243 AC_CHECK_SIZEOF(short)
245 AC_CHECK_SIZEOF(long)
247 if test x$has_char16 = "xyes" ; then
249 $ac_cv_sizeof_short) SIZE16="short";;
250 $ac_cv_sizeof_int) SIZE16="int";;
254 $ac_cv_sizeof_short) SIZE16="short";;
255 $ac_cv_sizeof_int) SIZE16="int";;
259 if test x$has_char16 = "xyes" ; then
261 $ac_cv_sizeof_int) SIZE32="int";;
262 $ac_cv_sizeof_long) SIZE32="long";;
263 $ac_cv_sizeof_short) SIZE32="short";;
267 $ac_cv_sizeof_int) SIZE32="int";;
268 $ac_cv_sizeof_long) SIZE32="long";;
269 $ac_cv_sizeof_short) SIZE32="short";;
276 AC_OUTPUT([Makefile libspeex/Makefile src/Makefile doc/Makefile
277 include/Makefile include/speex/Makefile speex.pc speexdsp.pc
278 win32/Makefile win32/libspeex/Makefile win32/speexenc/Makefile
279 win32/speexdec/Makefile symbian/Makefile
280 win32/VS2003/Makefile
281 win32/VS2003/tests/Makefile
282 win32/VS2003/libspeex/Makefile
283 win32/VS2003/libspeexdsp/Makefile
284 win32/VS2003/speexdec/Makefile
285 win32/VS2003/speexenc/Makefile
286 win32/VS2005/Makefile
287 win32/VS2005/libspeex/Makefile
288 win32/VS2005/speexdec/Makefile
289 win32/VS2005/speexenc/Makefile
290 win32/VS2005/libspeexdsp/Makefile
291 win32/VS2005/tests/Makefile
292 win32/VS2008/libspeexdsp/Makefile
293 win32/VS2008/Makefile
294 win32/VS2008/speexdec/Makefile
295 win32/VS2008/tests/Makefile
296 win32/VS2008/libspeex/Makefile
297 win32/VS2008/speexenc/Makefile
298 include/speex/speex_config_types.h ti/Makefile
299 ti/speex_C54_test/Makefile ti/speex_C55_test/Makefile
300 ti/speex_C64_test/Makefile ])
302 if test "x$src" = "x"; then
304 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)"
305 echo "You can download libogg from http://downloads.xiph.org/releases/ogg/"
308 echo "Type \"make; make install\" to compile and install Speex";