diff options
-rw-r--r-- | audio/flac/Makefile | 2 | ||||
-rw-r--r-- | audio/flac/files/patch-src_libFLAC_cpu.c | 33 |
2 files changed, 34 insertions, 1 deletions
diff --git a/audio/flac/Makefile b/audio/flac/Makefile index 2ecba1051d2d..1264ef9db1c6 100644 --- a/audio/flac/Makefile +++ b/audio/flac/Makefile @@ -7,7 +7,7 @@ PORTNAME= flac PORTVERSION= 1.1.0 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= audio MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/audio/flac/files/patch-src_libFLAC_cpu.c b/audio/flac/files/patch-src_libFLAC_cpu.c new file mode 100644 index 000000000000..36a52ecc2fb8 --- /dev/null +++ b/audio/flac/files/patch-src_libFLAC_cpu.c @@ -0,0 +1,33 @@ + +$FreeBSD$ + +--- src/libFLAC/cpu.c.orig ++++ src/libFLAC/cpu.c +@@ -25,6 +25,11 @@ + #include <config.h> + #endif + ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#endif ++ + const unsigned FLAC__CPUINFO_IA32_CPUID_CMOV = 0x00008000; + const unsigned FLAC__CPUINFO_IA32_CPUID_MMX = 0x00800000; + const unsigned FLAC__CPUINFO_IA32_CPUID_FXSR = 0x01000000; +@@ -52,6 +57,15 @@ + + #ifndef FLAC__SSE_OS + info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = false; ++#else ++#if defined(__FreeBSD__) ++ { ++ int sse; ++ size_t len = sizeof(sse); ++ if (sysctlbyname("hw.instruction_sse", &sse, &len, NULL, 0) || !sse) ++ info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = false; ++ } ++#endif + #endif + + #ifdef FLAC__USE_3DNOW |