blob: f427f46956210971a3b50a450a14f6ed067df701 [file] [log] [blame]
Jean-Marc Valine05aaf22011-04-29 19:48:42 -04001dnl Process this file with autoconf to produce a configure script. -*-m4-*-
Jean-Marc Valina0cbeca2010-07-08 11:27:20 -04002
Ron2f2f9d62013-05-11 02:05:24 +09303dnl The package_version file will be automatically synced to the git revision
4dnl by the update_version script when configured in the repository, but will
5dnl remain constant in tarball releases unless it is manually edited.
6m4_define([CURRENT_VERSION],
Roncfe8e2b2013-07-13 17:23:04 +09307 m4_esyscmd([ ./update_version 2>/dev/null || true
8 if test -e package_version; then
Ron918acd12013-05-18 16:11:18 +09309 . ./package_version
10 printf "$PACKAGE_VERSION"
11 else
12 printf "unknown"
13 fi ]))
Jean-Marc Valina0cbeca2010-07-08 11:27:20 -040014
Ron2f2f9d62013-05-11 02:05:24 +093015AC_INIT([opus],[CURRENT_VERSION],[opus@xiph.org])
16
17AC_CONFIG_SRCDIR(src/opus_encoder.c)
Ron50b395b2013-05-20 12:31:48 +093018AC_CONFIG_MACRO_DIR([m4])
Jean-Marc Valin381c7062011-03-21 13:53:40 -040019
Ralph Giles5ccc1242011-07-29 00:55:56 -070020dnl enable silent rules on automake 1.11 and later
21m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
22
Ralph Giles3164fcf2012-05-18 11:47:58 -070023# For libtool.
Ralph Giles59c5a822012-08-16 11:39:56 -070024dnl Please update these for releases.
Jean-Marc Valin65471dd2013-12-04 18:25:34 -050025OPUS_LT_CURRENT=5
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040026OPUS_LT_REVISION=0
Jean-Marc Valin65471dd2013-12-04 18:25:34 -050027OPUS_LT_AGE=5
Jean-Marc Valina0cbeca2010-07-08 11:27:20 -040028
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040029AC_SUBST(OPUS_LT_CURRENT)
30AC_SUBST(OPUS_LT_REVISION)
31AC_SUBST(OPUS_LT_AGE)
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040032
Ron2f2f9d62013-05-11 02:05:24 +093033AM_INIT_AUTOMAKE([no-define])
Ralph Giles14454c42012-11-14 12:42:19 -080034AM_MAINTAINER_MODE([enable])
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040035
36AC_CANONICAL_HOST
Gregory Maxwell417679c2012-08-09 08:39:15 -040037AC_MINGW32
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040038AM_PROG_LIBTOOL
Ralph Giles2852cb12011-08-02 11:43:43 -070039AM_PROG_CC_C_O
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040040
41AC_PROG_CC_C99
Jean-Marc Valina0cbeca2010-07-08 11:27:20 -040042AC_C_CONST
43AC_C_INLINE
Gregory Maxwell8ecba1a2012-05-14 01:58:05 -040044
Timothy B. Terriberry39386e02013-11-18 13:30:13 -050045AM_PROG_AS
46
Ron5bac4f22013-06-29 02:06:53 +093047AC_DEFINE([OPUS_BUILD], [], [This is a build of OPUS])
48
Gregory Maxwell8ecba1a2012-05-14 01:58:05 -040049#Use a hacked up version of autoconf's AC_C_RESTRICT because it's not
50#strong enough a test to detect old buggy versions of GCC (e.g. 2.95.3)
Ron5bac4f22013-06-29 02:06:53 +093051#Note: Both this and the test for variable-size arrays below are also
52# done by AC_PROG_CC_C99, but not thoroughly enough apparently.
Gregory Maxwell8ecba1a2012-05-14 01:58:05 -040053AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict,
54 [ac_cv_c_restrict=no
55 # The order here caters to the fact that C++ does not require restrict.
56 for ac_kw in __restrict __restrict__ _Restrict restrict; do
57 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
58 [[typedef int * int_ptr;
Timothy B. Terriberry39386e02013-11-18 13:30:13 -050059 int foo (int_ptr $ac_kw ip, int * $ac_kw baz[]) {
60 return ip[0];
Gregory Maxwell8ecba1a2012-05-14 01:58:05 -040061 }]],
62 [[int s[1];
Timothy B. Terriberry39386e02013-11-18 13:30:13 -050063 int * $ac_kw t = s;
64 t[0] = 0;
65 return foo(t, (void *)0)]])],
Gregory Maxwell8ecba1a2012-05-14 01:58:05 -040066 [ac_cv_c_restrict=$ac_kw])
67 test "$ac_cv_c_restrict" != no && break
68 done
69 ])
Ron5bac4f22013-06-29 02:06:53 +093070
71AH_VERBATIM([restrict],
Gregory Maxwell8ecba1a2012-05-14 01:58:05 -040072[/* Define to the equivalent of the C99 'restrict' keyword, or to
73 nothing if this is not supported. Do not define if restrict is
74 supported directly. */
75#undef restrict
76/* Work around a bug in Sun C++: it does not support _Restrict or
77 __restrict__, even though the corresponding Sun C compiler ends up with
78 "#define restrict _Restrict" or "#define restrict __restrict__" in the
79 previous line. Perhaps some future version of Sun C++ will work with
80 restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
81#if defined __SUNPRO_CC && !defined __RESTRICT
82# define _Restrict
83# define __restrict__
84#endif])
Ron5bac4f22013-06-29 02:06:53 +093085
86case $ac_cv_c_restrict in
Gregory Maxwell8ecba1a2012-05-14 01:58:05 -040087 restrict) ;;
88 no) AC_DEFINE([restrict], []) ;;
89 *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
Ron5bac4f22013-06-29 02:06:53 +093090esac
Jean-Marc Valin381c7062011-03-21 13:53:40 -040091
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040092AC_MSG_CHECKING(for C99 variable-size arrays)
Ron5bac4f22013-06-29 02:06:53 +093093AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
94 [[static int x; char a[++x]; a[sizeof a - 1] = 0; int N; return a[0];]])],
95 [ has_var_arrays=yes
96 use_alloca="no (using var arrays)"
97 AC_DEFINE([VAR_ARRAYS], [1], [Use C99 variable-size arrays])
98 ],[
99 has_var_arrays=no
100 ])
101AC_MSG_RESULT([$has_var_arrays])
Jean-Marc Valina0cbeca2010-07-08 11:27:20 -0400102
Ron5bac4f22013-06-29 02:06:53 +0930103AS_IF([test "$has_var_arrays" = "no"],
104 [
105 AC_CHECK_HEADERS([alloca.h])
106 AC_MSG_CHECKING(for alloca)
107 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alloca.h>]],
108 [[int foo=10; int *array = alloca(foo);]])],
109 [ use_alloca=yes;
110 AC_DEFINE([USE_ALLOCA], [], [Make use of alloca])
111 ],[
112 use_alloca=no
113 ])
114 AC_MSG_RESULT([$use_alloca])
115 ])
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400116
Ron5bac4f22013-06-29 02:06:53 +0930117LT_LIB_M
118
119AC_ARG_ENABLE([fixed-point],
120 [AS_HELP_STRING([--enable-fixed-point],
121 [compile without floating point (for machines without a fast enough FPU)])],,
122 [enable_fixed_point=no])
123
124AS_IF([test "$enable_fixed_point" = "yes"],[
125 enable_float="no"
126 AC_DEFINE([FIXED_POINT], [1], [Compile as fixed-point (for machines without a fast enough FPU)])
127 PC_BUILD="fixed-point"
128],[
129 enable_float="yes";
130 PC_BUILD="floating-point"
Ron5bac4f22013-06-29 02:06:53 +0930131])
132
133AM_CONDITIONAL([FIXED_POINT], [test "$enable_fixed_point" = "yes"])
134
135AC_ARG_ENABLE([fixed-point-debug],
136 [AS_HELP_STRING([--enable-fixed-point-debug], [debug fixed-point implementation])],,
137 [enable_fixed_point_debug=no])
138
139AS_IF([test "$enable_fixed_point_debug" = "yes"],[
140 AC_DEFINE([FIXED_DEBUG], [1], [Debug fixed-point implementation])
141])
142
Jean-Marc Valind814c5d2013-11-04 12:26:50 -0500143AC_ARG_ENABLE([float_api],
144 [AS_HELP_STRING([--disable-float-api],
145 [compile without the floating point API (for machines with no float library)])],,
146 [enable_float_api=yes])
147
148AM_CONDITIONAL([DISABLE_FLOAT_API], [test "$enable_float_api" = "no"])
149
150AS_IF([test "$enable_float_api" = "no"],[
151 AC_DEFINE([DISABLE_FLOAT_API], [1], [Do not build the float API])
152])
153
Ron5bac4f22013-06-29 02:06:53 +0930154AC_ARG_ENABLE([custom-modes],
155 [AS_HELP_STRING([--enable-custom-modes], [enable non-Opus modes, e.g. 44.1 kHz & 2^n frames])],,
156 [enable_custom_modes=no])
157
158AS_IF([test "$enable_custom_modes" = "yes"],[
159 AC_DEFINE([CUSTOM_MODES], [1], [Custom modes])
160 PC_BUILD="$PC_BUILD, custom modes"
Ron5bac4f22013-06-29 02:06:53 +0930161])
162
163AM_CONDITIONAL([CUSTOM_MODES], [test "$enable_custom_modes" = "yes"])
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400164
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400165has_float_approx=no
166#case "$host_cpu" in
167#i[[3456]]86 | x86_64 | powerpc64 | powerpc32 | ia64)
168# has_float_approx=yes
169# ;;
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500170#esac
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400171
Ron5bac4f22013-06-29 02:06:53 +0930172AC_ARG_ENABLE([float-approx],
173 [AS_HELP_STRING([--enable-float-approx], [enable fast approximations for floating point])],
174 [if test "$enable_float_approx" = "yes"; then
175 AC_WARN([Floating point approximations are not supported on all platforms.])
176 fi
177 ],
178 [enable_float_approx=$has_float_approx])
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400179
Ron5bac4f22013-06-29 02:06:53 +0930180AS_IF([test "$enable_float_approx" = "yes"],[
181 AC_DEFINE([FLOAT_APPROX], [1], [Float approximations])
182])
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400183
Ron5bac4f22013-06-29 02:06:53 +0930184AC_ARG_ENABLE([asm],
Jean-Marc Valin17dcb272013-12-03 13:31:24 -0500185 [AS_HELP_STRING([--disable-asm], [Disable assembly optimizations])],,
186 [enable_asm=yes])
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400187
Ron5bac4f22013-06-29 02:06:53 +0930188AC_ARG_ENABLE([rtcd],
189 [AS_HELP_STRING([--disable-rtcd], [Disable run-time CPU capabilities detection])],,
190 [enable_rtcd=yes])
191
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500192rtcd_support=no
193cpu_arm=no
194
195AS_IF([test x"${enable_asm}" = x"yes"],[
196 inline_optimization="No ASM for your platform, please send patches"
197 case $host_cpu in
198 arm*)
199 dnl Currently we only have asm for fixed-point
200 AS_IF([test "$enable_float" != "yes"],[
201 cpu_arm=yes
202 AC_DEFINE([OPUS_ARM_ASM], [], [Make use of ARM asm optimization])
203 AS_GCC_INLINE_ASSEMBLY(
204 [inline_optimization="ARM"],
205 [inline_optimization="disabled"]
206 )
207 AS_ASM_ARM_EDSP([OPUS_ARM_INLINE_EDSP=1],[OPUS_ARM_INLINE_EDSP=0])
208 AS_ASM_ARM_MEDIA([OPUS_ARM_INLINE_MEDIA=1],
209 [OPUS_ARM_INLINE_MEDIA=0])
210 AS_ASM_ARM_NEON([OPUS_ARM_INLINE_NEON=1],[OPUS_ARM_INLINE_NEON=0])
211 AS_IF([test x"$inline_optimization" = x"ARM"],[
212 AM_CONDITIONAL([OPUS_ARM_INLINE_ASM],[true])
213 AC_DEFINE([OPUS_ARM_INLINE_ASM], 1,
214 [Use generic ARMv4 inline asm optimizations])
215 AS_IF([test x"$OPUS_ARM_INLINE_EDSP" = x"1"],[
216 AC_DEFINE([OPUS_ARM_INLINE_EDSP], [1],
217 [Use ARMv5E inline asm optimizations])
218 inline_optimization="$inline_optimization (EDSP)"
219 ])
220 AS_IF([test x"$OPUS_ARM_INLINE_MEDIA" = x"1"],[
221 AC_DEFINE([OPUS_ARM_INLINE_MEDIA], [1],
222 [Use ARMv6 inline asm optimizations])
223 inline_optimization="$inline_optimization (Media)"
224 ])
225 AS_IF([test x"$OPUS_ARM_INLINE_NEON" = x"1"],[
226 AC_DEFINE([OPUS_ARM_INLINE_NEON], 1,
227 [Use ARM NEON inline asm optimizations])
228 inline_optimization="$inline_optimization (NEON)"
229 ])
230 ])
231 dnl We need Perl to translate RVCT-syntax asm to gas syntax.
232 AC_CHECK_PROG([HAVE_PERL], perl, yes, no)
233 AS_IF([test x"$HAVE_PERL" = x"yes"],[
234 AM_CONDITIONAL([OPUS_ARM_EXTERNAL_ASM],[true])
235 asm_optimization="ARM"
236 AS_IF([test x"$OPUS_ARM_INLINE_EDSP" = x"1"], [
237 OPUS_ARM_PRESUME_EDSP=1
238 OPUS_ARM_MAY_HAVE_EDSP=1
239 ],
240 [
241 OPUS_ARM_PRESUME_EDSP=0
242 OPUS_ARM_MAY_HAVE_EDSP=0
243 ])
244 AS_IF([test x"$OPUS_ARM_INLINE_MEDIA" = x"1"], [
245 OPUS_ARM_PRESUME_MEDIA=1
246 OPUS_ARM_MAY_HAVE_MEDIA=1
247 ],
248 [
249 OPUS_ARM_PRESUME_MEDIA=0
250 OPUS_ARM_MAY_HAVE_MEDIA=0
251 ])
252 AS_IF([test x"$OPUS_ARM_INLINE_NEON" = x"1"], [
253 OPUS_ARM_PRESUME_NEON=1
254 OPUS_ARM_MAY_HAVE_NEON=1
255 ],
256 [
257 OPUS_ARM_PRESUME_NEON=0
258 OPUS_ARM_MAY_HAVE_NEON=0
259 ])
260 AS_IF([test x"$enable_rtcd" = x"yes"],[
261 AS_IF([test x"$OPUS_ARM_MAY_HAVE_EDSP" != x"1"],[
262 AC_MSG_NOTICE(
263 [Trying to force-enable armv5e EDSP instructions...])
264 AS_ASM_ARM_EDSP_FORCE([OPUS_ARM_MAY_HAVE_EDSP=1])
265 ])
266 AS_IF([test x"$OPUS_ARM_MAY_HAVE_MEDIA" != x"1"],[
267 AC_MSG_NOTICE(
268 [Trying to force-enable ARMv6 media instructions...])
269 AS_ASM_ARM_MEDIA_FORCE([OPUS_ARM_MAY_HAVE_MEDIA=1])
270 ])
271 AS_IF([test x"$OPUS_ARM_MAY_HAVE_NEON" != x"1"],[
272 AC_MSG_NOTICE(
273 [Trying to force-enable NEON instructions...])
274 AS_ASM_ARM_NEON_FORCE([OPUS_ARM_MAY_HAVE_NEON=1])
275 ])
276 ])
277 rtcd_support=
278 AS_IF([test x"$OPUS_ARM_MAY_HAVE_EDSP" = x"1"],[
279 AC_DEFINE(OPUS_ARM_MAY_HAVE_EDSP, 1,
280 [Define if assembler supports EDSP instructions])
281 AS_IF([test x"$OPUS_ARM_PRESUME_EDSP" = x"1"],[
282 AC_DEFINE(OPUS_ARM_PRESUME_EDSP, 1,
283 [Define if binary requires EDSP instruction support])
284 asm_optimization="$asm_optimization (EDSP)"
285 ],
286 [rtcd_support="$rtcd_support (EDSP)"]
287 )
288 ])
289 AC_SUBST(OPUS_ARM_MAY_HAVE_EDSP)
290 AS_IF([test x"$OPUS_ARM_MAY_HAVE_MEDIA" = x"1"],[
291 AC_DEFINE(OPUS_ARM_MAY_HAVE_MEDIA, 1,
292 [Define if assembler supports ARMv6 media instructions])
293 AS_IF([test x"$OPUS_ARM_PRESUME_MEDIA" = x"1"],[
294 AC_DEFINE(OPUS_ARM_PRESUME_MEDIA, 1,
295 [Define if binary requires ARMv6 media instruction support])
296 asm_optimization="$asm_optimization (Media)"
297 ],
298 [rtcd_support="$rtcd_support (Media)"]
299 )
300 ])
301 AC_SUBST(OPUS_ARM_MAY_HAVE_MEDIA)
302 AS_IF([test x"$OPUS_ARM_MAY_HAVE_NEON" = x"1"],[
303 AC_DEFINE(OPUS_ARM_MAY_HAVE_NEON, 1,
304 [Define if compiler supports NEON instructions])
305 AS_IF([test x"$OPUS_ARM_PRESUME_NEON" = x"1"], [
306 AC_DEFINE(OPUS_ARM_PRESUME_NEON, 1,
307 [Define if binary requires NEON instruction support])
308 asm_optimization="$asm_optimization (NEON)"
309 ],
310 [rtcd_support="$rtcd_support (NEON)"]
311 )
312 ])
313 AC_SUBST(OPUS_ARM_MAY_HAVE_NEON)
314 dnl Make sure turning on RTCD gets us at least one
315 dnl instruction set.
316 AS_IF([test x"$rtcd_support" != x""],
317 [rtcd_support=ARM"$rtcd_support"],
318 [rtcd_support="no"]
319 )
Martin Storsjo76e831d2014-03-19 21:36:39 +0200320 AC_MSG_CHECKING([for apple style tools])
321 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
322#ifndef __APPLE__
323#error 1
324#endif],[])],
325 [AC_MSG_RESULT([yes]); ARM2GNU_PARAMS="--apple"],
326 [AC_MSG_RESULT([no]); ARM2GNU_PARAMS=""])
327 AC_SUBST(ARM2GNU_PARAMS)
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500328 ],
329 [
330 AC_MSG_WARN(
331 [*** ARM assembly requires perl -- disabling optimizations])
332 asm_optimization="(missing perl dependency for ARM)"
333 ])
334 ])
335 ;;
336 esac
337],[
338 inline_optimization="disabled"
339 asm_optimization="disabled"
340])
341
342AM_CONDITIONAL([CPU_ARM], [test "$cpu_arm" = "yes"])
343AM_CONDITIONAL([OPUS_ARM_INLINE_ASM],
Peter Korsgaard253e15f2013-12-08 11:05:41 +0100344 [test x"${inline_optimization%% *}" = x"ARM"])
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500345AM_CONDITIONAL([OPUS_ARM_EXTERNAL_ASM],
Peter Korsgaard253e15f2013-12-08 11:05:41 +0100346 [test x"${asm_optimization%% *}" = x"ARM"])
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500347
348AS_IF([test x"$enable_rtcd" = x"yes"],[
349 AS_IF([test x"$rtcd_support" != x"no"],[
350 AC_DEFINE([OPUS_HAVE_RTCD], [1],
351 [Use run-time CPU capabilities detection])
352 OPUS_HAVE_RTCD=1
353 AC_SUBST(OPUS_HAVE_RTCD)
Ron5bac4f22013-06-29 02:06:53 +0930354 ])
355],[
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500356 rtcd_support="disabled"
Ron5bac4f22013-06-29 02:06:53 +0930357])
Aurélien Zanellicd4c8242013-05-31 15:07:00 +0200358
Ron5bac4f22013-06-29 02:06:53 +0930359AC_ARG_ENABLE([assertions],
360 [AS_HELP_STRING([--enable-assertions],[enable additional software error checking])],,
361 [enable_assertions=no])
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400362
Ron5bac4f22013-06-29 02:06:53 +0930363AS_IF([test "$enable_assertions" = "yes"], [
364 AC_DEFINE([ENABLE_ASSERTIONS], [1], [Assertions])
365])
Jean-Marc Valinf334c822011-08-11 16:21:58 -0400366
Ron5bac4f22013-06-29 02:06:53 +0930367AC_ARG_ENABLE([fuzzing],
368 [AS_HELP_STRING([--enable-fuzzing],[causes the encoder to make random decisions])],,
369 [enable_fuzzing=no])
370
371AS_IF([test "$enable_fuzzing" = "yes"], [
372 AC_DEFINE([FUZZING], [1], [Fuzzing])
373])
374
Ralph Giles35d4fb72011-09-06 23:18:00 -0700375AC_ARG_ENABLE([doc],
Ron5bac4f22013-06-29 02:06:53 +0930376 [AS_HELP_STRING([--disable-doc], [Do not build API documentation])],,
377 [enable_doc=yes])
Ralph Giles35d4fb72011-09-06 23:18:00 -0700378
Ron5bac4f22013-06-29 02:06:53 +0930379AS_IF([test "$enable_doc" = "yes"], [
380 AC_CHECK_PROG(HAVE_DOXYGEN, [doxygen], [yes], [no])
381],[
382 HAVE_DOXYGEN=no
383])
384
385AM_CONDITIONAL([HAVE_DOXYGEN], [test "$HAVE_DOXYGEN" = "yes"])
386
Aurélien Zanellifaec6732013-05-26 22:08:02 +0200387AC_ARG_ENABLE([extra-programs],
Ron5bac4f22013-06-29 02:06:53 +0930388 [AS_HELP_STRING([--disable-extra-programs], [Do not build extra programs (demo and tests)])],,
389 [enable_extra_programs=yes])
390
391AM_CONDITIONAL([EXTRA_PROGRAMS], [test "$enable_extra_programs" = "yes"])
392
Aurélien Zanellifaec6732013-05-26 22:08:02 +0200393
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400394saved_CFLAGS="$CFLAGS"
395CFLAGS="$CFLAGS -fvisibility=hidden"
Gregory Maxwelle53ebd62011-10-21 14:21:53 -0400396AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Ron5bac4f22013-06-29 02:06:53 +0930397AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
398 [ AC_MSG_RESULT([yes]) ],
399 [ AC_MSG_RESULT([no])
400 CFLAGS="$saved_CFLAGS"
401 ])
Gregory Maxwell6c83b0b2012-05-14 00:30:34 -0400402
Gregory Maxwell6c83b0b2012-05-14 00:30:34 -0400403CFLAGS="$CFLAGS -W"
404
Ralph Giles99e8a932013-03-12 22:57:00 -0700405warn_CFLAGS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes"
Gregory Maxwell6c83b0b2012-05-14 00:30:34 -0400406saved_CFLAGS="$CFLAGS"
Ralph Giles42f39c52013-03-11 10:59:13 -0700407CFLAGS="$CFLAGS $warn_CFLAGS"
408AC_MSG_CHECKING([if ${CC} supports ${warn_CFLAGS}])
Ron5bac4f22013-06-29 02:06:53 +0930409AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
410 [ AC_MSG_RESULT([yes]) ],
411 [ AC_MSG_RESULT([no])
412 CFLAGS="$saved_CFLAGS"
413 ])
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400414
Ron5bac4f22013-06-29 02:06:53 +0930415saved_LIBS="$LIBS"
416LIBS="$LIBS $LIBM"
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400417AC_CHECK_FUNCS([lrintf])
418AC_CHECK_FUNCS([lrint])
Ron5bac4f22013-06-29 02:06:53 +0930419LIBS="$saved_LIBS"
420
Ralph Gilesc19bc342011-10-28 07:14:58 -0700421AC_CHECK_FUNCS([__malloc_hook])
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400422
Ralph Gilesd47ddfb2012-09-16 23:09:21 -0700423AC_SUBST([PC_BUILD])
Ralph Gilesd47ddfb2012-09-16 23:09:21 -0700424
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500425AC_CONFIG_FILES([
426 Makefile
427 opus.pc
428 opus-uninstalled.pc
429 celt/arm/armopts.s
430 doc/Makefile
431 doc/Doxyfile
432])
Ron2f2f9d62013-05-11 02:05:24 +0930433AC_CONFIG_HEADERS([config.h])
Ronc40d5002012-09-19 07:56:17 +0930434
435AC_OUTPUT
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400436
Ron4a7bb1f2013-06-09 00:57:02 +0930437AC_MSG_NOTICE([
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400438------------------------------------------------------------------------
Ron2f2f9d62013-05-11 02:05:24 +0930439 $PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
440
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400441 Compiler support:
442
443 C99 var arrays: ................ ${has_var_arrays}
444 C99 lrintf: .................... ${ac_cv_func_lrintf}
Ron5bac4f22013-06-29 02:06:53 +0930445 Use alloca: .................... ${use_alloca}
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500446
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400447 General configuration:
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500448
Ron5bac4f22013-06-29 02:06:53 +0930449 Floating point support: ........ ${enable_float}
450 Fast float approximations: ..... ${enable_float_approx}
451 Fixed point debugging: ......... ${enable_fixed_point_debug}
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500452 Inline Assembly Optimizations: . ${inline_optimization}
453 External Assembly Optimizations: ${asm_optimization}
Aurélien Zanellicd4c8242013-05-31 15:07:00 +0200454 Run-time CPU detection: ........ ${rtcd_support}
Ron5bac4f22013-06-29 02:06:53 +0930455 Custom modes: .................. ${enable_custom_modes}
456 Assertion checking: ............ ${enable_assertions}
457 Fuzzing: ....................... ${enable_fuzzing}
Ralph Giles35d4fb72011-09-06 23:18:00 -0700458
Ron5bac4f22013-06-29 02:06:53 +0930459 API documentation: ............. ${enable_doc}
460 Extra programs: ................ ${enable_extra_programs}
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400461------------------------------------------------------------------------
Ron4a7bb1f2013-06-09 00:57:02 +0930462
463 Type "make; make install" to compile and install
464 Type "make check" to run the test suite
Jean-Marc Valine05aaf22011-04-29 19:48:42 -0400465])
466