cURL / Mailing Lists / curl-library / Single Mail

curl-library

Errors building curl with OpenSSL for Android

From: Rag Tag <winkalott_at_gmail.com>
Date: Wed, 12 Sep 2012 16:51:39 -0700

I'm able to build curl fine for Android WITHOUT SSL support. However, I do
need SSL support in curl, so I built libssl.a and libcrypto.a for Android.
When I configure curl like this:

export CFLAGS="-I${PWD}/../OpenSSL/include
-L${PWD}/../Android/obj/local/armeabi"
OR
export CPPFLAGS="-I${PWD}/../OpenSSL/include"
export LDFLAGS="-L${PWD}/../Android/obj/local/armeabi"
where ${PWD}/../OpenSSL/include has the "openssl" folder with all the
headers, and ${PWD}/../Android/obj/local/armeabi has the libssl.a and
libcrypto.a

./configure --host=arm-linux-androideabi --disable-shared
-with-random=/dev/urandom --with-ssl --without-zlib

I get the following error:
checking for SSL_connect in -lssl... no
checking for ssl with RSAglue/rsaref libs in use... checking for
SSL_connect in -lssl... (cached) no
no
configure: error: OpenSSL libs and/or directories were not found where
specified!

And here's what I see in the config.log:
configure:20629: checking for CRYPTO_lock in -lcrypto
configure:20651: arm-linux-androideabi-gcc -o conftest -isystem
/OpenSSL/include -L/Android/obj/local/armeabi -g0 -O2 -Wno-system-headers
  conftest.c -lcrypto >&5
configure:20651: $? = 0
configure:20660: result: yes
configure:20723: checking for SSL_connect in -lssl
configure:20745: arm-linux-androideabi-gcc -o conftest -isystem
/OpenSSL/include -L/Android/obj/local/armeabi -g0 -O2 -Wno-system-headers
  conftest.c -lssl -lcrypto >&5
/Android/obj/local/armeabi/libcrypto.a(e_aes.o): In function `aes_init_key':
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:526: undefined
reference to `AES_set_decrypt_key'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:554: undefined
reference to `AES_set_encrypt_key'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:572: undefined
reference to `AES_decrypt'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:572: undefined
reference to `AES_cbc_encrypt'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:572: undefined
reference to `AES_encrypt'
/Android/obj/local/armeabi/libcrypto.a(e_aes.o): In function
`aes_gcm_init_key':
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:846: undefined
reference to `AES_set_encrypt_key'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:878: undefined
reference to `AES_encrypt'
/Android/obj/local/armeabi/libcrypto.a(e_aes.o): In function
`aes_xts_init_key':
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:1096:
undefined reference to `AES_set_encrypt_key'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:1101:
undefined reference to `AES_set_decrypt_key'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:1105:
undefined reference to `AES_set_encrypt_key'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:1119:
undefined reference to `AES_encrypt'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:1119:
undefined reference to `AES_decrypt'
/Android/obj/local/armeabi/libcrypto.a(e_aes.o): In function
`aes_ccm_init_key':
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:1224:
undefined reference to `AES_set_encrypt_key'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/e_aes.c:1236:
undefined reference to `AES_encrypt'
/Android/obj/local/armeabi/libcrypto.a(cms_env.o): In function
`cms_RecipientInfo_kekri_encrypt':
/Android/jni/../../../OpenSSL/Android/src/crypto/cms/cms_env.c:667:
undefined reference to `AES_set_encrypt_key'
/Android/jni/../../../OpenSSL/Android/src/crypto/cms/cms_env.c:683:
undefined reference to `AES_wrap_key'
/Android/obj/local/armeabi/libcrypto.a(cms_env.o): In function
`cms_RecipientInfo_kekri_decrypt':
/Android/jni/../../../OpenSSL/Android/src/crypto/cms/cms_env.c:744:
undefined reference to `AES_set_decrypt_key'
/Android/jni/../../../OpenSSL/Android/src/crypto/cms/cms_env.c:760:
undefined reference to `AES_unwrap_key'
/Android/obj/local/armeabi/libcrypto.a(evp_key.o): In function
`EVP_read_pw_string_min':
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/evp_key.c:104:
undefined reference to `UI_new'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/evp_key.c:105:
undefined reference to `UI_add_input_string'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/evp_key.c:107:
undefined reference to `UI_add_verify_string'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/evp_key.c:109:
undefined reference to `UI_process'
/Android/jni/../../../OpenSSL/Android/src/crypto/evp/evp_key.c:110:
undefined reference to `UI_free'
collect2: ld returned 1 exit status
configure:20745: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "curl"
| #define PACKAGE_TARNAME "curl"
| #define PACKAGE_VERSION "-"
| #define PACKAGE_STRING "curl -"
| #define PACKAGE_BUGREPORT "a suitable curl mailing list:
http://curl.haxx.se/mail/"
| #define PACKAGE_URL ""
| #define PACKAGE "curl"
| #define VERSION "-"
| #define OS "arm-unknown-linux-androideabi"
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_INTTYPES_H 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define SIZEOF_LONG 4
| #define SIZEOF_VOIDP 4
| #define CURL_PULL_SYS_TYPES_H 1
| #define CURL_PULL_STDINT_H 1
| #define CURL_PULL_INTTYPES_H 1
| #define CURL_TYPEOF_CURL_OFF_T int64_t
| #define CURL_FORMAT_CURL_OFF_T "lld"
| #define CURL_FORMAT_CURL_OFF_TU "llu"
| #define CURL_FORMAT_OFF_T "%lld"
| #define CURL_SIZEOF_CURL_OFF_T 8
| #define CURL_SUFFIX_CURL_OFF_T LL
| #define CURL_SUFFIX_CURL_OFF_TU ULL
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_LDAP_SSL 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_TIME_H 1
| #define HAVE_CLOCK_GETTIME_MONOTONIC 1
| #define CURL_DISABLE_LDAP 1
| #define CURL_DISABLE_LDAPS 1
| /* end confdefs.h. */
|
|
| #ifdef __cplusplus
| extern "C"
| #endif
| char SSL_connect ();
| int main (void)
| {
| return SSL_connect ();
| ;
| return 0;
| }
configure:20754: result: no
configure:20767: checking for ssl with RSAglue/rsaref libs in use
configure:20771: checking for SSL_connect in -lssl
configure:20802: result: no
configure:20814: result: no
configure:20894: error: OpenSSL libs and/or directories were not found
where specified!

Any ideas on what can fix this?
I've absolutely made sure that the libs and headers are there where I
specify in the flags.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-13