source: main/trunk/release-kits/kits/rk3/ant-scripts/monterey-compile.xml@ 37444

Last change on this file since 37444 was 37444, checked in by anupama, 14 months ago

Dr Bainbridge got the Monterey MacOS VM release kit past the wvware error by setting CFLAGS to ignore the warning that functions did not have header definitions. On Linux and in the past on Macs, the compiler was not so strict and would let functions missing extern definitions go through without compile errors. This CFLAG emulates the past situation.

  • Property svn:executable set to *
File size: 17.1 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk3-compile">
3
4
5 <target name="compile">
6 <!-- checkout greenstone3 -->
7 <exec executable="svn">
8 <arg line="${global-svn-args}"/>
9 <arg value="checkout"/>
10 <arg value="${svn.root}/main/${branch.path}/greenstone3"/>
11 <arg value="compiled"/>
12 <arg value="-r"/><arg value="${branch.revision}"/>
13 </exec>
14
15 <!-- comment out any active checkout.gnomelib.ext=true line in build.properties.svn
16 So that the release-kits go back to behaving how they did when the line
17 used to be commented out by default in build properties.
18 For alternative ways to achieve this, see
19 https://jeeva-paramasamy.blogspot.com/2012/07/removeunset-property-in-property-file.html
20 Further options in the propertyfile task https://ant.apache.org/manual/Tasks/propertyfile.html
21 -->
22 <!--<if><bool><equals arg1="${checkout.gnomelib.ext}" arg2="true"/></bool>-->
23 <echo>Release-kit is running, which turns on use.gnomelib.ext, so commenting out checkout.gnomelib.ext=true to deactivate it.</echo>
24 <rsr file="${basedir}/compiled/build.properties.svn" pattern="checkout.gnomelib.ext=true" replacement="#checkout.gnomelib.ext=true"/>
25 <!--</if>-->
26
27 <if><bool><equals arg1="${with.jni}" arg2="false"/></bool>
28 <rsr file="${basedir}/compiled/build.properties.svn" pattern="with.jni=true" replacement="#with.jni=true"/>
29 </if>
30
31 <if><bool><equals arg1="${with.gli.and.gems}" arg2="false"/></bool>
32 <rsr file="${basedir}/compiled/build.properties.svn" pattern="with.gli.and.gems=true" replacement="#with.gli.and.gems=true"/>
33 </if>
34
35 <!-- make sure all c++ compilation is done statically on linux -->
36 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
37 <property name="forward.compile.static" value="true"/>
38 </if>
39
40 <!-- make sure the c++ compilation can see the support library in the extension folder -->
41 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
42 <property name="forward.use.gnomelib.ext" value="true"/>
43 </if>
44
45 <antcall target="persist-forwarded-properties">
46 <param name="greenstone3basedir" value="compiled"/>
47 </antcall>
48
49 <!-- run greenstone3's ant prepare -->
50 <ant dir="compiled" inheritAll="false">
51 <target name="prepare"/>
52 <propertyset refid="forward.properties"/>
53 <property name="properties.accepted" value="true"/>
54 <property name="global-svn-args" value="${global-svn-args}"/>
55 </ant>
56
57 <!-- set all version numbers -->
58 <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="compiled"/></antcall>
59 <antcall target="gli-set-version-numbers"><param name="glibasedir" value="compiled/gli"/></antcall>
60 <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="compiled/gs2build"/></antcall>
61
62 <!-- mac or linux: compile the support library -->
63 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
64 <!-- checkout the gnome support library extension-->
65
66 <!-- For Lions, need a specific gnome-lib-minimal tar file. The file name contains darwin12 for Lion, it contains the os.shell name (darwin/linux) for other cases.
67 Mac OS X v10.7.4 onwards is Lion/Mountain Lion, different from Leopard/Snow Leopard. See http://en.wikipedia.org/wiki/Darwin_(operating_system) -->
68 <condition property="specific.os.type" value="${os.shell}-Lion" else="${os.shell}-Mojave">
69 <and>
70 <contains string="${os.shell}" substring="darwin" casesensitive="false"/>
71 <matches pattern="^(10\.7\.[4-9]|10\.[8-9]|1[1-9]|[2-9])" string="${os.version}"/>
72 </and>
73 </condition>
74
75 <if><bool><or>
76 <equals arg1="${post.2.83.version}" arg2="true"/>
77 </or></bool>
78 <echo>EXPORTING GNOME LIB EXTENSION</echo>
79 <exec executable="svn">
80 <arg line="${global-svn-args}"/>
81 <arg value="export"/>
82 <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${specific.os.type}${arch}${extension-x64}.tar.gz"/>
83 <arg value="${basedir}/compiled/ext/gnome-lib-${specific.os.type}.tar.gz"/>
84 </exec>
85
86 <exec executable="tar" dir="${basedir}/compiled/ext">
87 <arg value="xvzf"/>
88 <arg value="gnome-lib-${specific.os.type}.tar.gz"/>
89 </exec>
90
91 <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
92 <arg value="-c"/>
93 <arg value="source setup.bash_old &amp;&amp; source devel.bash"/>
94 </exec>
95 <echo>DONE COMPILING GNOME LIB EXTENSION</echo>
96 </if>
97 </if>
98
99 <!-- <rsr file="${basedir}/compiled/build.xml" pattern="CFLAGS=&amp;quot;" replacement="CFLAGS=&amp;quot;-fPIC "/> -->
100 <rsr file="${basedir}/compiled/build.xml" pattern="CFLAGS=&amp;quot;" replacement="CFLAGS=&amp;quot;-Wno-error=implicit-function-declaration "/>
101
102
103 <!-- run greenstone3's ant install and ant dist-tidy -->
104 <ant dir="compiled" inheritAll="false">
105 <target name="install"/>
106 <target name="dist-tidy"/>
107 <propertyset refid="forward.properties"/>
108 <property name="properties.accepted" value="true"/>
109 <property name="properties.keep.src" value="${keep.src}"/>
110 <property name="global-svn-args" value="${global-svn-args}"/>
111 </ant>
112
113 <!-- Delete all collections apart from the Lucene demo collection -->
114 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gberg"/>
115 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgdemo"/>
116 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgppdemo"/>
117 <delete dir="${basedir}/compiled/web/sites/localsite/collect/infomine"/>
118
119 <!-- Delete the entire gnome support library on Linux -->
120 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
121 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal"/>
122 <delete file="${basedir}/compiled/ext/gnome-lib-linux.tar.gz"/>
123 </if>
124
125 <!-- Delete all but the lib folder of the gnome support library on Mac,
126 then move this smaller gnome-lib-minimal dir from the top-level ext folder
127 to gs2build/ext, since wvware on mac needs gnome-lib-minimal -->
128 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
129 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/cascade-make"/>
130 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/packages"/>
131 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/bin"/>
132 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/etc"/>
133 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/include"/>
134 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/share"/>
135 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
136 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/CASCADE-MAKE.sh"/>
137 <delete file="${basedir}/compiled/ext/gnome-lib-darwin.tar.gz"/>
138 <move file="${basedir}/compiled/ext/gnome-lib-minimal" todir="compiled/gs2build/ext"/>
139 </if>
140
141 <!-- Delete Lucene 3.3 specific ext/solr folders, since we've switched over to Lucene 4.7.2 -->
142 <delete dir="${basedir}/compiled/ext/solr/lib3" />
143 <delete dir="${basedir}/compiled/ext/solr/conf3" />
144 <delete dir="${basedir}/compiled/ext/solr/etc3" />
145
146
147 <if><bool><and>
148 <equals arg1="${rk.os}" arg2="linux"/>
149 <equals arg1="${extension-x64}" arg2="-x64"/>
150 </and></bool>
151 <property name="bitness" value="64"/>
152 <else>
153 <property name="bitness" value="32"/>
154 </else>
155 </if>
156
157 <!-- insert an xml parser (matched to the version of Perl being used by the release kit).
158 For Linux 64 bit, use the 64 bit versions.
159 For other *nix cases, including Macs, we stick to the 32 bit
160 versions since there have been no problems yet, probably
161 because our Mac has 5.12 which is not included in
162 XML-Parser so that our mac then tries to find the xml
163 parser on the system.-->
164 <if><bool><not><equals arg1="${rk.os}" arg2="windows"/></not></bool>
165 <copy todir="compiled/gs2build/perllib/cpan">
166 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="${bitness}-bit/**/*"/>
167 </copy>
168 <move file="compiled/gs2build/perllib/cpan/${bitness}-bit" tofile="compiled/gs2build/perllib/cpan/XML-Parser"/>
169 </if>
170
171 <!-- insert ant -->
172 <property name="insert.ant.version" value="1.9.13"/> <!-- value="1.8.2" -->
173 <mkdir dir="compiled/packages"/>
174 <!--<get src="http://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>-->
175 <exec executable="wget" failonerror="true">
176 <arg value="-P"/>
177 <arg value="compiled/packages"/>
178 <arg value="--no-check-certificate"/>
179 <arg value="https://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz"/>
180 </exec>
181
182 <untar src="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
183 <move file="compiled/packages/apache-ant-${insert.ant.version}" tofile="compiled/packages/ant"/>
184 <delete file="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
185
186 <!-- put the uninstaller in place -->
187 <antcall target="insert-and-compile-uninstaller"/>
188
189 <!-- (windows only) -->
190 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
191 <!-- insert perl -->
192 <!--<unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>-->
193 <exec executable="svn" dir="compiled/gs2build/bin/windows">
194 <arg line="${global-svn-args}"/>
195 <arg value="export"/>
196 <arg value="${svn.root}/main/trunk/release-kits/shared/windows/perl.zip"/>
197 </exec>
198 <unzip src="compiled/gs2build/bin/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
199 <delete failonerror="false" file="compiled/gs2build/bin/windows/perl.zip" />
200 </if>
201
202 <!-- minify tomcat -->
203 <delete dir="compiled/packages/tomcat/webapps/docs"/>
204 <delete dir="compiled/packages/tomcat/webapps/examples"/>
205
206 <!-- tidy up gli to make it smaller -->
207 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
208
209 <!-- strip out .svn dirs -->
210 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
211
212 <!-- get rid of bin/formatconverter on windows and get rid of bin/formatconverter.exe on linux/mac. Now we have specific OS dirs, so get rid of the irrelevant OS dirs instead -->
213 <if>
214 <bool><equals arg1="${rk.os}" arg2="windows"/></bool>
215 <delete dir="compiled/bin/darwin"/>
216 <delete dir="compiled/bin/linux"/>
217 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
218 <delete dir="compiled/bin/windows"/>
219 <delete dir="compiled/bin/linux"/>
220 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
221 <delete dir="compiled/bin/windows"/>
222 <delete dir="compiled/bin/darwin"/>
223 </if></else>
224 </if></else>
225 </if>
226
227 <!-- (linux only) -->
228 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
229 <!-- grab imagemagick binaries -->
230 <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
231
232 <exec executable="svn">
233 <arg line="${global-svn-args}"/>
234 <arg value="export"/>
235 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
236 <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
237 </exec>
238
239 <exec executable="tar" dir="compiled/ext">
240 <arg value="xvzf"/>
241 <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
242 </exec>
243 <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
244 <move todir="compiled/gs2build/bin/linux/imagemagick">
245 <fileset dir="compiled/ext/imagemagick/linux"/>
246 </move>
247 <delete dir="compiled/ext/imagemagick"/>
248
249 <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
250 <exec executable="svn">
251 <arg line="${global-svn-args}"/>
252 <arg value="export"/>
253 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
254 <arg value="compiled/gs2build/bin/linux/imagemagick"/>
255 </exec>-->
256
257 <!-- grab wv binaries -->
258 <delete dir="compiled/gs2build/bin/linux/wv"/>
259 <exec executable="svn">
260 <arg line="${global-svn-args}"/>
261 <arg value="export"/>
262 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
263 <arg value="compiled/gs2build/bin/linux/wv"/>
264 </exec>
265 <!-- (mac only) -->
266 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
267 <!-- grab imagemagick binaries -->
268
269 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
270 <exec executable="svn">
271 <arg line="${global-svn-args}"/>
272 <arg value="export"/>
273 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.11.tar.gz"/>
274 <arg value="compiled/ext/imagemagick-darwin-10.11.tar.gz"/>
275 </exec>
276 <exec executable="tar" dir="compiled/ext">
277 <arg value="xvzf"/>
278 <arg value="imagemagick-darwin-10.11.tar.gz"/>
279 </exec>
280 <delete file="compiled/ext/imagemagick-darwin-10.11.tar.gz"/>
281 <move todir="compiled/gs2build/bin/darwin/imagemagick">
282 <fileset dir="compiled/ext/imagemagick/darwin"/>
283 </move>
284 <delete dir="compiled/ext/imagemagick"/>
285
286 <!--<exec executable="svn">
287 <arg line="${global-svn-args}"/>
288 <arg value="export"/>
289 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz"/>
290 <arg value="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
291 </exec>
292
293 <exec executable="tar" dir="compiled/ext">
294 <arg value="xvzf"/>
295 <arg value="imagemagick-darwin-10.5.tar.gz"/>
296 </exec>
297 <delete file="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
298 <move todir="compiled/gs2build/bin/darwin/imagemagick">
299 <fileset dir="compiled/ext/imagemagick/darwin"/>
300 </move>
301 <delete dir="compiled/ext/imagemagick"/>-->
302
303 <!--
304 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
305 <exec executable="svn">
306 <arg line="${global-svn-args}"/>
307 <arg value="export"/>
308 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
309 <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
310 </exec>-->
311
312 <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
313 <!-- grab ghostscript binaries -->
314 <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
315 <exec executable="svn">
316 <arg line="${global-svn-args}"/>
317 <arg value="export"/>
318 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
319 <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
320 </exec>
321 </if>
322 </if></else></if>
323
324 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
325 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
326 <arg line="-S"/>
327 <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
328 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
329 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
330 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
331 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
332 <env key="GSDLOS" value="windows"/>
333 <env key="PERL_PERTURB_KEYS" value="0"/>
334 <env key="PERL_HASH_SEED" value="0"/>
335 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
336 </exec>
337 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
338 <arg line="-S"/>
339 <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
340 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
341 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
342 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
343 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
344 <env key="GSDLOS" value="windows"/>
345 <env key="PERL_PERTURB_KEYS" value="0"/>
346 <env key="PERL_HASH_SEED" value="0"/>
347 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
348 </exec>
349 <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
350 <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
351 <else>
352 <echo file="${basedir}/compiled/buildscript.sh">
353 #!/bin/bash
354 source gs3-setup.sh
355 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
356 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
357 rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
358 mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
359 </echo>
360 <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
361 <exec dir="${basedir}/compiled" executable="/bin/bash">
362 <arg line="buildscript.sh"/>
363 </exec>
364 <delete file="${basedir}/compiled/buildscript.sh"/>
365 </else>
366 </if>
367
368 </target>
369
370</project>
Note: See TracBrowser for help on using the repository browser.