Index: gs2build/config.h.in
===================================================================
--- gs2build/config.h.in	(revision 16597)
+++ gs2build/config.h.in	(revision 16597)
@@ -0,0 +1,217 @@
+/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+#ifndef _GSDL_CONFIG_H
+#define _GSDL_CONFIG_H
+
+/* Define if on AIX 3.
+   System headers sometimes define this.
+   We just want to avoid a redefinition error message.  */
+#ifndef _ALL_SOURCE
+#undef _ALL_SOURCE
+#endif
+
+/* Define if using alloca.c.  */
+#undef C_ALLOCA
+
+/* Define if big endian */
+#undef WORDS_BIGENDIAN
+
+/* Define to empty if the keyword does not work.  */
+#undef const
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+   This function is required for alloca.c support on those systems.  */
+#undef CRAY_STACKSEG_END
+
+/* Define if you have alloca, as a function or macro.  */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
+#undef HAVE_ALLOCA_H
+
+/* Define if you don't have vprintf but do have _doprnt.  */
+#undef HAVE_DOPRNT
+
+/* Define if you have the vprintf function.  */
+#undef HAVE_VPRINTF
+
+/* Define if on MINIX.  */
+#undef _MINIX
+
+/* Define to `long' if <sys/types.h> doesn't define.  */
+#undef off_t
+
+/* Define if the system does not provide POSIX.1 features except
+   with this defined.  */
+#undef _POSIX_1_SOURCE
+
+/* Define if you need to in order for stat and other things to work.  */
+#undef _POSIX_SOURCE
+
+/* Define as the return type of signal handlers (int or void).  */
+#undef RETSIGTYPE
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+#undef size_t
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#undef STACK_DIRECTION
+
+/* Define if you have the ANSI C header files.  */
+#undef STDC_HEADERS
+
+/* Define if you can safely include both <sys/time.h> and <time.h>.  */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if your <sys/time.h> declares struct tm.  */
+#undef TM_IN_SYS_TIME
+
+/* Define to the name of the distribution.  */
+#undef PACKAGE
+
+/* Define to the version of the distribution.  */
+#undef VERSION
+
+/* Define to 1 if you have the valloc function.  */
+#undef HAVE_VALLOC
+
+/* Define to 1 if ANSI function prototypes are usable.  */
+#undef PROTOTYPES
+
+/* Define if you don't want to use long long's with GCC */
+#undef DISABLE_LONG_LONG
+ 
+/* Define to 1 for better use of the debugging malloc library.  See
+   site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz.  */
+#undef WITH_DMALLOC
+
+ 
+/* Define to 1 if GNU regex should be used instead of GNU rx.  */
+#undef WITH_REGEX
+
+/* Some braindead header files do not have the requ'd function declarations */
+#undef HAVE_FGETC_DECL
+#undef HAVE_FREAD_DECL
+
+/* See if have this field in the prstatus_t structure */
+/* It stores the size of the process heap */
+#undef HAVE_PR_BRKSIZE
+
+/* Define FASTCGI if needsbe */
+#undef USE_FASTCGI
+
+/* Define USE_CORBA if needsbe */
+#undef USE_CORBA
+
+/* Define MICO_DIR if needsbe */
+#undef MICO_DIR
+
+/* Define MICO_VERSION if required */
+#undef MICO_VERSION
+
+/* Define if you have the ftime function.  */
+#undef HAVE_FTIME
+
+/* Define if you have the ftruncate function.  */
+#undef HAVE_FTRUNCATE
+
+/* Define if you have the getpagesize function.  */
+#undef HAVE_GETPAGESIZE
+
+/* Define if you have the getrusage function.  */
+#undef HAVE_GETRUSAGE
+
+/* Define if you have the mallinfo function.  */
+#undef HAVE_MALLINFO
+
+/* Define if you have the select function.  */
+#undef HAVE_SELECT
+
+/* Define if you have the setbuffer function.  */
+#undef HAVE_SETBUFFER
+
+/* Define if you have the strcasecmp function.  */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strerror function.  */
+#undef HAVE_STRERROR
+
+/* Define if you have the strftime function.  */
+#undef HAVE_STRFTIME
+
+/* Define if you have the strstr function.  */
+#undef HAVE_STRSTR
+
+/* Define if you have the strtol function.  */
+#undef HAVE_STRTOL
+
+/* Define if you have the times function.  */
+#undef HAVE_TIMES
+
+/* Define if you have the valloc function.  */
+#undef HAVE_VALLOC
+
+/* Define if you have the <crypt.h> header file.  */
+#undef HAVE_CRYPT_H
+
+/* Define if you have the <dirent.h> header file.  */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <fcntl.h> header file.  */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <limits.h> header file.  */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <memory.h> header file.  */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the <ndir.h> header file.  */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <string.h> header file.  */
+#undef HAVE_STRING_H
+
+/* Define if you have the <sys/dir.h> header file.  */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/ndir.h> header file.  */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/procfs.h> header file.  */
+#undef HAVE_SYS_PROCFS_H
+
+/* Define if you have the <sys/time.h> header file.  */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <unistd.h> header file.  */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the crypt library (-lcrypt).  */
+#undef HAVE_LIBCRYPT
+
+/* Define if you have the g library (-lg).  */
+#undef HAVE_LIBG
+
+/* Define if you have the gdbm library (-lgdbm).  */
+#undef HAVE_LIBGDBM
+
+/* Define if you have the m library (-lm).  */
+#undef HAVE_LIBM
+
+/* Define if you have the stdc++ library (-lstdc++).  */
+#undef HAVE_LIBSTDC__
+
+/* Define if you have gettext (eg glibc) */
+#undef ENABLE_NLS
+
+/* Define if big endian */
+#undef WORDS_BIGENDIAN
+
+#endif /* _GSDL_CONFIG_H */
Index: gs2build/setup.bash
===================================================================
--- gs2build/setup.bash	(revision 16597)
+++ gs2build/setup.bash	(revision 16597)
@@ -0,0 +1,200 @@
+# if this file is executed, /bin/sh is used, as we don't start with #!
+# this should work under ash, bash, zsh, ksh, sh style shells.
+gsdllang=""
+# encoding inputs and outputs
+gsdltoenc=""
+gsdlfromenc=""
+
+# see if the shell has any language environment variables set
+# see locale(7) manpage for this ordering.
+if test ! -z "$LC_ALL" ; then
+  gsdllang="$LC_ALL"
+elif test ! -z "$LANG"; then
+  gsdllang="$LANG"
+fi
+
+
+# note... all our output strings have the charset hard-coded, but
+# people may be using a different encoding in their terminal. LANG
+# strings look like "en_NZ.UTF-8".
+
+# Determine the requested output encoding
+case $gsdllang in
+  *.*)
+    gsdltoenc=`echo $gsdllang | sed 's/.*\.//'`
+    ;;
+esac
+
+# Our french and spanish strings are currently in iso-8859-1 encoding.
+case $gsdllang in
+  fr*|FR*)
+    gsdllang=fr
+    gsdlfromenc="iso-8859-1"
+  ;;
+  es*|ES*)
+    gsdllang=es
+    gsdlfromenc="iso-8859-1"
+  ;;
+  ru*|RU*)
+    gsdllang=ru
+    gsdlfromenc="koi8r"
+  ;;
+  *) # default
+    gsdllang=en
+    gsdlfromenc="iso-8859-1"
+  ;;
+esac  
+
+# "iconv" is the program for converting text between encodings.
+gsdliconv=`which iconv 2>/dev/null`
+if test $? -ne 0 || test ! -x "$gsdliconv" || test -z "$gsdlfromenc" || test -z "$gsdltoenc"; then
+# we can't convert encodings from some reason
+  gsdliconv="cat"
+else
+# add the encodings
+  gsdliconv="$gsdliconv -f $gsdlfromenc -t $gsdltoenc"
+fi
+
+# make sure we are sourced, and not run
+
+if test "$0" != "`echo $0 | sed s/setup\.bash//`" ; then
+# if $0 contains "setup.bash" we've been run... $0 is shellname if sourced.
+# One exception is zsh has an option to set it temporarily to the script name
+  if test -z "$ZSH_NAME" ; then
+  # we aren't using zsh
+  gsdl_not_sourced=true
+  fi
+fi
+
+if test -n "$gsdl_not_sourced" ; then
+  case "$gsdllang" in
+ "es")
+eval $gsdliconv <<EOF
+      Error: Asegúrese de compilar este guión, no de ejecutarlo. P. ej.:
+         $ source setup.bash
+      o
+         $ . ./setup.bash
+      no
+         $ ./setup.bash
+EOF
+  ;;
+  "fr")
+eval $gsdliconv <<EOF
+      Erreur: Assurez-vous de "sourcer" le script, plutôt que de l'exécuter. Ex:
+         $ source setup.bash
+      ou
+         $ . ./setup.bash
+      pas
+         $ ./setup.bash
+EOF
+  ;;
+  "ru")
+eval $gsdliconv <<EOF
+      ïÛÉÂËÁ: õÄÏÓÔÏ×ÅÒØÔÅÓØ × ÉÓÔÏÞÎÉËÅ ÜÔÏÇÏ ÓËÒÉÐÔÁ. îÅ ÉÓÐÏÌÎÑÊÔÅ ÅÇÏ.
+      îÁÐÒÉÍÅÒ:
+         $ source setup.bash
+      ÉÌÉ
+         $ . ./setup.bash
+      ÎÅÔ
+         $ ./setup.bash
+EOF
+  ;;
+  *)
+eval $gsdliconv <<EOF
+	Error: Make sure you source this script, not execute it. Eg:
+		$ source setup.bash
+	or
+		$ . ./setup.bash
+	not
+		$ ./setup.bash
+EOF
+  ;;
+  esac
+elif test -n "$GSDLHOME" ; then
+  case "$gsdllang" in
+  "es")
+    echo '¡Su ambiente ya está listo para Greenstone!' | eval $gsdliconv
+  ;;
+  "fr")
+    echo 'Votre environnement est déjà préparé pour Greenstone!' | eval $gsdliconv
+ ;;
+  "ru")
+    echo '÷ÁÛÅ ÏËÒÕÖÅÎÉÅ ÕÖÅ ÎÁÓÔÒÏÅÎÏ ÄÌÑ Greenstone!' | eval $gsdliconv
+  ;;
+  *)
+    echo 'Your environment is already set up for Greenstone!'
+  ;;
+  esac
+elif test ! -f setup.bash ; then
+  case "$gsdllang" in
+    "es")
+eval $gsdliconv <<EOF
+Usted debe compilar el guión desde el interior del directorio de inicio
+de Greenstone.
+EOF
+  ;;
+  "fr")
+echo 'Vous devez trouver la source du script dans le répertoire de base de Greenstone' | eval $gsdliconv
+  ;;
+  "ru")
+eval $gsdliconv <<EOF
+÷ÁÍ ÎÅÏÂÈÏÄÉÍ ÉÓÔÏÞÎÉË ÓËÒÉÐÔÁ ÉÚ ÂÁÚÏ×ÏÊ ÄÉÒÅËÔÏÒÉÉ Greenstone
+EOF
+  ;;
+  *)
+    echo 'You must source the script from within the Greenstone home directory'
+  ;;
+  esac
+else
+  GSDLHOME=`pwd`
+  export GSDLHOME
+  GSDLOS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  # check for running bash under cygwin
+  if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
+  then
+    GSDLOS=windows
+  fi
+  export GSDLOS
+
+  PATH=$PATH:$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS
+  export PATH
+  MANPATH=$MANPATH:$GSDLHOME/packages/mg/man
+  export MANPATH
+  case "$gsdllang" in
+    "es")
+      echo 'Su ambiente ha sido configurado para correr los programas Greenstone.' | eval $gsdliconv
+    ;;
+    "fr")
+      echo 'Votre environnement a été configuére avec succès pour exécuter Greenstone' | eval $gsdliconv
+    ;;
+    "ru")
+eval $gsdliconv <<EOF
+÷ÁÛÅ ÏËÒÕÖÅÎÉÅ ÂÙÌÏ ÕÓÐÅÛÎÏ ÎÁÓÔÒÏÅÎÏ, ÞÔÏÂÙ ÕÓÔÁÎÏ×ÉÔØ Greenstone
+EOF
+    ;;
+    *)
+      echo 'Your environment has successfully been set up to run Greenstone'
+    ;;
+  esac
+fi
+unset gsdl_not_sourced
+unset gsdliconv
+unset gsdlfromenc
+unset gsdltoenc
+
+if [ -e ext ] ; then
+  for gsdl_ext in ext/* ; do
+    cd $gsdl_ext 
+    if [ -e setup.bash ] ; then 
+      . setup.bash 
+    fi 
+    cd ../..  
+  done
+fi
+
+if [ -e local ] ; then
+  export PATH=$GSDLHOME/local/bin:$PATH
+  export LD_LIBRARY_PATH=$GSDLHOME/local/lib:$LD_LIBRARY_PATH
+fi
+
+
Index: gs2build/setup.bat
===================================================================
--- gs2build/setup.bat	(revision 16597)
+++ gs2build/setup.bat	(revision 16597)
@@ -0,0 +1,56 @@
+@echo off
+set GSDLLANG=en
+
+if "%OS%" == "Windows_NT" goto WinNT
+if "%OS%" == "" goto Win95
+if "%GSDLLANG%" == "en" echo Setup failed - your PATH has not been set
+if "%GSDLLANG%" == "es" echo No se pudo realizar la configuraci¢n - no se ha establecido la RUTA.
+if "%GSDLLANG%" == "fr" echo Echc de l'installation - votre variable PATH n'a pas t ajuste
+if "%GSDLLANG%" == "ru" echo áâ ­®¢ª  ­¥ ã€ « áì -  ­¥ ¡ë« ãáâ ­®¢«¥­
+goto End
+
+:WinNT
+set GSDLHOME=**GSDLHOME**
+set GSDLOS=windows
+set PATH=%GSDLHOME%\bin\windows\perl\bin;%GSDLHOME%\bin\windows;%GSDLHOME%\bin\script;%PATH%
+goto Success
+
+:Win95
+if "%1" == "SetEnv" goto Win95Env
+REM We'll invoke a second copy of the command processor to make
+REM sure there's enough environment space
+COMMAND /E:2048 /K %0 SetEnv
+goto End
+
+:Win95Env
+set GSDLHOME=**GSDLHOME**
+set GSDLOS=windows
+set PATH="%GSDLHOME%\bin\windows\perl\bin";"%GSDLHOME%\bin\windows";"%GSDLHOME%\bin\script";"%PATH%"
+goto Success
+
+
+:Success
+if "%GSDLLANG%" == "en" echo Your environment has successfully been set up to run Greenstone.
+if "%GSDLLANG%" == "en" echo Note that these settings will only have effect within this MS-DOS
+if "%GSDLLANG%" == "en" echo session. You will therefore need to rerun setup.bat if you want
+if "%GSDLLANG%" == "en" echo to run Greenstone programs from a different MS-DOS session.
+
+if "%GSDLLANG%" == "es" echo Su ambiente ha sido configurado para correr los programas Greenstone.
+if "%GSDLLANG%" == "es" echo Recuerde que estos ajustes £nicamente tendr n efecto dentro de esta sesi¢n
+if "%GSDLLANG%" == "es" echo MS-DOS. Por lo tanto deber  ejecutar nuevamente setup.bat si desea
+if "%GSDLLANG%" == "es" echo correr los programas de Greenstone desde una sesi¢n MS-DOS diferente.
+
+if "%GSDLLANG%" == "fr" echo Votre environnement a t configure avec succs pour excuter Greenstone
+if "%GSDLLANG%" == "fr" echo Notez que ces paramtrages n'auront d'effet que dans cette session MS-DOS.
+if "%GSDLLANG%" == "fr" echo Vous devrez par consquent rexcuter setup.bat si vous voulez faire
+if "%GSDLLANG%" == "fr" echo lancer des programmes Greenstone dans une autre session MS-DOS.
+
+if "%GSDLLANG%" == "ru" echo  è¥ ®ªàãŠ¥­š¥ ¡ë«® ãá¯¥è­® ­ áâà®¥­®, çâ®¡ë ãáâ ­®¢šâì Greenstone ¡à âšâ¥
+if "%GSDLLANG%" == "ru" echo ¢­š¬ ­š¥, çâ® íâš ­ §­ ç¥­šï ¡ã€ãâ â®«ìª® š¬¥âì íää¥ªâ ¢ ¯à¥€¥« å íâ®£® MS DOS
+if "%GSDLLANG%" == "ru" echo á¥áášï. ë ¡ã€¥â¥ ¯®íâ®¬ã €®«Š­ë ¯®¢â®à­® ã¯à ¢«ïâì setup.bat, ¥á«š ë å®âšâ¥
+if "%GSDLLANG%" == "ru" echo ã¯à ¢«ïâì ¯à®£à ¬¬ ¬š ¥«ñ­ëå š§¢¥àŠ¥­­ëå ¯®à®€ ®â à §«šç­®© á¥áášš MS DOS.
+
+:End
+
+:: test writability of GSDLHOME
+@call "%GSDLHOME%\bin\script\checkwritability.bat"
Index: gs2build/setup.csh
===================================================================
--- gs2build/setup.csh	(revision 16597)
+++ gs2build/setup.csh	(revision 16597)
@@ -0,0 +1,18 @@
+setenv GSDLLANG en
+setenv GSDLHOME `pwd`
+setenv GSDLOS `uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+setenv PATH $PATH\:$GSDLHOME/bin/script\:$GSDLHOME/bin/$GSDLOS
+if ($?MANPATH) then
+  setenv MANPATH $MANPATH\:$GSDLHOME/packages/mg/man
+else
+  setenv MANPATH $GSDLHOME/packages/mg/man
+endif
+if ("$GSDLLANG" == "es") then
+  echo "Su ambiente ha sido configurado para correr los programas Greenstone."
+else if ("$GSDLLANG" == "fr") then
+  echo "Votre environnement a été configuére avec succès pour exécuter Greenstone"
+else if ("$GSDLLANG" == "ru") then
+  echo "÷ÁÛÅ ÏËÒÕÖÅÎÉÅ ÂÙÌÏ ÕÓÐÅÛÎÏ ÎÁÓÔÒÏÅÎÏ, ÞÔÏÂÙ ÕÓÔÁÎÏ×ÉÔØ Greenstone"
+else
+  echo "Your environment has successfully been set up to run Greenstone"
+endif
