Initial import.
[profile/ivi/log4cxx.git] / src / ant / common.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 <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"/>
25
26 <taskdef resource="cpptasks.tasks"/>
27 <typedef resource="cpptasks.types"/>
28
29 <target name="os-detect">
30         <condition property="os.family" value="mac">
31             <os family="mac"/>
32         </condition>
33         <condition property="os.family" value="windows">
34             <os family="windows"/>
35         </condition>
36         <property name="os.family" value="unix"/>
37         <condition property="is-mac" value="1">
38             <equals arg1="${os.family}" arg2="mac"/>
39         </condition>
40         <condition property="is-windows" value="1">
41             <equals arg1="${os.family}" arg2="windows"/>
42         </condition>
43         <condition property="is-unix" value="1">
44             <or>
45                 <equals arg1="${os.family}" arg2="unix"/>
46                 <equals arg1="${os.family}" arg2="mac"/>
47                 <equals arg1="${os.family}" arg2="cygwin"/>
48             </or>
49         </condition>
50 </target>
51
52
53 <target name="win-init" depends="os-detect" if="is-windows">
54     <property name="compiler" value="msvc"/>
55
56     <condition property="is-bcc" value="true">
57         <or>
58            <equals arg1="${compiler}" arg2="bcc"/>
59         </or>
60     </condition>
61
62     <condition property="is-msvc" value="true">
63         <or>
64            <equals arg1="${compiler}" arg2="msvc"/>
65         </or>
66     </condition>
67
68     <condition property="is-mingw" value="true">
69         <or>
70             <equals arg1="${compiler}" arg2="gcc"/>
71             <equals arg1="${compiler}" arg2="g++"/>
72         </or>
73     </condition>
74 </target>
75
76 <target name="mac-init" depends="os-detect" if="is-mac">
77     <property name="project.type" value="xcode"/>
78 </target>
79
80
81 <target name="unix-init" depends="mac-init" if="is-unix">
82
83     <property name="compiler" value="gcc"/>
84
85     <condition property="has-expat" value="true">
86          <not><isset property="is-mac"/></not>
87     </condition>
88     <condition property="is-cygwin" value="true">
89         <os family="windows"/>
90     </condition>
91 </target>
92
93
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
97
98 Use cpptasks 1.0b5 or later from
99 http://ant-contrib.sourceforge.net.
100 </fail>
101
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
105
106 Required features not present in cpptasks releases prior to Feb 2005</fail -->
107
108         <mkdir dir="${target.dir}"/>
109         <property name="projects.dir" value="${target.dir}"/>
110         <mkdir dir="${projects.dir}"/>
111
112         <condition property="is-gcc" value="true">
113             <or>
114                <equals arg1="${compiler}" arg2="gcc"/>
115                <equals arg1="${compiler}" arg2="g++"/>
116             </or>
117         </condition>
118
119          <condition property="pic-option" value="-fPIC">
120             <and>
121                      <isset property="is-gcc"/>
122                      <istrue value="${use-pic}"/>
123             </and>
124          </condition>
125
126
127         <condition property="is-debug" value="true">
128                 <istrue value="${debug}"/>
129         </condition>
130
131         <condition property="debug.release" value="debug">
132             <isset property="is-debug"/>
133         </condition>
134         <property name="debug.release" value="release"/>
135
136
137         <condition property="D.debug" value="d">
138             <isset property="is-debug"/>
139         </condition>
140         <property name="D.debug" value=""/>
141
142         <condition property="D.R" value="d">
143             <isset property="is-debug"/>
144         </condition>
145         <property name="D.R" value="r"/>
146
147
148                 <property name="lib-suffix" value=""/>
149
150         <condition property="is-static" value="1">
151               <equals arg1="${lib.type}" arg2="static"/>
152         </condition>
153         <condition property="is-shared" value="1">
154               <equals arg1="${lib.type}" arg2="shared"/>
155         </condition>
156
157         <property name="executable.dir" value="${target.dir}/${debug.release}/${lib.type}"/>
158
159         <property name="projectsOnly" value="false"/>
160         
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"/>
170 </target>
171
172
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>
176     </condition>
177 </target>
178
179 <target name="copy-if-changed" depends="copy-if-changed-compare" if="force-copy">
180     <copy tofile="${tofile}" file="${file}" overwrite="true"/>
181 </target>
182
183
184