Skip to content

Commit

Permalink
make openssl in $PWD
Browse files Browse the repository at this point in the history
  • Loading branch information
tatowilson authored and tom committed Aug 30, 2018
1 parent a217cba commit 37a3353
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion make_nginx.sh
@@ -1,6 +1,7 @@
#!/bin/sh

echo "building nginx..."
echo "see logs in make_nginx.log"

exec > make_nginx.log
exec 2>&1
Expand Down Expand Up @@ -78,4 +79,4 @@ make install -j8

cd ..
exec >/dev/tty
echo "see logs in make_nginx.log"
exec 2>&1
17 changes: 9 additions & 8 deletions make_openssl.sh
@@ -1,29 +1,30 @@
#!/bin/sh

echo "building openssl..."
echo "see logs in make_openssl.log"

exec > make_openssl.log
exec 2>&1
. ./portable_cmds.sh

# 执行环境脚本,第一个句点不能省略
. ./portable_cmds.sh
. ./Setenv-android.sh
export OPENSSL_DIR=/usr/local/ssl/$ANDROID_API
# 进入openssl源码目录
export OPENSSL_DIR=$PWD/ssl/$ANDROID_API

# enter openssl source code directory
OPENSSL_SRC_DIR=$(p_find ".*openssl-[0-9]+\.[0-9]+\.[0-9]+[a-z]")
if [[ -z $OPENSSL_SRC_DIR ]]; then
echo "Can't find openssl source directory!"
exit 1
fi
cd $OPENSSL_SRC_DIR
# 生成Makefile

# generate Makefile
KERNEL_BITS=32 ./config shared no-ssl2 no-ssl3 no-comp no-hw no-engine \
--openssldir=$OPENSSL_DIR --prefix=$OPENSSL_DIR
make depend
make all
# -E 保留当前的环境变量给root用户
sudo -E make install CC=$ANDROID_TOOLCHAIN/arm-linux-androideabi-gcc RANLIB=$ANDROID_TOOLCHAIN/arm-linux-androideabi-ranlib
make install CC=$ANDROID_TOOLCHAIN/arm-linux-androideabi-gcc RANLIB=$ANDROID_TOOLCHAIN/arm-linux-androideabi-ranlib

cd ..
exec >/dev/tty
echo "see logs in make_openssl.log"
exec 2>&1

0 comments on commit 37a3353

Please sign in to comment.