• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1dnl Process this file with autoconf to produce a configure script. -*-m4-*-
2
3AC_INIT([speexdsp],[1.2.1],[speex-dev@xiph.org])
4
5AC_CONFIG_SRCDIR([libspeexdsp/preprocess.c])
6AC_CONFIG_MACRO_DIR([m4])
7
8dnl enable silent rules on automake 1.11 and later
9m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
11
12SPEEXDSP_LT_CURRENT=6
13SPEEXDSP_LT_REVISION=2
14SPEEXDSP_LT_AGE=5
15
16
17AC_SUBST(SPEEXDSP_LT_CURRENT)
18AC_SUBST(SPEEXDSP_LT_REVISION)
19AC_SUBST(SPEEXDSP_LT_AGE)
20
21AM_INIT_AUTOMAKE([foreign no-define])
22AM_MAINTAINER_MODE([enable])
23
24AC_CANONICAL_HOST
25_LT_SET_OPTION([LT_INIT],[win32-dll])
26LT_INIT
27
28AC_C_BIGENDIAN
29AC_C_CONST
30AC_C_INLINE
31AC_C_RESTRICT
32
33
34AC_MSG_CHECKING(for C99 variable-size arrays)
35AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
36int foo;
37foo = 10;
38int array[foo];
39]])],[has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
40],[has_var_arrays=no
41])
42AC_MSG_RESULT($has_var_arrays)
43
44AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
45AC_LINK_IFELSE([
46AC_LANG_PROGRAM([[
47#include <xmmintrin.h>
48__m128 testfunc(float *a, float *b) {
49  return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
50}
51]])],
52[
53has_sse=yes
54],
55[
56has_sse=no
57]
58)
59AC_MSG_RESULT($has_sse)
60
61AC_MSG_CHECKING(for SSE2 in current arch/CFLAGS)
62AC_LINK_IFELSE([
63AC_LANG_PROGRAM([[
64#include <emmintrin.h>
65__m128d testfunc(double *a, double *b) {
66  return _mm_add_pd(_mm_loadu_pd(a), _mm_loadu_pd(b));
67}
68]])],
69[
70has_sse2=yes
71],
72[
73has_sse2=no
74]
75)
76AC_MSG_RESULT($has_sse2)
77
78AC_MSG_CHECKING(for NEON in current arch/CFLAGS)
79AC_LINK_IFELSE([
80AC_LANG_PROGRAM([[
81#include <arm_neon.h>
82int32x4_t testfunc(int16_t *a, int16_t *b) {
83      return vmull_s16(vld1_s16(a), vld1_s16(b));
84}
85]])],
86[
87has_neon=yes
88],
89[
90has_neon=no
91]
92)
93AC_MSG_RESULT($has_neon)
94
95SAVE_CFLAGS="$CFLAGS"
96CFLAGS="$CFLAGS -fvisibility=hidden"
97AC_MSG_CHECKING(for ELF visibility)
98AC_COMPILE_IFELSE([
99AC_LANG_PROGRAM([[
100#pragma GCC visibility push(hidden)
101__attribute__((visibility("default")))
102int var=10;
103]])],
104[
105has_visibility=yes
106AC_DEFINE([EXPORT], [__attribute__((visibility("default")))], [Symbol visibility prefix])
107],
108[
109has_visibility=no
110AC_DEFINE([EXPORT], [], [Symbol visibility prefix])
111CFLAGS="$SAVE_CFLAGS"
112]
113)
114AC_MSG_RESULT($has_visibility)
115
116AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h)
117
118AC_SUBST(src)
119
120LT_LIB_M
121
122
123AC_ARG_ENABLE(sse, [  --enable-sse            Enable SSE support], [
124if test "x$enableval" != xno; then
125has_sse=yes
126has_sse2=yes
127CFLAGS="$CFLAGS -O3 -msse -msse2"
128else
129has_sse=no
130has_sse2=no
131fi
132])
133
134AC_ARG_ENABLE(neon, [  --enable-neon           Enable NEON support], [
135if test "x$enableval" != xno; then
136has_neon=yes
137AS_CASE(["$host"],
138  [arm*], [CFLAGS="$CFLAGS -O3 -march=armv7-a -mfpu=neon"]
139)
140else
141has_neon=no
142fi
143])
144
145
146FFT=smallft
147
148AC_ARG_ENABLE(fixed-point, [  --enable-fixed-point    Compile as fixed-point],
149[if test "$enableval" = yes; then
150  FFT=kiss
151  has_sse=no
152  AC_DEFINE([FIXED_POINT], , [Compile as fixed-point])
153else
154  AC_DEFINE([FLOATING_POINT], , [Compile as floating-point])
155fi],
156AC_DEFINE([FLOATING_POINT], , [Compile as floating-point]))
157
158if test "$has_sse" = yes; then
159  AC_DEFINE([USE_SSE], , [Enable SSE support])
160fi
161
162if test "$has_neon" = yes; then
163  AC_DEFINE([USE_NEON], , [Enable NEON support])
164fi
165
166if test "$has_sse2" = yes; then
167  AC_DEFINE([USE_SSE2], , [Enable SSE2 support])
168fi
169
170AC_ARG_ENABLE(float-api, [  --disable-float-api     Disable the floating-point API],
171[if test "$enableval" = no; then
172  AC_DEFINE([DISABLE_FLOAT_API], , [Disable all parts of the API that are using floats])
173fi])
174
175AC_ARG_ENABLE(examples, [  --disable-examples      Do not build example programs, only the library])
176if test "$enableval" != no; then
177  AM_CONDITIONAL([BUILD_EXAMPLES], true)
178else
179  AM_CONDITIONAL([BUILD_EXAMPLES], false)
180fi
181
182AC_ARG_ENABLE(arm4-asm, [  --enable-arm4-asm       Make use of ARM4 assembly optimizations],
183[if test "$enableval" = yes; then
184  AC_DEFINE([ARM4_ASM], , [Make use of ARM4 assembly optimizations])
185fi])
186
187AC_ARG_ENABLE(arm5e-asm, [  --enable-arm5e-asm      Make use of ARM5E assembly optimizations],
188[if test "$enableval" = yes; then
189  AC_DEFINE([ARM5E_ASM], , [Make use of ARM5E assembly optimizations])
190fi])
191
192AC_ARG_ENABLE(blackfin-asm, [  --enable-blackfin-asm   Make use of Blackfin assembly optimizations],
193[if test "$enableval" = yes; then
194  AC_DEFINE([BFIN_ASM], , [Make use of Blackfin assembly optimizations])
195fi])
196case $host_os in
197  uclinux) LDFLAGS="-Wl,-elf2flt=-s100000 $LDFLAGS";;
198esac
199
200AC_ARG_ENABLE(fixed-point-debug, [  --enable-fixed-point-debug  Debug fixed-point implementation],
201[if test "$enableval" = yes; then
202  AC_DEFINE([FIXED_DEBUG], , [Debug fixed-point implementation])
203fi])
204
205AC_ARG_ENABLE(resample-full-sinc-table, [  --enable-resample-full-sinc-table Resample full SINC table (no interpolation)],
206[if test "$enableval" = yes; then
207  AC_DEFINE([RESAMPLE_FULL_SINC_TABLE], , [Resample with full SINC table (no interpolation)])
208fi])
209
210AC_ARG_ENABLE(ti-c55x, [  --enable-ti-c55x        Enable support for TI C55X DSP],
211[if test "$enableval" = yes; then
212  has_char16=yes;
213  AC_DEFINE([TI_C55X], , [Enable support for TI C55X DSP])
214fi])
215
216AC_ARG_WITH([fft], [AS_HELP_STRING([--with-fft=choice],[use an alternate FFT implementation. The available choices are
217kiss (default fixed point), smallft (default floating point), gpl-fftw3 and proprietary-intel-mkl])],
218[FFT=$withval]
219)
220
221FFT_PKGCONFIG=
222AS_CASE([$FFT],
223 [kiss], [
224  AC_DEFINE([USE_KISS_FFT], [], [Use KISS Fast Fourier Transform])
225 ],
226 [smallft], [
227  AC_DEFINE([USE_SMALLFT], [], [Use FFT from OggVorbis])
228 ],
229 [gpl-fftw3], [
230  AC_DEFINE([USE_GPL_FFTW3], [], [Use FFTW3 for FFT])
231  PKG_CHECK_MODULES([FFT], [fftw3f])
232 ],
233 [proprietary-intel-mkl], [
234  AC_DEFINE([USE_INTEL_MKL], [], [Use Intel Math Kernel Library for FFT])
235  AC_MSG_CHECKING(for valid MKL)
236  AC_LINK_IFELSE([
237   AC_LANG_PROGRAM([[
238#include <mkl.h>
239void func() {
240  DFTI_DESCRIPTOR_HANDLE h;
241  MKL_LONG result=DftiCreateDescriptor(&h, DFTI_SINGLE, DFTI_REAL, 0);
242}]])],
243   [AC_MSG_RESULT(yes)],
244   [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.])]
245  )
246 ],
247 [AC_MSG_FAILURE([Unknown FFT $FFT specified for --with-fft])]
248)
249AM_CONDITIONAL(BUILD_KISS_FFT, [test "$FFT" = "kiss"])
250AM_CONDITIONAL(BUILD_SMALLFT, [test "$FFT" = "smallft"])
251AC_SUBST(FFT_PKGCONFIG)
252
253
254AC_CHECK_SIZEOF([int16_t])
255AC_CHECK_SIZEOF([uint16_t])
256AC_CHECK_SIZEOF([u_int16_t])
257AC_CHECK_SIZEOF([int32_t])
258AC_CHECK_SIZEOF([uint32_t])
259AC_CHECK_SIZEOF([u_int32_t])
260AC_CHECK_SIZEOF([short])
261AC_CHECK_SIZEOF([int])
262AC_CHECK_SIZEOF([long])
263
264AS_IF([test "$has_char16" = "yes"],
265  [
266   SIZEOF16=1
267   SIZEOF32=2
268  ],[
269   SIZEOF16=2
270   SIZEOF32=4
271  ])
272
273case $SIZEOF16 in
274    $ac_cv_sizeof_int16_t) SIZE16="int16_t";;
275    $ac_cv_sizeof_short) SIZE16="short";;
276    $ac_cv_sizeof_int) SIZE16="int";;
277esac
278
279case $SIZEOF16 in
280    $ac_cv_sizeof_uint16_t) USIZE16="uint16_t";;
281    $ac_cv_sizeof_u_int16_t) USIZE16="u_int16_t";;
282    $ac_cv_sizeof_short) USIZE16="unsigned short";;
283    $ac_cv_sizeof_int) USIZE16="unsigned int";;
284esac
285
286case $SIZEOF32 in
287    $ac_cv_sizeof_int32_t) SIZE32="int32_t";;
288    $ac_cv_sizeof_int) SIZE32="int";;
289    $ac_cv_sizeof_long) SIZE32="long";;
290    $ac_cv_sizeof_short) SIZE32="short";;
291esac
292
293case $SIZEOF32 in
294    $ac_cv_sizeof_uint32_t) USIZE32="uint32_t";;
295    $ac_cv_sizeof_u_int32_t) USIZE32="u_int32_t";;
296    $ac_cv_sizeof_short) USIZE32="unsigned short";;
297    $ac_cv_sizeof_int) USIZE32="unsigned int";;
298    $ac_cv_sizeof_long) USIZE32="unsigned long";;
299esac
300
301AS_IF([test -z "$SIZE16"],[AC_MSG_ERROR([No 16 bit type found on this platform!])])
302AS_IF([test -z "$SIZE32"],[AC_MSG_ERROR([No 32 bit type found on this platform!])])
303AS_IF([test -z "$USIZE16"],[AC_MSG_ERROR([No unsigned 16 bit type found on this platform!])])
304AS_IF([test -z "$USIZE32"],[AC_MSG_ERROR([No unsigned 32 bit type found on this platform!])])
305
306AC_SUBST([SIZE16])
307AC_SUBST([USIZE16])
308AC_SUBST([SIZE32])
309AC_SUBST([USIZE32])
310
311AS_IF([test "$ac_cv_header_stdint_h" = "yes"],    [INCLUDE_STDINT="#include <stdint.h>"],
312      [test "$ac_cv_header_inttypes_h" = "yes"],  [INCLUDE_STDINT="#include <inttypes.h>"],
313      [test "$ac_cv_header_sys_types_h" = "yes"], [INCLUDE_STDINT="#include <sys/types.h>"])
314
315AC_SUBST([INCLUDE_STDINT])
316
317AC_CONFIG_FILES([
318           Makefile libspeexdsp/Makefile doc/Makefile SpeexDSP.spec
319           include/Makefile include/speex/Makefile speexdsp.pc
320           win32/Makefile win32/libspeexdsp/Makefile
321           symbian/Makefile
322
323           win32/VS2003/Makefile
324           win32/VS2003/libspeexdsp/Makefile
325           win32/VS2003/tests/Makefile
326
327           win32/VS2005/Makefile
328           win32/VS2005/libspeexdsp/Makefile
329           win32/VS2005/tests/Makefile
330
331           win32/VS2008/Makefile
332           win32/VS2008/libspeexdsp/Makefile
333           win32/VS2008/tests/Makefile
334           include/speex/speexdsp_config_types.h ti/Makefile
335	   ti/speex_C54_test/Makefile ti/speex_C55_test/Makefile
336	   ti/speex_C64_test/Makefile ])
337
338AC_CONFIG_HEADERS([config.h])
339
340AC_OUTPUT
341
342echo "Type \"make; make install\" to compile and install Speex";
343