summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang-Ming Huang <huangh@ociweb.com>2016-09-21 13:25:48 -0500
committerHuang-Ming Huang <huangh@ociweb.com>2016-09-21 13:25:48 -0500
commit1e2f6fc64b2cc8fdf6824545a77cb93a8e890c8f (patch)
treeba6790be75f0ac6bd213e48a825dddde5a752c55
parente96e1a5f6dedc9931373e6619a6eddfd092cd144 (diff)
downloadATCD-1e2f6fc64b2cc8fdf6824545a77cb93a8e890c8f.tar.gz
Add ace/config-macosx-all.h and include/makeinclude/platform_macosx_all.GNU for auto-detecting macOS version
-rw-r--r--ACE/ace/config-macosx-all.h23
-rw-r--r--ACE/include/makeinclude/platform_macosx_all.GNU39
2 files changed, 62 insertions, 0 deletions
diff --git a/ACE/ace/config-macosx-all.h b/ACE/ace/config-macosx-all.h
new file mode 100644
index 00000000000..afd4819f518
--- /dev/null
+++ b/ACE/ace/config-macosx-all.h
@@ -0,0 +1,23 @@
+#ifndef ACE_CONFIG_MACOSX_ALL_H
+#define ACE_CONFIG_MACOSX_ALL_H
+#include <Availability.h>
+
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 100900
+#include "ace/config-macosx-mavericks.h"
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100800
+#include "config-macosx-mountainlion.h"
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100700
+#include "config-macosx-lion.h"
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100600
+#include "config-macosx-snowleopard.h"
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100500
+#include "config-macosx-leopard.h"
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100400
+#include "config-macosx-tigher.h"
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100300
+#include "config-macosx-pather.h"
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 100200
+#include "config-macosx.h"
+#endif
+
+#endif // ACE_CONFIG_MACOSX_ALL_H
diff --git a/ACE/include/makeinclude/platform_macosx_all.GNU b/ACE/include/makeinclude/platform_macosx_all.GNU
new file mode 100644
index 00000000000..9f931101f02
--- /dev/null
+++ b/ACE/include/makeinclude/platform_macosx_all.GNU
@@ -0,0 +1,39 @@
+# include the platform_macosx_*.GNU based on the detected MacOS version
+
+MACOS_RELEASE_VERSION=$(shell sw_vers -productVersion)
+MACOS_REL_WORDS := $(subst ., ,${MACOS_RELEASE_VERSION})
+MACOS_MAJOR_VERSION = $(word 1,${MACOS_REL_WORDS})
+MACOS_MINOR_VERSION = $(word 2,${MACOS_REL_WORDS})
+MACOS_BUILD_VERSION = $(word 3,${MACOS_REL_WORDS})
+
+
+MACOS_CODENAME_VER_10_2 :=
+MACOS_CODENAME_VER_10_3 := panther
+MACOS_CODENAME_VER_10_4 := tigher
+MACOS_CODENAME_VER_10_5 := leopard
+MACOS_CODENAME_VER_10_6 := snowleopard
+MACOS_CODENAME_VER_10_7 := lion
+MACOS_CODENAME_VER_10_8 := mountainlion
+MACOS_CODENAME_VER_10_9 := mavericks
+MACOS_CODENAME_VER_10_10 := yosemite
+MACOS_CODENAME_VER_10_11 := elcapitan
+MACOS_CODENAME_VER_latest := elcapitan
+
+MACOS_CODENAME = $(MACOS_CODENAME_VER_$(MACOS_MAJOR_VERSION)_$(MACOS_MINOR_VERSION))
+
+ifeq ($(MACOS_MAJOR_VERSION),10)
+ ifeq ($(shell test $(MACOS_MINOR_VERSION) -gt 11; echo $$?),0)
+ ## if the detected version is greater than the lastest know version,
+ ## just use the lastest known version
+ MACOS_CODENAME = $(MACOS_CODENAME_VER_latest)
+ else ifeq ($(shell test $(MACOS_MINOR_VERSION) -lt 2; echo $$?),0)
+ ## Unsupoorted minor version
+ $(error Unsupported MacOS version $(MACOS_RELEASE_VERSION))
+ endif
+else
+ ## Unsupoorted major version
+ $(error Unsupported MacOS version $(MACOS_RELEASE_VERSION))
+endif
+
+include $(ACE_ROOT)/include/makeinclude/platform_macosx_$(MACOS_CODENAME).GNU
+