2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
19 <property file="build.properties"/>
20 <property name="debug" value="true"/>
21 <property name="rtti" value="false"/>
22 <property name="optimize" value="none"/>
23 <property name="lib.type" value="shared"/>
24 <property name="runtime" value="dynamic"/>
26 <taskdef resource="cpptasks.tasks"/>
27 <typedef resource="cpptasks.types"/>
29 <target name="os-detect">
30 <condition property="os.family" value="mac">
33 <condition property="os.family" value="windows">
34 <os family="windows"/>
36 <property name="os.family" value="unix"/>
37 <condition property="is-mac" value="1">
38 <equals arg1="${os.family}" arg2="mac"/>
40 <condition property="is-windows" value="1">
41 <equals arg1="${os.family}" arg2="windows"/>
43 <condition property="is-unix" value="1">
45 <equals arg1="${os.family}" arg2="unix"/>
46 <equals arg1="${os.family}" arg2="mac"/>
47 <equals arg1="${os.family}" arg2="cygwin"/>
53 <target name="win-init" depends="os-detect" if="is-windows">
54 <property name="compiler" value="msvc"/>
56 <condition property="is-bcc" value="true">
58 <equals arg1="${compiler}" arg2="bcc"/>
62 <condition property="is-msvc" value="true">
64 <equals arg1="${compiler}" arg2="msvc"/>
68 <condition property="is-mingw" value="true">
70 <equals arg1="${compiler}" arg2="gcc"/>
71 <equals arg1="${compiler}" arg2="g++"/>
76 <target name="mac-init" depends="os-detect" if="is-mac">
77 <property name="project.type" value="xcode"/>
81 <target name="unix-init" depends="mac-init" if="is-unix">
83 <property name="compiler" value="gcc"/>
85 <condition property="has-expat" value="true">
86 <not><isset property="is-mac"/></not>
88 <condition property="is-cygwin" value="true">
89 <os family="windows"/>
94 <target name="common-init" depends="win-init, unix-init">
95 <available classname="net.sf.antcontrib.cpptasks.CCTask" property="cctask-available"/>
96 <fail unless="cctask-available">cpptasks required
98 Use cpptasks 1.0b5 or later from
99 http://ant-contrib.sourceforge.net.
102 <available classname="net.sf.antcontrib.cpptasks.ide.ProjectDef"
103 property="cctask-project-available"/>
104 <!-- fail unless="cctask-project-available">later version of cpptasks required
106 Required features not present in cpptasks releases prior to Feb 2005</fail -->
108 <mkdir dir="${target.dir}"/>
109 <property name="projects.dir" value="${target.dir}"/>
110 <mkdir dir="${projects.dir}"/>
112 <condition property="is-gcc" value="true">
114 <equals arg1="${compiler}" arg2="gcc"/>
115 <equals arg1="${compiler}" arg2="g++"/>
119 <condition property="pic-option" value="-fPIC">
121 <isset property="is-gcc"/>
122 <istrue value="${use-pic}"/>
127 <condition property="is-debug" value="true">
128 <istrue value="${debug}"/>
131 <condition property="debug.release" value="debug">
132 <isset property="is-debug"/>
134 <property name="debug.release" value="release"/>
137 <condition property="D.debug" value="d">
138 <isset property="is-debug"/>
140 <property name="D.debug" value=""/>
142 <condition property="D.R" value="d">
143 <isset property="is-debug"/>
145 <property name="D.R" value="r"/>
148 <property name="lib-suffix" value=""/>
150 <condition property="is-static" value="1">
151 <equals arg1="${lib.type}" arg2="static"/>
153 <condition property="is-shared" value="1">
154 <equals arg1="${lib.type}" arg2="shared"/>
157 <property name="executable.dir" value="${target.dir}/${debug.release}/${lib.type}"/>
159 <property name="projectsOnly" value="false"/>
161 <property name="apr.lib.name" value="apr-1"/>
162 <property name="apr.sample.h" value="apr_pools.h"/>
163 <property name="apr.sample.c" value="file_io/unix/dir.c"/>
164 <property name="apr-util.lib.name" value="aprutil-1"/>
165 <property name="apr-util.sample.h" value="apr_xml.h"/>
166 <property name="apr-util.sample.c" value="xml/apr_xml.c"/>
167 <property name="esmtp.lib.name" value="esmtp"/>
168 <property name="esmtp.sample.h" value="libesmtp.h"/>
169 <property name="esmtp.sample.c" value="smtp-api.c"/>
173 <target name="copy-if-changed-compare" unless="force-copy">
174 <condition property="force-copy" value="2">
175 <not><filesmatch file1="${tofile}" file2="${file}"/></not>
179 <target name="copy-if-changed" depends="copy-if-changed-compare" if="force-copy">
180 <copy tofile="${tofile}" file="${file}" overwrite="true"/>