Game Development Reference
In-Depth Information
Of course, you can build a shared library and link your application dynamically
against it. However, this usually is a good choice when the library is located in
the system and is shared between several applications. In our case, since our
application is the sole user of the library, the static linking will make it easier
to link and debug the project.
Compiling the libcurl networking library
The libcurl library is a de facto standard for native applications, which deal with numerous
networking protocols. The libcurl compilation for Android on a Windows host requires some
additional steps to be done. We explain them in this recipe.
Getting ready
Download the libcurl source code from the library homepage: http://curl.haxx.se/
libcurl/ .
How to do it...
1.
Since the libcurl library build process is based on Autoconf , we will need to
generate a curl_config.h ile before actually building the library. Run the
configure script from the folder containing the unpacked libcurl distribution
package. Cross-compilation command-line lags should be set to:
--host=arm-linux CC=arm-eabi-gcc
2.
The -I parameter of the CPPFLAGS variable should point to the /system/core/
include subfolder of your NDK folder, in our case:
CPPFLAGS=”-I D:/NDK/system/core/include”
3.
The libcurl library can be customized in many ways. We use this set of parameters
(disable all protocols except HTTP):
>configure CC=arm-eabi-gcc --host=arm-linux --disable-tftp
--disable-sspi --disable-ipv6 --disable-ldaps --disable-ldap
--disable-telnet --disable-pop3 --disable-ftp --without-ssl
--disable-imap --disable-smtp --disable-pop3 --disable-rtsp
--disable-ares --without-ca-bundle --disable-warnings --disable-
manual --without-nss --enable-shared --without-zlib --without-
random --enable-threaded-resolver
4.
The configure script will generate a valid curl_config.h header ile. You may
ind it in the accompanying materials.
 
Search WWH ::




Custom Search