Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LOGCXX-1: Migrate SMTPAppender to libesmtp
- Loading branch information
Curt Arnold
committed
Dec 11, 2007
1 parent
bf8fa7a
commit 8a35b42
Showing
11 changed files
with
914 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You 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 libesmtp using Apache Ant (http://ant.apache.org) | ||
and the C++ compilation tasks from http://ant-contrib.sourceforge.net. | ||
--> | ||
<project name="esmtp" default="build"> | ||
|
||
<property name="debug" value="true"/> | ||
<property name="esmtp.version" value="1.0.4"/> | ||
<property name="esmtp.dir" location="${ant.file}/../../../../../libesmtp-${esmtp.version}"/> | ||
<property name="esmtp.include.dir" location="${esmtp.dir}"/> | ||
<property name="build.dir" location="${user.dir}/target"/> | ||
<property name="src.dir" location="${esmtp.dir}"/> | ||
<property name="esmtp.lib.type" value="shared"/> | ||
<property name="project.dir" location="${build.dir}"/> | ||
|
||
<taskdef resource="cpptasks.tasks"/> | ||
<typedef resource="cpptasks.types"/> | ||
|
||
<target name="usage" description="Displays usage notes on build"> | ||
<echo> | ||
</echo> | ||
</target> | ||
|
||
<target name="os-detect"> | ||
<condition property="is-mac" value="true"> | ||
<and> | ||
<os family="mac"/> | ||
<not><isset property="is-windows"/></not> | ||
</and> | ||
</condition> | ||
<condition property="is-unix" value="true"> | ||
<and> | ||
<not> | ||
<or> | ||
<isset property="is-windows"/> | ||
<equals arg1="${os.family}" arg2="windows"/> | ||
</or> | ||
</not> | ||
<or> | ||
<os family="unix"/> | ||
<equals arg1="${os.family}" arg2="cygwin"/> | ||
<equals arg1="${os.family}" arg2="unix"/> | ||
</or> | ||
</and> | ||
</condition> | ||
<condition property="is-windows" value="true"> | ||
<and> | ||
<not><isset property="is-unix"/></not> | ||
<or> | ||
<os family="windows"/> | ||
<equals arg1="${os.family}" arg2="windows"/> | ||
</or> | ||
</and> | ||
</condition> | ||
</target> | ||
|
||
|
||
<target name="win-init" depends="os-detect" if="is-windows"> | ||
<property name="compiler" value="msvc"/> | ||
<property name="arch" value="win32"/> | ||
<property name="project.type" value="msvc6"/> | ||
</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"/> | ||
<property name="project.type" value="cbuilderx"/> | ||
</target> | ||
|
||
<target name="init" depends="win-init, unix-init"> | ||
<property environment="env"/> | ||
<condition property="pic-option" value="-fPIC"> | ||
<and> | ||
<isset property="is-gcc"/> | ||
<istrue value="${use-pic}"/> | ||
</and> | ||
</condition> | ||
|
||
<condition property="is-debug" value="true"> | ||
<istrue value="${debug}"/> | ||
</condition> | ||
|
||
<condition property="esmtp.lib.dir" value="${build.dir}/debug/${esmtp.lib.type}"> | ||
<isset property="is-debug"/> | ||
</condition> | ||
<property name="esmtp.lib.dir" location="${build.dir}/release/${esmtp.lib.type}"/> | ||
<mkdir dir="${esmtp.lib.dir}"/> | ||
|
||
<condition property="lib-suffix" value="d"> | ||
<isset property="is-debug"/> | ||
</condition> | ||
<property name="lib-suffix" value=""/> | ||
|
||
<condition property="is-esmtp-shared" value="true"> | ||
<equals arg1="${esmtp.lib.type}" arg2="shared"/> | ||
</condition> | ||
|
||
<condition property="is-bcc" value="true"> | ||
<equals arg1="${compiler}" arg2="bcc"/> | ||
</condition> | ||
<condition property="project.if" value="true"> | ||
<istrue value="${project.if.value}"/> | ||
</condition> | ||
</target> | ||
|
||
<target name="clean" description="Removes build product files"> | ||
<delete dir="${build.dir}"/> | ||
</target> | ||
|
||
|
||
<target name="configure-check" depends="init"> | ||
<condition property="esmtp-configure-available" value="true"> | ||
<available file="${esmtp.include.dir}/libesmtp.h"/> | ||
</condition> | ||
</target> | ||
|
||
|
||
<target name="win-configure" depends="configure-check" if="is-windows" unless="esmtp-configure-available"> | ||
<copy tofile="${esmtp.include.dir}/libesmtp.h" file="${esmtp.include.dir}/libesmtp.hw"/> | ||
</target> | ||
|
||
<target name="unix-configure" depends="configure-check" if="is-unix" unless="esmtp-configure-available"> | ||
<!-- shelling to configure allows cygwin to work --> | ||
<exec executable="sh" dir="${esmtp.dir}"> | ||
<arg value="./configure"/> | ||
</exec> | ||
</target> | ||
|
||
|
||
<target name="configure" depends="unix-configure, win-configure"/> | ||
|
||
|
||
<target name="build" depends="configure" description="Build library"> | ||
<mkdir dir="${esmtp.lib.dir}/esmtp_obj"/> | ||
<property name="project.compiler" value="${compiler}"/> | ||
<cc name="${project.compiler}" | ||
outfile="${esmtp.lib.dir}/esmtp${lib-suffix}" | ||
subsystem="console" | ||
multithreaded="true" | ||
outtype="${esmtp.lib.type}" | ||
objdir="${esmtp.lib.dir}/esmtp_obj" | ||
outputfileproperty="esmtp.dll" | ||
debug="${debug}" | ||
projectsOnly="${projectsOnly}"> | ||
<fileset dir="${src.dir}" includes="*.c" excludes="getaddrinfo.c"/> | ||
<includepath path="${esmtp.include.dir}"/> | ||
<defineset define="HAVE_CONFIG_H"/> | ||
<defineset> | ||
<define name="VERSION" value='"${esmtp.version}"'/> | ||
</defineset> | ||
<compilerarg value="${pic-option}" if="pic-option"/> | ||
<libset libs="advapi32 ws2_32 mswsock rpcrt4" if="is-windows"/> | ||
<libset libs="ssl crypto" if="is-unix"/> | ||
<libset libs="cw32mt" if="is-bcc"/> | ||
<project type="${project.type}" outfile="${project.dir}/esmtp" if="project.if"/> | ||
</cc> | ||
</target> | ||
|
||
|
||
<target name="build-projects"> | ||
<mkdir dir="${project.dir}"/> | ||
<antcall target="build"> | ||
<param name="project.if" value="true"/> | ||
<param name="project.type" value="${project.type}"/> | ||
<param name="project.compiler" value="${project.compiler}"/> | ||
<param name="projects.dir" value="${project.dir}"/> | ||
<param name="projectsOnly" value="true"/> | ||
</antcall> | ||
</target> | ||
|
||
<target name="build-projects-vc6" description="Builds project files for Microsoft Visual C++ 6"> | ||
<antcall target="build-projects"> | ||
<param name="project.dir" value="msvc"/> | ||
<param name="project.type" value="msvc6"/> | ||
<param name="project.compiler" value="msvc"/> | ||
</antcall> | ||
</target> | ||
|
||
<target name="build-projects-vc8" description="Builds project files for Microsoft Visual C++ 2005"> | ||
<antcall target="build-projects"> | ||
<param name="project.dir" value="msvc"/> | ||
<param name="project.type" value="msvc8"/> | ||
<param name="project.compiler" value="msvc"/> | ||
</antcall> | ||
</target> | ||
|
||
<target name="build-projects-xcode" description="Builds project files for Apple Xcode"> | ||
<antcall target="build-projects"> | ||
<param name="project.dir" value="xcode"/> | ||
<param name="project.type" value="xcode"/> | ||
<param name="project.compiler" value="${compiler}"/> | ||
</antcall> | ||
</target> | ||
|
||
<target name="build-projects-cbx" description="Builds project files for Borland CBuilderX"> | ||
<antcall target="build-projects"> | ||
<param name="project.dir" value="cbx"/> | ||
<param name="project.type" value="cbuilderx"/> | ||
<param name="project.compiler" value="${compiler}"/> | ||
</antcall> | ||
</target> | ||
|
||
|
||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.