Arch dependent status headers. Fixes #80

This commit is contained in:
Victor Farazdagi 2016-12-16 02:00:08 +03:00
parent ddfd949a71
commit 0d5a6911ce
2 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@ statusgo-ios: xgo
@echo "iOS framework cross compilation done." @echo "iOS framework cross compilation done."
statusgo-ios-simulator: xgo 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 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." @echo "iOS framework cross compilation done."

View File

@ -572,6 +572,9 @@ for TARGET in $TARGETS; do
done done
(cd $framework && ln -nsf Versions/A/Headers Headers) (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 mkdir -p $framework/Versions/A/Resources
echo -e "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>" > $framework/Versions/A/Resources/Info.plist echo -e "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>" > $framework/Versions/A/Resources/Info.plist
(cd $framework && ln -nsf Versions/A/Resources Resources) (cd $framework && ln -nsf Versions/A/Resources Resources)