From 0d5a6911ce586a85d4e2c282d1baa2b1a776c57b Mon Sep 17 00:00:00 2001 From: Victor Farazdagi Date: Fri, 16 Dec 2016 02:00:08 +0300 Subject: [PATCH] Arch dependent status headers. Fixes #80 --- Makefile | 1 + xgo/base/build.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index ef04230d1..6b901950a 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ statusgo-ios: xgo @echo "iOS framework cross compilation done." statusgo-ios-simulator: xgo + @build/env.sh docker pull farazdagi/xgo-ios-simulator build/env.sh $(GOBIN)/xgo --image farazdagi/xgo-ios-simulator --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/testnet-flags.sh) ./cmd/status @echo "iOS framework cross compilation done." diff --git a/xgo/base/build.sh b/xgo/base/build.sh index 625e0e4f8..e7ce7a083 100644 --- a/xgo/base/build.sh +++ b/xgo/base/build.sh @@ -572,6 +572,9 @@ for TARGET in $TARGETS; do done (cd $framework && ln -nsf Versions/A/Headers Headers) + echo "Patching Statusgo.h to work correctly on any arch (32bit, 64bit)" + (cd $framework && perl -i -p0e 's/(\/\*\n\s*static assertion[\s\n\r\S+]+)(typedef char _check_for[^;]+;)/\1#ifdef __LP64__\ntypedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64\/8 ? 1:-1];\n#else\ntypedef char _check_for_32_bit_pointer_matching_GoInt[sizeof(void*)==32\/8 ? 1:-1];\n#endif/igm' Headers/Statusgo.h) + mkdir -p $framework/Versions/A/Resources echo -e "\n\n\n\n\n" > $framework/Versions/A/Resources/Info.plist (cd $framework && ln -nsf Versions/A/Resources Resources)