Created
November 13, 2016 12:14
-
-
Save mneumann/1997339bf559a688f220598bda2f6c93 to your computer and use it in GitHub Desktop.
Build static linked cargo (rust's package manager)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run from cargo git directory | |
OPENSSL_VERSION=1.0.2j | |
export OPENSSL_ROOT_DIR=`pwd`/openssl | |
export OPENSSL_LIB_DIR=${OPENSSL_ROOT_DIR}/lib | |
export OPENSSL_INCLUDE_DIR=${OPENSSL_ROOT_DIR}/include | |
export OPENSSL_STATIC=1 | |
export LIBSSH2_NO_PKG_CONFIG=1 | |
export LIBCURL_NO_PKG_CONFIG=1 | |
export LIBZ_SYS_STATIC=1 | |
export PROFILE=release | |
export VERBOSE=1 | |
export NUM_JOBS=8 | |
# Build OpenSSL | |
rm -rf openssl | |
fetch https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz | |
tar xf openssl-${OPENSSL_VERSION}.tar.gz | |
cd openssl-${OPENSSL_VERSION} | |
./Configure --prefix=${OPENSSL_ROOT_DIR} BSD-x86_64 -fPIC | |
make -j${NUM_JOBS} | |
make install | |
cd .. | |
# build cargo | |
rm -rf target | |
cargo build --release --verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was used to build version 0.15.0 (commit f6500c6b as of 2016-11-11) of cargo.