Add PowerPC CPU feature detection support for OpenBSD.

Index: vpx_ports/ppc_cpudetect.c
--- vpx_ports/ppc_cpudetect.c.orig
+++ vpx_ports/ppc_cpudetect.c
@@ -8,11 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include <fcntl.h>
 #include <unistd.h>
 #include <stdint.h>
-#include <asm/cputable.h>
-#include <linux/auxvec.h>
 
 #include "./vpx_config.h"
 #include "vpx_ports/ppc.h"
@@ -35,6 +32,12 @@ static int cpu_env_mask(void) {
   return env && *env ? (int)strtol(env, NULL, 0) : ~0;
 }
 
+#if defined(__linux__)
+
+#include <fcntl.h>
+#include <asm/cputable.h>
+#include <linux/auxvec.h>
+
 int ppc_simd_caps(void) {
   int flags;
   int mask;
@@ -71,6 +74,39 @@ int ppc_simd_caps(void) {
   }
 out_close:
   close(fd);
+  return flags & mask;
+}
+
+#elif defined(__OpenBSD__)
+
+#include <sys/auxv.h>
+
+// Define hwcap values ourselves: building with an old auxv header where these
+// hwcap values are not defined should not prevent features from being enabled.
+#define VPX_PPC_HWCAP_VSX (1 << 7)
+
+int ppc_simd_caps(void) {
+  int flags;
+  int mask;
+
+  // If VPX_SIMD_CAPS is set then allow only those capabilities.
+  if (!cpu_env_flags(&flags)) {
+    return flags;
+  }
+
+  mask = cpu_env_mask();
+
+#ifdef __OpenBSD__
+  unsigned long hwcap = 0;
+  elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap));
+#else
+  unsigned long hwcap = getauxval(AT_HWCAP);
+#endif
+#if HAVE_VSX
+  if (hwcap & VPX_PPC_HWCAP_VSX) {
+    flags |= HAS_VSX;
+  }
+#endif  // HAVE_VSX
   return flags & mask;
 }
 #else
