Author: carnold
Date: Thu Feb 14 09:23:12 2008
New Revision: 627807

URL: http://svn.apache.org/viewvc?rev=627807&view=rev
Log:
LOGCXX-1: Ant build tweaks for libesmtp

Modified:
    logging/log4cxx/trunk/build.xml
    logging/log4cxx/trunk/src/ant/common.xml
    logging/log4cxx/trunk/src/ant/esmtp-build.xml
    logging/log4cxx/trunk/src/examples/cpp/trivial.cpp

Modified: logging/log4cxx/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/build.xml?rev=627807&r1=627806&r2=627807&view=diff
==============================================================================
--- logging/log4cxx/trunk/build.xml (original)
+++ logging/log4cxx/trunk/build.xml Thu Feb 14 09:23:12 2008
@@ -22,7 +22,8 @@
         <libset 
libs="${apr-util.lib.prefix}${apr-util.lib.name}${apr-util.lib.suffix}" 
unless="apr-util.lib.dir"/>
         <libset libs="${apr.lib.prefix}${apr.lib.name}${apr.lib.suffix}" 
dir="${apr.lib.dir}" if="apr.lib.dir"/>
         <libset libs="${apr.lib.prefix}${apr.lib.name}${apr.lib.suffix}" 
unless="apr.lib.dir"/>
-        <libset libs="esmtp" if="has-libesmtp"/>
+        <libset libs="esmtp" dir="${esmtp.lib.dir}" if="esmtp.lib.dir"/>
+        <libset libs="esmtp" if="has-libesmtp" unless="esmtp.lib.dir"/>
       <libset libs="${odbc.lib}" if="odbc.lib"/>
       <libset libs="${apr-util.dependencies}" if="apr-util.dependencies"/>
         <libset libs="pthread" if="is-unix"/>
@@ -494,7 +495,7 @@
          </cc>
 </target>
 
-<target name="build" depends="build-apr-util, configure" description="Build 
log4cxx library">
+<target name="build" depends="build-apr-util, build-libesmtp, configure" 
description="Build log4cxx library">
     <mkdir dir="${log4cxx.lib.dir}/log4cxx_obj"/>
 
    <condition property="apr-static" value="1">
@@ -534,8 +535,9 @@
         <fileset dir="${src.dir}" includes="*.cpp"/>
         <fileset dir="${include.dir}" includes="**/*.h"/>
         <includepath path="${include.dir}"/>
-        <includepath path="${apr.include.dir}"/>
-        <includepath path="${apr-util.include.dir}"/>
+        <includepath path="${apr.include.dir}" if="apr.include.dir"/>
+        <includepath path="${apr-util.include.dir}" if="apr-util.include.dir"/>
+        <includepath path="${esmtp.include.dir}" if="esmtp.include.dir"/>
         <defineset define="_USRDLL DLL_EXPORTS" if="is-windows"/>
         <defineset define="LOG4CXX"/>
         <defineset define="LOG4CXX_STATIC" if="is-static"/>
@@ -548,6 +550,7 @@
          <comment>&license;</comment>
             <dependency file="${projects.dir}/apr-1"/>
             <dependency file="${projects.dir}/aprutil-1" depends="apr-1"/>
+            <dependency name="${projects.dir}/libesmtp"/>
         </project>
     </cc>
 </target>
@@ -570,7 +573,7 @@
         <fileset dir="${example.src.dir}" includes="${example.includes}"/>
         <includepath path="${include.dir}"/>
         <includepath path="${example.include.dir}"/>
-        <includepath path="${apr.include.dir}"/>
+        <includepath path="${apr.include.dir}" if="apr.include.dir"/>
 
         <defineset define="WIN32" if="is-windows"/>
         <defineset define="LOG4CXX_STATIC" if="is-static"/>
@@ -585,6 +588,7 @@
          <comment>&license;</comment>
             <dependency file="${projects.dir}/apr-1"/>
             <dependency name="${projects.dir}/aprutil-1"/>
+            <dependency name="${projects.dir}/libesmtp"/>
             <dependency file="${projects.dir}/log4cxx" 
depends="apr-1,aprutil-1"/>
         </project>
         
@@ -664,8 +668,8 @@
                 projectsOnly="${projectsOnly}">
         <fileset dir="${tests.cpp.dir}" includes="**/*.cpp **/*.c **/*.h"/>
         <includepath path="${include.dir}"/>
-        <includepath path="${apr.include.dir}"/>
-        <includepath path="${apr-util.include.dir}"/>
+        <includepath path="${apr.include.dir}" if="apr.include.dir"/>
+        <includepath path="${apr-util.include.dir}" if="apr-util.include.dir"/>
         <defineset define="LOG4CXX_STATIC" if="is-static"/>
         <defineset define="APR_DECLARE_STATIC" if="apr-static"/>
         <defineset define="APU_DECLARE_STATIC" if="apr-util-static"/>
@@ -679,7 +683,8 @@
          <comment>&license;</comment>
             <dependency file="${projects.dir}/apr-1"/>
             <dependency file="${projects.dir}/aprutil-1" depends="apr-1"/>
-            <dependency file="${projects.dir}/log4cxx" 
depends="apr-1,aprutil-1"/>
+            <dependency name="${projects.dir}/libesmtp"/>
+            <dependency file="${projects.dir}/log4cxx" 
depends="apr-1,aprutil-1,libesmtp"/>
         </project>
     </cc>
 </target>
@@ -689,7 +694,7 @@
 
 <target name="build-standalone-unittest"
     description="Builds a unit tests + log4cxx executable"
-    depends="build-apr-util,configure">
+    depends="build-apr-util, build-libesmtp, configure">
     <mkdir dir="${executable.dir}/static/testsuite-standalone_obj"/>
     <property name="project.compiler" value="${compiler}"/>
    <property name="project.type" value="msvc6"/>
@@ -707,8 +712,9 @@
         <fileset dir="${include.dir}" includes="**/*.h"/>
         <fileset dir="${tests.cpp.dir}" includes="**/*.cpp **/*.c **/*.h"/>
         <includepath path="${include.dir}"/>
-        <includepath path="${apr.include.dir}"/>
-        <includepath path="${apr-util.include.dir}"/>
+         <includepath path="${apr.include.dir}" if="apr.include.dir"/>
+        <includepath path="${apr-util.include.dir}" if="apr-util.include.dir"/>
+        <includepath path="${esmtp.include.dir}" if="esmtp.include.dir"/>
         <defineset define="LOG4CXX"/>
         <defineset define="APR_DECLARE_STATIC" if="apr-static"/>
         <defineset define="APU_DECLARE_STATIC" if="apr-util-static"/>
@@ -729,6 +735,7 @@
          <comment>&license;</comment>
             <dependency file="${projects.dir}/apr-1"/>
             <dependency file="${projects.dir}/aprutil-1" depends="apr-1"/>
+            <dependency name="${projects.dir}/libesmtp"/>
         </project>
     </cc>
 </target>
@@ -982,7 +989,7 @@
           description="Builds project files for Apple Xcode">
     <antcall target="build-projects">
         <param name="project.type" value="xcode"/>
-        <param name="project.compiler" value="g++"/>
+        <param name="project.compiler" value="gcc"/>
         <param name="os.family" value="mac"/>
         <param name="debug" value="${debug}"/>
         <param name="find" value="${find}"/>

Modified: logging/log4cxx/trunk/src/ant/common.xml
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/ant/common.xml?rev=627807&r1=627806&r2=627807&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/ant/common.xml (original)
+++ logging/log4cxx/trunk/src/ant/common.xml Thu Feb 14 09:23:12 2008
@@ -70,7 +70,7 @@
 
 <target name="unix-init" depends="mac-init" if="is-unix">
 
-    <property name="compiler" value="g++"/>
+    <property name="compiler" value="gcc"/>
 
     <condition property="has-expat" value="true">
          <not><isset property="is-mac"/></not>
@@ -154,9 +154,9 @@
         <property name="apr-util.lib.name" value="aprutil-1"/>
                <property name="apr-util.sample.h" value="apr_xml.h"/>
                <property name="apr-util.sample.c" value="xml/apr_xml.c"/>
-        <property name="esmtp.lib.name" value="esmtp"/>
-               <property name="esmtp.sample.h" value="libesmtp.h"/>
-               <property name="esmtp.sample.c" value="smtp-api.c"/>
+        <property name="esmtp.lib.name" value="esmtp"/>
+               <property name="esmtp.sample.h" value="libesmtp.h"/>
+               <property name="esmtp.sample.c" value="smtp-api.c"/>
 </target>
 
 

Modified: logging/log4cxx/trunk/src/ant/esmtp-build.xml
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/ant/esmtp-build.xml?rev=627807&r1=627806&r2=627807&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/ant/esmtp-build.xml (original)
+++ logging/log4cxx/trunk/src/ant/esmtp-build.xml Thu Feb 14 09:23:12 2008
@@ -55,7 +55,7 @@
 
 <target name="configure-check" depends="init">
         <condition property="esmtp-configure-available" value="true">
-              <available file="${include.dir}/libesmtp.h"/>
+              <available file="${include.dir}/config.h"/>
         </condition>
 </target>
 

Modified: logging/log4cxx/trunk/src/examples/cpp/trivial.cpp
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/examples/cpp/trivial.cpp?rev=627807&r1=627806&r2=627807&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/examples/cpp/trivial.cpp (original)
+++ logging/log4cxx/trunk/src/examples/cpp/trivial.cpp Thu Feb 14 09:23:12 2008
@@ -14,40 +14,29 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <log4cxx/logstring.h>
-#include <stdlib.h>
+
 #include <log4cxx/logger.h>
 #include <log4cxx/basicconfigurator.h>
-#include <log4cxx/helpers/exception.h>
-#include <log4cxx/ndc.h>
-#include <locale.h>
 
 using namespace log4cxx;
-using namespace log4cxx::helpers;
 
-int main()
-{
-    setlocale(LC_ALL, "");
-    int result = EXIT_SUCCESS;
-    try
+struct Foo {
+  Foo(const char *prefix):
+    logger (Logger::getLogger ("foo")), prefix (prefix)
+    {}
+  ~Foo()
     {
-                BasicConfigurator::configure();
-                LoggerPtr rootLogger = Logger::getRootLogger();
-
-                NDC::push("trivial context");
+      LOG4CXX_DEBUG (logger, "dtor");
+    }
+  LoggerPtr logger;
+  const char *prefix;
+};
 
-                LOG4CXX_DEBUG(rootLogger, "debug message");
-                LOG4CXX_INFO(rootLogger, "info message");
-                LOG4CXX_WARN(rootLogger, "warn message");
-                LOG4CXX_ERROR(rootLogger, "error message");
-                LOG4CXX_FATAL(rootLogger, "fatal message");
 
-                NDC::pop();
-        }
-        catch(std::exception&)
-        {
-                result = EXIT_FAILURE;
-        }
-
-    return result;
+Foo global ("global: ");
+int main()
+{
+  BasicConfigurator::configure();
+  Foo local ("local: ");
+  return 0;
 }


Reply via email to