Android build PJSIP with openssl

I am trying to create PJSIP on Android with SSL / TLS support.

I successfully built OpenSSL after this answer (without fips, like shared-.so libraries) and set it to ~ / android (which created the ~ / android / ssl directory file).

Now when i do

./configure-android --with-ssl=/home/andrea/android/ssl 

and look at config.log, the first status errors

 <ndk-directories-and-stuff>/arm-linux-androideabi/bin/ld: warning: libdl.so, needed by /home/andrea/android/ssl/lib/libcrypto.so, not found (try using -rpath or -rpath-link) 

many undefined links are executed.

As a result, SSL support is disabled:

 aconfigure:7012: result: ** OpenSSL libraries not found, disabling SSL support ** ac_cv_header_openssl_ssl_h=yes ac_cv_lib_ssl_SSL_library_init=no CFLAGS=' -I/home/andrea/android/android-ndk-r8e/platforms/android-14/arch-arm/usr/include -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I/home/andrea/android/ssl/include' LDFLAGS=' -nostdlib -L/home/andrea/android/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/ -L/home/andrea/android/ssl/lib' ac_no_ssl='' libssl_present='' openssl_h_present='1' 

but libdl.so exists in the ndk directory:

 <ndk-dir>/platforms/android-14/arch-arm/usr/lib/ 

I think I should tell ld where the other libraries are, what does the ld suggestion mean?

 try using -rpath or -rpath-link 

I cannot understand what -rpath or rpath-link is or where to use them.

any ideas?

+4
source share
1 answer

I have successfully created PJSIP with OpenSSL. follow these steps:

Download openssl-android first and compile it by reading ReadMe File. (Put your android-ndk in PATH and run the ndk-build in openssl-android root) and then copy libcrypto.so and libssl.so from libs/armeabi/ to the lib/ folder in the openssl-android root directory (you can create this folder). your directory structure should now look like this:
openssl-android/
->apps
->crypto
->include
->jni
->lib
->libs
->...

now just executes in the pjsip root directory:
./configure-android --with-ssl=/home/your-user-name/path-to-openssl-android-dir

to confirm that openssl is enabled, just connect this command to grep like:
./configure-android --with-ssl=/home/your-user-name/path-to-openssl-android-dir | grep -wi ssl

then you will see this line result: OpenSSL library found, SSL support enabled . This means that OpenSSL is now enabled for your PJSIP. Now you can continue to work normally.

hope this helps.

+2
source

Source: https://habr.com/ru/post/1481597/


All Articles