Skip to content

Commit

Permalink
add musl as libc
Browse files Browse the repository at this point in the history
  • Loading branch information
AnderEnder committed May 22, 2018
1 parent 0236820 commit ba7372f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ script:
- cargo build --verbose --all
- cargo test --verbose --all
before_deploy:
- sudo bash -x ci/openssl.sh linux-x86_64
- OPENSSL_STATIC=yes OPENSSL_LIB_DIR=/openssl/lib OPENSSL_INCLUDE_DIR=/openssl/include cargo build --release
- sudo bash -x ci/openssl.sh linux-x86_64 musl- -static
- CC_x86_64_unknown_linux_musl=musl-gcc OPENSSL_STATIC=yes OPENSSL_LIB_DIR=/openssl/lib OPENSSL_INCLUDE_DIR=/openssl/include cargo build --release
- tar -C target/release -czf $(pwd)/s3find-$TRAVIS_TAG-x86_64-$TRAVIS_OS_NAME.tar.gz s3find
deploy:
api_key:
Expand Down
17 changes: 17 additions & 0 deletions ci/openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ main() {
local version=1.0.2m
local os=$1 \
triple=$2
local m_version=1.1.15

local dependencies=(
ca-certificates
Expand All @@ -32,6 +33,22 @@ main() {
fi
done

local td=$(mktemp -d)

pushd $td
curl https://www.musl-libc.org/releases/musl-$m_version.tar.gz | \
tar --strip-components=1 -xz

CFLAGS="-fPIC ${@:3}" ./configure \
--disable-shared \
--prefix=/usr/local \
$(test -z $target || echo --target=$target)
nice make -j$(nproc)
nice make install
ln -s /usr/bin/ar /usr/local/bin/musl-ar

popd

td=$(mktemp -d)

pushd $td
Expand Down

0 comments on commit ba7372f

Please sign in to comment.