diff options
author | Christian Weisgerber <naddy@FreeBSD.org> | 2005-01-15 16:38:09 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@FreeBSD.org> | 2005-01-15 16:38:09 +0000 |
commit | 5852605e2bf690a3b1cdd315df967a02d233c85e (patch) | |
tree | 3aadb50c43b18ccce8ba062bdc349bd1cf471f78 /audio/flac | |
parent | - Update to 2.1 (diff) |
Don't enable SSE code if sysctl hw.instruction_sse is 0.
Original bug report and testing by Bryan Levin <bryan.levin@gmail.com>.
Notes
Notes:
svn path=/head/; revision=126507
Diffstat (limited to 'audio/flac')
-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 |