summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-cxx11abi.datbin0 -> 8780 bytes
-rwxr-xr-xscripts/check-cxx11abi.sh14
-rw-r--r--scripts/main.mk2
3 files changed, 16 insertions, 0 deletions
diff --git a/scripts/check-cxx11abi.dat b/scripts/check-cxx11abi.dat
new file mode 100755
index 0000000000..eab7298b50
--- /dev/null
+++ b/scripts/check-cxx11abi.dat
Binary files differ
diff --git a/scripts/check-cxx11abi.sh b/scripts/check-cxx11abi.sh
new file mode 100755
index 0000000000..ba64df1e79
--- /dev/null
+++ b/scripts/check-cxx11abi.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+# check-cxx11abi.dat is a binary just so we can use the loader
+# to take care of finding the libstdc++ which can be tricky.
+LIBSTDCPP=$(ldd $(dirname $0)/check-cxx11abi.dat |grep libstdc++ |cut -d' ' -f3)
+
+if [ $(readelf -Ws $LIBSTDCPP |c++filt |grep -c ::__cxx11::) -gt 0 ]; then
+ echo "-cxx11abi"
+else
+ echo ""
+fi
diff --git a/scripts/main.mk b/scripts/main.mk
index bc7506db5c..56b3fcd0c5 100644
--- a/scripts/main.mk
+++ b/scripts/main.mk
@@ -2,6 +2,7 @@ ifeq ($(shell uname -s), Darwin)
export PLATFORM ?= osx
else ifeq ($(shell uname -s), Linux)
export PLATFORM ?= linux
+ export CXX11ABI = $(shell scripts/check-cxx11abi.sh)
endif
ifeq ($(PLATFORM),android)
@@ -48,6 +49,7 @@ ifeq ($(PLATFORM),qt)
endif
# Defaults if not set
+export CXX11ABI ?= ""
export PLATFORM_OUTPUT ?= ./build/$(PLATFORM_SLUG)
export PLATFORM_CONFIG_INPUT ?= platform/$(MASON_PLATFORM)/scripts/configure.sh
export PLATFORM_CONFIG_OUTPUT ?= $(PLATFORM_OUTPUT)/config.gypi