From f6a4cd0167e1296e17b6cf2ae3103670a48e3dc3 Mon Sep 17 00:00:00 2001
From: William Welliver <william@welliver.org>
Date: Sun, 19 Mar 2017 11:05:51 -0400
Subject: [PATCH] smartlink: don't override MACOSX_DEPLOYMENT_TARGET if it's
 been specified.

this should prevent "compiled against version x but linking against version y" warnings.
---
 bin/smartlink | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/smartlink b/bin/smartlink
index 6f314d5c3c..c7076424dc 100755
--- a/bin/smartlink
+++ b/bin/smartlink
@@ -200,11 +200,15 @@ fi
 case "$UNAME" in
   Darwin\ 1[3-9]*|Darwin\ [2-9][0-9]*)
     # C++ Name mangling changed here, need to be able to interoperate with modern libs
-    export MACOSX_DEPLOYMENT_TARGET=10.9
+    if test "x$MACOSX_DEPLOYMENT_TARGET" = "x" ; then
+      export MACOSX_DEPLOYMENT_TARGET=10.9
+    fi
   ;;
   Darwin\ [7-9]*|Darwin\ [1-9][0-9]*)
     # Needs to be 10.3 or better for ld to accept "-undefined dynamic_lookup"
-    export MACOSX_DEPLOYMENT_TARGET=10.3
+    if test "x$MACOSX_DEPLOYMENT_TARGET" = "x" ; then
+      export MACOSX_DEPLOYMENT_TARGET=10.3
+    fi
   ;;
   *)
   ;;
-- 
GitLab