Refactor travis build instructions. Add iOS build
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/.travis/build.sh b/.travis/build.sh
new file mode 100755
index 0000000..8de2e64
--- /dev/null
+++ b/.travis/build.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# exit this script if any commmand fails
+# set -e
+
+function build_linux()
+{
+ ./autogen.sh
+ ./configure ${HOST+--host=$HOST} ${CONFIGURE_OPTIONS}
+ make
+ make dist
+ make check RUNTESTFLAGS="-a $RUNTESTFLAGS"
+ cat */testsuite/libffi.log
+}
+
+function build_ios()
+{
+ which python
+# export PYTHON_BIN=/usr/local/bin/python
+ ./generate-darwin-source-and-headers.py
+ xcodebuild -showsdks
+ xcodebuild -project libffi.xcodeproj -target "libffi-iOS" -configuration Release -sdk iphoneos10.3
+ find ./
+}
+
+./autogen.sh
+case "$HOST" in
+ arm-apple-darwin*)
+ build_ios
+ ;;
+ *)
+ build_linux
+ ;;
+esac