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 <target name="find-esmtp-src" depends="init">
20 <condition property="esmtp.dir" value="${with-libesmtp}">
21 <available file="${with-libesmtp}"/>
23 <condition property="esmtp.src.dir" value="${esmtp.dir}">
24 <available file="${esmtp.dir}/${esmtp.sample.c}"/>
26 <condition property="esmtp.src.dir" value="../libesmtp">
27 <available file="../libesmtp/${esmtp.sample.c}"/>
32 <target name="find-esmtp-lib" depends="find-esmtp-src" if="has-libesmtp" unless="force-ant">
33 <condition property="esmtp.lib.file"
34 value="${esmtp.dir}/lib${esmtp.lib.name}.la">
35 <available file="${esmtp.dir}/lib${esmtp.lib.name}.la"/></condition>
36 <condition property="esmtp.lib.file"
37 value="${esmtp.dir}/lib${esmtp.lib.name}.dylib">
38 <available file="${esmtp.dir}/lib${esmtp.lib.name}.dylib"/></condition>
39 <condition property="esmtp.lib.file"
40 value="${esmtp.dir}/lib${esmtp.lib.name}.so">
41 <available file="${esmtp.dir}/lib${esmtp.lib.name}.so"/></condition>
42 <condition property="esmtp.lib.file"
43 value="${esmtp.dir}/lib${esmtp.lib.name}.a">
44 <available file="${esmtp.dir}/lib${esmtp.lib.name}.a"/></condition>
45 <condition property="esmtp.lib.file"
46 value="${esmtp.dir}/${esmtp.lib.name}.lib">
47 <available file="${esmtp.dir}/${esmtp.lib.name}.lib"/></condition>
48 <condition property="esmtp.lib.file.dir" value="${esmtp.dir}">
49 <isset property="esmtp.lib.file"/>
52 <condition property="esmtp.lib.file"
53 value="${esmtp.dir}/.libs/lib${esmtp.lib.name}.la">
54 <available file="${esmtp.dir}/.libs/lib${esmtp.lib.name}.la"/></condition>
55 <condition property="esmtp.lib.file"
56 value="${esmtp.dir}/.libs/lib${esmtp.lib.name}.dylib">
57 <available file="${esmtp.dir}/.libs/lib${esmtp.lib.name}.dylib"/></condition>
58 <condition property="esmtp.lib.file"
59 value="${esmtp.dir}/.libs/lib${esmtp.lib.name}.so">
60 <available file="${esmtp.dir}/.libs/lib${esmtp.lib.name}.so"/></condition>
61 <condition property="esmtp.lib.file"
62 value="${esmtp.dir}/.libs/lib${esmtp.lib.name}.a">
63 <available file="${esmtp.dir}/.libs/lib${esmtp.lib.name}.a"/></condition>
64 <condition property="esmtp.lib.file"
65 value="${esmtp.dir}/.libs/${esmtp.lib.name}.lib">
66 <available file="${esmtp.dir}/.libs/${esmtp.lib.name}.lib"/></condition>
67 <condition property="esmtp.lib.file.dir" value="${esmtp.dir}/.libs">
68 <isset property="esmtp.lib.file"/>
71 <!-- start looking at candidates in /usr -->
72 <condition property="esmtp.lib.file"
73 value="/usr/lib/lib${esmtp.lib.name}.la">
74 <available file="/usr/lib/lib${esmtp.lib.name}.la"/></condition>
75 <condition property="esmtp.lib.file"
76 value="/usr/lib/lib${esmtp.lib.name}.dylib">
77 <available file="/usr/lib/lib${esmtp.lib.name}.dylib"/></condition>
78 <condition property="esmtp.lib.file"
79 value="/usr/lib/lib${esmtp.lib.name}.so">
80 <available file="/usr/lib/lib${esmtp.lib.name}.so"/></condition>
81 <condition property="esmtp.lib.file"
82 value="/usr/lib/lib${esmtp.lib.name}.a">
83 <available file="/usr/lib/lib${esmtp.lib.name}.a"/></condition>
84 <condition property="esmtp.dir" value="/usr">
85 <isset property="esmtp.lib.file"/>
87 <condition property="esmtp.lib.file.dir" value="/usr/lib">
88 <isset property="esmtp.lib.file"/>
91 <!-- start looking at candidates in /usr/local -->
92 <condition property="esmtp.lib.file"
93 value="/usr/local/lib/lib${esmtp.lib.name}.la">
94 <available file="/usr/local/lib/lib${esmtp.lib.name}.la"/></condition>
95 <condition property="esmtp.lib.file"
96 value="/usr/local/lib/lib${esmtp.lib.name}.dylib">
97 <available file="/usr/local/lib/lib${esmtp.lib.name}.dylib"/></condition>
98 <condition property="esmtp.lib.file"
99 value="/usr/local/lib/lib${esmtp.lib.name}.so">
100 <available file="/usr/local/lib/lib${esmtp.lib.name}.so"/></condition>
101 <condition property="esmtp.lib.file"
102 value="/usr/local/lib/lib${esmtp.lib.name}.a">
103 <available file="/usr/local/lib/lib${esmtp.lib.name}.a"/></condition>
104 <condition property="esmtp.dir" value="/usr/local">
105 <isset property="esmtp.lib.file"/>
107 <condition property="esmtp.lib.file.dir" value="/usr/local/lib">
108 <isset property="esmtp.lib.file"/>
112 <property name="relative-esmtp" location="../libesmtp"/>
113 <condition property="esmtp.dir" value="${relative-esmtp}">
114 <available file="${relative-esmtp}"/>
116 <condition property="esmtp.lib.file"
117 value="${esmtp.dir}/lib${esmtp.lib.name}.la">
118 <available file="${esmtp.dir}/lib${esmtp.lib.name}.la"/></condition>
119 <condition property="esmtp.lib.file"
120 value="${esmtp.dir}/lib${esmtp.lib.name}.dylib">
121 <available file="${esmtp.dir}/lib${esmtp.lib.name}.dylib"/></condition>
122 <condition property="esmtp.lib.file"
123 value="${esmtp.dir}/lib${esmtp.lib.name}.so">
124 <available file="${esmtp.dir}/lib${esmtp.lib.name}.so"/></condition>
125 <condition property="esmtp.lib.file"
126 value="${esmtp.dir}/lib${esmtp.lib.name}.a">
127 <available file="${esmtp.dir}/lib${esmtp.lib.name}.a"/></condition>
128 <condition property="esmtp.lib.file"
129 value="${esmtp.dir}/${esmtp.lib.name}.lib">
130 <available file="${esmtp.dir}/${esmtp.lib.name}.lib"/></condition>
131 <condition property="esmtp.lib.file.dir" value="${esmtp.dir}">
132 <isset property="esmtp.lib.file"/>
135 <condition property="esmtp.lib.file"
136 value="${esmtp.dir}/.libs/lib${esmtp.lib.name}.la">
137 <available file="${esmtp.dir}/.libs/lib${esmtp.lib.name}.la"/></condition>
138 <condition property="esmtp.lib.file"
139 value="${esmtp.dir}/.libs/lib${esmtp.lib.name}.dylib">
140 <available file="${esmtp.dir}/.libs/lib${esmtp.lib.name}.dylib"/></condition>
141 <condition property="esmtp.lib.file"
142 value="${esmtp.dir}/.libs/lib${esmtp.lib.name}.so">
143 <available file="${esmtp.dir}/.libs/lib${esmtp.lib.name}.so"/></condition>
144 <condition property="esmtp.lib.file"
145 value="${esmtp.dir}/.libs/lib${esmtp.lib.name}.a">
146 <available file="${esmtp.dir}/.libs/lib${esmtp.lib.name}.a"/></condition>
147 <condition property="esmtp.lib.file.dir" value="${esmtp.dir}/.libs">
148 <isset property="esmtp.lib.file"/>
150 <fail unless="esmtp.dir">Unable to locate esmtp base directory.</fail>
155 <!-- Static debug libraries in APR's VC6 projects typical location (ignored unless debug build) -->
156 <condition property="esmtp.lib.file"
157 value="${esmtp.dir}/LibD/${esmtp.lib.name}.lib">
159 <isset property="is-debug"/>
160 <available file="${esmtp.dir}/LibD/${esmtp.lib.name}.lib"/>
163 <condition property="esmtp.lib.file.dir"
164 value="${esmtp.dir}/LibD">
165 <isset property="esmtp.lib.file"/>
171 <!-- Shared debug libraries in APR's VC6 projects typical location (ignored unless debug build) -->
172 <condition property="esmtp.lib.file"
173 value="${esmtp.dir}/Debug/lib${esmtp.lib.name}.lib">
175 <isset property="is-debug"/>
176 <available file="${esmtp.dir}/Debug/lib${esmtp.lib.name}.lib"/>
179 <condition property="esmtp.lib.file.dir"
180 value="${esmtp.dir}/Debug">
181 <isset property="esmtp.lib.file"/>
186 <!-- Static release libraries in APR's VC6 projects typical location (ignored unless debug build) -->
187 <condition property="esmtp.lib.file"
188 value="${esmtp.dir}/LibR/${esmtp.lib.name}.lib">
189 <available file="${esmtp.dir}/LibR/${esmtp.lib.name}.lib"/>
191 <condition property="esmtp.lib.file.dir"
192 value="${esmtp.dir}/LibR">
193 <isset property="esmtp.lib.file"/>
199 <!-- Shared release libraries in APR's VC6 projects typical location -->
200 <condition property="esmtp.lib.file"
201 value="${esmtp.dir}/Release/lib${esmtp.lib.name}.lib">
202 <available file="${esmtp.dir}/Release/lib${esmtp.lib.name}.lib"/>
204 <condition property="esmtp.lib.file.dir"
205 value="${esmtp.dir}/Release">
206 <isset property="esmtp.lib.file"/>
211 <condition property="esmtp.lib.dir" value="${esmtp.lib.file.dir}">
213 <isset property="esmtp.lib.file.dir"/>
216 <!-- default search path -->
217 <equals arg1="${esmtp.lib.file.dir}" arg2="/usr"/>
223 <condition property="esmtp.lib.suffix" value="d">
225 <contains string="${esmtp.lib.file}" substring="/lib${esmtp.lib.name}d."/>
226 <contains string="${esmtp.lib.file}" substring="/${esmtp.lib.name}d."/>
229 <condition property="esmtp.lib.suffix" value="D">
231 <contains string="${esmtp.lib.file}" substring="/lib${esmtp.lib.name}D."/>
232 <contains string="${esmtp.lib.file}" substring="/${esmtp.lib.name}D."/>
235 <condition property="esmtp.lib.suffix" value="">
236 <isset property="esmtp.lib.file"/>
239 <condition property="esmtp.lib.prefix" value="lib">
241 <contains string="[${esmtp.lib.file}]" substring="/lib${esmtp.lib.name}.lib]"/>
244 <condition property="esmtp.lib.prefix" value="">
245 <isset property="esmtp.lib.file"/>
248 <condition property="esmtp.lib.type" value="shared">
250 <contains string="${esmtp.lib.file}]"
253 <contains string="${esmtp.lib.file}]"
256 <contains string="${esmtp.lib.file}]"
260 <!-- if we have just a .lib, guess based on file size.
261 Import libs should be much smaller. -->
262 <contains string="${esmtp.lib.file}]"
265 <isfileselected file="${esmtp.lib.file}">
266 <size value="250000" when="less"/>
273 <condition property="esmtp.lib.type" value="static">
274 <isset property="esmtp.lib.file"/>
278 <target name="find-esmtp" depends="find-esmtp-lib">
279 <!-- use character ref to prevent directory name from
280 being changed on global search and replacements -->
281 <condition property="esmtp.include.dir" value="${esmtp.dir}/include">
282 <available file="${esmtp.dir}/include/${esmtp.sample.h}"/>
284 <condition property="esmtp.include.dir" value="${esmtp.dir}">
285 <available file="${esmtp.dir}/${esmtp.sample.h}"/>
287 <condition property="esmtp.include.dir" value="${esmtp.dir}/../usr/include">
288 <available file="${esmtp.dir}/../usr/include/${esmtp.sample.h}"/>
290 <condition property="esmtp.include.dir" value="${esmtp.src.dir}/include">
291 <available file="${esmtp.src.dir}/include/${esmtp.sample.h}"/>
293 <condition property="esmtp.include.dir" value="${esmtp.src.dir}">
294 <available file="${esmtp.src.dir}/include/${esmtp.sample.h}"/>
297 <condition property="esmtp.dir" value="${esmtp.src.dir}">
298 <isset property="esmtp.src.dir"/>
303 esmtp.dir=${esmtp.dir}
304 esmtp.include.dir=${esmtp.include.dir}
305 esmtp.src.dir=${esmtp.src.dir}
306 esmtp.lib.file=${esmtp.lib.file}
307 esmtp.lib.file.dir=${esmtp.lib.file.dir}
308 esmtp.lib.dir=${esmtp.lib.dir}
309 esmtp.lib.prefix=${esmtp.lib.prefix}
310 esmtp.lib.suffix=${esmtp.lib.suffix}
311 esmtp.lib.type=${esmtp.lib.type}