| OLD | NEW |
| 1 dnl Process this file with autoconf to produce a configure script. -*-m4-*- | 1 dnl Process this file with autoconf to produce a configure script. -*-m4-*- |
| 2 | 2 |
| 3 AC_INIT(src/opus_encoder.c) | 3 dnl The package_version file will be automatically synced to the git revision |
| 4 dnl by the update_version script when configured in the repository, but will |
| 5 dnl remain constant in tarball releases unless it is manually edited. |
| 6 m4_define([CURRENT_VERSION], |
| 7 m4_esyscmd([ ./update_version 2>/dev/null || true |
| 8 if test -e package_version; then |
| 9 . ./package_version |
| 10 printf "$PACKAGE_VERSION" |
| 11 else |
| 12 printf "unknown" |
| 13 fi ])) |
| 4 | 14 |
| 5 AM_CONFIG_HEADER([config.h]) | 15 AC_INIT([opus],[CURRENT_VERSION],[opus@xiph.org]) |
| 16 |
| 17 AC_CONFIG_SRCDIR(src/opus_encoder.c) |
| 18 AC_CONFIG_MACRO_DIR([m4]) |
| 6 | 19 |
| 7 dnl enable silent rules on automake 1.11 and later | 20 dnl enable silent rules on automake 1.11 and later |
| 8 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | 21 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 9 | 22 |
| 10 # Read our default version string from version.mk. | |
| 11 # Please update this file for releases. | |
| 12 AC_MSG_CHECKING([version.mk]) | |
| 13 MK_VERSION=$(awk 'BEGIN { FS = "=" } | |
| 14 /OPUS_VERSION/ { ver = $2} | |
| 15 END { | |
| 16 gsub(/"/, "", ver); | |
| 17 gsub(/^ /, "", ver); | |
| 18 gsub(/ $/, "", ver); | |
| 19 print ver; | |
| 20 }' $srcdir/version.mk) | |
| 21 if test -z "$MK_VERSION"; then | |
| 22 AC_MSG_RESULT([no]) | |
| 23 else | |
| 24 AC_MSG_RESULT([$MK_VERSION]) | |
| 25 OPUS_VERSION="$MK_VERSION" | |
| 26 fi | |
| 27 | |
| 28 # Override with the git version, if available. | |
| 29 AC_MSG_CHECKING([git revision]) | |
| 30 GIT_VERSION=$(git describe --tags --match 'v*' 2>/dev/null | sed 's/^v//') | |
| 31 if test -z "$GIT_VERSION"; then | |
| 32 AC_MSG_RESULT([no]) | |
| 33 else | |
| 34 AC_MSG_RESULT([$GIT_VERSION]) | |
| 35 OPUS_VERSION="$GIT_VERSION" | |
| 36 fi | |
| 37 | |
| 38 # Use 'unknown' if all else fails. | |
| 39 if test -z "$OPUS_VERSION"; then | |
| 40 OPUS_VERSION="unknown" | |
| 41 fi | |
| 42 | |
| 43 # For automake. | |
| 44 PACKAGE=opus | |
| 45 VERSION=$OPUS_VERSION | |
| 46 | |
| 47 # For autoconf | |
| 48 AC_SUBST(OPUS_VERSION) | |
| 49 | |
| 50 # For config.h. | |
| 51 AC_DEFINE_UNQUOTED([OPUS_VERSION], ["$OPUS_VERSION"], | |
| 52 [Opus library version string]) | |
| 53 | |
| 54 # For libtool. | 23 # For libtool. |
| 55 dnl Please update these for releases. | 24 dnl Please update these for releases. |
| 56 OPUS_LT_CURRENT=3 | 25 OPUS_LT_CURRENT=4 |
| 57 OPUS_LT_REVISION=0 | 26 OPUS_LT_REVISION=0 |
| 58 OPUS_LT_AGE=3 | 27 OPUS_LT_AGE=4 |
| 59 | 28 |
| 60 AC_SUBST(OPUS_LT_CURRENT) | 29 AC_SUBST(OPUS_LT_CURRENT) |
| 61 AC_SUBST(OPUS_LT_REVISION) | 30 AC_SUBST(OPUS_LT_REVISION) |
| 62 AC_SUBST(OPUS_LT_AGE) | 31 AC_SUBST(OPUS_LT_AGE) |
| 63 | 32 |
| 64 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) | 33 AM_INIT_AUTOMAKE([no-define]) |
| 65 AM_MAINTAINER_MODE([enable]) | 34 AM_MAINTAINER_MODE([enable]) |
| 66 | 35 |
| 67 AC_CANONICAL_HOST | 36 AC_CANONICAL_HOST |
| 68 AC_MINGW32 | 37 AC_MINGW32 |
| 69 AM_PROG_LIBTOOL | 38 AM_PROG_LIBTOOL |
| 70 AM_PROG_CC_C_O | 39 AM_PROG_CC_C_O |
| 71 | 40 |
| 72 AC_PROG_CC_C99 | 41 AC_PROG_CC_C99 |
| 73 AC_C_CONST | 42 AC_C_CONST |
| 74 AC_C_INLINE | 43 AC_C_INLINE |
| 75 | 44 |
| 45 AC_DEFINE([OPUS_BUILD], [], [This is a build of OPUS]) |
| 46 |
| 76 #Use a hacked up version of autoconf's AC_C_RESTRICT because it's not | 47 #Use a hacked up version of autoconf's AC_C_RESTRICT because it's not |
| 77 #strong enough a test to detect old buggy versions of GCC (e.g. 2.95.3) | 48 #strong enough a test to detect old buggy versions of GCC (e.g. 2.95.3) |
| 49 #Note: Both this and the test for variable-size arrays below are also |
| 50 # done by AC_PROG_CC_C99, but not thoroughly enough apparently. |
| 78 AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, | 51 AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, |
| 79 [ac_cv_c_restrict=no | 52 [ac_cv_c_restrict=no |
| 80 # The order here caters to the fact that C++ does not require restrict. | 53 # The order here caters to the fact that C++ does not require restrict. |
| 81 for ac_kw in __restrict __restrict__ _Restrict restrict; do | 54 for ac_kw in __restrict __restrict__ _Restrict restrict; do |
| 82 AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | 55 AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 83 [[typedef int * int_ptr; | 56 [[typedef int * int_ptr; |
| 84 int foo (int_ptr $ac_kw ip, int * $ac_kw baz[]) { | 57 int foo (int_ptr $ac_kw ip, int * $ac_kw baz[]) { |
| 85 return ip[0]; | 58 return ip[0]; |
| 86 }]], | 59 }]], |
| 87 [[int s[1]; | 60 [[int s[1]; |
| 88 int * $ac_kw t = s; | 61 int * $ac_kw t = s; |
| 89 t[0] = 0; | 62 t[0] = 0; |
| 90 return foo(t, (void *)0)]])], | 63 return foo(t, (void *)0)]])], |
| 91 [ac_cv_c_restrict=$ac_kw]) | 64 [ac_cv_c_restrict=$ac_kw]) |
| 92 test "$ac_cv_c_restrict" != no && break | 65 test "$ac_cv_c_restrict" != no && break |
| 93 done | 66 done |
| 94 ]) | 67 ]) |
| 95 AH_VERBATIM([restrict], | 68 |
| 69 AH_VERBATIM([restrict], |
| 96 [/* Define to the equivalent of the C99 'restrict' keyword, or to | 70 [/* Define to the equivalent of the C99 'restrict' keyword, or to |
| 97 nothing if this is not supported. Do not define if restrict is | 71 nothing if this is not supported. Do not define if restrict is |
| 98 supported directly. */ | 72 supported directly. */ |
| 99 #undef restrict | 73 #undef restrict |
| 100 /* Work around a bug in Sun C++: it does not support _Restrict or | 74 /* Work around a bug in Sun C++: it does not support _Restrict or |
| 101 __restrict__, even though the corresponding Sun C compiler ends up with | 75 __restrict__, even though the corresponding Sun C compiler ends up with |
| 102 "#define restrict _Restrict" or "#define restrict __restrict__" in the | 76 "#define restrict _Restrict" or "#define restrict __restrict__" in the |
| 103 previous line. Perhaps some future version of Sun C++ will work with | 77 previous line. Perhaps some future version of Sun C++ will work with |
| 104 restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ | 78 restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ |
| 105 #if defined __SUNPRO_CC && !defined __RESTRICT | 79 #if defined __SUNPRO_CC && !defined __RESTRICT |
| 106 # define _Restrict | 80 # define _Restrict |
| 107 # define __restrict__ | 81 # define __restrict__ |
| 108 #endif]) | 82 #endif]) |
| 109 case $ac_cv_c_restrict in | 83 |
| 84 case $ac_cv_c_restrict in |
| 110 restrict) ;; | 85 restrict) ;; |
| 111 no) AC_DEFINE([restrict], []) ;; | 86 no) AC_DEFINE([restrict], []) ;; |
| 112 *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; | 87 *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; |
| 113 esac | 88 esac |
| 114 | |
| 115 AC_DEFINE([OPUS_BUILD], [], [This is a build of OPUS]) | |
| 116 | 89 |
| 117 AC_MSG_CHECKING(for C99 variable-size arrays) | 90 AC_MSG_CHECKING(for C99 variable-size arrays) |
| 118 AC_TRY_COMPILE( [], [static int x; char a[++x]; a[sizeof a - 1] = 0; int N; retu
rn a[0];], | 91 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
| 119 [has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays]) | 92 [[static int x; char a[++x]; a[sizeof a - 1] = 0; int N; retu
rn a[0];]])], |
| 120 ], | 93 [ has_var_arrays=yes |
| 121 has_var_arrays=no | 94 use_alloca="no (using var arrays)" |
| 122 ) | 95 AC_DEFINE([VAR_ARRAYS], [1], [Use C99 variable-size arrays]) |
| 123 AC_MSG_RESULT($has_var_arrays) | 96 ],[ |
| 97 has_var_arrays=no |
| 98 ]) |
| 99 AC_MSG_RESULT([$has_var_arrays]) |
| 124 | 100 |
| 125 AC_CHECK_HEADERS([alloca.h getopt.h]) | 101 AS_IF([test "$has_var_arrays" = "no"], |
| 126 AC_MSG_CHECKING(for alloca) | 102 [ |
| 127 AC_TRY_COMPILE( [#include <alloca.h>], [ | 103 AC_CHECK_HEADERS([alloca.h]) |
| 128 int foo=10; | 104 AC_MSG_CHECKING(for alloca) |
| 129 int *array = alloca(foo); | 105 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alloca.h>]], |
| 130 ], | 106 [[int foo=10; int *array = alloca(foo);]])
], |
| 131 [ | 107 [ use_alloca=yes; |
| 132 has_alloca=yes; | 108 AC_DEFINE([USE_ALLOCA], [], [Make use of alloca]) |
| 133 if test x$has_var_arrays = "xno" ; then | 109 ],[ |
| 134 AC_DEFINE([USE_ALLOCA], [], [Make use of alloca]) | 110 use_alloca=no |
| 135 fi | 111 ]) |
| 136 ], | 112 AC_MSG_RESULT([$use_alloca]) |
| 137 has_alloca=no | 113 ]) |
| 138 ) | |
| 139 AC_MSG_RESULT($has_alloca) | |
| 140 | 114 |
| 141 AC_CHECK_FUNC(exp,[fp_libm_not_needed=yes;LIBM=],[fp_libm_not_needed=dunno]) | 115 LT_LIB_M |
| 142 if test x"$fp_libm_not_needed" = xdunno; then | 116 |
| 143 AC_CHECK_LIB([m], [exp], [LIBS="-lm $LIBS"; LIBM="-lm"],[LIBM=]) | 117 AC_ARG_ENABLE([fixed-point], |
| 144 fi | 118 [AS_HELP_STRING([--enable-fixed-point], |
| 145 AC_SUBST([LIBM]) | 119 [compile without floating point (for machines without a fast
enough FPU)])],, |
| 120 [enable_fixed_point=no]) |
| 121 |
| 122 AS_IF([test "$enable_fixed_point" = "yes"],[ |
| 123 enable_float="no" |
| 124 AC_DEFINE([FIXED_POINT], [1], [Compile as fixed-point (for machines without a
fast enough FPU)]) |
| 125 PC_BUILD="fixed-point" |
| 126 ],[ |
| 127 enable_float="yes"; |
| 128 PC_BUILD="floating-point" |
| 129 ]) |
| 130 |
| 131 AM_CONDITIONAL([FIXED_POINT], [test "$enable_fixed_point" = "yes"]) |
| 132 |
| 133 AC_ARG_ENABLE([fixed-point-debug], |
| 134 [AS_HELP_STRING([--enable-fixed-point-debug], [debug fixed-point implementat
ion])],, |
| 135 [enable_fixed_point_debug=no]) |
| 136 |
| 137 AS_IF([test "$enable_fixed_point_debug" = "yes"],[ |
| 138 AC_DEFINE([FIXED_DEBUG], [1], [Debug fixed-point implementation]) |
| 139 ]) |
| 140 |
| 141 AC_ARG_ENABLE([custom-modes], |
| 142 [AS_HELP_STRING([--enable-custom-modes], [enable non-Opus modes, e.g. 44.1 k
Hz & 2^n frames])],, |
| 143 [enable_custom_modes=no]) |
| 144 |
| 145 AS_IF([test "$enable_custom_modes" = "yes"],[ |
| 146 AC_DEFINE([CUSTOM_MODES], [1], [Custom modes]) |
| 147 PC_BUILD="$PC_BUILD, custom modes" |
| 148 ]) |
| 149 |
| 150 AM_CONDITIONAL([CUSTOM_MODES], [test "$enable_custom_modes" = "yes"]) |
| 146 | 151 |
| 147 has_float_approx=no | 152 has_float_approx=no |
| 148 #case "$host_cpu" in | 153 #case "$host_cpu" in |
| 149 #i[[3456]]86 | x86_64 | powerpc64 | powerpc32 | ia64) | 154 #i[[3456]]86 | x86_64 | powerpc64 | powerpc32 | ia64) |
| 150 # has_float_approx=yes | 155 # has_float_approx=yes |
| 151 # ;; | 156 # ;; |
| 152 #esac | 157 #esac |
| 153 | 158 |
| 154 ac_enable_fixed="no"; | 159 AC_ARG_ENABLE([float-approx], |
| 155 ac_enable_float="yes"; | 160 [AS_HELP_STRING([--enable-float-approx], [enable fast approximations for flo
ating point])], |
| 156 AC_ARG_ENABLE(fixed-point, [ --enable-fixed-point compile without floatin
g point (for machines without a fast enough FPU)], | 161 [if test "$enable_float_approx" = "yes"; then |
| 157 [if test "$enableval" = yes; then | 162 AC_WARN([Floating point approximations are not supported on all platforms
.]) |
| 158 ac_enable_fixed="yes"; | 163 fi |
| 159 ac_enable_float="no"; | 164 ], |
| 160 AC_DEFINE([FIXED_POINT], [1], [Compile as fixed-point (for machines without a
fast enough FPU)]) | 165 [enable_float_approx=$has_float_approx]) |
| 161 fi]) | |
| 162 | 166 |
| 163 ac_enable_fixed_debug="no" | 167 AS_IF([test "$enable_float_approx" = "yes"],[ |
| 164 AC_ARG_ENABLE(fixed-point-debug, [ --enable-fixed-point-debug debug fixed-point
implementation], | 168 AC_DEFINE([FLOAT_APPROX], [1], [Float approximations]) |
| 165 [if test "$enableval" = yes; then | 169 ]) |
| 166 ac_enable_fixed_debug="yes" | |
| 167 AC_DEFINE([FIXED_DEBUG], , [Debug fixed-point implementation]) | |
| 168 fi]) | |
| 169 | 170 |
| 170 ac_enable_custom_modes="no" | 171 AC_ARG_ENABLE([asm], |
| 171 AC_ARG_ENABLE(custom-modes, [ --enable-custom-modes enable non-Opus modes,
e.g. 44.1 kHz & 2^n frames], | 172 [AS_HELP_STRING([--disable-asm], [Disable assembly optimizations])],, |
| 172 [if test "$enableval" = yes; then | 173 [enable_asm=yes]) |
| 173 ac_enable_custom_modes="yes" | |
| 174 AC_DEFINE([CUSTOM_MODES], , [Custom modes]) | |
| 175 fi]) | |
| 176 | 174 |
| 177 float_approx=$has_float_approx | 175 rtcd_support=no |
| 178 AC_ARG_ENABLE(float-approx, [ --enable-float-approx enable fast approximat
ions for floating point], | 176 cpu_arm=no |
| 179 [ if test "$enableval" = yes; then | |
| 180 AC_WARN([Floating point approximations are not supported on all platforms.]) | |
| 181 float_approx=yes | |
| 182 else | |
| 183 float_approx=no | |
| 184 fi], [ float_approx=$has_float_approx ]) | |
| 185 | 177 |
| 186 if test "x${float_approx}" = "xyes"; then | 178 AS_IF([test "$enable_asm" = "yes"],[ |
| 187 AC_DEFINE([FLOAT_APPROX], , [Float approximations]) | 179 asm_optimization="no asm for your platform, please send patches" |
| 188 fi | 180 case $host_cpu in |
| 181 arm*) |
| 182 cpu_arm=yes |
| 183 AS_GCC_INLINE_ASSEMBLY([asm_optimization="ARM"], |
| 184 [asm_optimization="disabled"]) |
| 185 if test "$asm_optimization" = "ARM" ; then |
| 186 rtcd_support=yes |
| 187 AC_DEFINE([ARMv4_ASM], 1, [Use generic ARMv4 asm optimizations]) |
| 188 AS_ASM_ARM_EDSP([ARMv5E_ASM=1],[ARMv5E_ASM=0]) |
| 189 if test "$ARMv5E_ASM" = "1" ; then |
| 190 AC_DEFINE([ARMv5E_ASM], [1], [Use ARMv5E asm optimizations]) |
| 191 asm_optimization="$asm_optimization (EDSP)" |
| 192 fi |
| 193 AS_ASM_ARM_MEDIA([ARMv6_ASM=1],[ARMv6_ASM=0]) |
| 194 if test "$ARMv6_ASM" = "1" ; then |
| 195 AC_DEFINE([ARMv6_ASM], [1], [Use ARMv6 asm optimizations]) |
| 196 asm_optimization="$asm_optimization (Media)" |
| 197 fi |
| 198 AS_ASM_ARM_NEON([ARM_HAVE_NEON=1],[ARM_HAVE_NEON=0]) |
| 199 if test "$ARM_HAVE_NEON" = "1" ; then |
| 200 AC_DEFINE([ARM_HAVE_NEON], 1, [Use ARM NEON optimizations]) |
| 201 asm_optimization="$asm_optimization (NEON)" |
| 202 fi |
| 203 fi |
| 204 ;; |
| 205 esac |
| 206 ],[ |
| 207 asm_optimization="disabled" |
| 208 ]) |
| 189 | 209 |
| 190 ac_enable_assertions="no" | 210 AM_CONDITIONAL([CPU_ARM], [test "$cpu_arm" = "yes"]) |
| 191 AC_ARG_ENABLE(assertions, [ --enable-assertions enable additional softwa
re error checking], | |
| 192 [if test "$enableval" = yes; then | |
| 193 ac_enable_assertions="yes" | |
| 194 AC_DEFINE([ENABLE_ASSERTIONS], , [Assertions]) | |
| 195 fi]) | |
| 196 | 211 |
| 197 ac_enable_fuzzing="no" | 212 AC_ARG_ENABLE([rtcd], |
| 198 AC_ARG_ENABLE(fuzzing, [ --enable-fuzzing causes the encoder to make
random decisions], | 213 [AS_HELP_STRING([--disable-rtcd], [Disable run-time CPU capabilities detecti
on])],, |
| 199 [if test "$enableval" = yes; then | 214 [enable_rtcd=yes]) |
| 200 ac_enable_fuzzing="yes" | |
| 201 AC_DEFINE([FUZZING], , [Fuzzing]) | |
| 202 fi]) | |
| 203 | 215 |
| 204 ac_enable_doc="yes" | 216 AS_IF([test "$enable_rtcd" = "yes"],[ |
| 217 AS_IF([test "$rtcd_support" = "yes"],[ |
| 218 AC_DEFINE([OPUS_HAVE_RTCD], [1], [Use run-time CPU capabilities detectio
n]) |
| 219 ],[ |
| 220 rtcd_support="no rtcd for your platform, please send patches" |
| 221 ]) |
| 222 ],[ |
| 223 rtcd_support="no" |
| 224 ]) |
| 225 |
| 226 AC_ARG_ENABLE([assertions], |
| 227 [AS_HELP_STRING([--enable-assertions],[enable additional software error chec
king])],, |
| 228 [enable_assertions=no]) |
| 229 |
| 230 AS_IF([test "$enable_assertions" = "yes"], [ |
| 231 AC_DEFINE([ENABLE_ASSERTIONS], [1], [Assertions]) |
| 232 ]) |
| 233 |
| 234 AC_ARG_ENABLE([fuzzing], |
| 235 [AS_HELP_STRING([--enable-fuzzing],[causes the encoder to make random decisi
ons])],, |
| 236 [enable_fuzzing=no]) |
| 237 |
| 238 AS_IF([test "$enable_fuzzing" = "yes"], [ |
| 239 AC_DEFINE([FUZZING], [1], [Fuzzing]) |
| 240 ]) |
| 241 |
| 205 AC_ARG_ENABLE([doc], | 242 AC_ARG_ENABLE([doc], |
| 206 AS_HELP_STRING([--disable-doc], [Do not build API documentation]), | 243 [AS_HELP_STRING([--disable-doc], [Do not build API documentation])],, |
| 207 [ac_enable_doc=$enableval]) | 244 [enable_doc=yes]) |
| 208 AC_CHECK_PROG(HAVE_DOXYGEN, [doxygen], [yes], [no]) | 245 |
| 209 if test "$HAVE_DOXYGEN" != "yes" -o "$ac_enable_doc" != "yes"; then | 246 AS_IF([test "$enable_doc" = "yes"], [ |
| 210 HAVE_DOXYGEN="false" | 247 AC_CHECK_PROG(HAVE_DOXYGEN, [doxygen], [yes], [no]) |
| 211 ac_enable_doc="no" | 248 ],[ |
| 212 fi | 249 HAVE_DOXYGEN=no |
| 213 AM_CONDITIONAL(HAVE_DOXYGEN, [test $HAVE_DOXYGEN = yes]) | 250 ]) |
| 251 |
| 252 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$HAVE_DOXYGEN" = "yes"]) |
| 253 |
| 254 AC_ARG_ENABLE([extra-programs], |
| 255 [AS_HELP_STRING([--disable-extra-programs], [Do not build extra programs (de
mo and tests)])],, |
| 256 [enable_extra_programs=yes]) |
| 257 |
| 258 AM_CONDITIONAL([EXTRA_PROGRAMS], [test "$enable_extra_programs" = "yes"]) |
| 259 |
| 214 | 260 |
| 215 saved_CFLAGS="$CFLAGS" | 261 saved_CFLAGS="$CFLAGS" |
| 216 CFLAGS="$CFLAGS -fvisibility=hidden" | 262 CFLAGS="$CFLAGS -fvisibility=hidden" |
| 217 AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) | 263 AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
| 218 AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], | 264 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])], |
| 219 [ AC_MSG_RESULT([yes]) | 265 [ AC_MSG_RESULT([yes]) ], |
| 220 SYMBOL_VISIBILITY="-fvisibility=hidden" ], | 266 [ AC_MSG_RESULT([no]) |
| 221 AC_MSG_RESULT([no])) | 267 CFLAGS="$saved_CFLAGS" |
| 222 CFLAGS="$saved_CFLAGS $SYMBOL_VISIBILITY" | 268 ]) |
| 223 AC_SUBST(SYMBOL_VISIBILITY) | |
| 224 | 269 |
| 225 CFLAGS="$CFLAGS -W" | 270 CFLAGS="$CFLAGS -W" |
| 226 | 271 |
| 272 warn_CFLAGS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-proto
types" |
| 227 saved_CFLAGS="$CFLAGS" | 273 saved_CFLAGS="$CFLAGS" |
| 228 CFLAGS="$CFLAGS -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-pr
ototypes" | 274 CFLAGS="$CFLAGS $warn_CFLAGS" |
| 229 AC_MSG_CHECKING([if ${CC} supports -Wall -Wextra -Wcast-align -Wnested-externs -
Wshadow -Wstrict-prototypes]) | 275 AC_MSG_CHECKING([if ${CC} supports ${warn_CFLAGS}]) |
| 230 AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], | 276 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])], |
| 231 [ AC_MSG_RESULT([yes]) | 277 [ AC_MSG_RESULT([yes]) ], |
| 232 EXTRA_WARNS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstri
ct-prototypes" ], | 278 [ AC_MSG_RESULT([no]) |
| 233 AC_MSG_RESULT([no])) | 279 CFLAGS="$saved_CFLAGS" |
| 234 CFLAGS="$saved_CFLAGS $EXTRA_WARNS" | 280 ]) |
| 235 | 281 |
| 282 saved_LIBS="$LIBS" |
| 283 LIBS="$LIBS $LIBM" |
| 236 AC_CHECK_FUNCS([lrintf]) | 284 AC_CHECK_FUNCS([lrintf]) |
| 237 AC_CHECK_FUNCS([lrint]) | 285 AC_CHECK_FUNCS([lrint]) |
| 286 LIBS="$saved_LIBS" |
| 287 |
| 238 AC_CHECK_FUNCS([__malloc_hook]) | 288 AC_CHECK_FUNCS([__malloc_hook]) |
| 239 | 289 |
| 240 AC_CHECK_SIZEOF(short) | |
| 241 AC_CHECK_SIZEOF(int) | |
| 242 AC_CHECK_SIZEOF(long) | |
| 243 AC_CHECK_SIZEOF(long long) | |
| 244 | |
| 245 if test x$has_char16 = "xyes" ; then | |
| 246 case 1 in | |
| 247 $ac_cv_sizeof_short) SIZE16="short";; | |
| 248 $ac_cv_sizeof_int) SIZE16="int";; | |
| 249 esac | |
| 250 else | |
| 251 case 2 in | |
| 252 $ac_cv_sizeof_short) SIZE16="short";; | |
| 253 $ac_cv_sizeof_int) SIZE16="int";; | |
| 254 esac | |
| 255 fi | |
| 256 | |
| 257 if test x$has_char16 = "xyes" ; then | |
| 258 case 2 in | |
| 259 $ac_cv_sizeof_int) SIZE32="int";; | |
| 260 $ac_cv_sizeof_long) SIZE32="long";; | |
| 261 $ac_cv_sizeof_short) SIZE32="short";; | |
| 262 esac | |
| 263 else | |
| 264 case 4 in | |
| 265 $ac_cv_sizeof_int) SIZE32="int";; | |
| 266 $ac_cv_sizeof_long) SIZE32="long";; | |
| 267 $ac_cv_sizeof_short) SIZE32="short";; | |
| 268 esac | |
| 269 fi | |
| 270 | |
| 271 AC_SUBST(SIZE16) | |
| 272 AC_SUBST(SIZE32) | |
| 273 | |
| 274 AM_CONDITIONAL([FIXED_POINT], [test x$ac_enable_fixed = xyes]) | |
| 275 AM_CONDITIONAL([CUSTOM_MODES], [test x$ac_enable_custom_modes = xyes]) | |
| 276 | |
| 277 dnl subsitutions for the pkg-config files | |
| 278 if test x$ac_enable_float = xyes; then | |
| 279 PC_BUILD="floating-point" | |
| 280 PC_LIBM=$LIBM | |
| 281 else | |
| 282 PC_BUILD="fixed-point" | |
| 283 PC_LIBM= | |
| 284 fi | |
| 285 dnl opus_custom requires libm as well | |
| 286 if test x$ac_enable_custom_modes = xyes; then | |
| 287 PC_BUILD="${PC_BUILD}, custom modes" | |
| 288 PC_LIBM=$LIBM | |
| 289 fi | |
| 290 AC_SUBST([PC_BUILD]) | 290 AC_SUBST([PC_BUILD]) |
| 291 AC_SUBST([PC_LIBM]) | |
| 292 | 291 |
| 293 | 292 |
| 294 AC_CONFIG_FILES([Makefile opus.pc opus-uninstalled.pc | 293 AC_CONFIG_FILES([Makefile opus.pc opus-uninstalled.pc |
| 295 doc/Makefile doc/Doxyfile]) | 294 doc/Makefile doc/Doxyfile]) |
| 295 AC_CONFIG_HEADERS([config.h]) |
| 296 | 296 |
| 297 AC_OUTPUT | 297 AC_OUTPUT |
| 298 | 298 |
| 299 AC_MSG_RESULT([ | 299 AC_MSG_NOTICE([ |
| 300 ------------------------------------------------------------------------ | 300 ------------------------------------------------------------------------ |
| 301 $PACKAGE $VERSION: Automatic configuration OK. | 301 $PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK. |
| 302 | 302 |
| 303 Compiler support: | 303 Compiler support: |
| 304 | 304 |
| 305 C99 var arrays: ................ ${has_var_arrays} | 305 C99 var arrays: ................ ${has_var_arrays} |
| 306 C99 lrintf: .................... ${ac_cv_func_lrintf} | 306 C99 lrintf: .................... ${ac_cv_func_lrintf} |
| 307 Alloca: ........................ ${has_alloca} | 307 Use alloca: .................... ${use_alloca} |
| 308 | 308 |
| 309 General configuration: | 309 General configuration: |
| 310 | 310 |
| 311 Floating point support: ........ ${ac_enable_float} | 311 Floating point support: ........ ${enable_float} |
| 312 Fast float approximations: ..... ${float_approx} | 312 Fast float approximations: ..... ${enable_float_approx} |
| 313 Fixed point debugging: ......... ${ac_enable_fixed_debug} | 313 Fixed point debugging: ......... ${enable_fixed_point_debug} |
| 314 Custom modes: .................. ${ac_enable_custom_modes} | 314 Assembly optimization: ......... ${asm_optimization} |
| 315 Assertion checking: ............ ${ac_enable_assertions} | 315 Run-time CPU detection: ........ ${rtcd_support} |
| 316 Fuzzing: ....................... ${ac_enable_fuzzing} | 316 Custom modes: .................. ${enable_custom_modes} |
| 317 Assertion checking: ............ ${enable_assertions} |
| 318 Fuzzing: ....................... ${enable_fuzzing} |
| 317 | 319 |
| 318 API documentation: ............. ${ac_enable_doc} | 320 API documentation: ............. ${enable_doc} |
| 321 Extra programs: ................ ${enable_extra_programs} |
| 319 ------------------------------------------------------------------------ | 322 ------------------------------------------------------------------------ |
| 323 |
| 324 Type "make; make install" to compile and install |
| 325 Type "make check" to run the test suite |
| 320 ]) | 326 ]) |
| 321 | 327 |
| 322 echo "Type \"make; make install\" to compile and install"; | |
| 323 echo "Type \"make check\" to run the test suite"; | |
| OLD | NEW |