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 dnl The package_version file will be automatically synced to the git revision | 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 | 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. | 5 dnl remain constant in tarball releases unless it is manually edited. |
6 m4_define([CURRENT_VERSION], | 6 m4_define([CURRENT_VERSION], |
7 m4_esyscmd([ ./update_version 2>/dev/null || true | 7 m4_esyscmd([ ./update_version 2>/dev/null || true |
8 if test -e package_version; then | 8 if test -e package_version; then |
9 . ./package_version | 9 . ./package_version |
10 printf "$PACKAGE_VERSION" | 10 printf "$PACKAGE_VERSION" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 ]) | 182 ]) |
183 | 183 |
184 AC_ARG_ENABLE([asm], | 184 AC_ARG_ENABLE([asm], |
185 [AS_HELP_STRING([--disable-asm], [Disable assembly optimizations])],, | 185 [AS_HELP_STRING([--disable-asm], [Disable assembly optimizations])],, |
186 [enable_asm=yes]) | 186 [enable_asm=yes]) |
187 | 187 |
188 AC_ARG_ENABLE([rtcd], | 188 AC_ARG_ENABLE([rtcd], |
189 [AS_HELP_STRING([--disable-rtcd], [Disable run-time CPU capabilities detecti
on])],, | 189 [AS_HELP_STRING([--disable-rtcd], [Disable run-time CPU capabilities detecti
on])],, |
190 [enable_rtcd=yes]) | 190 [enable_rtcd=yes]) |
191 | 191 |
| 192 AC_ARG_ENABLE([intrinsics], |
| 193 [AS_HELP_STRING([--enable-intrinsics], [Enable intrinsics optimizations for
ARM(float) X86(fixed)])],, |
| 194 [enable_intrinsics=no]) |
| 195 |
192 rtcd_support=no | 196 rtcd_support=no |
193 cpu_arm=no | 197 cpu_arm=no |
194 | 198 |
195 AS_IF([test x"${enable_asm}" = x"yes"],[ | 199 AS_IF([test x"${enable_asm}" = x"yes"],[ |
196 inline_optimization="No ASM for your platform, please send patches" | 200 inline_optimization="No inline ASM for your platform, please send patches" |
197 case $host_cpu in | 201 case $host_cpu in |
198 arm*) | 202 arm*) |
199 dnl Currently we only have asm for fixed-point | 203 dnl Currently we only have asm for fixed-point |
200 AS_IF([test "$enable_float" != "yes"],[ | 204 AS_IF([test "$enable_float" != "yes"],[ |
201 cpu_arm=yes | 205 cpu_arm=yes |
202 AC_DEFINE([OPUS_ARM_ASM], [], [Make use of ARM asm optimization]) | 206 AC_DEFINE([OPUS_ARM_ASM], [], [Make use of ARM asm optimization]) |
203 AS_GCC_INLINE_ASSEMBLY( | 207 AS_GCC_INLINE_ASSEMBLY( |
204 [inline_optimization="ARM"], | 208 [inline_optimization="ARM"], |
205 [inline_optimization="disabled"] | 209 [inline_optimization="disabled"] |
206 ) | 210 ) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 [rtcd_support="$rtcd_support (NEON)"] | 314 [rtcd_support="$rtcd_support (NEON)"] |
311 ) | 315 ) |
312 ]) | 316 ]) |
313 AC_SUBST(OPUS_ARM_MAY_HAVE_NEON) | 317 AC_SUBST(OPUS_ARM_MAY_HAVE_NEON) |
314 dnl Make sure turning on RTCD gets us at least one | 318 dnl Make sure turning on RTCD gets us at least one |
315 dnl instruction set. | 319 dnl instruction set. |
316 AS_IF([test x"$rtcd_support" != x""], | 320 AS_IF([test x"$rtcd_support" != x""], |
317 [rtcd_support=ARM"$rtcd_support"], | 321 [rtcd_support=ARM"$rtcd_support"], |
318 [rtcd_support="no"] | 322 [rtcd_support="no"] |
319 ) | 323 ) |
| 324 AC_MSG_CHECKING([for apple style tools]) |
| 325 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ |
| 326 #ifndef __APPLE__ |
| 327 #error 1 |
| 328 #endif],[])], |
| 329 [AC_MSG_RESULT([yes]); ARM2GNU_PARAMS="--apple"], |
| 330 [AC_MSG_RESULT([no]); ARM2GNU_PARAMS=""]) |
| 331 AC_SUBST(ARM2GNU_PARAMS) |
320 ], | 332 ], |
321 [ | 333 [ |
322 AC_MSG_WARN( | 334 AC_MSG_WARN( |
323 [*** ARM assembly requires perl -- disabling optimizations]) | 335 [*** ARM assembly requires perl -- disabling optimizations]) |
324 asm_optimization="(missing perl dependency for ARM)" | 336 asm_optimization="(missing perl dependency for ARM)" |
325 ]) | 337 ]) |
326 ]) | 338 ]) |
327 ;; | 339 ;; |
328 esac | 340 esac |
329 ],[ | 341 ],[ |
330 inline_optimization="disabled" | 342 inline_optimization="disabled" |
331 asm_optimization="disabled" | 343 asm_optimization="disabled" |
332 ]) | 344 ]) |
333 | 345 |
| 346 AM_CONDITIONAL([OPUS_ARM_INLINE_ASM], |
| 347 [test x"${inline_optimization%% *}" = x"ARM"]) |
| 348 AM_CONDITIONAL([OPUS_ARM_EXTERNAL_ASM], |
| 349 [test x"${asm_optimization%% *}" = x"ARM"]) |
| 350 |
| 351 AM_CONDITIONAL([HAVE_SSE4_1], [false]) |
| 352 AM_CONDITIONAL([HAVE_SSE2], [false]) |
| 353 |
| 354 AS_IF([test x"$enable_intrinsics" = x"yes"],[ |
| 355 case $host_cpu in |
| 356 arm*) |
| 357 cpu_arm=yes |
| 358 AC_MSG_CHECKING(if compiler supports ARM NEON intrinsics) |
| 359 save_CFLAGS="$CFLAGS"; CFLAGS="-mfpu=neon $CFLAGS" |
| 360 AC_LINK_IFELSE( |
| 361 [ |
| 362 AC_LANG_PROGRAM( |
| 363 [[#include <arm_neon.h> |
| 364 ]], |
| 365 [[ |
| 366 static float32x4_t A[2], SUMM; |
| 367 SUMM = vmlaq_f32(SUMM, A[0], A[1]); |
| 368 ]] |
| 369 ) |
| 370 ],[ |
| 371 OPUS_ARM_NEON_INTR=1 |
| 372 AC_MSG_RESULT([yes]) |
| 373 ],[ |
| 374 OPUS_ARM_NEON_INTR=0 |
| 375 AC_MSG_RESULT([no]) |
| 376 ] |
| 377 ) |
| 378 CFLAGS="$save_CFLAGS" |
| 379 #Now we know if compiler supports ARM neon intrinsics or not |
| 380 |
| 381 #Currently we only have intrinsic optimization for floating point |
| 382 AS_IF([test x"$enable_float" = x"yes"], |
| 383 [ |
| 384 AS_IF([test x"$OPUS_ARM_NEON_INTR" = x"1"], |
| 385 [ |
| 386 AC_DEFINE([OPUS_ARM_NEON_INTR], 1, [Compiler supports ARMv7 Neon Int
rinsics]) |
| 387 AS_IF([test x"enable_rtcd" != x""], |
| 388 [rtcd_support="ARM (ARMv7_Neon_Intrinsics)"],[]) |
| 389 enable_intrinsics="$enable_intrinsics ARMv7_Neon_Intrinsics" |
| 390 dnl Don't see why defining these is necessary to check features at r
untime |
| 391 AC_DEFINE([OPUS_ARM_MAY_HAVE_EDSP], 1, [Define if compiler support E
DSP Instructions]) |
| 392 AC_DEFINE([OPUS_ARM_MAY_HAVE_MEDIA], 1, [Define if compiler support
MEDIA Instructions]) |
| 393 AC_DEFINE([OPUS_ARM_MAY_HAVE_NEON], 1, [Define if compiler support N
EON instructions]) |
| 394 ], |
| 395 [ |
| 396 AC_MSG_WARN([Compiler does not support ARM intrinsics]) |
| 397 enable_intrinsics=no |
| 398 ]) |
| 399 ], [ |
| 400 AC_MSG_WARN([Currently on have ARM intrinsics for float]) |
| 401 enable_intrinsics=no |
| 402 ]) |
| 403 ;; |
| 404 "i386" | "i686" | "x86_64") |
| 405 AS_IF([test x"$enable_float" = x"no"],[ |
| 406 AS_IF([test x"$enable_rtcd" = x"yes"],[ |
| 407 get_cpuid_by_asm="no" |
| 408 AC_MSG_CHECKING([Get CPU Info]) |
| 409 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 410 #include <stdio.h> |
| 411 ]],[[ |
| 412 unsigned int CPUInfo0; |
| 413 unsigned int CPUInfo1; |
| 414 unsigned int CPUInfo2; |
| 415 unsigned int CPUInfo3; |
| 416 unsigned int InfoType; |
| 417 __asm__ __volatile__ ( |
| 418 "cpuid11": |
| 419 "=a" (CPUInfo0), |
| 420 "=b" (CPUInfo1), |
| 421 "=c" (CPUInfo2), |
| 422 "=d" (CPUInfo3) : |
| 423 "a" (InfoType), "c" (0) |
| 424 ); |
| 425 ]])], |
| 426 [get_cpuid_by_asm="yes" |
| 427 AC_MSG_RESULT([Inline Assembly])], |
| 428 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 429 #include <cpuid.h> |
| 430 ]],[[ |
| 431 unsigned int CPUInfo0; |
| 432 unsigned int CPUInfo1; |
| 433 unsigned int CPUInfo2; |
| 434 unsigned int CPUInfo3; |
| 435 unsigned int InfoType; |
| 436 __get_cpuid(InfoType, &CPUInfo0, &CPUInfo1, &CPUInfo2, &CPUInfo
3); |
| 437 ]])], |
| 438 [AC_MSG_RESULT([C method])], |
| 439 [AC_MSG_ERROR([not support Get CPU Info, please disable intrinsics ]
)])]) |
| 440 |
| 441 AC_MSG_CHECKING([sse4.1]) |
| 442 TMP_CFLAGS="$CFLAGS" |
| 443 gcc -Q --help=target | grep "\-msse4.1 " |
| 444 AS_IF([test x"$?" = x"0"],[ |
| 445 CFLAGS="$CFLAGS -msse4.1" |
| 446 AC_CHECK_HEADER(xmmintrin.h, [], [AC_MSG_ERROR([Couldn't find xmmint
rin.h])]) |
| 447 AC_CHECK_HEADER(emmintrin.h, [], [AC_MSG_ERROR([Couldn't find emmint
rin.h])]) |
| 448 AC_CHECK_HEADER(smmintrin.h, [], [AC_MSG_ERROR([Couldn't find smmint
rin.h])],[ |
| 449 #ifdef HAVE_XMMINSTRIN_H |
| 450 #include <xmmintrin.h> |
| 451 #endif |
| 452 #ifdef HAVE_EMMINSTRIN_H |
| 453 #include <emmintrin.h> |
| 454 #endif |
| 455 ]) |
| 456 |
| 457 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 458 #include <xmmintrin.h> |
| 459 #include <emmintrin.h> |
| 460 #include <smmintrin.h> |
| 461 ]],[[ |
| 462 __m128i mtest = _mm_setzero_si128(); |
| 463 mtest = _mm_cmpeq_epi64(mtest, mtest); |
| 464 ]])], |
| 465 [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([Compiler & linker failure for
sse4.1, please disable intrinsics])]) |
| 466 |
| 467 CFLAGS="$TMP_CFLAGS" |
| 468 AC_DEFINE([OPUS_X86_MAY_HAVE_SSE4_1], [1], [For x86 sse4.1 instrinsi
cs optimizations]) |
| 469 AC_DEFINE([OPUS_X86_MAY_HAVE_SSE2], [1], [For x86 sse2 instrinsics o
ptimizations]) |
| 470 rtcd_support="x86 sse4.1" |
| 471 AM_CONDITIONAL([HAVE_SSE4_1], [true]) |
| 472 AM_CONDITIONAL([HAVE_SSE2], [true]) |
| 473 AS_IF([test x"$get_cpuid_by_asm" = x"yes"],[AC_DEFINE([CPU_INFO_BY_A
SM], [1], [Get CPU Info by asm method])], |
| 474 [AC_DEFINE([CPU_INFO_BY_C], [1], [Get CPU Info by C method])]) |
| 475 ],[ ##### Else case for AS_IF([test x"$?" = x"0"]) |
| 476 gcc -Q --help=target | grep "\-msse2 " |
| 477 AC_MSG_CHECKING([sse2]) |
| 478 AS_IF([test x"$?" = x"0"],[ |
| 479 AC_MSG_RESULT([yes]) |
| 480 CFLAGS="$CFLAGS -msse2" |
| 481 AC_CHECK_HEADER(xmmintrin.h, [], [AC_MSG_ERROR([Couldn't find
xmmintrin.h])]) |
| 482 AC_CHECK_HEADER(emmintrin.h, [], [AC_MSG_ERROR([Couldn't find
emmintrin.h])]) |
| 483 |
| 484 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 485 #include <xmmintrin.h> |
| 486 #include <emmintrin.h> |
| 487 ]],[[ |
| 488 __m128i mtest = _mm_setzero_si128(); |
| 489 ]])], |
| 490 [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([Compiler & linker fail
ure for sse2, please disable intrinsics])]) |
| 491 |
| 492 CFLAGS="$TMP_CFLAGS" |
| 493 AC_DEFINE([OPUS_X86_MAY_HAVE_SSE2], [1], [For x86 sse2 instrin
sics optimize]) |
| 494 rtcd_support="x86 sse2" |
| 495 AM_CONDITIONAL([HAVE_SSE2], [true]) |
| 496 AS_IF([test x"$get_cpuid_by_asm" = x"yes"],[AC_DEFINE([CPU_INF
O_BY_ASM], [1], [Get CPU Info by asm method])], |
| 497 [AC_DEFINE([CPU_INFO_BY_C], [1], [Get CPU Info by c method])]) |
| 498 ],[enable_intrinsics="no"]) #End of AS_IF([test x"$?" = x"0"] |
| 499 ]) |
| 500 ], [ |
| 501 enable_intrinsics="no" |
| 502 ]) ## End of AS_IF([test x"$enable_rtcd" = x"yes"] |
| 503 ], |
| 504 [ ## Else case for AS_IF([test x"$enable_float" = x"no"] |
| 505 AC_MSG_WARN([Disabling intrinsics .. x86 intrinsics only avail for fixed poin
t]) |
| 506 enable_intrinsics="no" |
| 507 ]) ## End of AS_IF([test x"$enable_float" = x"no"] |
| 508 ;; |
| 509 *) |
| 510 AC_MSG_WARN([No intrinsics support for your architecture]) |
| 511 enable_intrinsics="no" |
| 512 ;; |
| 513 esac |
| 514 ]) |
| 515 |
334 AM_CONDITIONAL([CPU_ARM], [test "$cpu_arm" = "yes"]) | 516 AM_CONDITIONAL([CPU_ARM], [test "$cpu_arm" = "yes"]) |
335 AM_CONDITIONAL([OPUS_ARM_INLINE_ASM], | 517 AM_CONDITIONAL([OPUS_ARM_NEON_INTR], |
336 [test x"${inline_optimization:0:3}" = x"ARM"]) | 518 [test x"$OPUS_ARM_NEON_INTR" = x"1"]) |
337 AM_CONDITIONAL([OPUS_ARM_EXTERNAL_ASM], | |
338 [test x"${asm_optimization:0:3}" = x"ARM"]) | |
339 | 519 |
340 AS_IF([test x"$enable_rtcd" = x"yes"],[ | 520 AS_IF([test x"$enable_rtcd" = x"yes"],[ |
341 AS_IF([test x"$rtcd_support" != x"no"],[ | 521 AS_IF([test x"$rtcd_support" != x"no"],[ |
342 AC_DEFINE([OPUS_HAVE_RTCD], [1], | 522 AC_DEFINE([OPUS_HAVE_RTCD], [1], |
343 [Use run-time CPU capabilities detection]) | 523 [Use run-time CPU capabilities detection]) |
344 OPUS_HAVE_RTCD=1 | 524 OPUS_HAVE_RTCD=1 |
345 AC_SUBST(OPUS_HAVE_RTCD) | 525 AC_SUBST(OPUS_HAVE_RTCD) |
346 ]) | 526 ]) |
347 ],[ | 527 ],[ |
348 rtcd_support="disabled" | 528 rtcd_support="disabled" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 C99 lrintf: .................... ${ac_cv_func_lrintf} | 616 C99 lrintf: .................... ${ac_cv_func_lrintf} |
437 Use alloca: .................... ${use_alloca} | 617 Use alloca: .................... ${use_alloca} |
438 | 618 |
439 General configuration: | 619 General configuration: |
440 | 620 |
441 Floating point support: ........ ${enable_float} | 621 Floating point support: ........ ${enable_float} |
442 Fast float approximations: ..... ${enable_float_approx} | 622 Fast float approximations: ..... ${enable_float_approx} |
443 Fixed point debugging: ......... ${enable_fixed_point_debug} | 623 Fixed point debugging: ......... ${enable_fixed_point_debug} |
444 Inline Assembly Optimizations: . ${inline_optimization} | 624 Inline Assembly Optimizations: . ${inline_optimization} |
445 External Assembly Optimizations: ${asm_optimization} | 625 External Assembly Optimizations: ${asm_optimization} |
| 626 Intrinsics Optimizations.......: ${enable_intrinsics} |
446 Run-time CPU detection: ........ ${rtcd_support} | 627 Run-time CPU detection: ........ ${rtcd_support} |
447 Custom modes: .................. ${enable_custom_modes} | 628 Custom modes: .................. ${enable_custom_modes} |
448 Assertion checking: ............ ${enable_assertions} | 629 Assertion checking: ............ ${enable_assertions} |
449 Fuzzing: ....................... ${enable_fuzzing} | 630 Fuzzing: ....................... ${enable_fuzzing} |
450 | 631 |
451 API documentation: ............. ${enable_doc} | 632 API documentation: ............. ${enable_doc} |
452 Extra programs: ................ ${enable_extra_programs} | 633 Extra programs: ................ ${enable_extra_programs} |
453 ------------------------------------------------------------------------ | 634 ------------------------------------------------------------------------ |
454 | 635 |
455 Type "make; make install" to compile and install | 636 Type "make; make install" to compile and install |
456 Type "make check" to run the test suite | 637 Type "make check" to run the test suite |
457 ]) | 638 ]) |
458 | 639 |
OLD | NEW |