Note that there are some explanatory texts on larger screens.

plurals
  1. POporting libcurl on android with ssl support
    primarykey
    data
    text
    <p>I am trying to port libCurl to android with SSL support, step one would be to port the curl without ssl support I guess so I started doing that. but I run into a problem.</p> <p>as I read on the dev website and in the Android.mk file, the hard part is configuring the make first. so what I did is : </p> <ol> <li><p>Download Android Source code (and compile it! since some of the intermediate libs are needed)</p></li> <li><p>Download cURL </p></li> <li><p>unpack curl under : {android_src}/external/curl</p></li> <li><p>make the configure script for curl by creating a sh file in the external/curl folder with this content. </p></li> </ol> <p>`</p> <pre><code>export A=/home/user/Development/AOSP/2.3.3 export CC=$A/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-gcc export NDK=/home/user/Development/Tools/sdk/android/ndk export NDKLIBS=$NDK/platforms/android-4/arch-arm/usr/include export SYSROOT=$A/ndk/build/platforms/android-4/arch-arm export CPPFLAGS="-I $A/system/core/include" export LDFLAGS="-L$A/out/target/product/generic/obj/lib/ -L$A/out/target/product/generic/system/lib/-L$SYSROOT/usr/lib -Wl,--gc-sections -nostdlib -lc -lm -ldl -llog -lgcc -Wl,--no-undefined,-z,nocopyreloc -Wl,-dynamic-linker,/system/bin/linker -L$NDK/out/target/product/generic/obj/lib/" export CFLAGS="-fno-exceptions -Wno-multichar -mthumb -mthumb-interwork -nostdlib -lc -ldl -lm -march=armv5te -mtune=xscale -msoft-float -mandroid -fPIC -mthumb-interwork -mthumb -mlong-calls -ffunction-sections -fstack-protector -fno-short-enums -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -DANDROID -DOS_ANDROID -D__NEW__ -D__SGI_STL_INTERNAL_PAIR_H -I$SYSROOT/usr/include -I $A/system/core/include -I $NDKLIBS" ./configure --host=arm-eabi --with-ssl=$A/external/openssl </code></pre> <p>` And the output summary is this one : </p> <p>configure: Configured to build curl/libcurl:</p> <pre><code> curl version: 7.26.0 Host setup: arm-unknown-eabi Install prefix: /usr/local Compiler: /home/tanco/Development/AOSP/2.3.3/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-gcc SSL support: no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls} ) SSH support: no (--with-libssh2) zlib support: enabled krb4 support: no (--with-krb4*) GSSAPI support: no (--with-gssapi) SPNEGO support: no (--with-spnego) TLS-SRP support: no (--enable-tls-srp) resolver: default (--enable-ares / --enable-threaded-resolver) ipv6 support: no (--enable-ipv6) IDN support: no (--with-libidn) Build libcurl: Shared=no, Static=yes Built-in manual: enabled --libcurl option: enabled (--disable-libcurl-option) Verbose errors: enabled (--disable-verbose) SSPI support: no (--enable-sspi) ca cert bundle: /etc/ssl/certs/ca-certificates.crt ca cert path: no LDAP support: no (--enable-ldap / --with-ldap-lib / --with-lber-lib) LDAPS support: no (--enable-ldaps) RTSP support: enabled RTMP support: no (--with-librtmp) Protocols: DICT FILE FTP GOPHER HTTP IMAP POP3 RTSP SMTP TELNET TFTP SONAME bump: yes - WARNING: this library will be built with the SONAME number bumped due to (a detected) ABI breakage. See lib/README.curl_off_t for details on this. </code></pre> <p>First strange thing that comes to mind is why is SSL not included in the config since the linker shows to the intermediate libs and ssl support flag is called, but after when I use the same curl_config.h file in the jni project which I created for the build (since it has a standalone Android.mk file it can be compiled simply by unzipping in the jni folder of a android project, copying the config file created in the AOSP source and calling ndk-build) </p> <p>so I compile and I get : </p> <pre><code>$ ndk-build Compile thumb : curl &lt;= url.c In file included from /Projects/temp/testNDK/jni/lib/url.c:32:0: /Tools/sdk/android/ndk/platforms/android-14/arch-arm/usr/include/unistd.h: In function 'getpagesize': /Tools/sdk/android/ndk/platforms/android-14/arch-arm/usr/include/unistd.h:171:3: warning: nested extern declaration of '__page_size' [-Wnested-externs] /Tools/sdk/android/ndk/platforms/android-14/arch-arm/usr/include/unistd.h: In function '__getpageshift': /Tools/sdk/android/ndk/platforms/android-14/arch-arm/usr/include/unistd.h:175:3: warning: nested extern declaration of '__page_shift' [-Wnested-externs] /Projects/temp/testNDK/jni/lib/url.c: At top level: /Projects/temp/testNDK/jni/lib/url.c:57:2: error: #error "We can't compile without socket() support!" make: *** [/Projects/temp/testNDK/obj/local/armeabi/objs/curl/lib/url.o] Error 1 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload