mirror of
https://github.com/webmproject/libwebp.git
synced 2025-04-04 16:06:49 +02:00
configure: add --disable-<avx2|sse4.1|sse2>
Change-Id: I06e73d1f6b5204398b2160b4c0b2c330a6939458
This commit is contained in:
parent
2fc8b658b7
commit
46305ca649
91
configure.ac
91
configure.ac
@ -80,44 +80,63 @@ AS_IF([test "$GCC" = "yes" ], [
|
|||||||
AC_SUBST([AM_CFLAGS])
|
AC_SUBST([AM_CFLAGS])
|
||||||
|
|
||||||
dnl === Check for machine specific flags
|
dnl === Check for machine specific flags
|
||||||
TEST_AND_ADD_CFLAGS([AVX2_FLAGS], [-mavx2])
|
AC_ARG_ENABLE([avx2],
|
||||||
AS_IF([test -n "$AVX2_FLAGS"], [
|
AS_HELP_STRING([--disable-avx2],
|
||||||
SAVED_CFLAGS=$CFLAGS
|
[Disable detection of AVX2 support
|
||||||
CFLAGS="$CFLAGS $AVX2_FLAGS"
|
@<:@default=auto@:>@]))
|
||||||
AC_CHECK_HEADER([immintrin.h],
|
|
||||||
[AC_DEFINE(WEBP_HAVE_AVX2, [1],
|
|
||||||
[Set to 1 if AVX2 is supported])],
|
|
||||||
[AVX2_FLAGS=""],
|
|
||||||
dnl it's illegal to directly include avx2intrin.h, but it's
|
|
||||||
dnl included conditionally in immintrin.h, tricky!
|
|
||||||
[#ifndef __AVX2__
|
|
||||||
#error avx2 is not enabled
|
|
||||||
#endif
|
|
||||||
])
|
|
||||||
CFLAGS=$SAVED_CFLAGS])
|
|
||||||
AC_SUBST([AVX2_FLAGS])
|
|
||||||
|
|
||||||
TEST_AND_ADD_CFLAGS([SSE41_FLAGS], [-msse4.1])
|
AS_IF([test "x$enable_avx2" != "xno" -a "x$enable_sse4_1" != "xno" \
|
||||||
AS_IF([test -n "$SSE41_FLAGS"], [
|
-a "x$enable_sse2" != "xno"], [
|
||||||
SAVED_CFLAGS=$CFLAGS
|
TEST_AND_ADD_CFLAGS([AVX2_FLAGS], [-mavx2])
|
||||||
CFLAGS="$CFLAGS $SSE41_FLAGS"
|
AS_IF([test -n "$AVX2_FLAGS"], [
|
||||||
AC_CHECK_HEADER([smmintrin.h],
|
SAVED_CFLAGS=$CFLAGS
|
||||||
[AC_DEFINE(WEBP_HAVE_SSE41, [1],
|
CFLAGS="$CFLAGS $AVX2_FLAGS"
|
||||||
[Set to 1 if SSE4.1 is supported])],
|
AC_CHECK_HEADER([immintrin.h],
|
||||||
[SSE41_FLAGS=""])
|
[AC_DEFINE(WEBP_HAVE_AVX2, [1],
|
||||||
CFLAGS=$SAVED_CFLAGS])
|
[Set to 1 if AVX2 is supported])],
|
||||||
AC_SUBST([SSE41_FLAGS])
|
[AVX2_FLAGS=""],
|
||||||
|
dnl it's illegal to directly include avx2intrin.h, but it's
|
||||||
|
dnl included conditionally in immintrin.h, tricky!
|
||||||
|
[#ifndef __AVX2__
|
||||||
|
#error avx2 is not enabled
|
||||||
|
#endif
|
||||||
|
])
|
||||||
|
CFLAGS=$SAVED_CFLAGS])
|
||||||
|
AC_SUBST([AVX2_FLAGS])])
|
||||||
|
|
||||||
TEST_AND_ADD_CFLAGS([SSE2_FLAGS], [-msse2])
|
AC_ARG_ENABLE([sse4.1],
|
||||||
AS_IF([test -n "$SSE2_FLAGS"], [
|
AS_HELP_STRING([--disable-sse4.1],
|
||||||
SAVED_CFLAGS=$CFLAGS
|
[Disable detection of SSE4.1 support
|
||||||
CFLAGS="$CFLAGS $SSE2_FLAGS"
|
@<:@default=auto@:>@]))
|
||||||
AC_CHECK_HEADER([emmintrin.h],
|
|
||||||
[AC_DEFINE(WEBP_HAVE_SSE2, [1],
|
AS_IF([test "x$enable_sse4_1" != "xno" -a "x$enable_sse2" != "xno"], [
|
||||||
[Set to 1 if SSE2 is supported])],
|
TEST_AND_ADD_CFLAGS([SSE41_FLAGS], [-msse4.1])
|
||||||
[SSE2_FLAGS=""])
|
AS_IF([test -n "$SSE41_FLAGS"], [
|
||||||
CFLAGS=$SAVED_CFLAGS])
|
SAVED_CFLAGS=$CFLAGS
|
||||||
AC_SUBST([SSE2_FLAGS])
|
CFLAGS="$CFLAGS $SSE41_FLAGS"
|
||||||
|
AC_CHECK_HEADER([smmintrin.h],
|
||||||
|
[AC_DEFINE(WEBP_HAVE_SSE41, [1],
|
||||||
|
[Set to 1 if SSE4.1 is supported])],
|
||||||
|
[SSE41_FLAGS=""])
|
||||||
|
CFLAGS=$SAVED_CFLAGS])
|
||||||
|
AC_SUBST([SSE41_FLAGS])])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([sse2],
|
||||||
|
AS_HELP_STRING([--disable-sse2],
|
||||||
|
[Disable detection of SSE2 support
|
||||||
|
@<:@default=auto@:>@]))
|
||||||
|
|
||||||
|
AS_IF([test "x$enable_sse2" != "xno"], [
|
||||||
|
TEST_AND_ADD_CFLAGS([SSE2_FLAGS], [-msse2])
|
||||||
|
AS_IF([test -n "$SSE2_FLAGS"], [
|
||||||
|
SAVED_CFLAGS=$CFLAGS
|
||||||
|
CFLAGS="$CFLAGS $SSE2_FLAGS"
|
||||||
|
AC_CHECK_HEADER([emmintrin.h],
|
||||||
|
[AC_DEFINE(WEBP_HAVE_SSE2, [1],
|
||||||
|
[Set to 1 if SSE2 is supported])],
|
||||||
|
[SSE2_FLAGS=""])
|
||||||
|
CFLAGS=$SAVED_CFLAGS])
|
||||||
|
AC_SUBST([SSE2_FLAGS])])
|
||||||
|
|
||||||
dnl === CLEAR_LIBVARS([var_pfx])
|
dnl === CLEAR_LIBVARS([var_pfx])
|
||||||
dnl === Clears <var_pfx>_{INCLUDES,LIBS}.
|
dnl === Clears <var_pfx>_{INCLUDES,LIBS}.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user