diff --git a/configure.ac b/configure.ac index 4e0dd535..a4c689ca 100644 --- a/configure.ac +++ b/configure.ac @@ -219,11 +219,11 @@ AC_HELP_STRING([--disable-sse], [Disable SSE if the OS does not support SSE inst no) sse_os=no ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;; esac],[sse_os=yes]) -AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xyes) if test "x$sse_os" = xyes ; then -AC_DEFINE(FLAC__SSE_OS) -AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions]) -fi + AC_DEFINE_UNQUOTED([FLAC__SSE_OS],[1],[Define if your operating system supports SSE instructions]) +else + AC_DEFINE_UNQUOTED([FLAC__SSE_OS],[0]) + fi AC_ARG_ENABLE(altivec, AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]), diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c index a12d6977..fc472344 100644 --- a/src/libFLAC/cpu.c +++ b/src/libFLAC/cpu.c @@ -109,7 +109,7 @@ static const unsigned FLAC__CPUINFO_IA32_CPUID_AVX2 = 0x00000020; /* * Extra stuff needed for detection of OS support for SSE on IA-32 */ -#if defined(FLAC__CPU_IA32) && !defined FLAC__NO_ASM && (defined FLAC__HAS_NASM || defined FLAC__HAS_X86INTRIN) && !defined FLAC__NO_SSE_OS && !defined FLAC__SSE_OS +#if defined(FLAC__CPU_IA32) && !defined FLAC__NO_ASM && (defined FLAC__HAS_NASM || defined FLAC__HAS_X86INTRIN) && !FLAC__SSE_OS # if defined(__linux__) /* * If the OS doesn't support SSE, we will get here with a SIGILL. We @@ -206,11 +206,9 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) * now have to check for OS support of SSE instructions */ if(info->ia32.sse) { -#if defined FLAC__NO_SSE_OS +#if !FLAC__SSE_OS /* assume user knows better than us; turn it off */ disable_sse(info); -#elif defined FLAC__SSE_OS - /* assume user knows better than us; leave as detected above */ #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__) int sse = 0; size_t len; @@ -238,7 +236,7 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) # endif #elif defined(__ANDROID__) || defined(ANDROID) /* no need to check OS SSE support */ -#elif defined(__linux__) +#elif defined(__linux__) && !FLAC__SSE_OS int sse = 0; struct sigaction sigill_save; struct sigaction sigill_sse;