Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Kumpera <kumpera@gmail.com>2017-10-28 01:45:10 +0300
committerRodrigo Kumpera <kumpera@gmail.com>2017-10-28 01:49:31 +0300
commitac4095a1eab3845dd942bb8d5207491c41b91174 (patch)
tree8e5c2dbbb7de85535b25fc1f78003709df675acb
parent2856f523f67c541a947626a2d1dc65275353c3be (diff)
[sdks] Improve path handling and include local conf file
On my system, XS installs android sdk/ndk on different places. This patch probe the default places and fallback to the places I got. It does verify if the paths are bad and fail building ASAP. Finally, in includes sdks/Make.config that will include defines to trim what things you actually want to build.
-rw-r--r--sdks/Make.config.sample8
-rw-r--r--sdks/paths.mk36
2 files changed, 44 insertions, 0 deletions
diff --git a/sdks/Make.config.sample b/sdks/Make.config.sample
new file mode 100644
index 00000000000..051d2c23da8
--- /dev/null
+++ b/sdks/Make.config.sample
@@ -0,0 +1,8 @@
+#This is a sample file of all options that can be used by a Make.config file.
+
+
+#Disables building Android
+#DISABLE_ANDROID = 1
+
+#Disables building iOS
+#DISABLE_IOS = 1
diff --git a/sdks/paths.mk b/sdks/paths.mk
index ad8d5558d57..e00f9cb5581 100644
--- a/sdks/paths.mk
+++ b/sdks/paths.mk
@@ -1,4 +1,40 @@
+-include $(TOP)/sdks/Make.config
+
+#Default paths
+
SDK_DIR = $(abspath $(HOME)/Library/Developer/Xamarin/android-sdk-macosx/)
NDK_DIR = $(abspath $(HOME)/Library/Developer/Xamarin/android-ndk/android-ndk-r14b)
XCODE_DIR = /Applications/Xcode.app/Contents/Developer
+
+#Probe for alternative paths
+
+#On some systems the sdk is named mac_x86
+ifeq ($(wildcard $(SDK_DIR)/tools),)
+SDK_DIR = $(abspath $(HOME)/Library/Developer/Xamarin/android-sdk-mac_x86/)
+endif
+
+#Latest XS installs NDK in this PATH
+ifeq ($(wildcard $(NDK_DIR)/tools),)
+NDK_DIR = $(abspath $(HOME)/Library/Developer/Xamarin/android-sdk-mac_x86/ndk-bundle)
+endif
+
+#Error if tools are not found
+
+ifndef DISABLE_ANDROID
+ifeq ($(wildcard $(SDK_DIR)/tools),)
+$(error Could not find Android SDK in $(SDK_DIR))
+endif
+
+ifeq ($(wildcard $(NDK_DIR)),)
+$(error Could not find Android NDK in $(NDK_DIR))
+endif
+
+endif
+
+ifndef DISABLE_IOS
+ifeq ($(wildcard $(XCODE_DIR)),)
+$(error Could not find XCode in $(XCODE_DIR))
+endif
+
+endif \ No newline at end of file