(OK) 在CentOS7—编译OpenSSL 静态库—for—Android
来源:互联网 发布:ubuntu 改变源 编辑:程序博客网 时间:2024/05/16 14:51
参考: https://wiki.openssl.org/index.php/Android
下载makedepend.zip , 从http://llg.cubic.org/docs/vc7.html下载。 解压编译,然后 cp makedepend /bin/
下载Setenv-android.sh , wget https://wiki.openssl.org/images/7/70/Setenv-android.sh
[root@localhost openssl-1.0.1p]# gedit Setenv-android.sh //关键设置如下:
#-------------------------------------------------------
ANDROID_NDK_ROOT="/opt/android-on-linux/android-ndk-r8e"
_ANDROID_NDK="android-ndk-r8e"
_ANDROID_EABI="arm-linux-androideabi-4.7"
_ANDROID_API="android-14"
export MACHINE=armv7
export RELEASE=2.6.37
export SYSTEM=android
export ARCH=arm
#export CROSS_COMPILE="arm-linux-androideabi-"
export CROSS_COMPILE=""
#-------------------------------------------------------
[root@localhost openssl-1.0.1p]# pwd
/opt/cBPM-android/nginx-on-android/openssl-1.0.1p
chmod a+x Setenv-android.sh
perl -pi -e 's/install: all install_docs install_sw/install: install_docs install_sw/g' Makefile.org
./config shared no-ssl2 no-ssl3 no-comp no-hw no-engine --openssldir=/usr/local/ssl/android-14/
make depend
make all
find . -name "*.a"
find . -name libcrypto.a
find . -name libssl.a
readelf -h ./libcrypto.a | grep -i 'class\|machine' | head -2
cp libssl.a libcrypto.a /opt/cBPM-android/criteria-lin/lib
+++++++++++++++++++++++++++++++++++++++++++++
# gedit Setenv-android.sh //内容如下:
点击(此处)折叠或打开
- #!/bin/bash
- # Cross-compile environment for Android on ARMv7 and x86
- #
- # Contents licensed under the terms of the OpenSSL license
- # http://www.openssl.org/source/license.html
- #
- # See http://wiki.openssl.org/index.php/FIPS_Library_and_Android
- # and http://wiki.openssl.org/index.php/Android
- #####################################################################
- ANDROID_NDK_ROOT="/opt/android-on-linux/android-ndk-r8e"
- # Set ANDROID_NDK_ROOT to you NDK location. For example,
- # /opt/android-ndk-r8e or /opt/android-ndk-r9. This can be done in a
- # login script. If ANDROID_NDK_ROOT is not specified, the script will
- # try to pick it up with the value of _ANDROID_NDK_ROOT below. If
- # ANDROID_NDK_ROOT is set, then the value is ignored.
- _ANDROID_NDK="android-ndk-r8e"
- #_ANDROID_NDK="android-ndk-r9"
- # _ANDROID_NDK="android-ndk-r10"
- # Set _ANDROID_EABI to the EABI you want to use. You can find the
- # list in $ANDROID_NDK_ROOT/toolchains. This value is always used.
- # _ANDROID_EABI="x86-4.6"
- # _ANDROID_EABI="arm-linux-androideabi-4.6"
- _ANDROID_EABI="arm-linux-androideabi-4.7"
- # Set _ANDROID_ARCH to the architecture you are building for.
- # This value is always used.
- # _ANDROID_ARCH=arch-x86
- _ANDROID_ARCH=arch-arm
- # Set _ANDROID_API to the API you want to use. You should set it
- # to one of: android-14, android-9, android-8, android-14, android-5
- # android-4, or android-3. You can't set it to the latest (for
- # example, API-17) because the NDK does not supply the platform. At
- # Android 5.0, there will likely be another platform added (android-22?).
- # This value is always used.
- _ANDROID_API="android-14"
- #_ANDROID_API="android-18"
- # _ANDROID_API="android-19"
- #####################################################################
- # If the user did not specify the NDK location, try and pick it up.
- # We expect something like ANDROID_NDK_ROOT=/opt/android-ndk-r8e
- # or ANDROID_NDK_ROOT=/usr/local/android-ndk-r8e.
- if [ -z "$ANDROID_NDK_ROOT" ]; then
- _ANDROID_NDK_ROOT=""
- if [ -z "$_ANDROID_NDK_ROOT" ] && [ -d "/usr/local/$_ANDROID_NDK" ]; then
- _ANDROID_NDK_ROOT="/usr/local/$_ANDROID_NDK"
- fi
- if [ -z "$_ANDROID_NDK_ROOT" ] && [ -d "/opt/$_ANDROID_NDK" ]; then
- _ANDROID_NDK_ROOT="/opt/$_ANDROID_NDK"
- fi
- if [ -z "$_ANDROID_NDK_ROOT" ] && [ -d "$HOME/$_ANDROID_NDK" ]; then
- _ANDROID_NDK_ROOT="$HOME/$_ANDROID_NDK"
- fi
- if [ -z "$_ANDROID_NDK_ROOT" ] && [ -d "$PWD/$_ANDROID_NDK" ]; then
- _ANDROID_NDK_ROOT="$PWD/$_ANDROID_NDK"
- fi
- # If a path was set, then export it
- if [ ! -z "$_ANDROID_NDK_ROOT" ] && [ -d "$_ANDROID_NDK_ROOT" ]; then
- export ANDROID_NDK_ROOT="$_ANDROID_NDK_ROOT"
- fi
- fi
- # Error checking
- # ANDROID_NDK_ROOT should always be set by the user (even when not running this script)
- # http://groups.google.com/group/android-ndk/browse_thread/thread/a998e139aca71d77
- if [ -z "$ANDROID_NDK_ROOT" ] || [ ! -d "$ANDROID_NDK_ROOT" ]; then
- echo "Error: ANDROID_NDK_ROOT is not a valid path. Please edit this script."
- # echo "$ANDROID_NDK_ROOT"
- # exit 1
- fi
- # Error checking
- if [ ! -d "$ANDROID_NDK_ROOT/toolchains" ]; then
- echo "Error: ANDROID_NDK_ROOT/toolchains is not a valid path. Please edit this script."
- # echo "$ANDROID_NDK_ROOT/toolchains"
- # exit 1
- fi
- # Error checking
- if [ ! -d "$ANDROID_NDK_ROOT/toolchains/$_ANDROID_EABI" ]; then
- echo "Error: ANDROID_EABI is not a valid path. Please edit this script."
- # echo "$ANDROID_NDK_ROOT/toolchains/$_ANDROID_EABI"
- # exit 1
- fi
- #####################################################################
- # Based on ANDROID_NDK_ROOT, try and pick up the required toolchain. We expect something like:
- # /opt/android-ndk-r83/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin
- # Once we locate the toolchain, we add it to the PATH. Note: this is the 'hard way' of
- # doing things according to the NDK documentation for Ice Cream Sandwich.
- # https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
- ANDROID_TOOLCHAIN=""
- for host in "linux-x86_64" "linux-x86" "darwin-x86_64" "darwin-x86"
- do
- if [ -d "$ANDROID_NDK_ROOT/toolchains/$_ANDROID_EABI/prebuilt/$host/bin" ]; then
- ANDROID_TOOLCHAIN="$ANDROID_NDK_ROOT/toolchains/$_ANDROID_EABI/prebuilt/$host/bin"
- break
- fi
- done
- # Error checking
- if [ -z "$ANDROID_TOOLCHAIN" ] || [ ! -d "$ANDROID_TOOLCHAIN" ]; then
- echo "Error: ANDROID_TOOLCHAIN is not valid. Please edit this script."
- # echo "$ANDROID_TOOLCHAIN"
- # exit 1
- fi
- case $_ANDROID_ARCH in
- arch-arm)
- ANDROID_TOOLS="arm-linux-androideabi-gcc arm-linux-androideabi-ranlib arm-linux-androideabi-ld"
- ;;
- arch-x86)
- ANDROID_TOOLS="i686-linux-android-gcc i686-linux-android-ranlib i686-linux-android-ld"
- ;;
- *)
- echo "ERROR ERROR ERROR"
- ;;
- esac
- for tool in $ANDROID_TOOLS
- do
- # Error checking
- if [ ! -e "$ANDROID_TOOLCHAIN/$tool" ]; then
- echo "Error: Failed to find $tool. Please edit this script."
- # echo "$ANDROID_TOOLCHAIN/$tool"
- # exit 1
- fi
- done
- # Only modify/export PATH if ANDROID_TOOLCHAIN good
- if [ ! -z "$ANDROID_TOOLCHAIN" ]; then
- export ANDROID_TOOLCHAIN="$ANDROID_TOOLCHAIN"
- export PATH="$ANDROID_TOOLCHAIN":"$PATH"
- fi
- #####################################################################
- # For the Android SYSROOT. Can be used on the command line with --sysroot
- # https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
- export ANDROID_SYSROOT="$ANDROID_NDK_ROOT/platforms/$_ANDROID_API/$_ANDROID_ARCH"
- export SYSROOT="$ANDROID_SYSROOT"
- export NDK_SYSROOT="$ANDROID_SYSROOT"
- # Error checking
- if [ -z "$ANDROID_SYSROOT" ] || [ ! -d "$ANDROID_SYSROOT" ]; then
- echo "Error: ANDROID_SYSROOT is not valid. Please edit this script."
- # echo "$ANDROID_SYSROOT"
- # exit 1
- fi
- #####################################################################
- # If the user did not specify the FIPS_SIG location, try and pick it up
- # If the user specified a bad location, then try and pick it up too.
- if [ -z "$FIPS_SIG" ] || [ ! -e "$FIPS_SIG" ]; then
- # Try and locate it
- _FIPS_SIG=""
- if [ -d "/usr/local/ssl/$_ANDROID_API" ]; then
- _FIPS_SIG=`find "/usr/local/ssl/$_ANDROID_API" -name incore`
- fi
- if [ ! -e "$_FIPS_SIG" ]; then
- _FIPS_SIG=`find $PWD -name incore`
- fi
- # If a path was set, then export it
- if [ ! -z "$_FIPS_SIG" ] && [ -e "$_FIPS_SIG" ]; then
- export FIPS_SIG="$_FIPS_SIG"
- fi
- fi
- # Error checking. Its OK to ignore this if you are *not* building for FIPS
- if [ -z "$FIPS_SIG" ] || [ ! -e "$FIPS_SIG" ]; then
- echo "Error: FIPS_SIG does not specify incore module. Please edit this script."
- # echo "$FIPS_SIG"
- # exit 1
- fi
- #####################################################################
- # Most of these should be OK (MACHINE, SYSTEM, ARCH). RELEASE is ignored.
- export MACHINE=armv7
- export RELEASE=2.6.37
- export SYSTEM=android
- export ARCH=arm
- #export CROSS_COMPILE="arm-linux-androideabi-"
- export CROSS_COMPILE=""
- if [ "$_ANDROID_ARCH" == "arch-x86" ]; then
- export MACHINE=i686
- export RELEASE=2.6.37
- export SYSTEM=android
- export ARCH=x86
- export CROSS_COMPILE="i686-linux-android-"
- fi
- # For the Android toolchain
- # https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
- export ANDROID_SYSROOT="$ANDROID_NDK_ROOT/platforms/$_ANDROID_API/$_ANDROID_ARCH"
- export SYSROOT="$ANDROID_SYSROOT"
- export NDK_SYSROOT="$ANDROID_SYSROOT"
- export ANDROID_NDK_SYSROOT="$ANDROID_SYSROOT"
- export ANDROID_API="$_ANDROID_API"
- # CROSS_COMPILE and ANDROID_DEV are DFW (Don't Fiddle With). Its used by OpenSSL build system.
- # export CROSS_COMPILE="arm-linux-androideabi-"
- export ANDROID_DEV="$ANDROID_NDK_ROOT/platforms/$_ANDROID_API/$_ANDROID_ARCH/usr"
- export HOSTCC=gcc
- VERBOSE=1
- if [ ! -z "$VERBOSE" ] && [ "$VERBOSE" != "0" ]; then
- echo "ANDROID_NDK_ROOT: $ANDROID_NDK_ROOT"
- echo "ANDROID_ARCH: $_ANDROID_ARCH"
- echo "ANDROID_EABI: $_ANDROID_EABI"
- echo "ANDROID_API: $ANDROID_API"
- echo "ANDROID_SYSROOT: $ANDROID_SYSROOT"
- echo "ANDROID_TOOLCHAIN: $ANDROID_TOOLCHAIN"
- echo "FIPS_SIG: $FIPS_SIG"
- echo "CROSS_COMPILE: $CROSS_COMPILE"
- echo "ANDROID_DEV: $ANDROID_DEV"
- fi
0
上一篇:Android - OpenSSL
下一篇:glob.h and glob.c for the Android NDK
相关热门文章
- Android之开发环境搭建
- Android自定义View的实现...
- AndroidManifest.xml配置文件...
- Android相对布局+圆角按钮+Sha...
- 查看Android应用包名package和...
- linux dhcp peizhi roc
- 关于Unix文件的软链接
- 求教这个命令什么意思,我是新...
- sed -e "/grep/d" 是什么意思...
- 谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~
评论热议
0 0
- (OK) 在CentOS7—编译OpenSSL 静态库—for—Android
- (OK) 在CentOS7—编译OpenSSL 静态库—for—Android
- (Not OK) 在CentOS7—编译nginx—for—Android—Makefile
- (Not OK) 在CentOS7—编译nginx—for—Android—Makefile
- (Not OK) 在CentOS7—编译nginx—for—Android
- (Not OK) 在CentOS7—编译nginx—for—Android
- (OK) 交叉编译node-v4.2.1—for—android
- (OK) 交叉编译node-v4.2.1—for—android
- (OK) 编译xerces-c-3.1.2(静态库)—CentOS 7— android-ndk
- (OK) 编译libiconv-1.14(静态库)—CentOS 7— android-ndk
- (OK) 编译xerces-c-3.1.2(静态库)—CentOS 7— android-ndk
- (OK) 编译libiconv-1.14(静态库)—CentOS 7— android-ndk
- 在Android下编译openssl静态库(平台:Windows)
- 在Android下编译openssl静态库(平台:Windows)
- (OK) 运行cBPM—CentOS7
- (OK) 运行cBPM—CentOS7
- 编译openssl for android
- Android下编译OpenSSL静态库
- Android - OpenSSL
- (转)TableLayout中stretchColumns、shrinkColumns的用法
- 直方图与匹配
- C语言之常用字符串处理函数(非调用)
- swift开发笔记27 一个错误
- (OK) 在CentOS7—编译OpenSSL 静态库—for—Android
- 跟着柴毛毛学Spring(1)——纵观Spring
- 【随笔】IFE-task8小记(关于自适应布局)
- JAVA Excel数据批量导入到SQL数据库
- glob.h and glob.c for the Android NDK
- 腾讯TencentOS正式开放测试:支持“傻瓜式刷机”-android
- Android RecyclerView 使用完全解析 体验艺术般的控件
- (Not OK) 在CentOS7—编译nginx—for—Android
- CentOS 7 安装Nginx-1.9.2
原创粉丝点击
热门IT博客
热门问题
老师的惩罚
人脸识别
我在镇武司摸鱼那些年
重生之率土为王
我在大康的咸鱼生活
盘龙之生命进化
天生仙种
凡人之先天五行
春回大明朝
姑娘不必设防,我是瞎子
二手雪佛兰景程多少钱
景程2014款报价
雪佛兰景程2011款
2010款景程怎么样
雪弗兰景程配件
雪佛兰景程2009款
雪佛兰景程质量怎么样
雪佛兰景程两箱
雪佛兰景程评价
汽车雪佛兰景程
雪弗兰景程2007款
雪佛兰景程1.8怎么样
景程这车怎么样
雪福来新景程
雪佛兰的景程
雪佛兰景程2014款
雪佛兰景程2006款
13年景程多少钱
雪佛兰景程坐垫
雪佛兰景程改装车
雪佛兰景程09
雪佛兰景程排气管
雪佛兰景程车套
景程节气门价格
09年景程多少钱
雪佛兰景程钥匙匹配
雪佛兰景程05款
雪佛兰景程车型
雪佛兰景程08款
景程真皮座椅
雪佛兰景程2008
雪佛兰景程平衡杆
雪佛兰景程1.8升
雪佛兰景程2014
06款雪佛兰景程
雪佛兰景程用什么机油
二手雪佛兰
龙湖景粼原著
景粼原著
景美
黎景致