You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by Curt Arnold <ca...@apache.org> on 2005/02/06 07:13:43 UTC

One click build for Visual Studio

I've have reworked the Ant build script so it will download and build 
Apache Portable Runtime (apr, apr-util and apr-iconv modules) and 
Cppunit if a location for the installed versions are not specified.  
Also, the need for boost-regex in the unit tests has been eliminated by 
using "sed" to normalized the generated output to allow it to be 
compared with the reference versions.

All of these assume that you have a current CVS HEAD source for log4cxx 
and cpptasks (http://ant-contrib.sourceforge.net).

To build on Windows, you'd do something like:

 > set CLASSPATH=\cpptasks\build\lib\cpptasks.jar
 > "c:\program files\microsoft visual studio\vc98\bin\vcvars32"
 > ant

If you have sed on your path, that should get you through building 
everything and running the unit tests.  If you don't have sed, you'll 
should fail at the unit tests but you will still likely have a good 
build.

If you'd like to debug within Visual Studio, you can generate Visual 
Studio 6 project files by doing:

 > ant build-projects-vc6

The equivalent should also work on Unix's, but you are more likely to 
want to specify the location of an installed APR and cppunit instead of 
building them from scratch.

 > export CLASSPATH=/home/curta/cpptasks/build/lib/cpptasks.jar
 > ant -Dapr.dir=/usr/local/lib -Dcppunit.lib.dir=/usr/lib 
-Dcppunit.include.dir=/usr/include

All of these use static libraries for apr, apr-util, apr-iconv and 
cppunit and produce a log4cxx shared library plus some executables.

I still need to tweak the Mac build.  For the moment, you need to 
specify a (-Dextra.libs=pthread) to workaround a linkage problem before 
it totally fails the unit tests.

In addition, I have added a "dist" target for producing a source 
distribution .tar.gz.  Do "ant -p" to see descriptions of the public 
targets in the build file.

I haven't forgotten the straight Unix build process.  I'm really a 
newbie when it comes to that, but my current thought is to snag the 
buildconf and configure from apr-util and modify it to fit log4cxx.