summaryrefslogtreecommitdiff
path: root/.travis/build.sh
blob: 39e749c522e971816d3f325419957acb86009a03 (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash

# exit this script if any commmand fails
# set -e
set -x

function build_linux()
{
    ./autogen.sh
    ./configure ${HOST+--host=$HOST} ${CONFIGURE_OPTIONS}
    make
    make dist
    make check RUNTESTFLAGS="-a $RUNTESTFLAGS"

    gzip -c -9 */testsuite/libffi.log > libffi.log.gz
    echo ================================================================
    echo The logs are too long for travis to handle, so we compress and
    echo uuencode them.  Download, decode and uncompress if you need to
    echo read them.
    echo ================================================================
    uuencode libffi.log.gz -
    echo ================================================================
    echo ================================================================
}

function build_foreign_linux()
{
    ls -l /usr/bin/qemu-arm-static
    docker run --rm -t -i -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static -v `pwd`:/opt --rm -ti arm32v7/debian:stretch-slim /opt/.travis/build-in-container.sh
}

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
	;;
    arm32v7-linux-gnu)
        build_foreign_linux
	;;
    *)
	build_linux
	;;
esac