carnold 2005/02/05 18:04:33
Modified: . .cvsignore build.xml
include/log4cxx .cvsignore
tests/src main.cpp
tests/src/defaultinit testcase1.cpp testcase2.cpp
testcase3.cpp testcase4.cpp
Added: . apr-build.xml apriconv-build.xml aprutil-build.xml
cppunit-build.xml
Log:
LOGCXX-25: Ant build file will download and build apr and cppunit if needed
Revision Changes Path
1.3 +4 -0 logging-log4cxx/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/logging-log4cxx/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .cvsignore 29 Jan 2005 23:44:52 -0000 1.2
+++ .cvsignore 6 Feb 2005 02:04:33 -0000 1.3
@@ -11,3 +11,7 @@
linux
log4cxx.cbx
log4cxx.cbx.local
+xcode
+cbx
+msvc
+
1.30 +542 -324 logging-log4cxx/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/logging-log4cxx/build.xml,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- build.xml 4 Feb 2005 08:49:08 -0000 1.29
+++ build.xml 6 Feb 2005 02:04:33 -0000 1.30
@@ -26,12 +26,42 @@
<project name="log4cxx" default="check">
<property name="debug" value="true"/>
-<property name="src.dir" location="src"/>
-<property name="include.dir" location="include"/>
-<property name="build.dir" location="build"/>
-<property name="examples.dir" location="examples"/>
-<property name="tests.dir" location="tests"/>
+<property name="base.dir" location="."/>
+<property name="src.dir" location="${base.dir}/src"/>
+<property name="lib.dir" location="${base.dir}/lib"/>
+<property name="include.dir" location="${base.dir}/include"/>
+<property name="build.dir" location="${base.dir}/build"/>
+<property name="examples.dir" location="${base.dir}/examples"/>
+<property name="tests.dir" location="${base.dir}/tests"/>
+<property name="performance.dir" location="${base.dir}/performance"/>
<property name="version" value="0.9.8"/>
+<property name="rtti" value="false"/>
+<property name="optimize" value="none"/>
+<property name="lib.type" value="shared"/>
+<property name="apache.mirror" value="http://apache.mirrors.pair.com"/>
+<property name="cppunit.mirror"
value="http://unc.dl.sourceforge.net/sourceforge"/>
+
+<property name="apache.dist" value="http://www.apache.org/dist"/>
+
+
+
+<property name="apr.version" value="1.1.0"/>
+<property name="apr.lib.name" value="apr-1"/>
+<property name="apr.lib.type" value="static"/>
+
+<property name="aprutil.version" value="1.1.0"/>
+<property name="aprutil.lib.name" value="aprutil-1"/>
+<property name="aprutil.lib.type" value="static"/>
+
+<property name="apriconv.version" value="1.0.1"/>
+<property name="apriconv.lib.name" value="apriconv"/>
+<property name="apriconv.lib.type" value="static"/>
+
+<property name="cppunit.version" value="1.10.2"/>
+<property name="cppunit.lib.name" value="cppunit"/>
+<property name="cppunit.lib.type" value="static"/>
+
+
<taskdef resource="cpptasks.tasks"/>
<typedef resource="cpptasks.types"/>
@@ -51,78 +81,142 @@
<target name="win-init" depends="os-detect" if="is-windows">
- <property name="apr.dir" location="/apr-1"/>
- <property name="aprutil.dir" location="/apr-1"/>
- <property name="apr.include.dir" location="${apr.dir}/apr/include"/>
- <property name="apr.lib.name" value="apr-1"/>
- <property name="aprutil.lib.name" value="aprutil-1"/>
- <property name="apriconv.lib.name" value="apriconv"/>
- <condition property="apr.lib.dir" value="${apr.dir}/apr/LibD">
- <istrue value="${debug}"/>
- </condition>
- <property name="apr.lib.dir" location="${apr.dir}/apr/LibR"/>
- <property name="apriconv.lib.dir" location="${apr.lib.dir}"/>
- <property name="compiler" value="msvc"/>
- <condition property="lib-suffix" value="d">
- <istrue value="${debug}"/>
- </condition>
- <property name="lib-suffix" value=""/>
- <property name="cppunit.dir" location="/cppunit-1.10.2"/>
- <property name="cppunit.include.dir" location="${cppunit.dir}/include"/>
- <property name="cppunit.lib.dir" location="${cppunit.dir}/lib"/>
- <condition property="cppunit.lib.name" value="cppunitd">
- <istrue value="${debug}"/>
- </condition>
- <property name="cppunit.lib.name" value="cppunit"/>
+ <property name="lib.prefix" value=""/>
+ <property name="lib.extension" value=".lib"/>
+ <property name="project.type" value="msvc6"/>
+ <property name="project.dir" value="msvc"/>
+ <property name="compiler" value="msvc"/>
</target>
-<target name="unix-init" depends="os-detect" if="is-unix">
- <property name="apr.dir" location="/usr/local/apr"/>
- <property name="apr.include.dir" location="${apr.dir}/include/apr-1"/>
- <property name="aprutil.dir" location="${apr.dir}"/>
- <property name="aprutil.include.dir"
location="${aprutil.dir}/include/apr-1"/>
- <property name="apriconv.dir" location="${apr.dir}"/>
- <property name="apriconv.include.dir"
location="${apriconv.dir}/include"/>
- <property name="apr.lib.name" value="apr-1"/>
- <property name="aprutil.lib.name" value="aprutil-1"/>
- <property name="apriconv.lib.name" value="apriconv"/>
- <property name="apr.lib.dir" location="${apr.dir}/lib"/>
- <property name="aprutil.lib.dir" location="${aprutil.dir}/lib"/>
- <property name="apriconv.lib.dir" location="${apriconv.dir}/lib"/>
- <property name="compiler" value="gcc"/>
- <condition property="is-gcc" value="true">
- <or>
- <equals arg1="${compiler}" arg2="gcc"/>
- <equals arg1="${compiler}" arg2="g++"/>
- </or>
- </condition>
+<target name="mac-init" depends="os-detect" if="is-mac">
+ <property name="project.type" value="cbuilderx"/>
+ <property name="project.dir" value="cbx"/>
+</target>
- <property name="lib-suffix" value="-${version}"/>
- <condition property="cppunit.include.dir" value="${cppunit.dir}/include">
- <isset property="cppunit.dir"/>
- </condition>
- <condition property="cppunit.lib.dir"
value="${cppunit.dir}/src/cppunit">
- <isset property="cppunit.dir"/>
+<target name="unix-init" depends="mac-init" if="is-unix">
+
+ <property name="compiler" value="gcc"/>
+ <condition property="is-gcc" value="true">
+ <or>
+ <equals arg1="${compiler}" arg2="gcc"/>
+ <equals arg1="${compiler}" arg2="g++"/>
+ </or>
</condition>
- <property name="cppunit.lib.name" value="cppunit"/>
- <property name="expat.lib.name" value="expat"/>
+ <property name="lib.prefix" value="lib"/>
+ <property name="lib.extension" value=".a"/>
+ <property name="project.type" value="cbuilderx"/>
+ <property name="project.dir" value="cbx"/>
+ <property name="compiler" value="g++"/>
</target>
+
+
+
<target name="init" depends="win-init, unix-init">
+ <available classname="net.sf.antcontrib.cpptasks.CCTask"
property="cctask-available"/>
+ <fail unless="cctask-available">cpptasks required
+
+Use CVS HEAD or Feb 2005 or later release from
+http://ant-contrib.sourceforge.net.
+</fail>
+
+ <available classname="net.sf.antcontrib.cpptasks.ide.ProjectDef"
property="cctask-project-available"/>
+ <fail unless="cctask-project-available">later version of cpptasks
required
+
+Required features not present in cpptasks releases prior to Feb 2005</fail>
+
<mkdir dir="${build.dir}"/>
- <mkdir dir="cbx"/>
- <mkdir dir="xcode"/>
- <mkdir dir="msvc"/>
- <condition property="obj.dir" value="${build.dir}/debug">
+
+ <condition property="is-debug" value="true">
<istrue value="${debug}"/>
</condition>
- <property name="obj.dir" value="${build.dir}/release"/>
- <mkdir dir="${obj.dir}"/>
+
+ <condition property="debug.release" value="debug">
+ <isset property="is-debug"/>
+ </condition>
+ <property name="debug.release" value="release"/>
+
+ <condition property="apr.include.dir" value="${apr.dir}/include">
+ <isset property="apr.dir"/>
+ </condition>
+ <condition property="apr.lib.dir" value="${apr.dir}/lib">
+ <isset property="apr.dir"/>
+ </condition>
+
+
+ <condition property="apriconv.dir" value="${apr.dir}">
+ <isset property="apr.dir"/>
+ </condition>
+ <condition property="apriconv.include.dir"
value="${apriconv.dir}/include">
+ <isset property="apriconv.dir"/>
+ </condition>
+ <condition property="apriconv.lib.dir" value="${apriconv.dir}/lib">
+ <isset property="apriconv.dir"/>
+ </condition>
+
+
+ <condition property="aprutil.dir" value="${apr.dir}">
+ <isset property="apr.dir"/>
+ </condition>
+ <condition property="aprutil.include.dir"
value="${aprutil.dir}/include">
+ <isset property="aprutil.dir"/>
+ </condition>
+ <condition property="aprutil.lib.dir" value="${aprutil.dir}/lib">
+ <isset property="aprutil.dir"/>
+ </condition>
+
+ <condition property="cppunit.include.dir"
value="${cppunit.dir}/include">
+ <isset property="cppunit.dir"/>
+ </condition>
+ <condition property="cppunit.lib.dir" value="${cppunit.dir}/lib">
+ <isset property="cppunit.dir"/>
+ </condition>
+
+ <condition property="lib-suffix" value="d">
+ <isset property="is-debug"/>
+ </condition>
+ <property name="lib-suffix" value=""/>
+
+ <available property="apr-available"
file="${apr.lib.dir}/${lib.prefix}apr-1${lib-suffix}${lib.extension}"/>
+ <available property="aprutil-available"
file="${aprutil.lib.dir}/${lib.prefix}aprutil-1${lib-suffix}${lib.extension}"/>
+ <available property="apriconv-available"
file="${apriconv.lib.dir}/${lib.prefix}apriconv-1${lib-suffix}${lib.extension}"/>
+ <available property="cppunit-available"
file="${cppunit.lib.dir}/${lib.prefix}cppunit${lib-suffix}${lib.extension}"/>
+
+ <available property="apr-src-available"
file="${lib.dir}/apr-${apr.version}.tar.gz"/>
+ <available property="apriconv-src-available"
file="${lib.dir}/apr-iconv-${apriconv.version}.tar.gz"/>
+ <available property="aprutil-src-available"
file="${lib.dir}/apr-util-${aprutil.version}.tar.gz"/>
+ <available property="cppunit-src-available"
file="${lib.dir}/cppunit-${cppunit.version}.tar.gz"/>
+
+ <condition property="apr-static" value="true">
+ <equals arg1="${apr.lib.type}" arg2="static"/>
+ </condition>
+
+ <condition property="aprutil-static" value="true">
+ <equals arg1="${aprutil.lib.type}" arg2="static"/>
+ </condition>
+
+ <condition property="apriconv-static" value="true">
+ <equals arg1="${apriconv.lib.type}" arg2="static"/>
+ </condition>
+
+ <condition property="cppunit-static" value="true">
+ <equals arg1="${cppunit.lib.type}" arg2="static"/>
+ </condition>
+
+
+ <condition property="executable.dir" value="${build.dir}/debug">
+ <isset property="is-debug"/>
+ </condition>
+ <property name="executable.dir" value="${build.dir}/release"/>
+ <mkdir dir="${executable.dir}"/>
+
+
+ <property name="projectsOnly" value="false"/>
</target>
-<target name="clean">
+<target name="clean" depends="init">
<delete dir="${build.dir}"/>
<delete>
<fileset dir="${tests.dir}/src" includes="shortsocket*"
excludes="*.cpp"/>
@@ -137,32 +231,144 @@
</target>
-<target name="unix-prep" depends="init, config-check"
+<target name="unix-configure"
+ depends="config-check"
if="is-unix"
unless="config-available">
+
+ <exec executable="configure">
+ <arg value="--with-apr=${apr.dir}"/>
+ <arg value="--with-aprutil=${aprutil.dir}"/>
+ <arg value="--with-apriconv=${apriconv.dir}"/>
+ <arg value="--with-cppunit=${cppunit.dir}"/>
+ </exec>
+</target>
+
+<target name="win-configure" depends="config-check" if="is-windows">
</target>
-<target name="check-config-msvc" depends="init" if="is-windows">
- <condition property="config-msvc-available" value="true">
- <available file="${include.dir}/log4cxx/config_msvc.h"/>
- </condition>
+
+<target name="configure" depends="unix-configure, win-configure"/>
+
+<target name="get-apr-module">
+ <get src="${apache.mirror}/apr/${module}-${module.version}.tar.gz"
+ dest="${lib.dir}/${module}-${module.version}.tar.gz"
+ usetimestamp="true"/>
+ <get src="${apache.dist}/apr/${module}-${module.version}.tar.gz.asc"
+ dest="${lib.dir}/${module}-${module.version}.tar.gz.asc"
+ usetimestamp="true"/>
+ <exec executable="gpg" dir="${lib.dir}">
+ <arg value="--verify"/>
+ <arg value="${module}-${module.version}.tar.gz.asc"/>
+ </exec>
+ <untar src="${lib.dir}/${module}-${module.version}.tar.gz"
+ dest="${lib.dir}" compression="gzip"/>
</target>
-<target name="prep-config-msvc" depends="check-config-msvc" if="is-windows">
- <copy tofile="${include.dir}/log4cxx/config_msvc.h"
file="${include.dir}/log4cxx/config_msvc.h.in"/>
- <replace file="${include.dir}/log4cxx/config_msvc.h"
token="@VERSION@" value="${version}"/>
+<target name="get-apr-src" unless="apr-src-available">
+ <antcall target="get-apr-module">
+ <param name="module" value="apr"/>
+ <param name="module.version" value="${apr.version}"/>
+ </antcall>
</target>
+<target name="build-apr" depends="init" unless="apr-available">
+ <antcall target="get-apr-src"/>
-<target name="win-prep" depends="init, config-check, prep-config-msvc"
- if="is-windows"
- unless="config-available">
- <echo file="${include.dir}/log4cxx/config.h">#include "config_msvc.h"
-</echo>
+ <ant antfile="apr-build.xml" target="build" inheritAll="false">
+ <property name="version" value="${apr.version}"/>
+ <property name="debug" value="${debug}"/>
+ <property name="lib-suffix" value="${lib-suffix}"/>
+ <property name="compiler" value="${compiler}"/>
+ <property name="base.dir" value="${lib.dir}/apr-${apr.version}"/>
+ <property name="executable.dir" value="${executable.dir}"/>
+ <property name="lib.type" value="${apr.lib.type}"/>
+ </ant>
+ <property name="apr.dir" value="${lib.dir}/apr-${apr.version}"/>
+ <property name="apr.include.dir" value="${apr.dir}/include"/>
+ <property name="apr.lib.dir" value="${executable.dir}/${apr.lib.type}"/>
+</target>
+
+<target name="get-apriconv-src" unless="apriconv-src-available">
+ <antcall target="get-apr-module">
+ <param name="module" value="apr-iconv"/>
+ <param name="module.version" value="${apriconv.version}"/>
+ </antcall>
+</target>
+
+<target name="build-apriconv" depends="build-apr"
unless="apriconv-available">
+ <antcall target="get-apriconv-src"/>
+
+ <ant antfile="apriconv-build.xml" target="build" inheritAll="false">
+ <property name="version" value="${apriconv.version}"/>
+ <property name="base.dir"
value="${lib.dir}/apr-iconv-${apriconv.version}"/>
+ <property name="debug" value="${debug}"/>
+ <property name="lib-suffix" value="${lib-suffix}"/>
+ <property name="compiler" value="${compiler}"/>
+ <property name="apr.include.dir" value="${apr.include.dir}"/>
+ <property name="apr.lib.dir" value="${apr.lib.dir}"/>
+ <property name="executable.dir" value="${executable.dir}"/>
+ <property name="lib.type" value="${apriconv.lib.type}"/>
+ </ant>
+ <property name="apriconv.dir"
value="${lib.dir}/apr-iconv-${apriconv.version}"/>
+ <property name="apriconv.include.dir" value="${apriconv.dir}/include"/>
+ <property name="apriconv.lib.dir"
value="${executable.dir}/${apriconv.lib.type}"/>
+</target>
+
+<target name="get-aprutil-src" unless="aprutil-src-available">
+ <antcall target="get-apr-module">
+ <param name="module" value="apr-util"/>
+ <param name="module.version" value="${aprutil.version}"/>
+ </antcall>
</target>
-<target name="prep" depends="unix-prep, win-prep"/>
+<target name="build-aprutil" depends="build-apriconv"
unless="aprutil-available">
+ <antcall target="get-aprutil-src"/>
+
+ <ant antfile="aprutil-build.xml" target="build" inheritAll="false">
+ <property name="version" value="${aprutil.version}"/>
+ <property name="base.dir"
value="${lib.dir}/apr-util-${aprutil.version}"/>
+ <property name="debug" value="${debug}"/>
+ <property name="lib-suffix" value="${lib-suffix}"/>
+ <property name="compiler" value="${compiler}"/>
+ <property name="apr.include.dir" value="${apr.include.dir}"/>
+ <property name="apr.lib.dir" value="${apr.lib.dir}"/>
+ <property name="apriconv.include.dir"
value="${apriconv.include.dir}"/>
+ <property name="apriconv.lib.dir" value="${apriconv.lib.dir}"/>
+ <property name="executable.dir" value="${executable.dir}"/>
+ <property name="lib.type" value="${aprutil.lib.type}"/>
+ </ant>
+ <property name="aprutil.dir"
value="${lib.dir}/apr-util-${aprutil.version}"/>
+ <property name="aprutil.include.dir" value="${aprutil.dir}/include"/>
+ <property name="aprutil.lib.dir"
value="${executable.dir}/${aprutil.lib.type}"/>
+</target>
+
+<target name="get-cppunit-src" unless="cppunit-src-available">
+ <get src="${cppunit.mirror}/cppunit/cppunit-${cppunit.version}.tar.gz"
+ dest="${lib.dir}/cppunit-${cppunit.version}.tar.gz"
+ usetimestamp="true"/>
+ <untar src="${lib.dir}/cppunit-${cppunit.version}.tar.gz"
+ dest="${lib.dir}" compression="gzip"/>
+</target>
+
+
+<target name="build-cppunit" depends="init" unless="cppunit-available">
+ <antcall target="get-cppunit-src"/>
+
+ <ant antfile="cppunit-build.xml" target="build" inheritAll="false">
+ <property name="base.dir"
value="${lib.dir}/cppunit-${cppunit.version}"/>
+ <property name="cppunit.version" value="${cppunit.version}"/>
+ <property name="debug" value="${debug}"/>
+ <property name="lib-suffix" value="${lib-suffix}"/>
+ <property name="compiler" value="${compiler}"/>
+ <property name="executable.dir" value="${executable.dir}"/>
+ <property name="lib.type" value="${cppunit.lib.type}"/>
+ </ant>
+ <property name="cppunit.dir"
value="${lib.dir}/cppunit-${cppunit.version}"/>
+ <property name="cppunit.include.dir" value="${cppunit.dir}/include"/>
+ <property name="cppunit.lib.dir"
value="${executable.dir}/${cppunit.lib.type}"/>
+</target>
<target name="make-header-check" description="Generates a minimal C++ source
using a specified header">
@@ -172,8 +378,10 @@
</echo>
</target>
-<target name="header-check" depends="prep"
- description="Checks that header files declare their dependencies">
+
+<target name="header-check" depends="build-aprutil, configure"
+ description="Checks headers against Effective C++ guidelines">
+ <fail unless="is-gcc">Requires GCC compiler</fail>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<delete dir="${build.dir}/header-check"/>
<mkdir dir="${build.dir}/header-check"/>
@@ -188,14 +396,16 @@
<foreach target="make-header-check" param="header">
<path><fileset dir="${build.dir}/header-check"
includes="**/*.h"/></path>
</foreach>
- <cc objdir="${build.dir}/header-check"
+ <mkdir dir="${obj.dir}/header-check"/>
+ <cc objdir="${obj.dir}/header-check"
name="gcc"
exceptions="true"
subsystem="gui"
optimize="none"
multithreaded="true"
relentless="true"
- debug="${debug}">
+ debug="${debug}"
+ projectsOnly="${projectsOnly}">
<compilerarg value="-Weffc++"/>
<compilerarg value="-Wall"/>
<fileset dir="${build.dir}/header-check"
includes="**/*.cpp"/>
@@ -203,22 +413,26 @@
<includepath path="include"/>
<includepath path="${apr.include.dir}"/>
<includepath path="${aprutil.include.dir}"/>
- <project outfile="${build.dir}/header-check/header-check"
- type="cbuilderx" if="gen-cbx"/>
+ <project outfile="${project.dir}/header-check"
+ type="${project.type}" if="project.if"/>
</cc>
</target>
-<target name="build-log4cxx" depends="prep" description="Build log4cxx
shared library">
+<target name="build" depends="build-aprutil, configure" description="Build
log4cxx shared library">
+ <mkdir dir="${executable.dir}/${lib.type}/log4cxx_obj"/>
+
<cc name="${compiler}"
exceptions="true"
- outfile="${build.dir}/log4cxx${lib-suffix}"
+ outfile="${executable.dir}/${lib.type}/log4cxx${lib-suffix}"
subsystem="console"
multithreaded="true"
- outtype="shared"
- objdir="${obj.dir}"
- debug="${debug}">
+ outtype="${lib.type}"
+ objdir="${executable.dir}/${lib.type}/log4cxx_obj"
+ debug="${debug}"
+ projectsOnly="${projectsOnly}">
<fileset dir="${src.dir}" includes="*.cpp"/>
+ <fileset dir="${include.dir}" includes="**/*.h"/>
<includepath path="${include.dir}"/>
<includepath path="/usr/include/libxml2" if="is-unix"/>
<includepath path="${apr.include.dir}"/>
@@ -226,312 +440,213 @@
<includepath path="${apriconv.include.dir}"/>
<defineset define="_USRDLL DLL_EXPORTS" if="is-windows"/>
<defineset define="LOG4CXX"/>
- <defineset define="APR_DECLARE_STATIC"/>
- <defineset define="APU_DECLARE_STATIC"/>
+ <defineset define="APR_DECLARE_STATIC" if="apr-static"/>
+ <defineset define="APU_DECLARE_STATIC" if="aprutil-static"/>
<defineset define="WIN32" if="is-windows"/>
<libset libs="advapi32 odbc32 ws2_32" if="is-windows"/>
<libset libs="stdc++" if="is-gcc"/>
<libset libs="xml2" if="is-unix"/>
- <libset libs="${apr.lib.name}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
- <libset libs="${apr.lib.name}" unless="apr.lib.dir"/>
- <libset libs="${aprutil.lib.name}" dir="${aprutil.lib.dir}"
if="aprutil.lib.dir"/>
- <libset libs="${aprutil.lib.name}" unless="aprutil.lib.dir"/>
+ <libset libs="${apr.lib.name}${lib-suffix}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
+ <libset libs="${apr.lib.name}${lib-suffix}" unless="apr.lib.dir"/>
+ <libset libs="${aprutil.lib.name}${lib-suffix}"
dir="${aprutil.lib.dir}" if="aprutil.lib.dir"/>
+ <libset libs="${aprutil.lib.name}${lib-suffix}"
unless="aprutil.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
+ <libset libs="${apriconv.lib.name}${lib-suffix}"
dir="${apriconv.lib.dir}" if="apriconv.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
+ <libset libs="${apriconv.lib.name}${lib-suffix}"
unless="apriconv.lib.dir"/>
<syslibset libs="pthread" if="is-unix"/>
- <project outfile="cbx/log4cxx" type="cbuilderx" if="gen-cbx"/>
- <project outfile="msvc/log4cxx" type="msvc6" if="gen-dsw"/>
- <project outfile="xcode/log4cxx" type="xcode" if="gen-xcode"/>
+ <project type="${project.type}" outfile="${project.dir}/log4cxx"
if="project.if"/>
</cc>
</target>
-<target name="build-example" description="Build example template task">
+<target name="build-example">
+ <mkdir dir="${executable.dir}/${lib.type}/${example.name}_obj"/>
<cc name="${compiler}"
exceptions="true"
- outfile="${build.dir}/${example.name}"
+ outfile="${executable.dir}/${lib.type}/${example.name}"
subsystem="console"
multithreaded="true"
outtype="executable"
- objdir="${obj.dir}"
- debug="${debug}">
- <fileset dir="${example.src.dir}" includes="${example.name}.cpp"/>
+ objdir="${executable.dir}/${lib.type}/${example.name}_obj"
+ debug="${debug}"
+ projectsOnly="${projectsOnly}">
+ <fileset dir="${example.src.dir}" includes="${example.includes}"/>
<includepath path="${include.dir}"/>
<includepath path="${apr.include.dir}"/>
- <libset libs="log4cxx${lib-suffix}" dir="${build.dir}"/>
- <libset libs="${apr.lib.name}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
- <libset libs="${apr.lib.name}" unless="apr.lib.dir"/>
- <libset libs="${aprutil.lib.name}" dir="${aprutil.lib.dir}"
if="aprutil.lib.dir"/>
- <libset libs="${aprutil.lib.name}" unless="aprutil.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
+ <defineset define="WIN32" if="is-windows"/>
+ <defineset define="APR_DECLARE_STATIC" if="apr-static"/>
+ <defineset define="APU_DECLARE_STATIC" if="aprutil-static"/>
+ <defineset define="API_DECLARE_STATIC" if="iconv-static"/>
+
+
+ <libset libs="log4cxx${lib-suffix}"
dir="${executable.dir}/${lib.type}"/>
+
+ <libset libs="${apr.lib.name}${lib-suffix}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
+ <libset libs="${apr.lib.name}${lib-suffix}" unless="apr.lib.dir"/>
+ <libset libs="${aprutil.lib.name}${lib-suffix}"
dir="${aprutil.lib.dir}" if="aprutil.lib.dir"/>
+ <libset libs="${aprutil.lib.name}${lib-suffix}"
unless="aprutil.lib.dir"/>
+ <libset libs="${apriconv.lib.name}${lib-suffix}"
dir="${apriconv.lib.dir}" if="apriconv.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
+ <libset libs="${apriconv.lib.name}${lib-suffix}"
unless="apriconv.lib.dir"/>
<libset libs="stdc++" if="is-gcc"/>
- <project outfile="cbx/${example.name}" type="cbuilderx"
if="gen-cbx"/>
- <project outfile="msvc/${example.name}" type="msvc6" if="gen-dsw"/>
- <project outfile="xcode/${example.name}" type="xcode"
if="gen-xcode"/>
+ <libset libs="advapi32 ws2_32 mswsock rpcrt4" if="is-windows"/>
+
+
+ <project outfile="${project.dir}/${example.name}"
type="${project.type}" if="project.if"/>
</cc>
</target>
-<target name="build-delayedloop" depends="build-log4cxx">
+<target name="run-example">
+ <exec executable="${executable.dir}/${lib.type}/${example.name}"
+ dir="${executable.dir}/${lib.type}"
+ failonerror="true">
+ <env key="DYLD_LIBRARY_PATH"
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
+ <env key="LD_LIBRARY_PATH"
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
+ <env key="Path" value="${env.Path}"/>
+ </exec>
+</target>
+
+
+<target name="build-delayedloop" depends="build">
<antcall target="build-example">
<param name="example.src.dir" value="${examples.dir}"/>
<param name="example.name" value="delayedloop"/>
+ <param name="example.includes" value="delayedloop.cpp"/>
</antcall>
</target>
-<target name="build-trivial" depends="build-log4cxx">
+<target name="build-trivial" depends="build">
<antcall target="build-example">
<param name="example.src.dir" value="${examples.dir}"/>
<param name="example.name" value="trivial"/>
+ <param name="example.includes" value="trivial.cpp"/>
</antcall>
</target>
-<target name="build-stream" depends="build-log4cxx">
+<target name="build-stream" depends="build">
<antcall target="build-example">
<param name="example.src.dir" value="${examples.dir}"/>
<param name="example.name" value="stream"/>
+ <param name="example.includes" value="stream.cpp"/>
</antcall>
</target>
<target name="build-examples" depends="build-delayedloop, build-trivial,
build-stream"/>
-<target name="build-simplesocketserver" depends="build-log4cxx">
+<target name="build-simplesocketserver" depends="build">
<antcall target="build-example">
- <param name="example.src.dir" value="simplesocketserver"/>
+ <param name="example.src.dir" value="${base.dir}/simplesocketserver"/>
<param name="example.name" value="simplesocketserver"/>
+ <param name="example.includes" value="simplesocketserver.cpp"/>
</antcall>
</target>
-<target name="build-performance" depends="build-log4cxx">
- <cc name="${compiler}"
- exceptions="true"
- outfile="${build.dir}/performance"
- subsystem="console"
- multithreaded="true"
- outtype="executable"
- objdir="${obj.dir}"
- debug="${debug}">
- <fileset dir="performance" includes="**/*.cpp"/>
- <includepath path="${include.dir}"/>
- <includepath path="${apr.include.dir}"/>
- <libset libs="log4cxx${lib-suffix}" dir="${build.dir}"/>
- <libset libs="${apr.lib.name}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
- <libset libs="${apr.lib.name}" unless="apr.lib.dir"/>
- <libset libs="${aprutil.lib.name}" dir="${aprutil.lib.dir}"
if="aprutil.lib.dir"/>
- <libset libs="${aprutil.lib.name}" unless="aprutil.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
- dir="${apriconv.lib.dir}" if="apriconv.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
- unless="apriconv.lib.dir"/>
- <libset libs="stdc++" if="is-gcc"/>
- <project outfile="cbx/performance" type="cbuilderx" if="gen-cbx"/>
- <project outfile="msvc/performance" type="msvc6" if="gen-dsw"/>
- <project outfile="xcode/performance" type="xcode" if="gen-xcode"/>
- </cc>
+
+<target name="build-performance" depends="build">
+ <antcall target="build-example">
+ <param name="example.src.dir" value="${performance.dir}"/>
+ <param name="example.name" value="performance"/>
+ <param name="example.includes" value="**/*.cpp"/>
+ </antcall>
</target>
-<target name="build-shortsocketserver" depends="build-log4cxx"
+<target name="build-shortsocketserver" depends="build"
description="builds a socket server used by unit tests">
+ <mkdir dir="${executable.dir}/${lib.type}/shortsocketserver_obj"/>
+
<cc name="${compiler}"
exceptions="true"
outfile="${tests.dir}/src/shortsocketserver"
subsystem="console"
multithreaded="true"
outtype="executable"
- objdir="${obj.dir}"
+ objdir="${executable.dir}/${lib.type}/shortsocketserver_obj"
debug="${debug}">
<fileset dir="${tests.dir}/src">
<include name="shortsocketserver.cpp"/>
<include name="xml/xlevel.cpp"/>
+ <include name="net/socketservertestcase.h"/>
</fileset>
- <includepath path="${cppunit.include.dir}" if="cppunit.include.dir"/>
<includepath path="${include.dir}"/>
<includepath path="${apr.include.dir}"/>
- <libset libs="log4cxx${lib-suffix}" dir="${build.dir}"/>
+ <libset libs="log4cxx${lib-suffix}"
dir="${executable.dir}/${lib.type}"/>
<libset libs="${apr.lib.name}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
<libset libs="${apr.lib.name}" unless="apr.lib.dir"/>
- <libset libs="${aprutil.lib.name}" dir="${aprutil.lib.dir}"
if="aprutil.lib.dir"/>
- <libset libs="${aprutil.lib.name}" unless="aprutil.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
- dir="${apriconv.lib.dir}" if="apriconv.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
- unless="apriconv.lib.dir"/>
- <libset libs="${expat.lib.name}" dir="${expat.lib.dir}"
if="expat.lib.dir"/>
- <libset libs="${expat.lib.name}" unless="expat.lib.dir"
if="expat.lib.name"/>
<libset libs="stdc++" if="is-gcc"/>
- <libset libs="${cppunit.lib.name}" dir="${cppunit.lib.dir}"
if="cppunit.lib.dir"/>
- <libset libs="${cppunit.lib.name}" unless="cppunit.lib.dir"/>
- <project outfile="cbx/shortsocketserver" type="cbuilderx"
if="gen-cbx"/>
- <project outfile="msvc/shortsocketserver" type="msvc6" if="gen-dsw"/>
- <project outfile="xcode/shortsocketserver" type="xcode"
if="gen-xcode"/>
+ <project outfile="${project.dir}/shortsocketserver"
type="${project.type}" if="project.if"/>
</cc>
</target>
-<target name="build-unittest" depends="build-shortsocketserver">
+<target name="build-unittest" depends="build-shortsocketserver,
build-cppunit">
+ <mkdir dir="${executable.dir}/${lib.type}/log4cxx-test_obj"/>
+
<cc name="${compiler}"
exceptions="true"
- outfile="${build.dir}/log4cxx-test"
+ outfile="${executable.dir}/${lib.type}/log4cxx-test"
subsystem="console"
multithreaded="true"
outputfileproperty="log4cxx-test.exe"
outtype="executable"
- objdir="${obj.dir}"
- debug="${debug}">
- <fileset dir="${tests.dir}/src" includes="**/*.cpp">
+ objdir="${executable.dir}/${lib.type}/log4cxx-test_obj"
+ debug="${debug}"
+ projectsOnly="${projectsOnly}">
+ <fileset dir="${tests.dir}/src" includes="**/*.cpp **/*.h">
<exclude name="shortsocketserver.cpp"/>
- <exclude name="defaultinit/testcase2.cpp"/>
- <exclude name="defaultinit/testcase3.cpp"/>
- <exclude name="defaultinit/testcase4.cpp"/>
- </fileset>
- <includepath path="${cppunit.include.dir}" if="cppunit.include.dir"/>
- <includepath path="${include.dir}"/>
- <includepath path="${apr.include.dir}"/>
- <defineset define="APR_DECLARE_STATIC"/>
- <defineset define="WIN32" if="is-windows"/>
- <libset libs="log4cxx${lib-suffix}" dir="${build.dir}"/>
- <libset libs="${apr.lib.name}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
- <libset libs="${apr.lib.name}" unless="apr.lib.dir"/>
- <libset libs="${aprutil.lib.name}" dir="${aprutil.lib.dir}"
if="aprutil.lib.dir"/>
- <libset libs="${aprutil.lib.name}" unless="aprutil.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
- dir="${apriconv.lib.dir}" if="apriconv.lib.dir"/>
- <libset libs="${apriconv.lib.name}" unless="apriconv.lib.dir"/>
- <libset libs="${expat.lib.name}" dir="${expat.lib.dir}"
if="expat.lib.dir"/>
- <libset libs="${expat.lib.name}" unless="expat.lib.dir"
if="expat.lib.name"/>
- <libset libs="stdc++" if="is-gcc"/>
- <libset libs="${cppunit.lib.name}" dir="${cppunit.lib.dir}"
if="cppunit.lib.dir"/>
- <libset libs="${cppunit.lib.name}" unless="cppunit.lib.dir"/>
- <syslibset libs="Ws2_32 ws2 advapi32" if="is-windows"/>
- <project outfile="cbx/log4cxx-test" type="cbuilderx" if="gen-cbx"/>
- <project outfile="msvc/log4cxx-test" type="msvc6" if="gen-dsw"/>
- <project outfile="xcode/log4cxx-test" type="xcode" if="gen-xcode"/>
- </cc>
-
- <!-- testcase3 checks default configuration so must be run in isolation
-->
- <cc name="${compiler}"
- exceptions="true"
- outfile="${build.dir}/log4cxx-testcase3"
- subsystem="console"
- multithreaded="true"
- outputfileproperty="log4cxx-testcase3.exe"
- outtype="executable"
- objdir="${obj.dir}"
- debug="${debug}">
- <fileset dir="${tests.dir}/src">
- <include name="main.cpp"/>
- <include name="defaultinit/testcase3.cpp"/>
</fileset>
<includepath path="${cppunit.include.dir}" if="cppunit.include.dir"/>
<includepath path="${include.dir}"/>
<includepath path="${apr.include.dir}"/>
- <defineset define="APR_DECLARE_STATIC"/>
- <defineset define="WIN32" if="is-windows"/>
- <defineset define="APR_DECLARE_STATIC"/>
- <libset libs="log4cxx${lib-suffix}" dir="${build.dir}"/>
- <libset libs="${apr.lib.name}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
- <libset libs="${apr.lib.name}" unless="apr.lib.dir"/>
- <libset libs="${aprutil.lib.name}" dir="${aprutil.lib.dir}"
if="aprutil.lib.dir"/>
- <libset libs="${aprutil.lib.name}" unless="aprutil.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
- dir="${apriconv.lib.dir}" if="apriconv.lib.dir"/>
- <libset libs="${apriconv.lib.name}" unless="apriconv.lib.dir"/>
- <libset libs="${expat.lib.name}" dir="${expat.lib.dir}"
if="expat.lib.dir"/>
- <libset libs="${expat.lib.name}" unless="expat.lib.dir"
if="expat.lib.name"/>
+ <defineset define="APR_DECLARE_STATIC" if="apr-static"/>
+ <defineset define="WIN32" if="is-windows"/>
+ <libset libs="log4cxx${lib-suffix}"
dir="${executable.dir}/${lib.type}"/>
+ <libset libs="${apr.lib.name}${lib-suffix}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
+ <libset libs="${apr.lib.name}${lib-suffix}" unless="apr.lib.dir"/>
+ <libset libs="${cppunit.lib.name}${lib-suffix}"
dir="${cppunit.lib.dir}" if="cppunit.lib.dir"/>
+ <libset libs="${cppunit.lib.name}${lib-suffix}"
unless="cppunit.lib.dir"/>
<libset libs="stdc++" if="is-gcc"/>
- <libset libs="${cppunit.lib.name}" dir="${cppunit.lib.dir}"
if="cppunit.lib.dir"/>
- <libset libs="${cppunit.lib.name}" unless="cppunit.lib.dir"/>
- <syslibset libs="Ws2_32 ws2 advapi32" if="is-windows"/>
- <project outfile="cbx/log4cxx-testcase3" type="cbuilderx"
if="gen-cbx"/>
- <project outfile="msvc/log4cxx-testcase3" type="msvc6" if="gen-dsw"/>
- <project outfile="xcode/log4cxx-testcase3" type="xcode"
if="gen-xcode"/>
- </cc>
+ <syslibset libs="Ws2_32 ws2 advapi32" if="is-windows"/>
- <!-- testcase4 checks default configuration so must be run in isolation
-->
- <cc name="${compiler}"
- exceptions="true"
- outfile="${build.dir}/log4cxx-testcase4"
- subsystem="console"
- multithreaded="true"
- outputfileproperty="log4cxx-testcase4.exe"
- outtype="executable"
- objdir="${obj.dir}"
- debug="${debug}">
- <fileset dir="${tests.dir}/src">
- <include name="main.cpp"/>
- <include name="defaultinit/testcase4.cpp"/>
- </fileset>
- <includepath path="${cppunit.include.dir}" if="cppunit.include.dir"/>
- <includepath path="${include.dir}"/>
- <includepath path="${apr.include.dir}"/>
- <defineset define="APR_DECLARE_STATIC"/>
- <defineset define="WIN32" if="is-windows"/>
- <defineset define="APR_DECLARE_STATIC"/>
- <libset libs="log4cxx${lib-suffix}" dir="${build.dir}"/>
- <libset libs="${apr.lib.name}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
- <libset libs="${apr.lib.name}" unless="apr.lib.dir"/>
- <libset libs="${aprutil.lib.name}" dir="${aprutil.lib.dir}"
if="aprutil.lib.dir"/>
- <libset libs="${aprutil.lib.name}" unless="aprutil.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
- dir="${apriconv.lib.dir}" if="apriconv.lib.dir"/>
- <libset libs="${apriconv.lib.name}" unless="apriconv.lib.dir"/>
- <libset libs="${expat.lib.name}" dir="${expat.lib.dir}"
if="expat.lib.dir"/>
- <libset libs="${expat.lib.name}" unless="expat.lib.dir"
if="expat.lib.name"/>
- <libset libs="stdc++" if="is-gcc"/>
- <libset libs="${cppunit.lib.name}" dir="${cppunit.lib.dir}"
if="cppunit.lib.dir"/>
- <libset libs="${cppunit.lib.name}" unless="cppunit.lib.dir"/>
- <syslibset libs="Ws2_32 ws2 advapi32" if="is-windows"/>
- <project outfile="cbx/log4cxx-testcase4" type="cbuilderx"
if="gen-cbx"/>
- <project outfile="msvc/log4cxx-testcase4" type="msvc6" if="gen-dsw"/>
- <project outfile="xcode/log4cxx-testcase4" type="xcode"
if="gen-xcode"/>
+ <project outfile="${project.dir}/log4cxx-test"
type="${project.type}" if="project.if"/>
</cc>
-
-
</target>
<target name="build-standalone-unittest"
- depends="build-shortsocketserver"
+ depends="build-shortsocketserver, build-cppunit"
description="Build a single project that is easier to debug in IDEs">
- <mkdir dir="${obj.dir}/standalone"/>
+ <mkdir dir="${executable.dir}/static/log4cxx-standalone-test_obj"/>
<cc name="${compiler}"
exceptions="true"
- outfile="${build.dir}/log4cxx-standalone-test"
+ outfile="${executable.dir}/static/log4cxx-standalone-test"
subsystem="console"
multithreaded="true"
outputfileproperty="log4cxx-standalone-test.exe"
outtype="executable"
- objdir="${obj.dir}/standalone"
- debug="${debug}">
+ objdir="${executable.dir}/static/log4cxx-standalone-test_obj"
+ debug="${debug}"
+ projectsOnly="${projectsOnly}">
<fileset dir="${src.dir}" includes="*.cpp"/>
- <fileset dir="${tests.dir}/src" includes="**/*.cpp">
+ <fileset dir="${include.dir}" includes="**/*.h"/>
+ <fileset dir="${tests.dir}/src" includes="**/*.cpp **/*.h">
<exclude name="shortsocketserver.cpp"/>
- <exclude name="defaultinit/testcase3.cpp"/>
</fileset>
<includepath path="${cppunit.include.dir}" if="cppunit.include.dir"/>
<includepath path="${include.dir}"/>
<includepath path="${apr.include.dir}"/>
- <defineset define="APR_DECLARE_STATIC"/>
- <defineset define="WIN32" if="is-windows"/>
- <libset libs="${apr.lib.name}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
- <libset libs="${apr.lib.name}" unless="apr.lib.dir"/>
- <libset libs="${aprutil.lib.name}" dir="${aprutil.lib.dir}"
if="aprutil.lib.dir"/>
- <libset libs="${aprutil.lib.name}" unless="aprutil.lib.dir"/>
- <libset libs="${apriconv.lib.name}"
- dir="${apriconv.lib.dir}" if="apriconv.lib.dir"/>
- <libset libs="${apriconv.lib.name}" unless="apriconv.lib.dir"/>
- <libset libs="stdc++" if="is-gcc"/>
- <libset libs="${cppunit.lib.name}" dir="${cppunit.lib.dir}"
if="cppunit.lib.dir"/>
- <libset libs="${cppunit.lib.name}" unless="cppunit.lib.dir"/>
- <libset libs="${expat.lib.name}" dir="${expat.lib.dir}"
if="expat.lib.dir"/>
- <libset libs="${expat.lib.name}" unless="expat.lib.dir"
if="expat.lib.name"/>
+ <defineset define="APR_DECLARE_STATIC" if="apr-static"/>
+ <defineset define="WIN32" if="is-windows"/>
+ <libset libs="${apr.lib.name}${lib-suffix}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
+ <libset libs="${apr.lib.name}${lib-suffix}" unless="apr.lib.dir"/>
+ <libset libs="${cppunit.lib.name}${lib-suffix}"
dir="${cppunit.lib.dir}" if="cppunit.lib.dir"/>
+ <libset libs="${cppunit.lib.name}${lib-suffix}"
unless="cppunit.lib.dir"/>
<includepath path="${include.dir}"/>
<includepath path="/usr/include/libxml2" if="is-unix"/>
@@ -541,9 +656,7 @@
<libset libs="xml2" if="is-unix"/>
- <project outfile="cbx/log4cxx-standalone-test" type="cbuilderx"
if="gen-cbx"/>
- <project outfile="msvc/log4cxx-standalone-test" type="msvc6"
if="gen-dsw"/>
- <project outfile="xcode/log4cxx-standalone-test" type="xcode"
if="gen-xcode"/>
+ <project outfile="${projects.dir}/log4cxx-standalone-test"
type="${project.type}" if="project.if"/>
</cc>
</target>
@@ -555,78 +668,84 @@
<mkdir dir="${tests.dir}/output"/>
<exec executable="${log4cxx-test.exe}" dir="${tests.dir}"
failonerror="true">
+ <arg value="+TestCase1"/>
<env key="LD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
<env key="DYLD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
<env key="Path"
- value="${build.dir};${env.Path}"/>
+ value="${executable.dir}/${lib.type};${env.Path}"/>
</exec>
<!-- test use of log4j.configuration -->
<property name="defaultInit3.properties"
location="${tests.dir}/input/defaultInit3.properties"/>
- <exec executable="${log4cxx-testcase3.exe}" dir="${tests.dir}"
+ <exec executable="${log4cxx-test.exe}" dir="${tests.dir}"
failonerror="true">
+ <arg value="TestCase3"/>
<env key="LD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
<env key="DYLD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
<env key="log4j.configuration"
value="${defaultInit3.properties}"/>
</exec>
<!-- test of LOG4CXX_CONFIGURATION -->
- <exec executable="${log4cxx-testcase3.exe}" dir="${tests.dir}"
+ <exec executable="${log4cxx-test.exe}" dir="${tests.dir}"
failonerror="true">
+ <arg value="TestCase3"/>
<env key="LD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
<env key="DYLD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
<env key="LOG4CXX_CONFIGURATION"
value="${defaultInit3.properties}"/>
</exec>
<!-- test of log4j.properties -->
- <mkdir dir="${build.dir}/output"/>
- <delete file="${build.dir}/log4*.properties"/>
- <delete file="${build.dir}/log4*.xml"/>
- <copy tofile="${build.dir}/log4j.properties"
+ <mkdir dir="${executable.dir}/${lib.type}/output"/>
+ <delete file="${executable.dir}/${lib.type}/log4*.properties"/>
+ <delete file="${executable.dir}/${lib.type}/log4*.xml"/>
+ <copy tofile="${executable.dir}/${lib.type}/log4j.properties"
file="${defaultInit3.properties}" overwrite="true"/>
- <exec executable="${log4cxx-testcase3.exe}" dir="${build.dir}"
+ <exec executable="${log4cxx-test.exe}"
dir="${executable.dir}/${lib.type}"
failonerror="true">
+ <arg value="TestCase3"/>
<env key="DYLD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
<env key="LD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
</exec>
<!-- modify log4j.properties so if it has precedence the test fails -->
- <replace file="${build.dir}/log4j.properties" token="D3" value="D4"/>
- <copy tofile="${build.dir}/log4cxx.properties"
+ <replace file="${executable.dir}/${lib.type}/log4j.properties"
token="D3" value="D4"/>
+ <copy tofile="${executable.dir}/${lib.type}/log4cxx.properties"
file="${defaultInit3.properties}"/>
- <exec executable="${log4cxx-testcase3.exe}" dir="${build.dir}"
+ <exec executable="${log4cxx-test.exe}"
dir="${executable.dir}/${lib.type}"
failonerror="true">
+ <arg value="TestCase3"/>
<env key="DYLD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
<env key="LD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
</exec>
- <delete file="${build.dir}/log4cxx.properties"/>
- <delete file="${build.dir}/log4j.properties"/>
+ <delete file="${executable.dir}/${lib.type}/log4cxx.properties"/>
+ <delete file="${executable.dir}/${lib.type}/log4j.properties"/>
<property name="defaultInit.xml"
location="${tests.dir}/input/xml/defaultInit.xml"/>
- <copy tofile="${build.dir}/log4j.xml"
+ <copy tofile="${executable.dir}/${lib.type}/log4j.xml"
file="${defaultInit.xml}"/>
- <copy todir="${build.dir}" file="${tests.dir}/input/xml/log4j.dtd"/>
- <exec executable="${log4cxx-testcase4.exe}" dir="${build.dir}"
+ <copy todir="${executable.dir}/${lib.type}"
file="${tests.dir}/input/xml/log4j.dtd"/>
+ <exec executable="${log4cxx-test.exe}"
dir="${executable.dir}/${lib.type}"
failonerror="true">
+ <arg value="TestCase4"/>
<env key="LD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
<env key="DYLD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
</exec>
</target>
@@ -637,16 +756,115 @@
<exec executable="${log4cxx-standalone-test.exe}" dir="${tests.dir}"
failonerror="true">
<env key="DYLD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.DYLD_LIBRARY_PATH}"/>
<env key="LD_LIBRARY_PATH"
-
value="${build.dir}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
+
value="${executable.dir}/${lib.type}:${apr.lib.dir}:${aprutil.lib.dir}:${apriconv.lib.dir}:${env.LD_LIBRARY_PATH}"/>
<env key="Path"
- value="${build.dir};${env.Path}"/>
+ value="${executable.dir}/${lib.type};${env.Path}"/>
</exec>
</target>
-<target name="check" depends="build-log4cxx, run-unittest"/>
+<target name="build-projects">
+ <mkdir dir="msvc"/>
+ <antcall target="build">
+ <param name="project.if" value="true"/>
+ <param name="project.type" value="${project.type}"/>
+ <param name="projects.dir" value="${project.dir}"/>
+ <param name="projectsOnly" value="true"/>
+ </antcall>
+ <antcall target="build-unittest">
+ <param name="project.if" value="true"/>
+ <param name="project.type" value="${project.type}"/>
+ <param name="projects.dir" value="${project.dir}"/>
+ <param name="projectsOnly" value="true"/>
+ </antcall>
+ <antcall target="build-standalone-unittest">
+ <param name="project.if" value="true"/>
+ <param name="project.type" value="${project.type}"/>
+ <param name="projects.dir" value="${project.dir}"/>
+ <param name="projectsOnly" value="true"/>
+ </antcall>
+ <antcall target="build-examples">
+ <param name="project.if" value="true"/>
+ <param name="project.type" value="${project.type}"/>
+ <param name="projects.dir" value="${project.dir}"/>
+ <param name="projectsOnly" value="true"/>
+ </antcall>
+ <antcall target="build-performance">
+ <param name="project.if" value="true"/>
+ <param name="project.type" value="${project.type}"/>
+ <param name="projects.dir" value="${project.dir}"/>
+ <param name="projectsOnly" value="true"/>
+ </antcall>
+</target>
+
+<target name="build-projects-vc6">
+ <antcall target="build-projects">
+ <param name="project.dir" value="msvc"/>
+ <param name="project.type" value="msvc6"/>
+ </antcall>
+</target>
+
+<target name="build-projects-xcode">
+ <antcall target="build-projects">
+ <param name="project.dir" value="xcode"/>
+ <param name="project.type" value="xcode"/>
+ </antcall>
+</target>
+
+<target name="build-projects-cbx">
+ <antcall target="build-projects">
+ <param name="project.dir" value="cbx"/>
+ <param name="project.type" value="cbuilderx"/>
+ </antcall>
+</target>
+
+
+<target name="check" depends="run-unittest, build-examples,
build-performance">
+ <antcall target="run-example">
+ <param name="example.name" value="trivial"/>
+ </antcall>
+ <antcall target="run-example">
+ <param name="example.name" value="stream"/>
+ </antcall>
+</target>
+
+
+<target name="dist" depends="init">
+ <tar destfile="${build.dir}/log4cxx-${version}.tar.gz"
+ compression="gzip">
+ <tarfileset dir="${base.dir}" prefix="log4cxx-${version}">
+ <include name="AUTHORS"/>
+ <include name="autogen.sh"/>
+ <include name="ChangeLog"/>
+ <include name="COPYING"/>
+ <include name="INSTALL"/>
+ <include name="license.apl"/>
+ <include name="Makefile.am"/>
+ <include name="NEWS"/>
+ <include name="README"/>
+ <include name="*.xml"/>
+ <include name="examples/*.cpp"/>
+ <include name="include/**/*.h"/>
+ <include name="mock/*"/>
+ <include name="performance/*.cpp"/>
+ <include name="performance/*.h"/>
+ <include name="performance/**/*.xml"/>
+ <include name="simplesocketserver/*.cpp"/>
+ <include name="src/*.cpp"/>
+ <include name="tests/**/*.properties"/>
+ <include name="tests/input/xml/*.xml"/>
+ <include name="tests/input/xml/*.dtd"/>
+ <include name="tests/src/**/*.cpp"/>
+ <include name="tests/src/**/*.h"/>
+ <include name="tests/witness/*"/>
+ <include name="tests/witness/ndc/*"/>
+ <include name="tests/log4j.dtd"/>
+ <exclude name="**/.cvsignore"/>
+ </tarfileset>
+ </tar>
+</target>
-<target name="gump" depends="build-log4cxx, check, header-check"/>
+<target name="gump" depends="check, header-check"/>
</project>
1.1 logging-log4cxx/apr-build.xml
Index: apr-build.xml
===================================================================
<?xml version="1.0"?>
<!--
Copyright 2004-2005 The Apache Software Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
This file builds APR using Apache Ant (http://ant.apache.org)
and the C++ compilation tasks from http://ant-contrib.sourceforge.net.
-->
<project name="apr" default="check">
<property name="debug" value="true"/>
<property name="build.dir" location="build"/>
<property name="version" value="1.1.0"/>
<property name="base.dir" location="."/>
<property name="include.dir" location="${base.dir}/include"/>
<property name="lib.type" value="shared"/>
<taskdef resource="cpptasks.tasks"/>
<typedef resource="cpptasks.types"/>
<target name="usage">
<echo>
</echo>
</target>
<target name="os-detect">
<condition property="is-unix" value="true">
<os family="unix"/>
</condition>
<condition property="is-windows" value="true">
<os family="windows"/>
</condition>
</target>
<target name="win-init" depends="os-detect" if="is-windows">
<property name="compiler" value="msvc"/>
<property name="arch" value="win32"/>
</target>
<target name="unix-init" depends="os-detect" if="is-unix">
<property name="compiler" value="gcc"/>
<condition property="is-gcc" value="true">
<or>
<equals arg1="${compiler}" arg2="gcc"/>
<equals arg1="${compiler}" arg2="g++"/>
</or>
</condition>
<property name="arch" value="unix"/>
</target>
<target name="init" depends="win-init, unix-init">
<condition property="is-debug" value="true">
<istrue value="${debug}"/>
</condition>
<condition property="executable.dir" value="${build.dir}/debug">
<isset property="is-debug"/>
</condition>
<property name="executable.dir" location="${build.dir}/release"/>
<mkdir dir="${executable.dir}"/>
<condition property="lib-suffix" value="d">
<isset property="is-debug"/>
</condition>
<property name="lib-suffix" value=""/>
<condition property="is-shared" value="true">
<equals arg1="${lib.type}" arg2="shared"/>
</condition>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="configure-check" depends="init">
<condition property="configure-available" value="true">
<available file="${include.dir}/apr.h"/>
</condition>
</target>
<target name="win-configure" depends="configure-check" if="is-windows"
unless="configure-available">
<copy tofile="${include.dir}/apr.h" file="${include.dir}/apr.hw"/>
</target>
<target name="unix-configure" depends="configure-check" if="is-unix"
unless="apr_h-available">
<exec executable="configure" dir="${base.dir}"/>
</target>
<target name="configure" depends="unix-configure, win-configure"/>
<target name="build" depends="configure" description="Build library">
<mkdir dir="${executable.dir}/${lib.type}/apr_obj"/>
<cc name="${compiler}"
outfile="${executable.dir}/${lib.type}/apr-1${lib-suffix}"
subsystem="console"
multithreaded="true"
outtype="${lib.type}"
objdir="${executable.dir}/${lib.type}/apr_obj"
debug="${debug}">
<fileset dir="${base.dir}" includes="**/${arch}/*.c"
excludes="**/apr_app.c"/>
<fileset dir="${base.dir}/file_io/unix" includes="copy.c fileacc.c
filepath_util.c fullrw.c mktemp.c tempdir.c"/>
<fileset dir="${base.dir}/memory/unix" includes="*.c"/>
<fileset dir="${base.dir}/misc/unix" includes="errorcodes.c getopt.c
otherchild.c version.c"/>
<fileset dir="${base.dir}/mmap/unix" includes="common.c"/>
<fileset dir="${base.dir}/network_io/unix" includes="inet_ntop.c
inet_pton.c sockaddr.c"/>
<fileset dir="${base.dir}/poll/unix" includes="select.c"/>
<fileset dir="${base.dir}/random/unix" includes="*.c"/>
<fileset dir="${base.dir}/strings" includes="*.c"/>
<fileset dir="${base.dir}/tables" includes="*.c"/>
<includepath path="${include.dir}"/>
<includepath path="${include.dir}/arch"/>
<includepath path="${include.dir}/arch/${arch}"/>
<includepath path="${include.dir}/arch/unix"/>
<defineset define="APR_DECLARE_EXPORT" if="is-shared"/>
<defineset define="APR_DECLARE_STATIC" unless="is-shared"/>
<defineset define="WIN32" if="is-windows"/>
<libset libs="advapi32 ws2_32 mswsock rpcrt4" if="is-windows"/>
</cc>
</target>
<target name="build-check" depends="init">
<mkdir dir="${executable.dir}/${lib.type}/apr_obj"/>
<cc name="${compiler}"
outfile="${executable.dir}/${lib.type}/aprtest"
subsystem="console"
multithreaded="true"
outtype="executable"
objdir="${executable.dir}/${lib.type}/apr_obj"
debug="${debug}">
<fileset dir="${base.dir}/test" includes="**/*.c">
<exclude name="nw_misc.c"/>
<exclude name="internal/testregex.c"/>
</fileset>
<includepath path="${include.dir}"/>
<defineset define="WIN32" if="is-windows"/>
<libset dir="${executable.dir}/${lib.type}"
libs="apr-1${lib-suffix}"/>
</cc>
</target>
<target name="check" depends="build-check">
</target>
</project>
1.1 logging-log4cxx/apriconv-build.xml
Index: apriconv-build.xml
===================================================================
<?xml version="1.0"?>
<!--
Copyright 2004-2005 The Apache Software Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
This file builds APR using Apache Ant (http://ant.apache.org)
and the C++ compilation tasks from http://ant-contrib.sourceforge.net.
-->
<project name="apriconv" default="check">
<property name="debug" value="true"/>
<property name="build.dir" location="build"/>
<property name="version" value="1.0.1"/>
<property name="base.dir" location="."/>
<property name="include.dir" location="${base.dir}/include"/>
<property name="lib.type" value="static"/>
<taskdef resource="cpptasks.tasks"/>
<typedef resource="cpptasks.types"/>
<property name="apr.dir" location="${base.dir}/../apr-1.1.0"/>
<property name="apr.include.dir" location="${apr.dir}/include"/>
<target name="usage">
<echo>
</echo>
</target>
<target name="os-detect">
<condition property="is-unix" value="true">
<os family="unix"/>
</condition>
<condition property="is-windows" value="true">
<os family="windows"/>
</condition>
</target>
<target name="win-init" depends="os-detect" if="is-windows">
<property name="compiler" value="msvc"/>
<property name="arch" value="win32"/>
</target>
<target name="unix-init" depends="os-detect" if="is-unix">
<property name="compiler" value="gcc"/>
<condition property="is-gcc" value="true">
<or>
<equals arg1="${compiler}" arg2="gcc"/>
<equals arg1="${compiler}" arg2="g++"/>
</or>
</condition>
<property name="arch" value="unix"/>
</target>
<target name="init" depends="win-init, unix-init">
<condition property="is-debug" value="true">
<istrue value="${debug}"/>
</condition>
<condition property="executable.dir" value="${build.dir}/debug">
<isset property="is-debug"/>
</condition>
<property name="executable.dir" location="${build.dir}/release"/>
<mkdir dir="${executable.dir}"/>
<condition property="lib-suffix" value="d">
<isset property="is-debug"/>
</condition>
<property name="lib-suffix" value=""/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="configure-check" depends="init">
<condition property="config-available" value="true">
<available file="${base.dir}/lib/apr_iconv_private.h"/>
</condition>
</target>
<target name="win-configure" depends="configure-check" if="is-windows"
unless="config-available">
<copy tofile="${base.dir}/lib/apr_iconv_private.h"
file="${base.dir}/lib/apr_iconv_private.h.in"/>
</target>
<target name="unix-configure" depends="configure-check" if="is-unix"
unless="apr_h-available">
<exec executable="configure" dir="${base.dir}"/>
</target>
<target name="configure" depends="unix-configure, win-configure"/>
<target name="build" depends="configure" description="Build library">
<mkdir dir="${executable.dir}/${lib.type}/apriconv_obj"/>
<cc name="${compiler}"
outfile="${executable.dir}/${lib.type}/apriconv${lib-suffix}"
subsystem="console"
multithreaded="true"
outtype="${lib.type}"
objdir="${executable.dir}/${lib.type}/apriconv_obj"
debug="${debug}">
<fileset dir="${base.dir}" includes="**/*.c" excludes="util/*"/>
<includepath path="${include.dir}"/>
<includepath path="${base.dir}/lib"/>
<includepath path="${apr.include.dir}"/>
<defineset define="API_DECLARE_EXPORT" if="is-shared"/>
<defineset define="API_DECLARE_STATIC" unless="is-shared"/>
<defineset define="WIN32" if="is-windows"/>
</cc>
</target>
<target name="build-check" depends="build"/>
<target name="check" depends="build-check"/>
</project>
1.1 logging-log4cxx/aprutil-build.xml
Index: aprutil-build.xml
===================================================================
<?xml version="1.0"?>
<!--
Copyright 2004-2005 The Apache Software Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
This file builds APR using Apache Ant (http://ant.apache.org)
and the C++ compilation tasks from http://ant-contrib.sourceforge.net.
-->
<project name="aprutil" default="check">
<property name="debug" value="true"/>
<property name="build.dir" location="build"/>
<property name="version" value="1.1.0"/>
<property name="base.dir" location="."/>
<property name="include.dir" location="${base.dir}/include"/>
<property name="lib.type" value="shared"/>
<taskdef resource="cpptasks.tasks"/>
<typedef resource="cpptasks.types"/>
<property name="apr.dir" location="${base.dir}/../apr-1.1.0"/>
<property name="apr.include.dir" location="${apr.dir}/include"/>
<property name="apriconv.dir" location="${base.dir}/../apr-iconv-1.0.1"/>
<property name="apriconv.include.dir" location="${apriconv.dir}/include"/>
<target name="usage">
<echo>
</echo>
</target>
<target name="os-detect">
<condition property="is-unix" value="true">
<os family="unix"/>
</condition>
<condition property="is-windows" value="true">
<os family="windows"/>
</condition>
</target>
<target name="win-init" depends="os-detect" if="is-windows">
<property name="compiler" value="msvc"/>
<property name="arch" value="win32"/>
</target>
<target name="unix-init" depends="os-detect" if="is-unix">
<property name="compiler" value="gcc"/>
<condition property="is-gcc" value="true">
<or>
<equals arg1="${compiler}" arg2="gcc"/>
<equals arg1="${compiler}" arg2="g++"/>
</or>
</condition>
<property name="arch" value="unix"/>
</target>
<target name="init" depends="win-init, unix-init">
<condition property="is-debug" value="true">
<istrue value="${debug}"/>
</condition>
<condition property="executable.dir" value="${build.dir}/debug">
<isset property="is-debug"/>
</condition>
<property name="executable.dir" location="${build.dir}/release"/>
<mkdir dir="${executable.dir}"/>
<condition property="lib-suffix" value="d">
<isset property="is-debug"/>
</condition>
<property name="lib-suffix" value=""/>
<available property="src-available" file="${base.dir}"/>
<condition property="is-shared" value="true">
<equals arg1="${lib.type}" arg2="shared"/>
</condition>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="configure-check" depends="init">
<condition property="config-available" value="true">
<and>
<available file="${include.dir}/apu.h"/>
<available file="${include.dir}/apu_want.h"/>
<available file="${include.dir}/private/apu_config.h"/>
<available
file="${include.dir}/private/apu_select_dbm.h"/>
<available file="${base.dir}/xml/expat/lib/expat.h"/>
<available file="${base.dir}/xml/expat/lib/config.h"/>
</and>
</condition>
</target>
<target name="win-configure" depends="configure-check" if="is-windows"
unless="config-available">
<copy tofile="${include.dir}/apu.h" file="${include.dir}/apu.hw"/>
<copy tofile="${include.dir}/apu_want.h"
file="${include.dir}/apu_want.hw"/>
<copy tofile="${include.dir}/private/apu_config.h"
file="${include.dir}/private/apu_config.hw"/>
<copy tofile="${include.dir}/private/apu_select_dbm.h"
file="${include.dir}/private/apu_select_dbm.hw"/>
<copy tofile="${base.dir}/xml/expat/lib/expat.h"
file="${base.dir}/xml/expat/lib/expat.h.in"/>
<copy tofile="${base.dir}/xml/expat/lib/config.h"
file="${base.dir}/xml/expat/lib/winconfig.h"/>
</target>
<target name="unix-configure" depends="configure-check" if="is-unix"
unless="apr_h-available">
<exec executable="configure" dir="${base.dir}"/>
</target>
<target name="configure" depends="unix-configure, win-configure"/>
<target name="build" depends="configure" description="Build library">
<mkdir dir="${executable.dir}/${lib.type}/aprutil_obj"/>
<cc name="${compiler}"
outfile="${executable.dir}/${lib.type}/aprutil-1${lib-suffix}"
subsystem="console"
multithreaded="true"
outtype="${lib.type}"
objdir="${executable.dir}/${lib.type}/aprutil_obj"
debug="${debug}">
<fileset dir="${base.dir}" includes="**/*.c"
excludes="test/*.c ldap/*.c xml/expat/lib/*"/>
<fileset dir="${base.dir}/xml/expat/lib"
includes="xmlparse.c xmlrole.c xmltok.c"/>
<includepath path="${include.dir}"/>
<includepath path="${include.dir}/private"/>
<includepath path="${apr.include.dir}"/>
<includepath path="${apriconv.include.dir}"/>
<includepath path="${base.dir}/xml/expat/lib"/>
<defineset define="APU_DECLARE_EXPORT" if="is-shared"/>
<defineset define="APU_DECLARE_STATIC" unless="is-shared"/>
<defineset>
<define name="VERSION" value='\"expat_1.95.1\"'/>
<define name="XML_MAJOR_VERSION" value="1"/>
<define name="XML_MINOR_VERSION" value="95"/>
<define name="XML_MICRO_VERSION" value="1"/>
</defineset>
<defineset define="WIN32" if="is-windows"/>
<libset dir="${apr.lib.dir}" libs="apr-1"/>
<libset dir="${apriconv.lib.dir}" libs="apriconv"/>
</cc>
</target>
<target name="build-check" depends="build"/>
<target name="check" depends="build-check"/>
</project>
1.1 logging-log4cxx/cppunit-build.xml
Index: cppunit-build.xml
===================================================================
<?xml version="1.0"?>
<!--
Copyright 2004-2005 The Apache Software Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
This file builds Cppunit using Apache Ant (http://ant.apache.org)
and the C++ compilation tasks from http://ant-contrib.sourceforge.net.
-->
<project name="cppunit" default="check">
<property name="debug" value="true"/>
<property name="build.dir" location="build"/>
<property name="version" value="1.10.2"/>
<property name="include.dir" location="${base.dir}/include"/>
<property name="lib.type" value="static"/>
<taskdef resource="cpptasks.tasks"/>
<typedef resource="cpptasks.types"/>
<target name="usage">
<echo>
</echo>
</target>
<target name="os-detect">
<condition property="is-unix" value="true">
<os family="unix"/>
</condition>
<condition property="is-windows" value="true">
<os family="windows"/>
</condition>
</target>
<target name="win-init" depends="os-detect" if="is-windows">
<property name="compiler" value="msvc"/>
</target>
<target name="unix-init" depends="os-detect" if="is-unix">
<property name="compiler" value="gcc"/>
<condition property="is-gcc" value="true">
<or>
<equals arg1="${compiler}" arg2="gcc"/>
<equals arg1="${compiler}" arg2="g++"/>
</or>
</condition>
<property name="arch" value="unix"/>
</target>
<target name="init" depends="win-init, unix-init">
<condition property="is-debug" value="true">
<istrue value="${debug}"/>
</condition>
<condition property="executable.dir" value="${build.dir}/debug">
<isset property="is-debug"/>
</condition>
<property name="executable.dir" location="${build.dir}/release"/>
<mkdir dir="${executable.dir}"/>
<condition property="lib-suffix" value="d">
<isset property="is-debug"/>
</condition>
<property name="lib-suffix" value=""/>
<available property="src-available" file="${base.dir}"/>
<condition property="is-shared" value="true">
<equals arg1="${lib.type}" arg2="shared"/>
</condition>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="configure-check" depends="init">
<condition property="config-available" value="true">
<available file="${include.dir}/apr.h"/>
</condition>
</target>
<target name="win-configure" depends="configure-check" if="is-windows"
unless="config-available">
</target>
<target name="unix-configure" depends="configure-check" if="is-unix"
unless="config-available">
<exec executable="configure" dir="${base.dir}"/>
</target>
<target name="configure" depends="unix-configure, win-configure"/>
<target name="build" depends="configure" description="Build library">
<mkdir dir="${executable.dir}/${lib.type}/cppunit_obj"/>
<cc name="${compiler}"
outfile="${executable.dir}/${lib.type}/cppunit${lib-suffix}"
subsystem="console"
multithreaded="true"
outtype="${lib.type}"
rtti="true"
exceptions="true"
objdir="${executable.dir}/${lib.type}/cppunit_obj"
debug="${debug}">
<fileset dir="${base.dir}/src/cppunit" includes="**/*.cpp"/>
<includepath path="${include.dir}"/>
<defineset define="CPPUNIT_BUILD_DLL" if="is-shared"/>
<defineset define="CPPUNIT_BUILD_STATIC" unless="is-shared"/>
<defineset define="WIN32" if="is-windows"/>
</cc>
</target>
<target name="build-check" depends="build">
</target>
<target name="check" depends="build-check">
</target>
</project>
1.3 +2 -1 logging-log4cxx/include/log4cxx/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/logging-log4cxx/include/log4cxx/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .cvsignore 21 Oct 2004 04:53:43 -0000 1.2
+++ .cvsignore 6 Feb 2005 02:04:33 -0000 1.3
@@ -3,5 +3,6 @@
config_auto_log4cxx.h
config_auto.h
config_auto.h.in
-config_msvc.h
+config_msvc.h
+config.h
stamp-h1
1.13 +52 -12 logging-log4cxx/tests/src/main.cpp
Index: main.cpp
===================================================================
RCS file: /home/cvs/logging-log4cxx/tests/src/main.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- main.cpp 6 Jan 2005 07:26:56 -0000 1.12
+++ main.cpp 6 Feb 2005 02:04:33 -0000 1.13
@@ -37,7 +37,10 @@
#include <log4cxx/basicconfigurator.h>
-
+extern CPPUNIT_NS::Test* createTestCase1();
+extern CPPUNIT_NS::Test* createTestCase2();
+extern CPPUNIT_NS::Test* createTestCase3();
+extern CPPUNIT_NS::Test* createTestCase4();
//
@@ -58,19 +61,56 @@
bool wasSuccessful = true;
if (argc > 1)
{
+ bool runAll = false;
for (int n = 1; n < argc; n++)
{
- try
- {
- wasSuccessful = runner.run(argv[n], false)
&& wasSuccessful;
- }
- catch(std::exception& e)
- {
- std::cout << e.what() << std::endl;
- }
- catch (...) {
- std::cout << "Unexpected exception";
- }
+ std::string testName(argv[n]);
+ //
+ // if any name starts with a +
+ // run it in addition to all tests
+ if (argv[n][0] == '+') {
+ runAll = true;
+ testName.erase(0, 1);
+ }
+
+ //
+ // if the test case starts with
TestCase
+ //
+ if (testName.length() >= 9 &&
testName.compare(0, 8, "TestCase") == 0) {
+ char testN = testName[8];
+ switch(testN) {
+ case '1':
+
runner.addTest(createTestCase1());
+ break;
+ case '2':
+
runner.addTest(createTestCase2());
+ break;
+ case '3':
+
runner.addTest(createTestCase3());
+ break;
+ case '4':
+
runner.addTest(createTestCase4());
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (runAll) {
+ wasSuccessful = runner.run("",
false);
+ } else {
+ try
+ {
+ wasSuccessful =
runner.run(testName, false) && wasSuccessful;
+ }
+ catch(std::exception& e)
+ {
+ std::cout << e.what()
<< std::endl;
+ }
+ catch (...) {
+ std::cout <<
"Unexpected exception";
+ }
+ }
}
}
else
1.3 +4 -1 logging-log4cxx/tests/src/defaultinit/testcase1.cpp
Index: testcase1.cpp
===================================================================
RCS file: /home/cvs/logging-log4cxx/tests/src/defaultinit/testcase1.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- testcase1.cpp 22 Apr 2004 21:21:36 -0000 1.2
+++ testcase1.cpp 6 Feb 2005 02:04:33 -0000 1.3
@@ -46,4 +46,7 @@
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(TestCase1);
+CPPUNIT_NS::Test* createTestCase1() {
+ return TestCase1::suite();
+}
+
1.7 +4 -1 logging-log4cxx/tests/src/defaultinit/testcase2.cpp
Index: testcase2.cpp
===================================================================
RCS file: /home/cvs/logging-log4cxx/tests/src/defaultinit/testcase2.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- testcase2.cpp 12 Jan 2005 04:37:12 -0000 1.6
+++ testcase2.cpp 6 Feb 2005 02:04:33 -0000 1.7
@@ -56,6 +56,9 @@
};
-CPPUNIT_TEST_SUITE_REGISTRATION(TestCase2);
+CPPUNIT_NS::Test* createTestCase2() {
+ return TestCase2::suite();
+}
+
#endif //HAVE_XML
1.7 +3 -1 logging-log4cxx/tests/src/defaultinit/testcase3.cpp
Index: testcase3.cpp
===================================================================
RCS file: /home/cvs/logging-log4cxx/tests/src/defaultinit/testcase3.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- testcase3.cpp 16 Dec 2004 06:41:18 -0000 1.6
+++ testcase3.cpp 6 Feb 2005 02:04:33 -0000 1.7
@@ -52,4 +52,6 @@
};
-CPPUNIT_TEST_SUITE_REGISTRATION(TestCase3);
+CPPUNIT_NS::Test* createTestCase3() {
+ return TestCase3::suite();
+}
1.7 +3 -1 logging-log4cxx/tests/src/defaultinit/testcase4.cpp
Index: testcase4.cpp
===================================================================
RCS file: /home/cvs/logging-log4cxx/tests/src/defaultinit/testcase4.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- testcase4.cpp 12 Jan 2005 04:37:12 -0000 1.6
+++ testcase4.cpp 6 Feb 2005 02:04:33 -0000 1.7
@@ -57,6 +57,8 @@
};
-CPPUNIT_TEST_SUITE_REGISTRATION(TestCase4);
+CPPUNIT_NS::Test* createTestCase4() {
+ return TestCase4::suite();
+}
#endif //HAVE_XML