Steps For Porting Log4Cpp For Android

Link of Ported code:
I have already ported the code for Log4cpp and the same can be found in the location:
 Log4cpp - Android.

Development machine used:
Ubuntu 12.04 (LTS) - x86_64
NDK - r9d

Preparing for the build:
 1. Get the code from this Log4cpp link.
 2. Create an Empty "AndroidManifest.xml" in the root folder of the Log4cpp code.
 3. Copy Android.mk file from this GitHub Location.
 4. Copy Application.mk file from this GitHub Location.
 5. Copy android_configure.sh file from this GitHub Location.
 6. Update the android_configure.sh with the proper ANDROID NDK location.
 7. Edit configure.in in the root directory of log4cpp and add below lines after searching for “AC_CXX_HAVE_SSTREAM”

#AC_CXX_HAVE_SSTREAM - Commented
if test "$CROSS_COMPILE" = "arm-linux-androideabi"; then
    AC_DEFINE(HAVE_SSTREAM,1)
else
    AC_CXX_HAVE_SSTREAM
fi


 8. Update the config/config.guess & config/config.sub from the website
     - Config Update 1
     - Config Update 2

Building Steps:
Perform the below steps in order in the root directory of the Log4cpp folder.
 1. ./autogen.sh
 2. ./android_configure.sh
 3. ndk-build NDK_APPLICATION_MK=`pwd`/Application.mk

"SO" files will be generated in the libs folder which can be used for linking.

No comments: