Initial import.
[profile/ivi/log4cxx.git] / src / ant / find-libesmtp.xml
1 <!--
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
8
9       http://www.apache.org/licenses/LICENSE-2.0
10
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.
16
17 -->
18
19 <target name="find-esmtp-src" depends="init">
20     <condition property="esmtp.dir" value="${with-libesmtp}">
21         <available file="${with-libesmtp}"/>
22     </condition>
23         <condition property="esmtp.src.dir" value="${esmtp.dir}">
24                 <available file="${esmtp.dir}/${esmtp.sample.c}"/>
25         </condition>
26         <condition property="esmtp.src.dir" value="../libesmtp">
27                 <available file="../libesmtp/${esmtp.sample.c}"/>
28         </condition>
29 </target>
30
31
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"/>
50         </condition>
51
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"/>
69         </condition>
70
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"/>
86         </condition>
87         <condition property="esmtp.lib.file.dir" value="/usr/lib">
88                 <isset property="esmtp.lib.file"/>
89         </condition>
90
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"/>
106         </condition>
107         <condition property="esmtp.lib.file.dir" value="/usr/local/lib">
108                 <isset property="esmtp.lib.file"/>
109         </condition>
110
111
112     <property name="relative-esmtp" location="../libesmtp"/>
113     <condition property="esmtp.dir" value="${relative-esmtp}">
114         <available file="${relative-esmtp}"/>
115     </condition>
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"/>
133         </condition>
134
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"/>
149         </condition>
150     <fail unless="esmtp.dir">Unable to locate esmtp base directory.</fail>
151     
152
153
154
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">
158                 <and>
159                         <isset property="is-debug"/>
160                         <available file="${esmtp.dir}/LibD/${esmtp.lib.name}.lib"/>
161                 </and>
162         </condition>
163         <condition property="esmtp.lib.file.dir"
164                 value="${esmtp.dir}/LibD">
165                         <isset property="esmtp.lib.file"/>
166         </condition>
167
168
169
170
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">
174                 <and>
175                         <isset property="is-debug"/>
176                         <available file="${esmtp.dir}/Debug/lib${esmtp.lib.name}.lib"/>
177                 </and>
178         </condition>
179         <condition property="esmtp.lib.file.dir"
180                 value="${esmtp.dir}/Debug">
181                         <isset property="esmtp.lib.file"/>
182         </condition>
183
184
185
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"/>
190         </condition>
191         <condition property="esmtp.lib.file.dir"
192                 value="${esmtp.dir}/LibR">
193                         <isset property="esmtp.lib.file"/>
194         </condition>
195
196
197
198
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"/>
203         </condition>
204         <condition property="esmtp.lib.file.dir"
205                 value="${esmtp.dir}/Release">
206                         <isset property="esmtp.lib.file"/>
207         </condition>
208
209
210
211         <condition property="esmtp.lib.dir" value="${esmtp.lib.file.dir}">
212                 <and>
213                         <isset property="esmtp.lib.file.dir"/>
214                         <not>
215                                 <or>
216                                         <!--  default search path -->
217                                         <equals arg1="${esmtp.lib.file.dir}" arg2="/usr"/>
218                                 </or>
219                         </not>
220                 </and>
221         </condition>
222
223         <condition property="esmtp.lib.suffix" value="d">
224                 <or>
225                         <contains string="${esmtp.lib.file}" substring="/lib${esmtp.lib.name}d."/>
226                         <contains string="${esmtp.lib.file}" substring="/${esmtp.lib.name}d."/>
227                 </or>
228         </condition>
229         <condition property="esmtp.lib.suffix" value="D">
230                 <or>
231                         <contains string="${esmtp.lib.file}" substring="/lib${esmtp.lib.name}D."/>
232                         <contains string="${esmtp.lib.file}" substring="/${esmtp.lib.name}D."/>
233                 </or>
234         </condition>
235         <condition property="esmtp.lib.suffix" value="">
236                 <isset property="esmtp.lib.file"/>
237         </condition>
238
239         <condition property="esmtp.lib.prefix" value="lib">
240                 <or>
241                         <contains string="[${esmtp.lib.file}]" substring="/lib${esmtp.lib.name}.lib]"/>
242                 </or>
243         </condition>
244         <condition property="esmtp.lib.prefix" value="">
245                 <isset property="esmtp.lib.file"/>
246         </condition>
247
248         <condition property="esmtp.lib.type" value="shared">
249                 <or>
250                         <contains string="${esmtp.lib.file}]" 
251                                 substring=".dylib]" 
252                                 casesensitive="no"/>
253                         <contains string="${esmtp.lib.file}]" 
254                                 substring=".so]" 
255                                 casesensitive="no"/>
256                         <contains string="${esmtp.lib.file}]" 
257                                 substring=".la]" 
258                                 casesensitive="no"/>
259                         <and>
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}]" 
263                                         substring=".lib]" 
264                                         casesensitive="no"/>
265                                 <isfileselected file="${esmtp.lib.file}">
266                                         <size value="250000" when="less"/>
267                                 </isfileselected>
268                         </and>
269                 </or>
270         </condition>
271
272
273         <condition property="esmtp.lib.type" value="static">
274                 <isset property="esmtp.lib.file"/>
275         </condition>
276 </target>
277
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}"/>
283     </condition>
284     <condition property="esmtp.include.dir" value="${esmtp.dir}">
285         <available file="${esmtp.dir}/${esmtp.sample.h}"/>
286     </condition>
287     <condition property="esmtp.include.dir" value="${esmtp.dir}/../usr/include">
288         <available file="${esmtp.dir}/../usr/include/${esmtp.sample.h}"/>
289     </condition>
290     <condition property="esmtp.include.dir" value="${esmtp.src.dir}/include">
291         <available file="${esmtp.src.dir}/include/${esmtp.sample.h}"/>
292     </condition>
293     <condition property="esmtp.include.dir" value="${esmtp.src.dir}">
294         <available file="${esmtp.src.dir}/include/${esmtp.sample.h}"/>
295     </condition>
296
297         <condition property="esmtp.dir" value="${esmtp.src.dir}">
298                 <isset property="esmtp.src.dir"/>
299         </condition>
300
301
302         <echo>esmtp-find:
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}
312 </echo>
313 </target>