Index: main/trunk/greenstone2/common-src/Makefile.in
===================================================================
--- main/trunk/greenstone2/common-src/Makefile.in	(revision 24882)
+++ main/trunk/greenstone2/common-src/Makefile.in	(revision 24901)
@@ -38,4 +38,5 @@
 
 GSDLOS = @gsdlos@
+GSDLARCH = @gsdlarch@
 
 COMPILE = $(CC) -c
Index: main/trunk/greenstone2/common-src/cgi-bin/Makefile.in
===================================================================
--- main/trunk/greenstone2/common-src/cgi-bin/Makefile.in	(revision 24882)
+++ main/trunk/greenstone2/common-src/cgi-bin/Makefile.in	(revision 24901)
@@ -27,21 +27,22 @@
 COMMON_DIR = $(GSDL_DIR)/common-src
 GSDLOS = @gsdlos@
+GSDLARCH = @gsdlarch@
 
 
 
 all:	
-	mkdir -p $(GSDL_DIR)/cgi-bin/$(GSDLOS)
+	mkdir -p $(GSDL_DIR)/cgi-bin/$(GSDLOS)$(GSDLARCH)
 
 install:
-	cp * $(GSDL_DIR)/cgi-bin/$(GSDLOS)/.
-	rm -f $(GSDL_DIR)/cgi-bin/$(GSDLOS)/Makefile
-	rm -f $(GSDL_DIR)/cgi-bin/$(GSDLOS)/Makefile.in
-	rm -f $(GSDL_DIR)/cgi-bin/$(GSDLOS)/win32.mak
+	cp * $(GSDL_DIR)/cgi-bin/$(GSDLOS)$(GSDLARCH)/.
+	rm -f $(GSDL_DIR)/cgi-bin/$(GSDLOS)$(GSDLARCH)/Makefile
+	rm -f $(GSDL_DIR)/cgi-bin/$(GSDLOS)$(GSDLARCH)/Makefile.in
+	rm -f $(GSDL_DIR)/cgi-bin/$(GSDLOS)$(GSDLARCH)/win32.mak
 
 clean:
-	rm -rf $(GSDL_DIR)/cgi-bin/$(GSDLOS)
+	rm -rf $(GSDL_DIR)/cgi-bin/$(GSDLOS)$(GSDLARCH)
 
 distclean:
-	rm -rf $(GSDL_DIR)/cgi-bin/$(GSDLOS)
+	rm -rf $(GSDL_DIR)/cgi-bin/$(GSDLOS)$(GSDLARCH)
 	rm -f Makefile
 
Index: main/trunk/greenstone2/common-src/configure
===================================================================
--- main/trunk/greenstone2/common-src/configure	(revision 24882)
+++ main/trunk/greenstone2/common-src/configure	(revision 24901)
@@ -312,5 +312,5 @@
 ac_subdirs_all="$ac_subdirs_all packages"
 ac_subdirs_all="$ac_subdirs_all indexers"
-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_JAVA USE_JDBM USE_GDBM 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 JAVA uudecode JAVAC JAVACFLAGS 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_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_JAVA USE_JDBM USE_GDBM 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 JAVA uudecode JAVAC JAVACFLAGS 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 gsdlarch MODULEDIRS subdirs LTLIBOBJS'
 ac_subst_files=''
 
@@ -3780,4 +3780,5 @@
   if test -z "$COMPAT32BITFLAGS" ; then
     COMPAT32BITFLAGS="-m32"
+    gsdlarch='64'
   fi
 else
@@ -3786,4 +3787,5 @@
   if test -z "$COMPAT32BITFLAGS" ; then
     COMPAT32BITFLAGS=
+    gsdlarch='32'
   fi
 fi
@@ -7566,4 +7568,12 @@
   gsdlos=windows
  fi
+
+
+# Make gsdlarch empty if the OS bit value (32 or 64) is not used in naming
+# directories already or if common-src is compiled up on its own.
+# E.g. 32/64 bit won't be used in the SVN version if only bin/linux exists.
+if test -d "../bin/$gsdlos" -o ! -f "../setup.bash" ; then
+   gsdlarch=""
+fi
 
 
@@ -8542,4 +8552,5 @@
 s,@STATIC@,$STATIC,;t t
 s,@gsdlos@,$gsdlos,;t t
+s,@gsdlarch@,$gsdlarch,;t t
 s,@MODULEDIRS@,$MODULEDIRS,;t t
 s,@subdirs@,$subdirs,;t t
Index: main/trunk/greenstone2/common-src/configure.in
===================================================================
--- main/trunk/greenstone2/common-src/configure.in	(revision 24882)
+++ main/trunk/greenstone2/common-src/configure.in	(revision 24901)
@@ -226,4 +226,5 @@
   if test -z "$COMPAT32BITFLAGS" ; then
     COMPAT32BITFLAGS="-m32"
+    gsdlarch='64'
   fi
 else
@@ -231,4 +232,5 @@
   if test -z "$COMPAT32BITFLAGS" ; then
     COMPAT32BITFLAGS=
+    gsdlarch='32'
   fi
 fi
@@ -426,4 +428,12 @@
  fi
 AC_SUBST(gsdlos)
+
+# Make gsdlarch empty if the OS bit value (32 or 64) is not used in naming 
+# directories already or if common-src is compiled up on its own.
+# E.g. 32/64 bit won't be used in the SVN version if only bin/linux exists.
+if test -d "../bin/$gsdlos" -o ! -f "../setup.bash" ; then
+   gsdlarch=""
+fi
+AC_SUBST(gsdlarch)
 
 # check for endianness
