From 1961092f2d6fa997e8b374773d22005275696ac5 Mon Sep 17 00:00:00 2001
From: Nguyen Anh Quynh <aquynh@gmail.com>
Date: Fri, 15 Jul 2016 02:44:58 +0800
Subject: [PATCH] build universal binaries on MacOS by default

---
 docs/COMPILE-NIX.md | 10 ----------
 make-lib.sh         | 12 +++++++-----
 make-share.sh       | 12 +++++++-----
 3 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/docs/COMPILE-NIX.md b/docs/COMPILE-NIX.md
index ab6d11b..5026cdc 100644
--- a/docs/COMPILE-NIX.md
+++ b/docs/COMPILE-NIX.md
@@ -22,11 +22,6 @@ For Windows, see [COMPILE-WINDOWS.md](COMPILE-WINDOWS.md)
         $ cd build
         $ ../make-share.sh
 
-   On Mac OS, to build universal binaries including both 32-bit & 64-bit code,
-   replace the last line with:
-
-        $ ../make-share.sh macos-universal
-
    In the case you want to compile with all the debug information, replace the
    last line with:
 
@@ -46,11 +41,6 @@ For Windows, see [COMPILE-WINDOWS.md](COMPILE-WINDOWS.md)
         $ cd build
         $ ../make-lib.sh
 
-   On Mac OS, to build universal binaries including both 32-bit & 64-bit code,
-   replace the last line with:
-
-        $ ../make-lib.sh macos-universal
-
    In the case you want to compile with all the debug information, replace the
    last line with:
 
diff --git a/make-lib.sh b/make-lib.sh
index 3f787b4..0ee2228 100755
--- a/make-lib.sh
+++ b/make-lib.sh
@@ -8,21 +8,23 @@ usage()
   echo ""
   echo "Syntax:  make-lib.sh [debug] [macos-universal]"
   echo "\tdebug:           build with debug info"
-  echo "\tmacos-universal: build MacOS universal binaries"
+  echo "\tmacos-no-universal: do not build MacOS universal binaries"
   echo ""
 }
 
 BUILDTYPE='Release'
-MACOS_UNIVERSAL=''
-ARCH=''
+
+# on MacOS, build universal binaries by default
+ARCH='i386;x86_64'
 
 while [ "$1" != "" ]; do
   case $1 in
     debug)
       BUILDTYPE='Debug'
+      ARCH=''	# do not build MacOS universal binaries in debug mode
       ;;
-    macos-universal)
-      ARCH='i386;x86_64'
+    macos-no-universal)
+      ARCH=''	# do not build MacOS universal binaries in debug mode
       ;;
     *)
       echo "ERROR: unknown parameter \"$1\""
diff --git a/make-share.sh b/make-share.sh
index b33c550..43cd6b3 100755
--- a/make-share.sh
+++ b/make-share.sh
@@ -8,21 +8,23 @@ usage()
   echo ""
   echo "Syntax:  make-share.sh [debug] [macos-universal]"
   echo "\tdebug:           build with debug info"
-  echo "\tmacos-universal: build MacOS universal binaries"
+  echo "\tmacos-no-universal: do not build MacOS universal binaries"
   echo ""
 }
 
 BUILDTYPE='Release'
-MACOS_UNIVERSAL=''
-ARCH=''
+
+# on MacOS, build universal binaries by default
+ARCH='i386;x86_64'
 
 while [ "$1" != "" ]; do
   case $1 in
     debug)
       BUILDTYPE='Debug'
+      ARCH=''	# do not build MacOS universal binaries in debug mode
       ;;
-    macos-universal)
-      ARCH='i386;x86_64'
+    macos-no-universal)
+      ARCH=''	# do not build MacOS universal binaries in debug mode
       ;;
     *)
       echo "ERROR: unknown parameter \"$1\""
-- 
GitLab