Index: /main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml
===================================================================
--- /main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 37450)
+++ /main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 37451)
@@ -100,6 +100,12 @@
 
 			<property name="allargs" value="${path.arg} ${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${pcpath.arg} ${ldlpath.arg}"/>
-		</if>	
-		
+		</if>
+
+		<!-- mac only: make errors about missing extern declarations back into warnings as in old (Mojave and before) macs -->
+		<if>
+                  <bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+                  <rsr file="${basedir}/compiled/build.xml" pattern="CFLAGS=&amp;quot;" replacement="CFLAGS=&amp;quot;-Wno-error=implicit-function-declaration "/>
+                </if>
+
 		<!-- windows only -->
 		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
@@ -273,8 +279,21 @@
 			</if>
 
-		</if>
-
+
+			<!-- for 64 bit need to copy in the statically compiled IsisGdl -->
+			<!--<delete file="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>-->
+			<!--<get src="http://www.greenstone.org/caveat-emptor/IsisGdl.macleopard" dest="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>-->
+			<!--<get src="http://www.greenstone.org/caveat-emptor/IsisGdl.mac64mojave" dest="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>-->
+			<exec executable="wget" failonerror="true">
+			  <arg value="-P"/>
+			  <arg value="${basedir}/compiled/bin/${os.shell}"/>
+			  <arg value="--no-check-certificate"/>
+			  <arg value="http://www.greenstone.org/caveat-emptor/IsisGdl.mac64mojave"/>
+			</exec>
+			
+			<move file="${basedir}/compiled/bin/${os.shell}/IsisGdl.mac64mojave" tofile="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>
+			<chmod perm="755" file="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>
+		</if>
+	      
 		<!-- in mac and linux 64 bit versions, we copy IsisGdl from caveat-emptor. However, now that it compiles under 64 bit, I don't think we need to do that anymore.-->
-
 		
 		<!-- Delete all but the lib folder and the setup.bash script of the gnome support library -->
@@ -462,59 +481,75 @@
 		<!-- mac -->
 		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
-			<!-- grab imagemagick and ghostscript binaries -->
-			<delete dir="compiled/bin/darwin/imagemagick"/>
-			<delete dir="compiled/bin/darwin/ghostscript"/>
-
-			<if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
-
-                    <!--<exec executable="svn">
-			<arg line="${global-svn-args}"/>
-                       <arg value="export"/>
-                       <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz"/>
-                       <arg value="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
-                    </exec>
-
-                    <exec executable="tar" dir="compiled/ext">
-                       <arg value="xvzf"/>
-                       <arg value="imagemagick-darwin-10.5.tar.gz"/>
-                    </exec>
-                    <delete file="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
-                    <move todir="compiled/bin/darwin/imagemagick">
-                       <fileset dir="compiled/ext/imagemagick/darwin"/>
-                    </move>-->
-
+		  <!-- grab imagemagick and ghostscript binaries -->
+		  <delete dir="compiled/bin/darwin/imagemagick"/>
+		  <delete dir="compiled/bin/darwin/ghostscript"/>
+		  
+		  <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
+		  
+		  <!-- before mojave -->
+		  <!--<property name="darwin-imagick-tarball" value="imagemagick-darwin-10.5.tar.gz"/>-->
+		  <!-- mojave onwards -->
+		  <property name="darwin-imagick-tarball" value="imagemagick-darwin-10.11.tar.gz"/>
+
+		  <!-- grab imagemagick binaries for El Capitan -->
+		  <!-- Grab the imagemagick compiled on an XWindows-less darwin 10.11 (El Capitan)
+		       but where it was made backwards compatible with 10.8 (Mountain Lion) with mmacosx-version-min flag.
+		       Upto and including the gs3.08 release this code still referred to imagemagick-darwin-10.5.tar.gz  -->		  
+                  <exec executable="svn">
+		    <arg line="${global-svn-args}"/>
+                    <arg value="export"/>
+                    <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/${darwin-imagick-tarball}"/>
+                    <arg value="compiled/ext/${darwin-imagick-tarball}"/>
+                  </exec>
+		  
+                  <exec executable="tar" dir="compiled/ext">
+                    <arg value="xvzf"/>
+                    <arg value="${darwin-imagick-tarball}"/>
+                  </exec>
+                  <delete file="compiled/ext/${darwin-imagick-tarball}"/>
+                  <move todir="compiled/bin/darwin/imagemagick">
+                    <fileset dir="compiled/ext/imagemagick/darwin"/>
+                  </move>
+
+		  <!-- No more use for the decompressed ext/imagemagick folder, as it contains only setup scripts
+			     that end up referring to the (empty) ext/imagemagick in the environment.
+			     On sourcing GS2's setup script, these env vars further conflict with cmdline wget on newer Macs,
+			     as DYLD_FALLBACK_LIBRARY_PATH (another env var hidden on Macs) ends up set. -->
+		  <delete dir="compiled/ext/imagemagick"/>  <!-- dir = The directory to delete, including all its files and subdirectories. -->
+
+		  <!--
+		  <exec executable="svn">
+		    <arg line="${global-svn-args}"/>
+		    <arg value="export"/>
+		    <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
+		    <arg value="compiled/bin/darwin/imagemagick"/>
+		  </exec>
+		  -->
+		  <exec executable="svn">
+		    <arg line="${global-svn-args}"/>
+		    <arg value="export"/>
+		    <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
+		    <arg value="compiled/bin/darwin/ghostscript"/>
+		  </exec>
+		  
+		  <else>			    
 		    <exec executable="svn">
 		      <arg line="${global-svn-args}"/>
-					<arg value="export"/>
-					<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
-					<arg value="compiled/bin/darwin/imagemagick"/>
-				</exec>
-			  
-				<exec executable="svn">
-				  <arg line="${global-svn-args}"/>
-					<arg value="export"/>
-					<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
-					<arg value="compiled/bin/darwin/ghostscript"/>
-				</exec>
-
-				<else>			    
-				  <exec executable="svn">
-				    <arg line="${global-svn-args}"/>
-						<arg value="export"/>
-						<arg value="${svn.root}/main/trunk/binaries/mac/intel/imagemagick"/>
-						<arg value="compiled/bin/darwin/imagemagick"/>
-					</exec>
-			    
-					<exec executable="svn">
-					  <arg line="${global-svn-args}"/>
-						<arg value="export"/>
-						<arg value="${svn.root}/main/trunk/binaries/mac/intel/ghostscript"/>
-						<arg value="compiled/bin/darwin/ghostscript"/>
-					</exec>
-				</else>
-			</if>
-
-			<!-- delete unneeded files -->
-			<delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm"/></delete>
+		      <arg value="export"/>
+		      <arg value="${svn.root}/main/trunk/binaries/mac/intel/imagemagick"/>
+		      <arg value="compiled/bin/darwin/imagemagick"/>
+		    </exec>
+		    
+		    <exec executable="svn">
+		      <arg line="${global-svn-args}"/>
+		      <arg value="export"/>
+		      <arg value="${svn.root}/main/trunk/binaries/mac/intel/ghostscript"/>
+		      <arg value="compiled/bin/darwin/ghostscript"/>
+		    </exec>
+		  </else>
+		  </if>
+		  
+		  <!-- delete unneeded files -->
+		  <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm"/></delete>
 <!--
   Actually useful to keep these files around for a Pure Java install
@@ -538,4 +573,5 @@
 				<env key="GSDLOS" value="windows"/>
 				<env key="PERL_PERTURB_KEYS" value="0"/>
+				<env key="PERL_HASH_SEED" value="0"/>
 				<env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
 			</exec>
@@ -544,4 +580,5 @@
 				<arg line="bin/script/buildcol.pl demo"/>
 				<env key="PERL_PERTURB_KEYS" value="0"/>
+				<env key="PERL_HASH_SEED" value="0"/>
 				<env key="GSDLHOME" path="${basedir}/compiled"/>
 				<env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
