Index: gs2-extensions/gsdl-amp/trunk/packages/CASCADE-MAKE.sh
===================================================================
--- gs2-extensions/gsdl-amp/trunk/packages/CASCADE-MAKE.sh	(revision 22995)
+++ gs2-extensions/gsdl-amp/trunk/packages/CASCADE-MAKE.sh	(revision 23003)
@@ -1,6 +1,12 @@
 #!/bin/bash
 
+list=
+if [ "x$COMPILE_UP_MYSQL" = "x1" ] ; then
+  list="MYSQL LIBPNG APACHE PHP"
+else  
+  list="LIBPNG APACHE PHP"
+fi
 
-for d in MYSQL LIBPNG APACHE PHP  ; do
+for d in $list ; do
   echo "    Running CASCADE-MAKE/$d.sh $*"
 
Index: gs2-extensions/gsdl-amp/trunk/packages/CASCADE-MAKE/MYSQL.sh
===================================================================
--- gs2-extensions/gsdl-amp/trunk/packages/CASCADE-MAKE/MYSQL.sh	(revision 23003)
+++ gs2-extensions/gsdl-amp/trunk/packages/CASCADE-MAKE/MYSQL.sh	(revision 23003)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+package=mysql
+version=-5.1.47
+
+progname=$0
+
+source ../cascade-make/lib/cascade-lib.bash
+
+prefix=$GEXTAMP_INSTALLED
+
+opt_run_untar $force_untar $auto_untar $package $version
+opt_run_configure $force_config $auto_config $package $version $prefix --exec-prefix=$prefix
+
+opt_run_make $compile   $package $version
+opt_run_make $install   $package $version "install"
+opt_run_make $clean     $package $version "clean"
+opt_run_make $distclean $package $version "distclean"
+
+opt_run_tarclean $tarclean $package $version
+
+
+
+
Index: gs2-extensions/gsdl-amp/trunk/packages/CASCADE-MAKE/PHP.sh
===================================================================
--- gs2-extensions/gsdl-amp/trunk/packages/CASCADE-MAKE/PHP.sh	(revision 22995)
+++ gs2-extensions/gsdl-amp/trunk/packages/CASCADE-MAKE/PHP.sh	(revision 23003)
@@ -3,6 +3,4 @@
 package=php
 version=-5.3.2
-
-apache_version=httpd-2.2.15
 
 progname=$0
@@ -11,8 +9,16 @@
 
 prefix=$GEXTAMP_INSTALLED
+mysqlprefix=
+if [ "x$COMPILE_UP_MYSQL" = "x1" ] ; then
+  mysqlprefix=$GEXTAMP_INSTALLED
+else
+  if [ -n "$GEXTMYSQL_INSTALLED" ] ; then
+    mysqlprefix=$GEXTMYSQL_INSTALLED
+  fi
+fi
 
 opt_run_untar $force_untar $auto_untar $package $version
 
-opt_run_configure $force_config $auto_config $package $version $prefix --with-mysql=$prefix --with-png-dir=$prefix --with-apxs2=$prefix/bin/apxs --with-gd
+opt_run_configure $force_config $auto_config $package $version $prefix --with-mysql=$mysqlprefix --with-png-dir=$prefix --with-apxs2=$prefix/bin/apxs --with-gd
 
 opt_run_make $compile   $package $version
Index: gs2-extensions/gsdl-amp/trunk/setup.bash
===================================================================
--- gs2-extensions/gsdl-amp/trunk/setup.bash	(revision 22995)
+++ gs2-extensions/gsdl-amp/trunk/setup.bash	(revision 23003)
@@ -5,6 +5,4 @@
 fulldir=${full_setup%/*}
 fulldir=${fulldir%/.}
-
-failed="false"
 
 source cascade-make/lib/cascade-lib.bash
@@ -33,22 +31,10 @@
       fi
   fi
-
-  if [ -e $GEXTAMP/packages/CASCADE-MAKE/MYSQL.sh ] ; then
-    echo "The MySQL extension extension has already been acquired"
-  else
-    echo "Attempting to acquire the MySQL extension ..."
-    if [ -e ../mysql ] ; then
-      cp ../mysql/packages/mysql-*.tar.gz packages/. && cp ../mysql/packages/CASCADE-MAKE/MYSQL.sh packages/CASCADE-MAKE/. 
-      
-      if [ $? != "0" ] ; then
-        echo "FAILED -- There was an error copying the necessary files"
-		failed="true"
-      else
-        echo "SUCCESS!"
-      fi 
-    else 
-      echo "FAILED -- The MySQL extension does not exist, please check it out into the extension directory by typing "
-      echo "svn co http://svn.greenstone.org/gs2-extensions/mysql-src/trunk mysql"
-	  failed="true"
+  
+  export COMPILE_UP_MYSQL=1
+  if [ -n "$GEXTMYSQL" ] ; then
+    if [ -e "$GEXTMYSQL/$GSDLOS" ] ; then
+      export COMPILE_UP_MYSQL=0     
+      source $GEXTMYSQL/setup.bash
     fi
   fi
@@ -62,10 +48,5 @@
   fi
 
-  if [ $failed = "true" ] ; then
-    echo "+Your environment was not successfully setup for $extdesc to Greenstone"    
-    GEXTAMP=
-  else
-    echo "+Your environment is now setup for $extdesc to Greenstone"
-  fi
+  echo "+Your environment is now setup for $extdesc to Greenstone"
 else
   echo "+Your environment is already setup for $extdesc to Greenstone"
