Index: /main/trunk/gs2build/Makefile.in
===================================================================
--- /main/trunk/gs2build/Makefile.in	(revision 21375)
+++ /main/trunk/gs2build/Makefile.in	(revision 21376)
@@ -105,8 +105,4 @@
 	fi
 
-# For GS2: include the Greenstone Server Interface Makefile here
-# http://www.makelinux.net/make3/make3-CHP-3-SECT-7.html
-sinclude GSI-Makefile
-
 distclean: clean
 	rm -f Makefile config.cache config.h config.log stamp-h config.status
Index: /main/trunk/gs2build/config.h.in
===================================================================
--- /main/trunk/gs2build/config.h.in	(revision 21375)
+++ /main/trunk/gs2build/config.h.in	(revision 21376)
@@ -115,4 +115,7 @@
 #undef ENABLE_LUCENE
 
+/* Define ENABLE_JNI */
+#undef ENABLE_JNI
+
 /* Define MICO_DIR if needsbe */
 #undef MICO_DIR
Index: /main/trunk/gs2build/configtest.pl
===================================================================
--- /main/trunk/gs2build/configtest.pl	(revision 21376)
+++ /main/trunk/gs2build/configtest.pl	(revision 21376)
@@ -0,0 +1,1 @@
+print $]
Index: /main/trunk/gs2build/configure
===================================================================
--- /main/trunk/gs2build/configure	(revision 21375)
+++ /main/trunk/gs2build/configure	(revision 21376)
@@ -309,6 +309,8 @@
 #endif"
 
-ac_subdirs_all="$ac_subdirs_all common-src build-src"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION USE_FASTCGI USE_LANGACTION USE_CORBA MICO_DIR USE_Z3950 USE_YAZ ENABLE_ACCENTFOLD USE_SQLITE ENABLE_JNI ENABLE_MG ENABLE_MGPP ENABLE_LUCENE LDFLAGS CFLAGS CC CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX AWK YACC build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB COMPAT32BITFLAGS MICO_VER CPP EGREP U ANSI2KNR ALLOCA LIBOBJS STATIC gsdlos MODULEDIRS subdirs LTLIBOBJS'
+ac_subdirs_all="$ac_subdirs_all common-src"
+ac_subdirs_all="$ac_subdirs_all build-src"
+ac_subdirs_all="$ac_subdirs_all runtime-src"
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION USE_FASTCGI USE_LANGACTION USE_CORBA MICO_DIR USE_Z3950 USE_YAZ ENABLE_ACCENTFOLD USE_SQLITE USE_APACHE_HTTPD ENABLE_JNI ENABLE_MG ENABLE_MGPP ENABLE_LUCENE LDFLAGS CFLAGS CC CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX AWK YACC build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB COMPAT32BITFLAGS MICO_VER CPP EGREP U ANSI2KNR ALLOCA LIBOBJS STATIC gsdlos MODULEDIRS subdirs LTLIBOBJS'
 ac_subst_files=''
 
@@ -859,4 +861,5 @@
   --disable-accentfold    Disable Accent Folding for MGPP
   --disable-sqlite        Disable SQLite support
+  --enable-apache-httpd  Enable Apache httpd support
   --enable-jni    Enable JNI compilation
   --disable-mg    Disable MG compilation
@@ -1435,4 +1438,19 @@
 
 
+if test -d runtime-src; then
+   # Check whether --enable-apache-httpd or --disable-apache-httpd was given.
+if test "${enable_apache_httpd+set}" = set; then
+  enableval="$enable_apache_httpd"
+  USE_APACHE_HTTPD=1
+else
+  USE_APACHE_HTTPD=0
+fi;
+   cat >>confdefs.h <<\_ACEOF
+#define USE_APACHE_HTTPD $USE_APACHE_HTTPD
+_ACEOF
+
+
+fi
+
 # Check whether --enable-jni or --disable-jni was given.
 if test "${enable_jni+set}" = set; then
@@ -4770,75 +4788,7 @@
 ac_cv_lib_crypt=ac_cv_lib_crypt_main
 
-if test $ENABLE_ACCENTFOLD = 1; then
-
-echo "$as_me:$LINENO: checking for main in -liconv" >&5
-echo $ECHO_N "checking for main in -liconv... $ECHO_C" >&6
-if test "${ac_cv_lib_iconv_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-liconv  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_iconv_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_iconv_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_main" >&5
-echo "${ECHO_T}$ac_cv_lib_iconv_main" >&6
-if test $ac_cv_lib_iconv_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBICONV 1
-_ACEOF
-
-  LIBS="-liconv $LIBS"
-
-fi
-ac_cv_lib_iconv=ac_cv_lib_iconv_main
-
-fi
+#if test $ENABLE_ACCENTFOLD = 1; then
+#AC_HAVE_LIBRARY(iconv)
+#fi
 
 
@@ -6881,4 +6831,37 @@
 
 
+echo "$as_me:$LINENO: checking that Perl 5 is available" >&5
+echo $ECHO_N "checking that Perl 5 is available... $ECHO_C" >&6
+success="no"
+pl_path="$PATH"
+IFS="${IFS=   }"; pl_save_ifs="$IFS"; IFS=":"
+for pl_dir in $pl_path; do
+  test -z "$pl_dir" && pl_dir=.
+  if test -x $pl_dir/perl; then
+    success="yes"
+    break
+  fi
+done
+IFS="$pl_save_ifs"
+
+if test $success = "yes"; then
+try=`perl configtest.pl` || try="0"
+try=`expr $try \> 5.000`
+if test $try = "1"; then
+echo "$as_me:$LINENO: result: \"yes\"" >&5
+echo "${ECHO_T}\"yes\"" >&6
+else
+success="no"
+fi
+fi
+
+if test $success = "no"; then
+echo "$as_me:$LINENO: result: \"no\"" >&5
+echo "${ECHO_T}\"no\"" >&6
+{ { echo "$as_me:$LINENO: error: \"Perl 5 not available - cannot install\"" >&5
+echo "$as_me: error: \"Perl 5 not available - cannot install\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
 success=no
 echo "$as_me:$LINENO: checking \"whether STL library has known faults\"" >&5
@@ -7321,8 +7304,12 @@
 # indexers needs a bindir option to get the binaries into the right place
 gsdlprefix=`pwd`
-ac_configure_args="$ac_configure_args --bindir=$gsdlprefix/bin/$gsdlos "
-
-
-subdirs="$subdirs common-src build-src"
+ac_configure_args="$ac_configure_args --bindir=$gsdlprefix/bin/$gsdlos --libdir=$gsdlprefix/lib/$gsdlos"
+
+
+subdirs="$subdirs common-src"
+
+
+
+subdirs="$subdirs build-src"
 
 
@@ -7330,4 +7317,13 @@
 srclist="common-src/Makefile \
          build-src/Makefile"
+
+if test -d runtime-src; then
+
+
+subdirs="$subdirs runtime-src"
+
+   srclist="$srclist \
+         runtime-src/Makefile"
+fi
 
                               ac_config_files="$ac_config_files Makefile $srclist $moduleDirs"
@@ -7955,4 +7951,5 @@
 s,@ENABLE_ACCENTFOLD@,$ENABLE_ACCENTFOLD,;t t
 s,@USE_SQLITE@,$USE_SQLITE,;t t
+s,@USE_APACHE_HTTPD@,$USE_APACHE_HTTPD,;t t
 s,@ENABLE_JNI@,$ENABLE_JNI,;t t
 s,@ENABLE_MG@,$ENABLE_MG,;t t
Index: /main/trunk/gs2build/configure.in
===================================================================
--- /main/trunk/gs2build/configure.in	(revision 21375)
+++ /main/trunk/gs2build/configure.in	(revision 21376)
@@ -72,4 +72,13 @@
 AC_DEFINE(USE_SQLITE, $USE_SQLITE)
 AC_SUBST(USE_SQLITE)
+
+dnl
+dnl Set use of Apache httpd (disabled by default)
+dnl
+if test -d runtime-src; then
+   AC_ARG_ENABLE(apache-httpd, [  --enable-apache-httpd  Enable Apache httpd support], USE_APACHE_HTTPD=1, USE_APACHE_HTTPD=0)
+   AC_DEFINE(USE_APACHE_HTTPD, $USE_APACHE_HTTPD)
+   AC_SUBST(USE_APACHE_HTTPD)
+fi
 
 dnl
@@ -229,7 +238,7 @@
 dnl check for -lcrypt:
 AC_HAVE_LIBRARY(crypt)
-if test $ENABLE_ACCENTFOLD = 1; then
-AC_HAVE_LIBRARY(iconv)
-fi
+#if test $ENABLE_ACCENTFOLD = 1; then
+#AC_HAVE_LIBRARY(iconv)
+#fi
 
 dnl Checks for header files.
@@ -292,4 +301,42 @@
 dnl
 AC_LANG_CPLUSPLUS
+
+dnl
+dnl Now check that Perl is actually around, and can be found
+dnl
+AC_MSG_CHECKING(that Perl 5 is available)
+success="no"
+pl_path="$PATH"
+IFS="${IFS=   }"; pl_save_ifs="$IFS"; IFS=":"
+for pl_dir in $pl_path; do
+  test -z "$pl_dir" && pl_dir=.
+  if test -x $pl_dir/perl; then
+    success="yes"
+    break
+  fi
+done
+IFS="$pl_save_ifs"
+
+dnl
+dnl Perl actually can be run; now we see if it is version 5 by
+dnl running a sample script (which returns a "clean" version number
+dnl and then tests the result using expr.  If perl errors in some
+dnl way (eg. broken Perl executable, missing script), we set a failure
+dnl value ("0") and then proceed as best we can
+dnl
+if test $success = "yes"; then
+try=`perl configtest.pl` || try="0"
+try=`expr $try \> 5.000`
+if test $try = "1"; then
+AC_MSG_RESULT("yes")
+else
+success="no"
+fi
+fi
+
+if test $success = "no"; then
+AC_MSG_RESULT("no")
+AC_MSG_ERROR("Perl 5 not available - cannot install")
+fi
 
 dnl
@@ -386,6 +433,7 @@
 # indexers needs a bindir option to get the binaries into the right place
 gsdlprefix=`pwd`
-ac_configure_args="$ac_configure_args --bindir=$gsdlprefix/bin/$gsdlos "
-AC_CONFIG_SUBDIRS(common-src build-src)
+ac_configure_args="$ac_configure_args --bindir=$gsdlprefix/bin/$gsdlos --libdir=$gsdlprefix/lib/$gsdlos"
+AC_CONFIG_SUBDIRS(common-src)
+AC_CONFIG_SUBDIRS(build-src)
 
 # the list of folders in the src folder
@@ -393,4 +441,10 @@
          build-src/Makefile"
 
+if test -d runtime-src; then
+   AC_CONFIG_SUBDIRS(runtime-src)
+   srclist="$srclist \
+         runtime-src/Makefile"
+fi
+
 AC_OUTPUT(Makefile $srclist $moduleDirs)
 
