View | Details | Raw Unified | Return to bug 228586 | Differences between
and this patch

Collapse All | Expand All

(-)multimedia/libvpx/Makefile (-1 / +1 lines)
Lines 17-23 BUILD_DEPENDS= nasm:devel/nasm Link Here
17
USE_GITHUB=	yes
17
USE_GITHUB=	yes
18
GH_ACCOUNT=	webmproject
18
GH_ACCOUNT=	webmproject
19
19
20
USES=		cpe gmake perl5 shebangfix
20
USES=		compiler:c++11-lib cpe gmake perl5 shebangfix
21
CPE_VENDOR=	john_koleszar
21
CPE_VENDOR=	john_koleszar
22
HAS_CONFIGURE=	yes
22
HAS_CONFIGURE=	yes
23
USE_PERL5=	build
23
USE_PERL5=	build
(-)multimedia/libvpx/files/patch-libs.mk (-11 lines)
Lines 1-16 Link Here
1
--- libs.mk.orig	2017-01-12 20:27:27 UTC
1
--- libs.mk.orig	2017-01-12 20:27:27 UTC
2
+++ libs.mk
2
+++ libs.mk
3
@@ -117,8 +117,8 @@ endif
4
 $(BUILD_PFX)third_party/googletest/%.cc.o: CXXFLAGS += -Wno-missing-field-initializers
5
 # Suppress -Wextra warnings in first party code pending investigation.
6
 # https://bugs.chromium.org/p/webm/issues/detail?id=1069
7
-$(BUILD_PFX)vp8/encoder/onyx_if.c.o: CFLAGS += -Wno-unknown-warning-option -Wno-clobbered
8
-$(BUILD_PFX)vp8/decoder/onyxd_if.c.o: CFLAGS += -Wno-unknown-warning-option -Wno-clobbered
9
+$(BUILD_PFX)vp8/encoder/onyx_if.c.o: CFLAGS += -Wno-extra
10
+$(BUILD_PFX)vp8/decoder/onyxd_if.c.o: CFLAGS += -Wno-extra
11
 
12
 ifeq ($(CONFIG_MSVS),yes)
13
 CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
14
@@ -339,8 +339,8 @@ else
3
@@ -339,8 +339,8 @@ else
15
 	$(qexec)echo 'Libs.private: -lm' >> $@
4
 	$(qexec)echo 'Libs.private: -lm' >> $@
16
 endif
5
 endif
(-)multimedia/libvpx/files/patch-vpx__ports_ppc__cpudetect.c (+66 lines)
Line 0 Link Here
1
--- vpx_ports/ppc_cpudetect.c.orig	2018-01-24 22:25:44 UTC
2
+++ vpx_ports/ppc_cpudetect.c
3
@@ -8,12 +8,6 @@
4
  *  be found in the AUTHORS file in the root of the source tree.
5
  */
6
 
7
-#include <fcntl.h>
8
-#include <unistd.h>
9
-#include <stdint.h>
10
-#include <asm/cputable.h>
11
-#include <linux/auxvec.h>
12
-
13
 #include "./vpx_config.h"
14
 #include "vpx_ports/ppc.h"
15
 
16
@@ -35,6 +29,13 @@ static int cpu_env_mask(void) {
17
   return env && *env ? (int)strtol(env, NULL, 0) : ~0;
18
 }
19
 
20
+#if defined(__linux__)
21
+#include <fcntl.h>
22
+#include <unistd.h>
23
+#include <stdint.h>
24
+#include <asm/cputable.h>
25
+#include <linux/auxvec.h>
26
+
27
 int ppc_simd_caps(void) {
28
   int flags;
29
   int mask;
30
@@ -73,6 +74,36 @@ out_close:
31
   close(fd);
32
   return flags & mask;
33
 }
34
+#elif defined(__FreeBSD__)
35
+#include <sys/types.h>
36
+#include <sys/sysctl.h>
37
+#include <machine/cpu.h>
38
+
39
+int ppc_simd_caps(void) {
40
+  int flags;
41
+  int mask;
42
+  u_long cpu_features = 0;
43
+  size_t sz = sizeof(cpu_features);
44
+
45
+  // If VPX_SIMD_CAPS is set then allow only those capabilities.
46
+  if (!cpu_env_flags(&flags)) {
47
+    return flags;
48
+  }
49
+
50
+  mask = cpu_env_mask();
51
+
52
+  sysctlbyname("hw.cpu_features", &cpu_features, &sz, NULL, 0);
53
+#if HAVE_VSX
54
+  if (cpu_features & PPC_FEATURE_HAS_VSX) flags |= HAS_VSX;
55
+#endif
56
+
57
+  return flags & mask;
58
+}
59
+#else
60
+#error \
61
+    "--enable-runtime-cpu-detect selected, but no CPU detection method " \
62
+"available for your platform. Reconfigure with --disable-runtime-cpu-detect."
63
+#endif   /* end __linux__ */
64
 #else
65
 // If there is no RTCD the function pointers are not used and can not be
66
 // changed.

Return to bug 228586