Monday, January 13, 2014

Building log4cxx from dev trunk [new incubation repo]

Log4CXX recently moved to Apache incubation. So its trunk[dev branch] is moved to
http://svn.apache.org/repos/asf/incubator/log4cxx/trunk

Here I'll explain how to build log4cxx from trunk. In additionally to log4cxx, you need Apache Portable Runtime and , APR-Utils libraries. Because, Log4CXX depends on APR. I'm using Ubuntu 12.04 version here.

Download APR and APR-Utils from APR site at:
http://apr.apache.org/download.cgi

I've tree my downloaded folder here, with latest[at blogging date].
Using wget will be easier for apr and apr-utils.

├── apr-1.5.0
├── apr-util-1.5.3
└── trunk
    └── src
        ├── ant
        ├── assembly
        ├── changes
        ├── examples
        ├── main
        │   ├── cpp
        │   ├── include
        │   └── resources
        ├── site
        └── test
Do SVN checkout of log4cxx trunk as well.

svn checkout http://svn.apache.org/repos/asf/incubator/log4cxx/trunk


Unzip APR and APR-Utils
tar -zxvf apr-1.5.0.tar.gz
tar -zxvf apr-util-1.5.3.tar.gz

Build APR
cd apr-1.5.0
./configure
make

Build APR-Utils
cd ../apr-util-1.5.3
./configure  --with-apr=../apr-1.5.0
make

To Configure Log4CXX, you need some more tools.
LIBTOOL
AUTOMAKE
AUTOCONF

Make sure you have them already installed or install them.
apt-get install automake

Generate configure script:
 autoreconf --force --install

Set environment variables in to configure file using autogen.sh script
 ./autogen.sh

Configure Log4CXX configure file with APR and APR-Utils paths
 ./configure --with-apr=../apr-1.5.0 --with-apr-util=../apr-util-1.5.3
make
make install

Enjoy. Please drop any suggestions, bugs to log4cxx-user@logging.apache.org

No comments:

Post a Comment