openssl裁剪
2016-01-13 15:42
2381 查看
引言
网上关于openssl交叉编译,裁剪的文章很多,但大部分都需要修改Makefile。我写这篇文章只为自己做个笔记,方便以后自己复习。openssl交叉编译及裁剪
交叉编译openssl的MakefileSHELL=/bin/bash CROSS_COMPILE = mipsisa32-elf- PLATFORM=linux-elf-mips INST=/works/libopenssl/inst MY_CFLAG = "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Wno-write-strings -EL -mips32 -msoft-float -O2 -fno-exceptions -G0 -I." CONFIG_EXTEND="no-shared no-zlib no-asm no-dso no-threads no-comp no-gmp no-krb5 no-rc5 no-zlib-dynamic no-hw no-cipher no-cms no-aes no-sse2 no-rfc3779 no-idea no-md4 no-mdc2 no-ripemd no-cope no-ocsp no-pem no-jpake no-txt_db no-krb5 no-seed no-store no-camellia no-pqueue no-whrlpool no-modes no-perlasm no-srp no-ts" romfs:openssl/Makefile @pushd openssl;\ make CC=$(CROSS_COMPILE)gcc AR="$(CROSS_COMPILE)ar r" && make CC=$(CROSS_COMPILE) install ;\ popd openssl/Makefile: pushd openssl; \ ./Configure $(PLATFORM) $(CONFIG_EXTEND) --prefix=$(INST) linux:gcc:"$(MY_CFLAG)";\ popd; clean: @pushd openssl; \ if [ -f Makefile ]; then \ make clean; \ fi; \ popd; \ rm -rf openssl/Makefile \ rm -rf inst/*
注意:在make的时候不能加CFLAGS这个选项,一旦加入就会把openssl自己内部的CFLAGS取代,会引起编译的时候找不到头文件。所以是在configure配置得时候加上的MY_CFLAGS。
本配置只为最简化openssl,只要ecdh算法能用就行。算法的配置可在CONFIG_EXTEND选项中增减。如果只需要静态库,那么apps目录也可以直接删除不要了。但是就这样配置下来x86编译出来的libcrypto.a还是有2.1M,我的交叉编译器编译出来更是有2.5M。对于flash只有1M的人来说:::伤不起啊/(ㄒoㄒ)/~~
对于能力有限的我来说,直接到openssl里提取ecdh算法出来还真是个头疼的事情(各个模块关联太深)。如果哪有更为小的ecdh算法库,还请告知!!thank you,O(∩_∩)O谢谢!
相关文章推荐
- XAMPP配置apache环境,用于运行rockmongo遇到的若干问题
- 三分钟让你学会如何使用 apache-common-pool2 创建自己的资源池
- Win7 64位 php-5.5.13+Apache 2.4.9+mysql-5.6.19 配置
- 安装配置jdk和tomcat
- Linux下PHP扩展添加
- linux ifconfig -a
- CentOs使用Yum自动安装UnRar方法
- shell 引号
- pop
- 自己利用opencv2.4.4和MFC写的视频目标标注助手
- pg常用自制shell脚本-tina
- nginx hello world模块编译运行的问题
- Nginx访问控制
- [solr] - IKAnalyzer 分词加入
- linux c文件操作函数
- 数据平台架构基于AWS的使用总结- Redshift优劣
- pop up layer loading
- 解决 Linux/Ubuntu: adb shell insufficient permissions for device 的问题
- [solr] - 环境搭建
- linux Vi 编辑器各模式功能键