Skip to content

Commit cc03a0d

Browse files
committed
ci: fix build environments for linux32 and linux-armhf
1 parent 6b22471 commit cc03a0d

File tree

2 files changed

+35
-22
lines changed

2 files changed

+35
-22
lines changed

.travis.yml

+33-21
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,49 @@ services:
44
- docker
55

66
matrix:
7-
include:
8-
- env:
9-
- TARGET_OS=linux64
10-
- CROSS_TRIPLE=x86_64-linux-gnu
11-
- env:
12-
- TARGET_OS=linux32
13-
- CROSS_TRIPLE=x86_64-linux-gnu
14-
- env:
15-
- TARGET_OS=linux-armhf
16-
- CROSS_TRIPLE=x86_64-linux-gnu
17-
- env:
18-
- TARGET_OS=win32
19-
- CROSS_TRIPLE=i686-w64-mingw32
20-
# Unfortunately multiarch/crossbuild doesn't come with 'zip',
21-
# so we build a tgz archive in the container, and re-package it later in the script.
22-
- EXTRA_ARGS='-e ARCHIVE=tar'
23-
- env:
24-
- TARGET_OS=osx
25-
- CROSS_TRIPLE=x86_64-apple-darwin
7+
include:
8+
- env:
9+
- TARGET_OS=linux64
10+
- DOCKER_IMAGE=multiarch/crossbuild
11+
- CROSS_TRIPLE=x86_64-linux-gnu
12+
- BUILD_DIR=/workdir
13+
- env:
14+
- TARGET_OS=linux32
15+
# multiarch/crossbuild doesn't come with 32-bit compilers, use a different image
16+
- DOCKER_IMAGE=dockcross/linux-x86
17+
- CROSS_TRIPLE=i686-linux-gnu
18+
- BUILD_DIR=/work
19+
- env:
20+
- TARGET_OS=linux-armhf
21+
- DOCKER_IMAGE=multiarch/crossbuild
22+
- CROSS_TRIPLE=arm-linux-gnueabihf
23+
- BUILD_DIR=/workdir
24+
- env:
25+
- TARGET_OS=win32
26+
- DOCKER_IMAGE=multiarch/crossbuild
27+
- CROSS_TRIPLE=i686-w64-mingw32
28+
- BUILD_DIR=/workdir
29+
# multiarch/crossbuild doesn't come with 'zip',
30+
# so we build a tgz archive in the container, and re-package it later in the script.
31+
- EXTRA_ARGS='-e ARCHIVE=tar'
32+
- env:
33+
- TARGET_OS=osx
34+
- DOCKER_IMAGE=multiarch/crossbuild
35+
- CROSS_TRIPLE=x86_64-apple-darwin
36+
- BUILD_DIR=/workdir
37+
2638

2739
script:
2840
- export VER=$(git describe)
2941
- echo ${VER}
3042

3143
- >-
3244
docker run --rm
33-
-v $PWD:/workdir
45+
-v ${PWD}:${BUILD_DIR}
3446
-e TARGET_OS=${TARGET_OS}
3547
-e CROSS_TRIPLE=${CROSS_TRIPLE}
3648
${EXTRA_ARGS}
37-
multiarch/crossbuild
49+
${DOCKER_IMAGE}
3850
make clean dist
3951
4052
# for windows, prepare zip archive

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ $(DIST_ARCHIVE): $(TARGET) $(DIST_DIR)
9292

9393
$(TARGET): $(OBJECTS)
9494
$(CC) $^ -o $@ $(LDFLAGS)
95-
strip $(TARGET)
95+
strip $(TARGET) 2>/dev/null \
96+
|| $(CROSS_TRIPLE)-strip $(TARGET)
9697

9798
$(BUILD_DIR):
9899
@mkdir -p $@

0 commit comments

Comments
 (0)