Index: main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 22836)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 22851)
@@ -170,4 +170,5 @@
 				<env key="CFLAGS" value="-I${basedir}/compiled/ext/gnome-lib/linux/include"/>
 				<env key="CXXFLAGS" value="-I${basedir}/compiled/ext/gnome-lib/linux/include"/>
+				<env key="CPPFLAGS" value="-I${basedir}/compiled/ext/gnome-lib/linux/include"/>
 				<env key="LDFLAGS" value="-static -L${basedir}/compiled/ext/gnome-lib/linux/lib"/>
 			</exec>
@@ -187,4 +188,5 @@
 				<env key="CFLAGS" value="-I${basedir}/compiled/ext/gnome-lib/darwin/include"/>
 				<env key="CXXFLAGS" value="-I${basedir}/compiled/ext/gnome-lib/darwin/include"/>
+				<env key="CPPFLAGS" value="-I${basedir}/compiled/ext/gnome-lib/darwin/include"/>
 				<env key="LDFLAGS" value="-L${basedir}/compiled/ext/gnome-lib/darwin/lib"/>
 			</exec>
@@ -203,4 +205,5 @@
 				<env key="CFLAGS" value="-I${basedir}/compiled/ext/gnome-lib/${os.shell}/include"/>
 				<env key="CXXFLAGS" value="-I${basedir}/compiled/ext/gnome-lib/${os.shell}/include"/>
+				<env key="CPPFLAGS" value="-I${basedir}/compiled/ext/gnome-lib/${os.shell}/include"/>
 				<env key="LDFLAGS" value="-static -L${basedir}/compiled/ext/gnome-lib/${os.shell}/lib"/>
 			</exec>
@@ -223,5 +226,5 @@
 		</if>
 
-		<!-- Delete all but the lib folder of the gnome support library on Mac -->
+		<!-- Delete all but the lib folder and the setup.bash script of the gnome support library on Mac -->
 		<if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
 			<delete dir="${basedir}/compiled/ext/gnome-lib/cascade-make"/>
@@ -231,5 +234,4 @@
 			<delete dir="${basedir}/compiled/ext/gnome-lib/darwin/include"/>
 			<delete dir="${basedir}/compiled/ext/gnome-lib/darwin/share"/>
-			<delete file="${basedir}/compiled/ext/gnome-lib/setup.bash"/>
 			<delete file="${basedir}/compiled/ext/gnome-lib/setup.bat"/>
 			<delete file="${basedir}/compiled/ext/gnome-lib/CASCADE-MAKE.sh"/>
Index: main/trunk/release-kits/kits/rk3/ant-scripts/compile.xml
===================================================================
--- main/trunk/release-kits/kits/rk3/ant-scripts/compile.xml	(revision 22836)
+++ main/trunk/release-kits/kits/rk3/ant-scripts/compile.xml	(revision 22851)
@@ -12,12 +12,17 @@
 		</exec>
 
-		<antcall target="persist-forwarded-properties">
-			<param name="greenstone3basedir" value="compiled"/>
-		</antcall>
-
 		<!-- make sure all c++ compilation is done statically on linux -->
 		<if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
 			<property name="forward.compile.static" value="true"/>
 		</if>
+
+		<!-- make sure the c++ compilation can see the support library in the extension folder -->
+		<if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
+			<property name="forward.use.support.lib" value="true"/>
+		</if>
+
+		<antcall target="persist-forwarded-properties">
+			<param name="greenstone3basedir" value="compiled"/>
+		</antcall>
 
 		<!-- run greenstone3's ant prepare -->
@@ -45,7 +50,7 @@
 					<arg value="checkout"/>
 					<arg value="${svn.root}/gs2-extensions/gnome-lib/trunk"/>
-					<arg value="${basedir}/compiled/gs2build/ext/gnome-lib"/>
+					<arg value="${basedir}/compiled/ext/gnome-lib"/>
 				</exec>
-				<exec executable="/bin/bash" dir="${basedir}/compiled/gs2build/ext/gnome-lib">
+				<exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib">
 					<arg value="-c"/>
 					<arg value="./CASCADE-MAKE.sh"/>
@@ -62,4 +67,21 @@
 			<property name="properties.accepted" value="true"/>
 		</ant>
+
+		<!-- Delete the entire gnome support library on Linux -->
+		<if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<delete dir="${basedir}/compiled/ext/gnome-lib"/>
+		</if>
+
+		<!-- Delete all but the lib folder of the gnome support library on Mac -->
+		<if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+			<delete dir="${basedir}/compiled/ext/gnome-lib/cascade-make"/>
+			<delete dir="${basedir}/compiled/ext/gnome-lib/packages"/>
+			<delete dir="${basedir}/compiled/ext/gnome-lib/darwin/bin"/>
+			<delete dir="${basedir}/compiled/ext/gnome-lib/darwin/etc"/>
+			<delete dir="${basedir}/compiled/ext/gnome-lib/darwin/include"/>
+			<delete dir="${basedir}/compiled/ext/gnome-lib/darwin/share"/>
+			<delete file="${basedir}/compiled/ext/gnome-lib/setup.bat"/>
+			<delete file="${basedir}/compiled/ext/gnome-lib/CASCADE-MAKE.sh"/>
+		</if>
 
 		<!-- insert an xml parser -->
