Skip to content

Commit

Permalink
ci: fix build environments for linux32 and linux-armhf
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Oct 15, 2017
1 parent 6b22471 commit cc03a0d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
54 changes: 33 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,49 @@ services:
- docker

matrix:
include:
- env:
- TARGET_OS=linux64
- CROSS_TRIPLE=x86_64-linux-gnu
- env:
- TARGET_OS=linux32
- CROSS_TRIPLE=x86_64-linux-gnu
- env:
- TARGET_OS=linux-armhf
- CROSS_TRIPLE=x86_64-linux-gnu
- env:
- TARGET_OS=win32
- CROSS_TRIPLE=i686-w64-mingw32
# Unfortunately multiarch/crossbuild doesn't come with 'zip',
# so we build a tgz archive in the container, and re-package it later in the script.
- EXTRA_ARGS='-e ARCHIVE=tar'
- env:
- TARGET_OS=osx
- CROSS_TRIPLE=x86_64-apple-darwin
include:
- env:
- TARGET_OS=linux64
- DOCKER_IMAGE=multiarch/crossbuild
- CROSS_TRIPLE=x86_64-linux-gnu
- BUILD_DIR=/workdir
- env:
- TARGET_OS=linux32
# multiarch/crossbuild doesn't come with 32-bit compilers, use a different image
- DOCKER_IMAGE=dockcross/linux-x86
- CROSS_TRIPLE=i686-linux-gnu
- BUILD_DIR=/work
- env:
- TARGET_OS=linux-armhf
- DOCKER_IMAGE=multiarch/crossbuild
- CROSS_TRIPLE=arm-linux-gnueabihf
- BUILD_DIR=/workdir
- env:
- TARGET_OS=win32
- DOCKER_IMAGE=multiarch/crossbuild
- CROSS_TRIPLE=i686-w64-mingw32
- BUILD_DIR=/workdir
# multiarch/crossbuild doesn't come with 'zip',
# so we build a tgz archive in the container, and re-package it later in the script.
- EXTRA_ARGS='-e ARCHIVE=tar'
- env:
- TARGET_OS=osx
- DOCKER_IMAGE=multiarch/crossbuild
- CROSS_TRIPLE=x86_64-apple-darwin
- BUILD_DIR=/workdir


script:
- export VER=$(git describe)
- echo ${VER}

- >-
docker run --rm
-v $PWD:/workdir
-v ${PWD}:${BUILD_DIR}
-e TARGET_OS=${TARGET_OS}
-e CROSS_TRIPLE=${CROSS_TRIPLE}
${EXTRA_ARGS}
multiarch/crossbuild
${DOCKER_IMAGE}
make clean dist
# for windows, prepare zip archive
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ $(DIST_ARCHIVE): $(TARGET) $(DIST_DIR)

$(TARGET): $(OBJECTS)
$(CC) $^ -o $@ $(LDFLAGS)
strip $(TARGET)
strip $(TARGET) 2>/dev/null \
|| $(CROSS_TRIPLE)-strip $(TARGET)

$(BUILD_DIR):
@mkdir -p $@
Expand Down

0 comments on commit cc03a0d

Please sign in to comment.