From 10a6d771171114c873684ef0443abd4e41d83754 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lawrence=20Vel=C3=A1zquez?= <larryv@macports.org>
Date: Fri, 23 Jan 2015 22:57:04 -0500
Subject: [PATCH 16/16] (MP) libvpx: Set build target explicitly

This should get libvpx's build to respect our desired deployment target
and build architecture.
---
 contrib/libvpx/module.defs | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/contrib/libvpx/module.defs b/contrib/libvpx/module.defs
index 0293db8..6e46459 100644
--- a/contrib/libvpx/module.defs
+++ b/contrib/libvpx/module.defs
@@ -28,6 +28,23 @@ ifeq (yes,$(CCACHE))
     LIBVPX.CONFIGURE.extra += --enable-ccache
 endif
 
+ifeq (darwin,$(BUILD.system))
+    osx_minor_version := $(word 2,$(subst ., ,$(MACOSX_DEPLOYMENT_TARGET)))
+    ifneq ($(osx_minor_version),)
+        darwin_vers := $(shell echo $$(($(osx_minor_version) + 4)))
+        ifeq (i386,$(BUILD.arch))
+            LIBVPX.CONFIGURE.extra += \
+                --target=x86-darwin$(darwin_vers)-gcc
+        else ifeq (ppc,$(BUILD.arch))
+            LIBVPX.CONFIGURE.extra += \
+                --target=ppc32-darwin$(darwin_vers)-gcc
+        else
+            LIBVPX.CONFIGURE.extra += \
+                --target=$(BUILD.arch)-darwin$(darwin_vers)-gcc
+        endif
+    endif
+endif
+
 LIBVPX.BUILD.extra = quiet:=''
 LIBVPX.INSTALL.extra = quiet:=''
 LIBVPX.UNINSTALL.extra = quiet:=''
-- 
2.3.0

