title: Android build PJSIP with openssl
body: <p>I'm trying to build PJSIP on Android with SSL/TLS support.</p>
  
  <p>I successfully built OpenSSL following <a href="https://stackoverflow.com/a/11170629/1274789">this answer</a> (without fips, as shared-.so libraries) and installed it in ~/android (which created the ~/android/ssl directory).</p>
  
  <p>Now, when i do</p>
  
  <pre><code>./configure-android --with-ssl=/home/andrea/android/ssl
  </code></pre>
  
  <p>and look at the config.log, the first error states</p>
  
  <pre><code>&lt;ndk-directories-and-stuff&gt;/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)
  </code></pre>
  
  <p>a lot of undefined references follow.</p>
  
  <p>As consequence SSL support is disabled:</p>
  
  <pre><code>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'
  </code></pre>
  
  <p>but libdl.so exists in the ndk's directory:</p>
  
  <pre><code>&lt;ndk-dir&gt;/platforms/android-14/arch-arm/usr/lib/
  </code></pre>
  
  <p>I guess I have to tell ld where the other libraries are,
  what does ld's suggestion mean?</p>
  
  <pre><code>try using -rpath or -rpath-link
  </code></pre>
  
  <p>I can't understand what -rpath or rpath-link are or where to apply them .</p>
  
  <p>any ideas?</p>