[工作积累] android 中添加libssl和libcurl

时间:2023-01-24 18:27:17

1. libssl

https://github.com/guardianproject/openssl-android

然后执行ndk-build

2.libcurl

源代码组织结构, 下面的makefile要依赖这个结构. 因为curl依赖openssl, 所以需要先编译openssl:

src/openssl-android

src/curl-android

下载curl的代码, 并放入src/curl-android/jni 下.

本来想用cygwin来运行configure, 生成android的配置然后上传到代码库

./configure --host=arm-linux-androideabi --with-ssl=../openssl-android/ssl

但是直接修改配置文件的话也是可以的:

手动填写curl_config.h: 激活libz(这个是可选的), 和ssl

/* lib/curl_config.h.  Generated from curl_config.h.in by configure.  */
/* lib/curl_config.h.in. Generated from configure.ac by autoheader. */ /* when building libcurl itself */
/* #undef BUILDING_LIBCURL */ /* Location of default ca bundle */
/* #undef CURL_CA_BUNDLE */ /* Location of default ca path */
/* #undef CURL_CA_PATH */ /* to disable cookies support */
/* #undef CURL_DISABLE_COOKIES */ /* to disable cryptographic authentication */
/* #undef CURL_DISABLE_CRYPTO_AUTH */ /* to disable DICT */
/* #undef CURL_DISABLE_DICT */ /* to disable FILE */
/* #undef CURL_DISABLE_FILE */ /* to disable FTP */
#define CURL_DISABLE_FTP 1 /* to disable HTTP */
/* #undef CURL_DISABLE_HTTP */ /* to disable IMAP */
#define CURL_DISABLE_IMAP 1 /* to disable LDAP */
#define CURL_DISABLE_LDAP 1 /* to disable LDAPS */
#define CURL_DISABLE_LDAPS 1 /* to disable POP3 */
#define CURL_DISABLE_POP3 1 /* to disable proxies */
/* #undef CURL_DISABLE_PROXY */ /* to disable RTSP */
#define CURL_DISABLE_RTSP 1 /* to disable SMTP */
#define CURL_DISABLE_SMTP 1 /* to disable TELNET */
#define CURL_DISABLE_TELNET 1 /* to disable TFTP */
#define CURL_DISABLE_TFTP 1 /* to disable verbose strings */
/* #undef CURL_DISABLE_VERBOSE_STRINGS */ /* to make a symbol visible */
/* #undef CURL_EXTERN_SYMBOL */ /* to enable hidden symbols */
/* #undef CURL_HIDDEN_SYMBOLS */ /* W$ LDAP with non-W$ compiler */
/* #undef CURL_LDAP_HYBRID */ /* Use W$ LDAP implementation */
/* #undef CURL_LDAP_WIN */ /* when not building a shared library */
/* #undef CURL_STATICLIB */ /* your Entropy Gathering Daemon socket pathname */
/* #undef EGD_SOCKET */ /* Define if you want to enable IPv6 support */
/* #undef ENABLE_IPV6 */ /* Define to the type qualifier of arg 1 for getnameinfo. */
#define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */
#define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */
#define GETNAMEINFO_TYPE_ARG46 size_t /* Define to the type of arg 7 for getnameinfo. */
#define GETNAMEINFO_TYPE_ARG7 int /* Specifies the number of arguments to getservbyport_r */
/* #undef GETSERVBYPORT_R_ARGS */ /* Specifies the size of the buffer to pass to getservbyport_r */
/* #undef GETSERVBYPORT_R_BUFSIZE */ /* Define to 1 if you have the alarm function. */
#define HAVE_ALARM 1 /* Define to 1 if you have the <alloca.h> header file. */
#define HAVE_ALLOCA_H 1 /* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the <arpa/tftp.h> header file. */
/* #undef HAVE_ARPA_TFTP_H */ /* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1 /* Define to 1 if you have the basename function. */
#define HAVE_BASENAME 1 /* Define to 1 if bool is an available type. */
#define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */
#define HAVE_CLOCK_GETTIME_MONOTONIC 1 /* Define to 1 if you have the closesocket function. */
/* #undef HAVE_CLOSESOCKET */ /* Define to 1 if you have the CloseSocket camel case function. */
/* #undef HAVE_CLOSESOCKET_CAMEL */ /* Define to 1 if you have the connect function. */
#define HAVE_CONNECT 1 /* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
/* #undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA */ /* Define to 1 if you have the <crypto.h> header file. */
/* #undef HAVE_CRYPTO_H */ /* Define to 1 if you have the <des.h> header file. */
/* #undef HAVE_DES_H */ /* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1 /* Define to 1 if you have the `ENGINE_cleanup' function. */
/* #undef HAVE_ENGINE_CLEANUP */ /* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
/* #undef HAVE_ENGINE_LOAD_BUILTIN_ENGINES */ /* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1 /* Define to 1 if you have the <err.h> header file. */
/* #undef HAVE_ERR_H */ /* Define to 1 if you have the fcntl function. */
#define HAVE_FCNTL 1 /* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */
#define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the fdopen function. */
#define HAVE_FDOPEN 1 /* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1 /* Define to 1 if you have the freeaddrinfo function. */
#define HAVE_FREEADDRINFO 1 /* Define to 1 if you have the freeifaddrs function. */
/* #undef HAVE_FREEIFADDRS */ /* Define to 1 if you have the ftruncate function. */
#define HAVE_FTRUNCATE 1 /* Define to 1 if you have a working getaddrinfo function. */
#define HAVE_GETADDRINFO 1 /* Define to 1 if the getaddrinfo function is threadsafe. */
#define HAVE_GETADDRINFO_THREADSAFE 1 /* Define to 1 if you have the `geteuid' function. */
#define HAVE_GETEUID 1 /* Define to 1 if you have the gethostbyaddr function. */
#define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyaddr_r function. */
/* #undef HAVE_GETHOSTBYADDR_R */ /* gethostbyaddr_r() takes 5 args */
/* #undef HAVE_GETHOSTBYADDR_R_5 */ /* gethostbyaddr_r() takes 7 args */
/* #undef HAVE_GETHOSTBYADDR_R_7 */ /* gethostbyaddr_r() takes 8 args */
/* #undef HAVE_GETHOSTBYADDR_R_8 */ /* Define to 1 if you have the gethostbyname function. */
#define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the gethostbyname_r function. */
#define HAVE_GETHOSTBYNAME_R 1 /* gethostbyname_r() takes 3 args */
/* #undef HAVE_GETHOSTBYNAME_R_3 */ /* gethostbyname_r() takes 5 args */
/* #undef HAVE_GETHOSTBYNAME_R_5 */ /* gethostbyname_r() takes 6 args */
#define HAVE_GETHOSTBYNAME_R_6 1 /* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1 /* Define to 1 if you have a working getifaddrs function. */
/* #undef HAVE_GETIFADDRS */ /* Define to 1 if you have the getnameinfo function. */
#define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the `getpass_r' function. */
/* #undef HAVE_GETPASS_R */ /* Define to 1 if you have the `getppid' function. */
#define HAVE_GETPPID 1 /* Define to 1 if you have the `getprotobyname' function. */
#define HAVE_GETPROTOBYNAME 1 /* Define to 1 if you have the `getpwuid' function. */
#define HAVE_GETPWUID 1 /* Define to 1 if you have the `getrlimit' function. */
#define HAVE_GETRLIMIT 1 /* Define to 1 if you have the getservbyport_r function. */
/* #undef HAVE_GETSERVBYPORT_R */ /* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have a working glibc-style strerror_r function. */
/* #undef HAVE_GLIBC_STRERROR_R */ /* Define to 1 if you have a working gmtime_r function. */
#define HAVE_GMTIME_R 1 /* if you have the gssapi libraries */
/* #undef HAVE_GSSAPI */ /* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ /* Define to 1 if you have the <gssapi/gssapi.h> header file. */
/* #undef HAVE_GSSAPI_GSSAPI_H */ /* Define to 1 if you have the <gssapi/gssapi_krb5.h> header file. */
/* #undef HAVE_GSSAPI_GSSAPI_KRB5_H */ /* if you have the GNU gssapi libraries */
/* #undef HAVE_GSSGNU */ /* if you have the Heimdal gssapi libraries */
/* #undef HAVE_GSSHEIMDAL */ /* if you have the MIT gssapi libraries */
/* #undef HAVE_GSSMIT */ /* Define to 1 if you have the `idna_strerror' function. */
/* #undef HAVE_IDNA_STRERROR */ /* Define to 1 if you have the `idn_free' function. */
/* #undef HAVE_IDN_FREE */ /* Define to 1 if you have the <idn-free.h> header file. */
/* #undef HAVE_IDN_FREE_H */ /* Define to 1 if you have the <ifaddrs.h> header file. */
/* #undef HAVE_IFADDRS_H */ /* Define to 1 if you have the `inet_addr' function. */
#define HAVE_INET_ADDR 1 /* Define to 1 if you have the inet_ntoa_r function. */
/* #undef HAVE_INET_NTOA_R */ /* inet_ntoa_r() takes 2 args */
/* #undef HAVE_INET_NTOA_R_2 */ /* inet_ntoa_r() takes 3 args */
/* #undef HAVE_INET_NTOA_R_3 */ /* Define to 1 if you have a IPv6 capable working inet_ntop function. */
#define HAVE_INET_NTOP 1 /* Define to 1 if you have a IPv6 capable working inet_pton function. */
#define HAVE_INET_PTON 1 /* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */
#define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */
/* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */
/* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
*/
/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */
/* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */
#define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
#define HAVE_IOCTL_SIOCGIFADDR 1 /* Define to 1 if you have the <io.h> header file. */
/* #undef HAVE_IO_H */ /* if you have the Kerberos4 libraries (including -ldes) */
/* #undef HAVE_KRB4 */ /* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */
/* #undef HAVE_KRB_GET_OUR_IP_FOR_REALM */ /* Define to 1 if you have the <krb.h> header file. */
/* #undef HAVE_KRB_H */ /* Define to 1 if you have the lber.h header file. */
/* #undef HAVE_LBER_H */ /* Define to 1 if you have the ldapssl.h header file. */
/* #undef HAVE_LDAPSSL_H */ /* Define to 1 if you have the ldap.h header file. */
/* #undef HAVE_LDAP_H */ /* Use LDAPS implementation */
/* #undef HAVE_LDAP_SSL */ /* Define to 1 if you have the ldap_ssl.h header file. */
/* #undef HAVE_LDAP_SSL_H */ /* Define to 1 if you have the `ldap_url_parse' function. */
/* #undef HAVE_LDAP_URL_PARSE */ /* Define to 1 if you have the <libgen.h> header file. */
#define HAVE_LIBGEN_H 1 /* Define to 1 if you have the `idn' library (-lidn). */
/* #undef HAVE_LIBIDN */ /* Define to 1 if you have the `resolv' library (-lresolv). */
/* #undef HAVE_LIBRESOLV */ /* Define to 1 if you have the `resolve' library (-lresolve). */
/* #undef HAVE_LIBRESOLVE */ /* Define to 1 if you have the `ssh2' library (-lssh2). */
/* #undef HAVE_LIBSSH2 */ /* Define to 1 if you have the <libssh2.h> header file. */
/* #undef HAVE_LIBSSH2_H */ /* Define to 1 if you have the `libssh2_version' function. */
/* #undef HAVE_LIBSSH2_VERSION */ /* Define to 1 if you have the `ssl' library (-lssl). */
/* #undef HAVE_LIBSSL */
#define HAVE_LIBSSL 1 /* if zlib is available */
/* #undef HAVE_LIBZ */
#define HAVE_LIBZ 1 /* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1 /* if your compiler supports LL */
#define HAVE_LL 1 /* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1 /* Define to 1 if you have a working localtime_r function. */
#define HAVE_LOCALTIME_R 1 /* Define to 1 if the compiler supports the 'long long' data type. */
#define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */
#define HAVE_MALLOC_H 1 /* Define to 1 if you have the memory.h header file. */
#define HAVE_MEMORY_H 1 /* Define to 1 if you have the memrchr function or macro. */
#define HAVE_MEMRCHR 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */
#define HAVE_MSG_NOSIGNAL 1 /* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1 /* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the <netinet/tcp.h> header file. */
#define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the <net/if.h> header file. */
#define HAVE_NET_IF_H 1 /* Define to 1 if NI_WITHSCOPEID exists and works. */
/* #undef HAVE_NI_WITHSCOPEID */ /* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE
*/
/* #undef HAVE_OLD_GSSMIT */ /* Define to 1 if you have the <openssl/crypto.h> header file. */
/* #undef HAVE_OPENSSL_CRYPTO_H */
#define HAVE_OPENSSL_CRYPTO_H 1 /* Define to 1 if you have the <openssl/engine.h> header file. */
/* #undef HAVE_OPENSSL_ENGINE_H */ /* Define to 1 if you have the <openssl/err.h> header file. */
/* #undef HAVE_OPENSSL_ERR_H */
#define HAVE_OPENSSL_ERR_H 1 /* Define to 1 if you have the <openssl/pem.h> header file. */
/* #undef HAVE_OPENSSL_PEM_H */
#define HAVE_OPENSSL_PEM_H 1 /* Define to 1 if you have the <openssl/pkcs12.h> header file. */
/* #undef HAVE_OPENSSL_PKCS12_H */
#define HAVE_OPENSSL_PKCS12_H 1 /* Define to 1 if you have the <openssl/rsa.h> header file. */
/* #undef HAVE_OPENSSL_RSA_H */
#define HAVE_OPENSSL_RSA_H 1 /* Define to 1 if you have the <openssl/ssl.h> header file. */
/* #undef HAVE_OPENSSL_SSL_H */
#define HAVE_OPENSSL_SSL_H 1 /* Define to 1 if you have the <openssl/x509.h> header file. */
/* #undef HAVE_OPENSSL_X509_H */
#define HAVE_OPENSSL_X509_H 1 /* Define to 1 if you have the <pem.h> header file. */
/* #undef HAVE_PEM_H */ /* Define to 1 if you have the `perror' function. */
#define HAVE_PERROR 1 /* Define to 1 if you have the `pipe' function. */
#define HAVE_PIPE 1 /* if you have the function PK11_CreateGenericObject */
/* #undef HAVE_PK11_CREATEGENERICOBJECT */ /* Define to 1 if you have a working poll function. */
#define HAVE_POLL 1 /* If you have a fine poll */
#define HAVE_POLL_FINE 1 /* Define to 1 if you have the <poll.h> header file. */
#define HAVE_POLL_H 1 /* Define to 1 if you have a working POSIX-style strerror_r function. */
#define HAVE_POSIX_STRERROR_R 1 /* Define to 1 if you have the <pwd.h> header file. */
#define HAVE_PWD_H 1 /* Define to 1 if you have the `RAND_egd' function. */
/* #undef HAVE_RAND_EGD */ /* Define to 1 if you have the `RAND_screen' function. */
/* #undef HAVE_RAND_SCREEN */ /* Define to 1 if you have the `RAND_status' function. */
/* #undef HAVE_RAND_STATUS */ /* Define to 1 if you have the recv function. */
#define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */
#define HAVE_RECVFROM 1 /* Define to 1 if you have the <rsa.h> header file. */
/* #undef HAVE_RSA_H */ /* Define to 1 if you have the select function. */
#define HAVE_SELECT 1 /* Define to 1 if you have the send function. */
#define HAVE_SEND 1 /* Define to 1 if you have the <setjmp.h> header file. */
#define HAVE_SETJMP_H 1 /* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1 /* Define to 1 if you have the `setmode' function. */
/* #undef HAVE_SETMODE */ /* Define to 1 if you have the `setrlimit' function. */
#define HAVE_SETRLIMIT 1 /* Define to 1 if you have the setsockopt function. */
#define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the <sgtty.h> header file. */
#define HAVE_SGTTY_H 1 /* Define to 1 if you have the sigaction function. */
#define HAVE_SIGACTION 1 /* Define to 1 if you have the siginterrupt function. */
#define HAVE_SIGINTERRUPT 1 /* Define to 1 if you have the signal function. */
/* #undef HAVE_SIGNAL */ /* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1 /* Define to 1 if you have the sigsetjmp function or macro. */
#define HAVE_SIGSETJMP 1 /* Define to 1 if sig_atomic_t is an available typedef. */
#define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */
/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */
/* #undef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID */ /* Define to 1 if you have the socket function. */
#define HAVE_SOCKET 1 /* Define to 1 if you have the <socket.h> header file. */
/* #undef HAVE_SOCKET_H */ /* Define this if you have the SPNEGO library fbopenssl */
/* #undef HAVE_SPNEGO */ /* Define to 1 if you have the `SSL_get_shutdown' function. */
/* #undef HAVE_SSL_GET_SHUTDOWN */ /* Define to 1 if you have the <ssl.h> header file. */
/* #undef HAVE_SSL_H */ /* Define to 1 if you have the <stdbool.h> header file. */
#define HAVE_STDBOOL_H 1 /* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1 /* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1 /* Define to 1 if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1 /* Define to 1 if you have the strcasestr function. */
#define HAVE_STRCASESTR 1 /* Define to 1 if you have the strcmpi function. */
/* #undef HAVE_STRCMPI */ /* Define to 1 if you have the strdup function. */
#define HAVE_STRDUP 1 /* Define to 1 if you have the strerror_r function. */
#define HAVE_STRERROR_R 1 /* Define to 1 if you have the stricmp function. */
/* #undef HAVE_STRICMP */ /* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1 /* Define to 1 if you have the strlcat function. */
#define HAVE_STRLCAT 1 /* Define to 1 if you have the `strlcpy' function. */
/* #undef HAVE_STRLCPY */ /* Define to 1 if you have the strncasecmp function. */
#define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */
/* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */
/* #undef HAVE_STRNICMP */ /* Define to 1 if you have the <stropts.h> header file. */
/* #undef HAVE_STROPTS_H */ /* Define to 1 if you have the strstr function. */
#define HAVE_STRSTR 1 /* Define to 1 if you have the strtok_r function. */
#define HAVE_STRTOK_R 1 /* Define to 1 if you have the strtoll function. */
#define HAVE_STRTOLL 1 /* if struct sockaddr_storage is defined */
#define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */
#define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the <sys/filio.h> header file. */
/* #undef HAVE_SYS_FILIO_H */ /* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the <sys/poll.h> header file. */
#define HAVE_SYS_POLL_H 1 /* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1 /* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the <sys/sockio.h> header file. */
/* #undef HAVE_SYS_SOCKIO_H */ /* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <sys/uio.h> header file. */
#define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the <sys/un.h> header file. */
#define HAVE_SYS_UN_H 1 /* Define to 1 if you have the <sys/utime.h> header file. */
#define HAVE_SYS_UTIME_H 1 /* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1 /* Define to 1 if you have the <termio.h> header file. */
/* #undef HAVE_TERMIO_H */ /* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1 /* Define to 1 if you have the <tld.h> header file. */
/* #undef HAVE_TLD_H */ /* Define to 1 if you have the `tld_strerror' function. */
/* #undef HAVE_TLD_STRERROR */ /* Define to 1 if you have the `uname' function. */
#define HAVE_UNAME 1 /* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1 /* Define to 1 if you have the `utime' function. */
#define HAVE_UTIME 1 /* Define to 1 if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1 /* Define to 1 if compiler supports C99 variadic macro style. */
#define HAVE_VARIADIC_MACROS_C99 1 /* Define to 1 if compiler supports old gcc variadic macro style. */
#define HAVE_VARIADIC_MACROS_GCC 1 /* Define to 1 if you have the winber.h header file. */
/* #undef HAVE_WINBER_H */ /* Define to 1 if you have the windows.h header file. */
/* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winldap.h header file. */
/* #undef HAVE_WINLDAP_H */ /* Define to 1 if you have the winsock2.h header file. */
/* #undef HAVE_WINSOCK2_H */ /* Define to 1 if you have the winsock.h header file. */
/* #undef HAVE_WINSOCK_H */ /* Define this symbol if your OS supports changing the contents of argv */
/* #undef HAVE_WRITABLE_ARGV */ /* Define to 1 if you have the writev function. */
#define HAVE_WRITEV 1 /* Define to 1 if you have the ws2tcpip.h header file. */
/* #undef HAVE_WS2TCPIP_H */ /* Define to 1 if you have the <x509.h> header file. */
/* #undef HAVE_X509_H */ /* if you have the zlib.h header file */
/* #undef HAVE_ZLIB_H */
#define HAVE_ZLIB_H 1 /* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/" /* Define to 1 if you are building a native Windows target. */
/* #undef NATIVE_WINDOWS */ /* Define to 1 if you need the lber.h header file even with ldap.h */
/* #undef NEED_LBER_H */ /* Define to 1 if you need the malloc.h header file even with stdlib.h */
/* #undef NEED_MALLOC_H */ /* Define to 1 if you need the memory.h header file even with stdlib.h */
/* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
/* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */
/* #undef NEED_THREAD_SAFE */ /* cpu-machine-OS */
#define OS "arm-linux-androideabi" /* Name of package */
#define PACKAGE "curl" /* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/" /* Define to the full name of this package. */
#define PACKAGE_NAME "curl" /* Define to the full name and version of this package. */
#define PACKAGE_STRING "curl -" /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "curl" /* Define to the home page for this package. */
/* #undef PACKAGE_URL */ /* Define to the version of this package. */
#define PACKAGE_VERSION "-" /* a suitable file to read random data from */
/* #undef RANDOM_FILE */ /* Define to the type of arg 1 for recvfrom. */
/* #undef RECVFROM_TYPE_ARG1 */ /* Define to the type pointed by arg 2 for recvfrom. */
/* #undef RECVFROM_TYPE_ARG2 */ /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
/* #undef RECVFROM_TYPE_ARG2_IS_VOID */ /* Define to the type of arg 3 for recvfrom. */
/* #undef RECVFROM_TYPE_ARG3 */ /* Define to the type of arg 4 for recvfrom. */
/* #undef RECVFROM_TYPE_ARG4 */ /* Define to the type pointed by arg 5 for recvfrom. */
/* #undef RECVFROM_TYPE_ARG5 */ /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
/* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */
/* #undef RECVFROM_TYPE_ARG6 */ /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
/* #undef RECVFROM_TYPE_ARG6_IS_VOID */ /* Define to the function return type for recvfrom. */
/* #undef RECVFROM_TYPE_RETV */ /* Define to the type of arg 1 for recv. */
#define RECV_TYPE_ARG1 int /* Define to the type of arg 2 for recv. */
#define RECV_TYPE_ARG2 void * /* Define to the type of arg 3 for recv. */
#define RECV_TYPE_ARG3 size_t /* Define to the type of arg 4 for recv. */
#define RECV_TYPE_ARG4 unsigned int /* Define to the function return type for recv. */
#define RECV_TYPE_RETV ssize_t /* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void /* Define to the type qualifier of arg 5 for select. */
#define SELECT_QUAL_ARG5 /* Define to the type of arg 1 for select. */
#define SELECT_TYPE_ARG1 int /* Define to the type of args 2, 3 and 4 for select. */
#define SELECT_TYPE_ARG234 fd_set * /* Define to the type of arg 5 for select. */
#define SELECT_TYPE_ARG5 struct timeval * /* Define to the function return type for select. */
#define SELECT_TYPE_RETV int /* Define to the type qualifier of arg 2 for send. */
#define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */
#define SEND_TYPE_ARG1 int /* Define to the type of arg 2 for send. */
#define SEND_TYPE_ARG2 void * /* Define to the type of arg 3 for send. */
#define SEND_TYPE_ARG3 size_t /* Define to the type of arg 4 for send. */
#define SEND_TYPE_ARG4 unsigned int /* Define to the function return type for send. */
#define SEND_TYPE_RETV ssize_t /* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4 /* The size of `off_t', as computed by sizeof. */
#define SIZEOF_OFF_T 4 /* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 4 /* The size of `time_t', as computed by sizeof. */
#define SIZEOF_TIME_T 4 /* The size of `void*', as computed by sizeof. */
#define SIZEOF_VOIDP 4 /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 /* Define to the type of arg 3 for strerror_r. */
#define STRERROR_R_TYPE_ARG3 size_t /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1 /* Define to enable c-ares support */
/* #undef USE_ARES */ /* Define to disable non-blocking sockets. */
/* #undef USE_BLOCKING_SOCKETS */ /* if GnuTLS is enabled */
/* #undef USE_GNUTLS */ /* if libSSH2 is in use */
/* #undef USE_LIBSSH2 */ /* If you want to build curl with the built-in manual */
/* #undef USE_MANUAL */ /* if NSS is enabled */
/* #undef USE_NSS */ /* if OpenSSL is in use */
/* #undef USE_OPENSSL */
#define USE_OPENSSL 1 /* if SSL is enabled */
/* #undef USE_SSLEAY */
#define USE_SSLEAY 1 /* Define to 1 if you are building a Windows target without large file
support. */
/* #undef USE_WIN32_LARGE_FILES */ /* to enable SSPI support */
/* #undef USE_WINDOWS_SSPI */ /* Define to 1 if using yaSSL in OpenSSL compatibility mode. */
/* #undef USE_YASSLEMUL */ /* Version number of package */
#define VERSION "7.43.0" /* Define to avoid automatic inclusion of winsock.h */
/* #undef WIN32_LEAN_AND_MEAN */ /* Define to 1 if OS is AIX. */
#ifndef _ALL_SOURCE
/* # undef _ALL_SOURCE */
#endif /* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */ /* Type to use in place of in_addr_t when system does not provide it. */
/* #undef in_addr_t */ /* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif /* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */ /* the signed version of size_t */
/* #undef ssize_t */

src/curl-android/jni下创建application.mk

NDK_TOOLCHAIN_VERSION=4.8
LOCAL_PATH := $(call my-dir)
APP_ABI := armeabi-v7a
APP_BUILD_SCRIPT := $(LOCAL_PATH)/Android.mk

src/curl-android/jni下创建Android.mk, 引用libssl和libcrypto, 以及系统自带的libz:

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := ssl
LOCAL_SRC_FILES := ../../openssl-android/libs/$(TARGET_ARCH_ABI)/libssl.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../openssl-android/include
include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS)
LOCAL_MODULE := crypto
LOCAL_SRC_FILES := ../../openssl-android/libs/$(TARGET_ARCH_ABI)/libcrypto.so
include $(PREBUILT_SHARED_LIBRARY) CFLAGS := -Wpointer-arith -Wwrite-strings -Wunused -Winline \
-Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-long-long \
-Wfloat-equal -Wno-multichar -Wsign-compare -Wno-format-nonliteral \
-Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement \
-Wno-system-headers -DHAVE_CONFIG_H -Wno-nested-externs include $(CLEAR_VARS)
include $(LOCAL_PATH)/curl/lib/Makefile.inc
LOCAL_SRC_FILES := $(addprefix curl/lib/,$(CSOURCES))
LOCAL_LDLIBS += -lz
LOCAL_SHARED_LIBRARIES += ssl crypto LOCAL_CFLAGS += $(CFLAGS)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/curl/include/ $(LOCAL_PATH)/curl/lib LOCAL_COPY_HEADERS_TO := libcurl
LOCAL_COPY_HEADERS := $(addprefix curl/include/curl/,$(HHEADERS)) LOCAL_MODULE:= libcurl include $(BUILD_SHARED_LIBRARY)

执行ndk-build

注意: libz是系统自带的库, 所以-lz可以, 但是openssl直接在LD里面链接依赖, -L../openssl-android/libs/$(TARGET_ARCH_ABI) -lssl 或者-l:../openssl-android/libs/$(TARGET_ARCH_ABI)/libssl.so 都是不行的, 有警告, 然后链接失败找不到库, 必须使用PREBUILT_SHARED_LIBRARY才行(难道是路径填错了...?). 因为没怎么用过ndkbuild所以不知道.我们公司用的是自己的build system,只集成了ndk的编译工具.这两个库可以用ndk-build预先生成.

这里有一个参考 :

http://piggyq.com/pen/compile-libcurl-and-openssl-on-android-using-ndk.html

iOS上的key需要安装到应用的keychain:

http://curl.haxx.se/libcurl/c/CURLOPT_SSLKEY.html

(iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport. Secure Transport expects the private key to be already present in the keychain or PKCS#12 file containing the certificate.


更新(09/21/2015)

最近的APK被Google Play拒绝, 原因是OpenSSL版本太低, 有安全隐患。

App update rejected

Your app submission has been rejected for using a version of OpenSSL that has multiple security vulnerabilities for users. This is a violation of our dangerous products policy. If this APK was an app update, the previous version is still available on Google Play. Please review the OpenSSL Security Advisory, upgrade OpenSSL to versions 1.0.1h, 1.0.0m, 0.9.8za, or higher and submit your app again. To confirm you’ve upgraded correctly, submit the updated version of the app(s) to the Developer Console and check back after five hours. Additional details have been emailed to the account owner.

解决办法是到AOSP下载最新的OpenSSL (platform/external/openssl),当前(09/21/2015)AOSP上的版本为1.0.1L

不过原作者的github上(https://github.com/guardianproject/openssl-android)的makefile已经失效, 需要手动修改,添加新的文件,去掉没有的文件。可以diff一下文件夹, 加上缺少的文件.

这里贴出来我手动更新的makfile:

openssl-android/crypto/Android.mk (1.0.1L)

LOCAL_PATH:= $(call my-dir)

arm_cflags := -DOPENSSL_BN_ASM_MONT -DAES_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
arm_src_files := \
aes/asm/aes-armv4.S \
bn/asm/armv4-mont.S \
sha/asm/sha1-armv4-large.S \
sha/asm/sha256-armv4.S \
sha/asm/sha512-armv4.S
non_arm_src_files := aes/aes_core.c local_src_files := \
cryptlib.c \
mem.c \
mem_clr.c \
mem_dbg.c \
cversion.c \
ex_data.c \
cpt_err.c \
ebcdic.c \
uid.c \
o_time.c \
o_str.c \
o_dir.c \
o_init.c \
aes/aes_cbc.c \
aes/aes_cfb.c \
aes/aes_ctr.c \
aes/aes_ecb.c \
aes/aes_misc.c \
aes/aes_ofb.c \
aes/aes_wrap.c \
asn1/a_bitstr.c \
asn1/a_bool.c \
asn1/a_bytes.c \
asn1/a_d2i_fp.c \
asn1/a_digest.c \
asn1/a_dup.c \
asn1/a_enum.c \
asn1/a_gentm.c \
asn1/a_i2d_fp.c \
asn1/a_int.c \
asn1/a_mbstr.c \
asn1/a_object.c \
asn1/a_octet.c \
asn1/a_print.c \
asn1/a_set.c \
asn1/a_sign.c \
asn1/a_strex.c \
asn1/a_strnid.c \
asn1/a_time.c \
asn1/a_type.c \
asn1/a_utctm.c \
asn1/a_utf8.c \
asn1/a_verify.c \
asn1/ameth_lib.c \
asn1/asn1_err.c \
asn1/asn1_gen.c \
asn1/asn1_lib.c \
asn1/asn1_par.c \
asn1/asn_mime.c \
asn1/asn_moid.c \
asn1/asn_pack.c \
asn1/bio_asn1.c \
asn1/bio_ndef.c \
asn1/d2i_pr.c \
asn1/d2i_pu.c \
asn1/evp_asn1.c \
asn1/f_enum.c \
asn1/f_int.c \
asn1/f_string.c \
asn1/i2d_pr.c \
asn1/i2d_pu.c \
asn1/n_pkey.c \
asn1/nsseq.c \
asn1/p5_pbe.c \
asn1/p5_pbev2.c \
asn1/p8_pkey.c \
asn1/t_bitst.c \
asn1/t_crl.c \
asn1/t_pkey.c \
asn1/t_req.c \
asn1/t_spki.c \
asn1/t_x509.c \
asn1/t_x509a.c \
asn1/tasn_dec.c \
asn1/tasn_enc.c \
asn1/tasn_fre.c \
asn1/tasn_new.c \
asn1/tasn_prn.c \
asn1/tasn_typ.c \
asn1/tasn_utl.c \
asn1/x_algor.c \
asn1/x_attrib.c \
asn1/x_bignum.c \
asn1/x_crl.c \
asn1/x_exten.c \
asn1/x_info.c \
asn1/x_long.c \
asn1/x_name.c \
asn1/x_nx509.c \
asn1/x_pkey.c \
asn1/x_pubkey.c \
asn1/x_req.c \
asn1/x_sig.c \
asn1/x_spki.c \
asn1/x_val.c \
asn1/x_x509.c \
asn1/x_x509a.c \
bf/bf_cfb64.c \
bf/bf_ecb.c \
bf/bf_enc.c \
bf/bf_ofb64.c \
bf/bf_skey.c \
bio/b_dump.c \
bio/b_print.c \
bio/b_sock.c \
bio/bf_buff.c \
bio/bf_nbio.c \
bio/bf_null.c \
bio/bio_cb.c \
bio/bio_err.c \
bio/bio_lib.c \
bio/bss_acpt.c \
bio/bss_bio.c \
bio/bss_conn.c \
bio/bss_dgram.c \
bio/bss_fd.c \
bio/bss_file.c \
bio/bss_log.c \
bio/bss_mem.c \
bio/bss_null.c \
bio/bss_sock.c \
bn/bn_add.c \
bn/bn_asm.c \
bn/bn_blind.c \
bn/bn_ctx.c \
bn/bn_div.c \
bn/bn_err.c \
bn/bn_exp.c \
bn/bn_exp2.c \
bn/bn_gcd.c \
bn/bn_gf2m.c \
bn/bn_kron.c \
bn/bn_lib.c \
bn/bn_mod.c \
bn/bn_mont.c \
bn/bn_mpi.c \
bn/bn_mul.c \
bn/bn_nist.c \
bn/bn_prime.c \
bn/bn_print.c \
bn/bn_rand.c \
bn/bn_recp.c \
bn/bn_shift.c \
bn/bn_sqr.c \
bn/bn_sqrt.c \
bn/bn_word.c \
buffer/buf_err.c \
buffer/buffer.c \
buffer/buf_str.c \
cmac/cm_ameth.c \
cmac/cm_pmeth.c \
cmac/cmac.c \
comp/c_rle.c \
comp/c_zlib.c \
comp/comp_err.c \
comp/comp_lib.c \
conf/conf_api.c \
conf/conf_def.c \
conf/conf_err.c \
conf/conf_lib.c \
conf/conf_mall.c \
conf/conf_mod.c \
conf/conf_sap.c \
des/cbc_cksm.c \
des/cbc_enc.c \
des/cfb64ede.c \
des/cfb64enc.c \
des/cfb_enc.c \
des/des_enc.c \
des/des_old.c \
des/des_old2.c \
des/ecb3_enc.c \
des/ecb_enc.c \
des/ede_cbcm_enc.c \
des/enc_read.c \
des/enc_writ.c \
des/fcrypt.c \
des/fcrypt_b.c \
des/ofb64ede.c \
des/ofb64enc.c \
des/ofb_enc.c \
des/pcbc_enc.c \
des/qud_cksm.c \
des/rand_key.c \
des/read2pwd.c \
des/rpc_enc.c \
des/set_key.c \
des/str2key.c \
des/xcbc_enc.c \
dh/dh_ameth.c \
dh/dh_asn1.c \
dh/dh_check.c \
dh/dh_depr.c \
dh/dh_err.c \
dh/dh_gen.c \
dh/dh_key.c \
dh/dh_lib.c \
dh/dh_pmeth.c \
dsa/dsa_ameth.c \
dsa/dsa_asn1.c \
dsa/dsa_depr.c \
dsa/dsa_err.c \
dsa/dsa_gen.c \
dsa/dsa_key.c \
dsa/dsa_lib.c \
dsa/dsa_ossl.c \
dsa/dsa_pmeth.c \
dsa/dsa_prn.c \
dsa/dsa_sign.c \
dsa/dsa_vrf.c \
dso/dso_dl.c \
dso/dso_dlfcn.c \
dso/dso_err.c \
dso/dso_lib.c \
dso/dso_null.c \
dso/dso_openssl.c \
ec/ec2_mult.c \
ec/ec2_oct.c \
ec/ec2_smpl.c \
ec/ec_ameth.c \
ec/ec_asn1.c \
ec/ec_check.c \
ec/ec_curve.c \
ec/ec_cvt.c \
ec/ec_err.c \
ec/ec_key.c \
ec/ec_lib.c \
ec/ec_mult.c \
ec/ec_pmeth.c \
ec/ec_print.c \
ec/ec_oct.c \
ec/eck_prn.c \
ec/ecp_mont.c \
ec/ecp_nist.c \
ec/ecp_oct.c \
ec/ecp_smpl.c \
ecdh/ech_err.c \
ecdh/ech_key.c \
ecdh/ech_lib.c \
ecdh/ech_ossl.c \
ecdsa/ecs_asn1.c \
ecdsa/ecs_err.c \
ecdsa/ecs_lib.c \
ecdsa/ecs_ossl.c \
ecdsa/ecs_sign.c \
ecdsa/ecs_vrf.c \
err/err.c \
err/err_all.c \
err/err_prn.c \
evp/bio_b64.c \
evp/bio_enc.c \
evp/bio_md.c \
evp/bio_ok.c \
evp/c_all.c \
evp/c_allc.c \
evp/c_alld.c \
evp/digest.c \
evp/e_aes.c \
evp/e_aes_cbc_hmac_sha1.c \
evp/e_bf.c \
evp/e_des.c \
evp/e_des3.c \
evp/e_null.c \
evp/e_old.c \
evp/e_rc2.c \
evp/e_rc4.c \
evp/e_rc4_hmac_md5.c \
evp/e_rc5.c \
evp/e_xcbc_d.c \
evp/encode.c \
evp/evp_acnf.c \
evp/evp_cnf.c \
evp/evp_enc.c \
evp/evp_err.c \
evp/evp_key.c \
evp/evp_lib.c \
evp/evp_pbe.c \
evp/evp_pkey.c \
evp/m_dss.c \
evp/m_dss1.c \
evp/m_ecdsa.c \
evp/m_md4.c \
evp/m_md5.c \
evp/m_mdc2.c \
evp/m_null.c \
evp/m_ripemd.c \
evp/m_sha1.c \
evp/m_sigver.c \
evp/m_wp.c \
evp/names.c \
evp/p5_crpt.c \
evp/p5_crpt2.c \
evp/p_dec.c \
evp/p_enc.c \
evp/p_lib.c \
evp/p_open.c \
evp/p_seal.c \
evp/p_sign.c \
evp/p_verify.c \
evp/pmeth_fn.c \
evp/pmeth_gn.c \
evp/pmeth_lib.c \
hmac/hm_ameth.c \
hmac/hm_pmeth.c \
hmac/hmac.c \
krb5/krb5_asn.c \
lhash/lh_stats.c \
lhash/lhash.c \
md4/md4_dgst.c \
md4/md4_one.c \
md5/md5_dgst.c \
md5/md5_one.c \
modes/cbc128.c \
modes/ccm128.c \
modes/cfb128.c \
modes/ctr128.c \
modes/ofb128.c \
modes/gcm128.c \
modes/xts128.c \
objects/o_names.c \
objects/obj_dat.c \
objects/obj_err.c \
objects/obj_lib.c \
objects/obj_xref.c \
ocsp/ocsp_asn.c \
ocsp/ocsp_cl.c \
ocsp/ocsp_err.c \
ocsp/ocsp_ext.c \
ocsp/ocsp_ht.c \
ocsp/ocsp_lib.c \
ocsp/ocsp_prn.c \
ocsp/ocsp_srv.c \
ocsp/ocsp_vfy.c \
pem/pem_all.c \
pem/pem_err.c \
pem/pem_info.c \
pem/pem_lib.c \
pem/pem_oth.c \
pem/pem_pk8.c \
pem/pem_pkey.c \
pem/pem_seal.c \
pem/pem_sign.c \
pem/pem_x509.c \
pem/pem_xaux.c \
pem/pvkfmt.c \
pkcs12/p12_add.c \
pkcs12/p12_asn.c \
pkcs12/p12_attr.c \
pkcs12/p12_crpt.c \
pkcs12/p12_crt.c \
pkcs12/p12_decr.c \
pkcs12/p12_init.c \
pkcs12/p12_key.c \
pkcs12/p12_kiss.c \
pkcs12/p12_mutl.c \
pkcs12/p12_npas.c \
pkcs12/p12_p8d.c \
pkcs12/p12_p8e.c \
pkcs12/p12_utl.c \
pkcs12/pk12err.c \
pkcs7/pk7_asn1.c \
pkcs7/pk7_attr.c \
pkcs7/pk7_doit.c \
pkcs7/pk7_lib.c \
pkcs7/pk7_mime.c \
pkcs7/pk7_smime.c \
pkcs7/pkcs7err.c \
rand/md_rand.c \
rand/rand_egd.c \
rand/rand_err.c \
rand/rand_lib.c \
rand/rand_unix.c \
rand/randfile.c \
rc2/rc2_cbc.c \
rc2/rc2_ecb.c \
rc2/rc2_skey.c \
rc2/rc2cfb64.c \
rc2/rc2ofb64.c \
rc4/rc4_enc.c \
rc4/rc4_skey.c \
rc4/rc4_utl.c \
rsa/rsa_ameth.c \
rsa/rsa_asn1.c \
rsa/rsa_chk.c \
rsa/rsa_eay.c \
rsa/rsa_err.c \
rsa/rsa_gen.c \
rsa/rsa_lib.c \
rsa/rsa_none.c \
rsa/rsa_null.c \
rsa/rsa_oaep.c \
rsa/rsa_pk1.c \
rsa/rsa_pmeth.c \
rsa/rsa_prn.c \
rsa/rsa_pss.c \
rsa/rsa_saos.c \
rsa/rsa_sign.c \
rsa/rsa_ssl.c \
rsa/rsa_x931.c \
rsa/rsa_crpt.c \
sha/sha1_one.c \
sha/sha1dgst.c \
sha/sha256.c \
sha/sha512.c \
sha/sha_dgst.c \
srp/srp_lib.c \
srp/srp_vfy.c \
stack/stack.c \
ts/ts_err.c \
txt_db/txt_db.c \
ui/ui_compat.c \
ui/ui_err.c \
ui/ui_lib.c \
ui/ui_openssl.c \
ui/ui_util.c \
x509/by_dir.c \
x509/by_file.c \
x509/x509_att.c \
x509/x509_cmp.c \
x509/x509_d2.c \
x509/x509_def.c \
x509/x509_err.c \
x509/x509_ext.c \
x509/x509_lu.c \
x509/x509_obj.c \
x509/x509_r2x.c \
x509/x509_req.c \
x509/x509_set.c \
x509/x509_trs.c \
x509/x509_txt.c \
x509/x509_v3.c \
x509/x509_vfy.c \
x509/x509_vpm.c \
x509/x509cset.c \
x509/x509name.c \
x509/x509rset.c \
x509/x509spki.c \
x509/x509type.c \
x509/x_all.c \
x509v3/pcy_cache.c \
x509v3/pcy_data.c \
x509v3/pcy_lib.c \
x509v3/pcy_map.c \
x509v3/pcy_node.c \
x509v3/pcy_tree.c \
x509v3/v3_akey.c \
x509v3/v3_akeya.c \
x509v3/v3_alt.c \
x509v3/v3_bcons.c \
x509v3/v3_bitst.c \
x509v3/v3_conf.c \
x509v3/v3_cpols.c \
x509v3/v3_crld.c \
x509v3/v3_enum.c \
x509v3/v3_extku.c \
x509v3/v3_genn.c \
x509v3/v3_ia5.c \
x509v3/v3_info.c \
x509v3/v3_int.c \
x509v3/v3_lib.c \
x509v3/v3_ncons.c \
x509v3/v3_ocsp.c \
x509v3/v3_pci.c \
x509v3/v3_pcia.c \
x509v3/v3_pcons.c \
x509v3/v3_pku.c \
x509v3/v3_pmaps.c \
x509v3/v3_prn.c \
x509v3/v3_purp.c \
x509v3/v3_skey.c \
x509v3/v3_sxnet.c \
x509v3/v3_utl.c \
x509v3/v3err.c local_c_includes := \
$(NDK_PROJECT_PATH) \
$(NDK_PROJECT_PATH)/crypto/asn1 \
$(NDK_PROJECT_PATH)/crypto/evp \
$(NDK_PROJECT_PATH)/crypto/modes \
$(NDK_PROJECT_PATH)/include \
$(NDK_PROJECT_PATH)/include/openssl local_c_flags := -DNO_WINDOWS_BRAINDEATH ####################################### # target
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_CFLAGS += $(local_c_flags)
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_LDLIBS += -lz
ifeq ($(TARGET_ARCH),arm)
LOCAL_SRC_FILES += $(arm_src_files)
LOCAL_CFLAGS += $(arm_cflags)
else
LOCAL_SRC_FILES += $(non_arm_src_files)
endif
ifeq ($(TARGET_SIMULATOR),true)
# Make valgrind happy.
LOCAL_CFLAGS += -DPURIFY
LOCAL_LDLIBS += -ldl
endif
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libcrypto
include $(BUILD_SHARED_LIBRARY) #######################################
# host shared library
ifeq ($(WITH_HOST_DALVIK),true)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_CFLAGS += $(local_c_flags) -DPURIFY
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_SRC_FILES += $(non_arm_src_files)
LOCAL_LDLIBS += -ldl
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libcrypto
include $(BUILD_SHARED_LIBRARY)
endif ########################################
# host static library, which is used by some SDK tools. include $(CLEAR_VARS)
include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_CFLAGS += $(local_c_flags) -DPURIFY
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_SRC_FILES += $(non_arm_src_files)
LOCAL_LDLIBS += -ldl
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libcrypto_static
include $(BUILD_STATIC_LIBRARY)

openssl-android/ssl/Android.mk (1.0.1L)

LOCAL_PATH:= $(call my-dir)

local_c_includes := \
$(NDK_PROJECT_PATH) \
$(NDK_PROJECT_PATH)/include \
$(NDK_PROJECT_PATH)/crypto local_src_files:= \
d1_srtp.c \
s2_meth.c \
s2_srvr.c \
s2_clnt.c \
s2_lib.c \
s2_enc.c \
s2_pkt.c \
s3_meth.c \
s3_srvr.c \
s3_cbc.c \
s3_clnt.c \
s3_lib.c \
s3_enc.c \
s3_pkt.c \
s3_both.c \
s23_meth.c \
s23_srvr.c \
s23_clnt.c \
s23_lib.c \
s23_pkt.c \
t1_meth.c \
t1_srvr.c \
t1_clnt.c \
t1_lib.c \
t1_enc.c \
t1_reneg.c \
tls_srp.c \
ssl_lib.c \
ssl_err2.c \
ssl_cert.c \
ssl_sess.c \
ssl_ciph.c \
ssl_stat.c \
ssl_rsa.c \
ssl_asn1.c \
ssl_txt.c \
ssl_algs.c \
bio_ssl.c \
ssl_err.c \
kssl.c include $(CLEAR_VARS)
include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_SHARED_LIBRARIES += libcrypto
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libssl
include $(BUILD_SHARED_LIBRARY) ifeq ($(WITH_HOST_DALVIK),true)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_SHARED_LIBRARIES += libcrypto
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libssl
include $(BUILD_SHARED_LIBRARY)
endif # ssltest
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES:= ssltest.c
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_SHARED_LIBRARIES := libssl libcrypto
LOCAL_MODULE:= ssltest
LOCAL_MODULE_TAGS := optional
include $(BUILD_EXECUTABLE)

openssl-android/app/Android.mk (1.0.1L)

# Copyright  The Android Open Source Project

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS) LOCAL_SRC_FILES:= \
app_rand.c \
apps.c \
asn1pars.c \
ca.c \
ciphers.c \
crl.c \
crl2p7.c \
dgst.c \
dh.c \
dhparam.c \
dsa.c \
dsaparam.c \
ecparam.c \
ec.c \
enc.c \
engine.c \
errstr.c \
gendh.c \
gendsa.c \
genpkey.c \
genrsa.c \
nseq.c \
ocsp.c \
openssl.c \
passwd.c \
pkcs12.c \
pkcs7.c \
pkcs8.c \
pkey.c \
pkeyparam.c \
pkeyutl.c \
prime.c \
rand.c \
req.c \
rsa.c \
rsautl.c \
s_cb.c \
s_client.c \
s_server.c \
s_socket.c \
s_time.c \
sess_id.c \
smime.c \
speed.c \
spkac.c \
srp.c \
verify.c \
version.c \
x509.c # cms.c ec.c s_server.c LOCAL_SHARED_LIBRARIES := \
libssl \
libcrypto LOCAL_C_INCLUDES := \
$(NDK_PROJECT_PATH) \
$(NDK_PROJECT_PATH)/include LOCAL_CFLAGS := -DMONOLITH include $(LOCAL_PATH)/../android-config.mk # These flags omit whole features from the commandline "openssl".
# However, portions of these features are actually turned on.
LOCAL_CFLAGS += -DOPENSSL_NO_DTLS1 LOCAL_MODULE:= openssl LOCAL_MODULE_TAGS := tests include $(BUILD_EXECUTABLE)