1. 程式人生 > >GmSSL Android NDK編譯 (版本95c0dba)

GmSSL Android NDK編譯 (版本95c0dba)

下載原始碼並切換到版本95c0dba

[[email protected] tmp]$ git clone https://github.com/guanzhi/GmSSL.git
Cloning into 'GmSSL'...
remote: Counting objects: 13557, done.
remote: Total 13557 (delta 0), reused 0 (delta 0), pack-reused 13557
Receiving objects: 100% (13557/13557), 32.95 MiB | 69.00 KiB/s, done.
Resolving deltas: 100% (7525/7525), done.
[
[email protected]
tmp]$ cd GmSSL/ [[email protected] GmSSL]$ git checkout 95c0dba Note: checking out '95c0dba'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b <new-branch-name> HEAD is now at 95c0dba... 補充(漏)提交說明見https://github.com/zsdev2015/GmSSL/commit/5c315bca3f08e706e6a81a133575cda315012e4d [
[email protected]
GmSSL]$

利用config產生Makefile
./config shared --prefix=/usr/local/gmssl no-zlib no-threads no-asm no-sse2 no-gmp no-rfc3779 no-dso 

修改Makefile如下
### Generated automatically from Makefile.org by Configure.

##
## Makefile for OpenSSL
##

VERSION=1.0.2d-fips
MAJOR=1
MINOR=0.2
SHLIB_VERSION_NUMBER=1.0.0
SHLIB_VERSION_HISTORY=
SHLIB_MAJOR=1
SHLIB_MINOR=0.0
SHLIB_EXT=.so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
PLATFORM=linux-x86_64
OPTIONS=enable-shared --prefix=/home/yeqiang/Android/Sdk/ndk-bundle/platforms/android-26/arch-arm64/usr no-asm no-dso no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-libunbound no-md2 no-rc5 no-rfc3779 no-sctp no-sse2 no-ssl-trace no-store no-threads no-unit-test no-zlib no-zlib-dynamic no-static-engine
CONFIGURE_ARGS=linux-x86_64 shared --prefix=/home/yeqiang/Android/Sdk/ndk-bundle/platforms/android-26/arch-arm64/usr no-zlib no-threads no-asm no-sse2 no-gmp no-rfc3779 no-dso
SHLIB_TARGET=linux-shared

# HERE indicates where this Makefile lives.  This can be used to indicate
# where sub-Makefiles are expected to be.  Currently has very limited usage,
# and should probably not be bothered with at all.
HERE=.

# INSTALL_PREFIX is for package builders so that they can configure
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
# Normally it is left empty.
INSTALL_PREFIX=
INSTALLTOP=/home/yeqiang/Android/Sdk/ndk-bundle/platforms/android-26/arch-arm64/usr

# Do not edit this manually. Use Configure --openssldir=DIR do change this!
OPENSSLDIR=/home/yeqiang/Android/Sdk/ndk-bundle/platforms/android-26/arch-arm64/usr/ssl

# NO_IDEA - Define to build without the IDEA algorithm
# NO_RC4  - Define to build without the RC4 algorithm
# NO_RC2  - Define to build without the RC2 algorithm
# THREADS - Define when building with threads, you will probably also need any
#           system defines as well, i.e. _REENTERANT for Solaris 2.[34]
# TERMIO  - Define the termio terminal subsystem, needed if sgtty is missing.
# TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
# LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
# DEVRANDOM - Give this the value of the 'random device' if your OS supports
#           one.  32 bytes will be read from this when the random
#           number generator is initalised.
# SSL_FORBID_ENULL - define if you want the server to be not able to use the
#           NULL encryption ciphers.
#
# LOCK_DEBUG - turns on lots of lock debug output :-)
# REF_CHECK - turn on some xyz_free() assertions.
# REF_PRINT - prints some stuff on structure free.
# CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
# MFUNC - Make all Malloc/Free/Realloc calls call
#       CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
#       call application defined callbacks via CRYPTO_set_mem_functions()
# MD5_ASM needs to be defined to use the x86 assembler for MD5
# SHA1_ASM needs to be defined to use the x86 assembler for SHA1
# RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
# Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8.  It must
# equal 4.
# PKCS1_CHECK - pkcs1 tests.

CC= /home/yeqiang/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-gcc
CFLAG= -fPIC --sysroot=/home/yeqiang/Android/Sdk/ndk-bundle/platforms/android-26/arch-arm64 -I/home/yeqiang/Android/Sdk/ndk-bundle/sysroot/usr/include -I/home/yeqiang/Android/Sdk/ndk-bundle/sysroot/usr/include/i686-linux-android -DOPENSSL_PIC -DL_ENDIAN -O3 -Wall
DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST
PEX_LIBS= 
EX_LIBS= -ldl
EXE_EXT= 
ARFLAGS= 
AR= /home/yeqiang/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar $(ARFLAGS) r
RANLIB= /home/yeqiang/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ranlib
NM= nm
PERL= /usr/bin/perl
TAR= tar
TARFLAGS= --no-recursion
MAKEDEPPROG= /home/yeqiang/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-gcc
LIBDIR=lib

# We let the C compiler driver to take care of .s files. This is done in
# order to be excused from maintaining a separate set of architecture
# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
# gcc, then the driver will automatically translate it to -xarch=v8plus
# and pass it down to assembler.
AS=$(CC) -c
ASFLAG=$(CFLAG)

# For x86 assembler: Set PROCESSOR to 386 if you want to support
# the 80386.
PROCESSOR= 

# CPUID module collects small commonly used assembler snippets
CPUID_OBJ= mem_clr.o
BN_ASM= bn_asm.o
EC_ASM= 
DES_ENC= des_enc.o fcrypt_b.o
AES_ENC= aes_core.o aes_cbc.o
BF_ENC= bf_enc.o
CAST_ENC= c_enc.o
RC4_ENC= rc4_enc.o rc4_skey.o
RC5_ENC= rc5_enc.o
MD5_ASM_OBJ= 
SHA1_ASM_OBJ= 
RMD160_ASM_OBJ= 
WP_ASM_OBJ= wp_block.o
CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o
MODES_ASM_OBJ= 
ENGINES_ASM_OBJ= 
PERLASM_SCHEME= elf

# KRB5 stuff
KRB5_INCLUDES=
LIBKRB5=

# Zlib stuff
ZLIB_INCLUDE=
LIBZLIB=

# TOP level FIPS install directory.
FIPSDIR=/usr/local/ssl/fips-2.0

# This is the location of fipscanister.o and friends.
# The FIPS module build will place it $(INSTALLTOP)/lib
# but since $(INSTALLTOP) can only take the default value
# when the module is built it will be in /usr/local/ssl/lib
# $(INSTALLTOP) for this build may be different so hard
# code the path.

FIPSLIBDIR=

# The location of the library which contains fipscanister.o
# normally it will be libcrypto unless fipsdso is set in which
# case it will be libfips. If not compiling in FIPS mode at all
# this is empty making it a useful test for a FIPS compile.

FIPSCANLIB=

# Shared library base address. Currently only used on Windows.
#

BASEADDR=0xFB00000

DIRS=   crypto ssl engines apps test tools
ENGDIRS= ccgost
SHLIBDIRS= crypto ssl

# dirs in crypto to build
SDIRS=  \
	objects \
	md4 md5 sha mdc2 hmac ripemd whrlpool \
	des aes rc2 rc4 idea bf cast camellia seed modes \
	bn ec rsa dsa ecdsa dh ecdh ecies dso engine \
	buffer bio stack lhash rand err \
	evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
	cms pqueue ts srp cmac \
	sm2 sm3 sms4 sm9 ecies ffx cpk zuc cbcmac otp skf paillier kdf

# keep in mind that the above list is adjusted by ./Configure
# according to no-xxx arguments...

# tests to perform.  "alltests" is a special word indicating that all tests
# should be performed.
TESTS = alltests

MAKEFILE= Makefile

MANDIR=$(OPENSSLDIR)/man
MAN1=1
MAN3=3
MANSUFFIX=
HTMLSUFFIX=html
HTMLDIR=$(OPENSSLDIR)/html
SHELL=/bin/sh

TOP=    .
ONEDIRS=out tmp
EDIRS=  times doc bugs util include certs ms shlib mt demos perl sf dep VMS
WDIRS=  windows
LIBS=   libcrypto.a libssl.a
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
SHARED_SSL=libssl$(SHLIB_EXT)
SHARED_LIBS=$(SHARED_CRYPTO) $(SHARED_SSL)
SHARED_LIBS_LINK_EXTS=.so.$(SHLIB_MAJOR) .so
SHARED_LDFLAGS=

GENERAL=        Makefile
BASENAME=       gmssl
NAME=           $(BASENAME)-$(VERSION)
TARFILE=        $(NAME).tar
WTARFILE=       $(NAME)-win.tar
EXHEADER=       e_os2.h
HEADER=         e_os.h

all: Makefile build_all

# as we stick to -e, CLEARENV ensures that local variables in lower
# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
# shell, which [annoyingly enough] terminates unset with error if VAR
# is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
# which terminates unset with error if no variable was present:-(
CLEARENV=	TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS}	\
		$${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES}	\
		$${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC}		\
		$${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL}	\
		$${EXHEADER+EXHEADER} $${HEADER+HEADER}		\
		$${GENERAL+GENERAL} $${CFLAGS+CFLAGS}		\
		$${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS}		\
		$${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS}	\
		$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS}	\
		$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}

BUILDENV=	PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
		CC='$(CC)' CFLAG='$(CFLAG)' 			\
		AS='$(CC)' ASFLAG='$(CFLAG) -c'			\
		AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)'	\
		CROSS_COMPILE='$(CROSS_COMPILE)'	\
		PERL='$(PERL)' ENGDIRS='$(ENGDIRS)'		\
		SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)'	\
		INSTALL_PREFIX='$(INSTALL_PREFIX)'		\
		INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)'	\
		LIBDIR='$(LIBDIR)'				\
		MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
		DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)'	\
		MAKEDEPPROG='$(MAKEDEPPROG)'			\
		SHARED_LDFLAGS='$(SHARED_LDFLAGS)'		\
		KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)'	\
		ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)'	\
		EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)'	\
		SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)'	\
		PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)'	\
		CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)'	\
		EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' 	\
		AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)'	\
		BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)'	\
		RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)'	\
		SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)'			\
		MD5_ASM_OBJ='$(MD5_ASM_OBJ)'			\
		RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)'		\
		WP_ASM_OBJ='$(WP_ASM_OBJ)'			\
		MODES_ASM_OBJ='$(MODES_ASM_OBJ)'		\
		ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)'		\
		PERLASM_SCHEME='$(PERLASM_SCHEME)'		\
		FIPSLIBDIR='${FIPSLIBDIR}'			\
		FIPSDIR='${FIPSDIR}'				\
		FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}"	\
		THIS=$${THIS:
[email protected]
} MAKEFILE=Makefile MAKEOVERRIDES= # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, # which in turn eliminates ambiguities in variable treatment with -e. # BUILD_CMD is a generic macro to build a given target in a given # subdirectory. The target must be given through the shell variable # `target' and the subdirectory to build in must be given through `dir'. # This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or # BUILD_ONE_CMD instead. # # BUILD_ONE_CMD is a macro to build a given target in a given # subdirectory if that subdirectory is part of $(DIRS). It requires # exactly the same shell variables as BUILD_CMD. # # RECURSIVE_BUILD_CMD is a macro to build a given target in all # subdirectories defined in $(DIRS). It requires that the target # is given through the shell variable `target'. BUILD_CMD= if [ -d "$$dir" ]; then \ ( cd $$dir && echo "making $$target in $$dir..." && \ $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \ ) || exit 1; \ fi RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done BUILD_ONE_CMD=\ if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \ $(BUILD_CMD); \ fi reflect: @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV) sub_all: build_all build_all: build_libs build_apps build_tests build_tools build_libs: build_libcrypto build_libssl openssl.pc build_libcrypto: build_crypto build_engines libcrypto.pc build_libssl: build_ssl libssl.pc build_crypto: @dir=crypto; target=all; $(BUILD_ONE_CMD) build_ssl: build_crypto @dir=ssl; target=all; $(BUILD_ONE_CMD) build_engines: build_crypto @dir=engines; target=all; $(BUILD_ONE_CMD) build_apps: build_libs @dir=apps; target=all; $(BUILD_ONE_CMD) build_tests: build_libs @dir=test; target=all; $(BUILD_ONE_CMD) build_tools: build_libs @dir=tools; target=all; $(BUILD_ONE_CMD) all_testapps: build_libs build_testapps build_testapps: @dir=crypto; target=testapps; $(BUILD_ONE_CMD) fips_premain_dso$(EXE_EXT): libcrypto.a [ -z "$(FIPSCANLIB)" ] || $(CC) $(CFLAG) -Iinclude \ -DFINGERPRINT_PREMAIN_DSO_LOAD -o [email protected] \ $(FIPSLIBDIR)fips_premain.c $(FIPSLIBDIR)fipscanister.o \ libcrypto.a $(EX_LIBS) libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT) @if [ "$(SHLIB_TARGET)" != "" ]; then \ if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \ FIPSLD_LIBCRYPTO=libcrypto.a ; \ FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \ export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ fi; \ $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \ (touch -c fips_premain_dso$(EXE_EXT) || :); \ else \ echo "There's no support for shared libraries on this platform" >&2; \ exit 1; \ fi libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a @if [ "$(SHLIB_TARGET)" != "" ]; then \ $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \ else \ echo "There's no support for shared libraries on this platform" >&2; \ exit 1; \ fi clean-shared: @set -e; for i in $(SHLIBDIRS); do \ if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \ tmp="$(SHARED_LIBS_LINK_EXTS)"; \ for j in $${tmp:-x}; do \ ( set -x; rm -f lib$$i$$j ); \ done; \ fi; \ ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \ if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \ ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \ fi; \ done link-shared: @ set -e; for i in $(SHLIBDIRS); do \ $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \ LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \ LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \ symlink.$(SHLIB_TARGET); \ libs="$$libs -l$$i"; \ done build-shared: do_$(SHLIB_TARGET) link-shared do_$(SHLIB_TARGET): @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \ if [ "$$i" = "ssl" -a -n "$(LIBKRB5)" ]; then \ libs="$(LIBKRB5) $$libs"; \ fi; \ $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \ LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \ LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \ LIBDEPS="$$libs $(EX_LIBS)" \ link_a.$(SHLIB_TARGET); \ libs="-l$$i $$libs"; \ done libcrypto.pc: Makefile @ ( echo 'prefix=$(INSTALLTOP)'; \ echo 'exec_prefix=$${prefix}'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ echo ''; \ echo 'Name: OpenSSL-libcrypto'; \ echo 'Description: OpenSSL cryptography library'; \ echo 'Version: '$(VERSION); \ echo 'Requires: '; \ echo 'Libs: -L$${libdir} -lcrypto'; \ echo 'Libs.private: $(EX_LIBS)'; \ echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc libssl.pc: Makefile @ ( echo 'prefix=$(INSTALLTOP)'; \ echo 'exec_prefix=$${prefix}'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ echo ''; \ echo 'Name: OpenSSL-libssl'; \ echo 'Description: Secure Sockets Layer and cryptography libraries'; \ echo 'Version: '$(VERSION); \ echo 'Requires.private: libcrypto'; \ echo 'Libs: -L$${libdir} -lssl'; \ echo 'Libs.private: $(EX_LIBS)'; \ echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc openssl.pc: Makefile @ ( echo 'prefix=$(INSTALLTOP)'; \ echo 'exec_prefix=$${prefix}'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ echo ''; \ echo 'Name: OpenSSL'; \ echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ echo 'Version: '$(VERSION); \ echo 'Requires: libssl libcrypto' ) > openssl.pc Makefile: Makefile.org Configure config @echo "Makefile is older than Makefile.org, Configure or config." @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please." @false libclean: rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib clean: libclean rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c @set -e; target=clean; $(RECURSIVE_BUILD_CMD) rm -f $(LIBS) rm -f openssl.pc libssl.pc libcrypto.pc rm -f speed.* .pure rm -f $(TARFILE) @set -e; for i in $(ONEDIRS) ;\ do \ rm -fr $$i/*; \ done makefile.one: files $(PERL) util/mk1mf.pl >makefile.one; \ sh util/do_ms.sh files: $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO @set -e; target=files; $(RECURSIVE_BUILD_CMD) links: @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER) @set -e; target=links; $(RECURSIVE_BUILD_CMD) gentests: @(cd test && echo "generating dummy tests (if needed)..." && \ $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate ); dclean: rm -rf *.bak include/openssl certs/.0 @set -e; target=dclean; $(RECURSIVE_BUILD_CMD) rehash: rehash.time rehash.time: certs apps @if [ -z "$(CROSS_COMPILE)" ]; then \ (OPENSSL="`pwd`/util/opensslwrap.sh"; \ [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \ OPENSSL_DEBUG_MEMORY=on; \ export OPENSSL OPENSSL_DEBUG_MEMORY; \ $(PERL) tools/c_rehash certs/demo) && \ touch rehash.time; \ else :; fi test: tests tests: rehash @(cd test && echo "testing..." && \ $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests ); OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a report: @$(PERL) util/selftest.pl update: errors stacks util/libeay.num util/ssleay.num TABLE @set -e; target=update; $(RECURSIVE_BUILD_CMD) depend: @set -e; target=depend; $(RECURSIVE_BUILD_CMD) lint: @set -e; target=lint; $(RECURSIVE_BUILD_CMD) tags: rm -f TAGS find . -name '[^.]*.[ch]' | xargs etags -a errors: $(PERL) util/ck_errf.pl -strict */*.c */*/*.c $(PERL) util/mkerr.pl -recurse -write (cd engines; $(MAKE) PERL=$(PERL) errors) stacks: $(PERL) util/mkstack.pl -write util/libeay.num:: $(PERL) util/mkdef.pl crypto update util/ssleay.num:: $(PERL) util/mkdef.pl ssl update TABLE: Configure (echo 'Output of `Configure TABLE'"':"; \ $(PERL) Configure TABLE) > TABLE # Build distribution tar-file. As the list of files returned by "find" is # pretty long, on several platforms a "too many arguments" error or similar # would occur. Therefore the list of files is temporarily stored into a file # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # tar does not support the --files-from option. tar: find . -type d -print | xargs chmod 755 find . -type f -print | xargs chmod a+r find . -type f -perm -0100 -print | xargs chmod a+x find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \ $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \ tardy --user_number=0 --user_name=openssl \ --group_number=0 --group_name=openssl \ --prefix=openssl-$(VERSION) - |\ gzip --best >../$(TARFILE).gz; \ rm -f ../$(TARFILE).list; \ ls -l ../$(TARFILE).gz tar-snap: @$(TAR) $(TARFLAGS) -cvf - \ `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\ tardy --user_number=0 --user_name=openssl \ --group_number=0 --group_name=openssl \ --prefix=openssl-$(VERSION) - > ../$(TARFILE);\ ls -l ../$(TARFILE) dist: $(PERL) Configure dist @$(MAKE) dist_pem_h @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar dist_pem_h: (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) install: all install_sw install_sw: @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \ $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \ $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ $(INSTALL_PREFIX)$(OPENSSLDIR)/private @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\ do \ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ done; @set -e; target=install; $(RECURSIVE_BUILD_CMD) @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ do \ if [ -f "$$i" ]; then \ ( echo installing $$i; \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \ fi; \ done; @set -e; if [ -n "$(SHARED_LIBS)" ]; then \ tmp="$(SHARED_LIBS)"; \ for i in $${tmp:-x}; \ do \ if [ -f "$$i" -o -f "$$i.a" ]; then \ ( echo installing $$i; \ if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \ c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \ else \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \ fi ); \ if expr $(PLATFORM) : 'mingw' > /dev/null; then \ ( case $$i in \ *crypto*) i=libeay32.dll;; \ *ssl*) i=ssleay32.dll;; \ esac; \ echo installing $$i; \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \ fi; \ fi; \ done; \ ( here="`pwd`"; \ cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \ $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \ if [ "$(INSTALLTOP)" != "/usr" ]; then \ echo 'OpenSSL shared libraries have been installed in:'; \ echo ' $(INSTALLTOP)'; \ echo ''; \ sed -e '1,/^$$/d' doc/openssl-shared.txt; \ fi; \ fi cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc install_html_docs: here="`pwd`"; \ filecase=; \ case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \ filecase=-i; \ esac; \ for subdir in apps crypto ssl; do \ mkdir -p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \ for i in doc/$$subdir/*.pod; do \ fn=`basename $$i .pod`; \ echo "installing html/$$fn.$(HTMLSUFFIX)"; \ cat $$i \ | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \ | pod2html --podroot=doc --htmlroot=.. --podpath=apps:crypto:ssl \ | sed -r 's/<!DOCTYPE.*//g' \ > $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \ $(PERL) util/extract-names.pl < $$i | \ grep -v $$filecase "^$$fn\$$" | \ (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \ while read n; do \ PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \ done); \ done; \ done install_docs: @$(PERL) $(TOP)/util/mkdir-p.pl \ $(INSTALL_PREFIX)$(MANDIR)/man1 \ $(INSTALL_PREFIX)$(MANDIR)/man3 \ $(INSTALL_PREFIX)$(MANDIR)/man5 \ $(INSTALL_PREFIX)$(MANDIR)/man7 @pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \ here="`pwd`"; \ filecase=; \ case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \ filecase=-i; \ esac; \ set -e; for i in doc/apps/*.pod; do \ fn=`basename $$i .pod`; \ sec=`$(PERL) util/extract-section.pl 1 < $$i`; \ echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ (cd `$(PERL) util/dirname.pl $$i`; \ sh -c "$$pod2man \ --section=$$sec --center=OpenSSL \ --release=$(VERSION) `basename $$i`") \ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ $(PERL) util/extract-names.pl < $$i | \ (grep -v $$filecase "^$$fn\$$"; true) | \ (grep -v "[ ]"; true) | \ (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ while read n; do \ PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ done); \ done; \ set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \ fn=`basename $$i .pod`; \ sec=`$(PERL) util/extract-section.pl 3 < $$i`; \ echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ (cd `$(PERL) util/dirname.pl $$i`; \ sh -c "$$pod2man \ --section=$$sec --center=OpenSSL \ --release=$(VERSION) `basename $$i`") \ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ $(PERL) util/extract-names.pl < $$i | \ (grep -v $$filecase "^$$fn\$$"; true) | \ (grep -v "[ ]"; true) | \ (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ while read n; do \ PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ done); \ done # DO NOT DELETE THIS LINE -- make depend depends on it.

開始構建
[[email protected] GmSSL]$ make depend
[[email protected] GmSSL]$ make

檢視構建好的動態庫
[[email protected] GmSSL]$  ls lib* -l
-rw-rw-r--. 1 yeqiang yeqiang 4107704 Feb  7 10:21 libcrypto.a
-rw-rw-r--. 1 yeqiang yeqiang     327 Feb  7 10:21 libcrypto.pc
lrwxrwxrwx. 1 yeqiang yeqiang      18 Feb  7 10:21 libcrypto.so -> libcrypto.so.1.0.0
-rwxrwxr-x. 1 yeqiang yeqiang 2263312 Feb  7 10:21 libcrypto.so.1.0.0
-rw-rw-r--. 1 yeqiang yeqiang  744408 Feb  7 10:21 libssl.a
-rw-rw-r--. 1 yeqiang yeqiang     357 Feb  7 10:21 libssl.pc
lrwxrwxrwx. 1 yeqiang yeqiang      15 Feb  7 10:21 libssl.so -> libssl.so.1.0.0
-rwxrwxr-x. 1 yeqiang yeqiang  476848 Feb  7 10:21 libssl.so.1.0.0
[[email protected] GmSSL]$ file libcrypto.so.1.0.0 
libcrypto.so.1.0.0: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, not stripped
[[email protected] GmSSL]$ file libssl.so.1.0.0 
libssl.so.1.0.0: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, not stripped


相關推薦

GmSSL Android NDK編譯 版本95c0dba

下載原始碼並切換到版本95c0dba [[email protected] tmp]$ git clone https://github.com/guanzhi/GmSSL.git Cloning into 'GmSSL'... remote: Counting

自己收集的資料 僅供學習使用——————Android編譯經驗證

在學習Android開發的過程你,你往往會去借鑑別人的應用是怎麼開發的,那些漂亮的動畫和精緻的佈局可能會讓你愛不釋手,作為一個開發者,你可能會很想知道這些效果介面是怎麼去實現的,這時,你便可以對改應用的APK進行反編譯檢視。下面是我參考了一些文章後簡單的教程詳解。 (注

Android NDK學習編譯腳本語法Android.mk和Application.mk

GC make files 文件的 包括 一次 opengl aries 基本語法 一、Android.mk Android.mk分為一下幾部分: LOCAL_PATH:= $(call my-dir), 返回當前文件在系統中的路徑,Android.mk文件開始時必須定義

Android NDK編譯Openssl-1.1.0f靜態庫

https://blog.csdn.net/ljttianqin/article/details/72991869 0 前言 按照原始碼C:\openssl-1.1.0f下的INSTALL檔案中的編譯指導,在Windows中用Cygwin模擬Linux環境順利編譯出libcrypt.a和libs

protobuf使用android ndk 編譯 protobuf-3.6.x windows

首先建議大家看好版本,環境,有可能因為小的變化會造成編譯有問題:  我的環境是 PC  OS: windows10(沒辦法暫時沒機器); NDK: android-ndk-r17b-windows-x86_64 proto : syntax = "proto

NET-SNMP Android上的編譯基於NDK10

之前記錄的基於NDK16的SNMP Android上的編譯報錯很多,基本無法正常編譯。後續在排查問題,發現NDK版本差異一起的這些問題,具體我們來看: 在使用NDK10的時候,我們修改指令碼setenv.sh: #! /bash/sh ***********************

Android NDK開發CMake構建工具使用

  一、Android studio中需要的外掛:     CMake     LLDB     NDK   二、專案配置      ①build.gardle的配置  :多了兩個externalNativeBuild :def

android原始碼編譯ubuntu16.04 64位

編譯步驟 1. 原始碼下載; 2. 構建編譯環境; 3.編譯原始碼; 4.執行. 編譯之前首先要下載和安裝repo和gitt工具。 repo和git Google採用Git對AOSP專案進行多倉庫管理. 為了方便需要,對git語句進行了封裝,也就形成了repo.

實現PHP伺服器+Android客戶端Retrofit+RxJava第五天學一學ndk開發吧

前兩天發現一本相當可以的書Java 效能權威指南,粗略的看了兩天,對於我這種還在去中級的路上的人,看著的確是挺累的,所以也就歇了幾天沒有寫部落格了。看了那麼高深的東西還是要繼續回來鞏固一下實戰水平,所以今天繼續來講我的這個應用的實現過程,在上篇文章實現PHP伺服

Android原始碼編譯系統原始碼目錄

Android 8.0之後原始碼目錄有所改變 Android平臺四層架構對應原始碼中的目錄: 第一層:應用程式層(applications)對應根目錄下packages/apps 第二層:應用程式框架層(application framework)對應根目錄下的f

Android編譯操作簡單、方便可用

轉自:http://blog.csdn.net/a1010012805/article/details/46827517 在Android開發的過程中,有時候難免會想參考其他人的程式碼、思路,或者佈局。這時候就需要反編譯其他人的apk了。網上好多的都是要下載這個工具,

Android NDK開發環境搭建

關於ndk的開發流程,對於Windows環境下NDK的開發,如果使用的NDK是r7之前的版本,必須要安裝Cygwin才能使用NDK。而在NDKr7開始,Google的Windows版的NDK提供了一個ndk-build.cmd的指令碼,這樣,就可以直接利用這個

最新gulp 整合打包檔案壓縮編譯版本

1.原理:(以生產環境為例) 監聽dest下靜態檔案,自動編譯static目錄,進而修改JSP包中引入路徑(無需清理瀏覽器快取,只需重新整理頁面)。 2.工具及配置 3.編譯內容 css檔案

android編譯dex 和 odex,非腦殘轉帖,絕對可靠

Android 反編譯 反編譯odex檔案(例如framework.odex),若是反編譯dex,直接第4步 1.由於反編譯odex的工具在D:\Develop tools\android反編譯工具\odex中,因此為了執行命令方便一點在odex資料夾裡面,將syste

Android NDK 開發AndroidStudio 2.2 NDK的開發環境搭建

前言 之前一直在用Eclipse 做開發,直到今年年初才將專案遷移到Google 推薦的AndroidStudio上面,畢竟這是一個趨勢,可誰知道事情根本沒有我想的那麼簡單,這期間遇到了N多坑,我想這些坑可能大家也有可能遇到,不在這裡詳細敘述。最終一個個問題的

使用 Android Studio 寫出第一個 NDK 程式超詳細

    NDK(Native Development Kit),是用於在 Android 應用中巢狀原生代碼的工具集,現在 Android 開發最常用的工具就是 Android Studio 了,筆者也是剛剛接觸 NDK 開發,用了一天的時間,踩了很多坑,最終跑通了自己的第一

FreeType2.9 NDK編譯FFmpeg編譯

上篇文章介紹完了X264編譯,這篇文章開始記錄FreeType編譯,只有FFmpeg配置了FreeType字型庫,--enable-libfreetype \才能開啟,drawtext才能在視訊裡面寫水印文字。fontconfig的編譯下篇再寫,一邊寫一邊測試,新手進度很慢。

Android NDK 開發JNI 傳遞引數和返回值

前言 我們在使用 JNI 時最常問到的是 JAVA 和 C/C++之間如何傳遞資料,以及資料型別之間如何 互相對映。我們從整數等基本型別和陣列、字串等普通的物件型別開始講述。至於如何傳遞任意物件,將在後面會更新。 正文 繼JNI簡介及呼叫流程這

Pro Android學習筆記一三七:Home Screen Widgets3:配置Activity

map onclick widgets info xtra ces extends height appwidget 文章轉載僅僅能用於非商業性質,且不能帶有虛擬貨幣、積分、註冊等附加條件。轉載須註明出處http://blog.csdn.net/flowingfly

項目版本管理版本

代碼 測試 做到 友情 device 努力 工作 xxx 系統 現在在酷派負責合入廣升的升級代碼,是的就是在它們今年賣的C1設備上上合入。 打算把雲卡服務集成到裏面去,也是為了以後公司的手機項目(我肯定不在這個公司了,呵呵 兩年工作經驗,應屆生的工資都比你高。我是考慮到公司