Index: /main/trunk/greenstone2/build-src/configure
===================================================================
--- /main/trunk/greenstone2/build-src/configure	(revision 21431)
+++ /main/trunk/greenstone2/build-src/configure	(revision 21432)
@@ -3133,4 +3133,14 @@
   fi
 fi
+
+# Only need compat32bitflag if using MG or MGPP
+if test "$ENABLE_MG" = "0" ; then
+  COMPAT32BITFLAGS=
+else
+  if test "$ENABLE_MGPP" = "0" ; then
+    COMPAT32BITFLAGS=
+  fi
+fi
+
 export COMPAT32BITFLAGS
 
Index: /main/trunk/greenstone2/build-src/configure.in
===================================================================
--- /main/trunk/greenstone2/build-src/configure.in	(revision 21431)
+++ /main/trunk/greenstone2/build-src/configure.in	(revision 21432)
@@ -115,4 +115,14 @@
   fi
 fi
+
+# Only need compat32bitflag if using MG or MGPP
+if test "$ENABLE_MG" = "0" ; then
+  COMPAT32BITFLAGS=
+else
+  if test "$ENABLE_MGPP" = "0" ; then
+    COMPAT32BITFLAGS=
+  fi
+fi
+
 export COMPAT32BITFLAGS
 AC_SUBST(COMPAT32BITFLAGS)
Index: /main/trunk/greenstone2/common-src/configure
===================================================================
--- /main/trunk/greenstone2/common-src/configure	(revision 21431)
+++ /main/trunk/greenstone2/common-src/configure	(revision 21432)
@@ -3233,4 +3233,14 @@
   fi
 fi
+
+# Only need compat32bitflag if using MG or MGPP
+if test "$ENABLE_MG" = "0" ; then
+  COMPAT32BITFLAGS=
+else
+  if test "$ENABLE_MGPP" = "0" ; then
+    COMPAT32BITFLAGS=
+  fi
+fi
+
 export COMPAT32BITFLAGS
 
Index: /main/trunk/greenstone2/common-src/configure.in
===================================================================
--- /main/trunk/greenstone2/common-src/configure.in	(revision 21431)
+++ /main/trunk/greenstone2/common-src/configure.in	(revision 21432)
@@ -178,4 +178,14 @@
   fi
 fi
+
+# Only need compat32bitflag if using MG or MGPP
+if test "$ENABLE_MG" = "0" ; then
+  COMPAT32BITFLAGS=
+else
+  if test "$ENABLE_MGPP" = "0" ; then
+    COMPAT32BITFLAGS=
+  fi
+fi
+
 export COMPAT32BITFLAGS
 AC_SUBST(COMPAT32BITFLAGS)
Index: /main/trunk/greenstone2/common-src/packages/configure
===================================================================
--- /main/trunk/greenstone2/common-src/packages/configure	(revision 21431)
+++ /main/trunk/greenstone2/common-src/packages/configure	(revision 21432)
@@ -158,7 +158,7 @@
 
 # configure
-echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
+echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
 cd "$PACKAGES/iconv/libiconv-1.13.1" && \
-CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
+CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
 
 # make
@@ -169,4 +169,27 @@
 echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $HOSTTARGETFLAGS $ENVIRONMENT
 CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $HOSTTARGETFLAGS $ENVIRONMENT
+
+if test ! -z "$COMPAT32BITFLAGS" ; then
+  echo "Generating native 64-bit version as well"
+  # used in apache web server, for example
+
+  # dist clean
+  cd "$PACKAGES/iconv/libiconv-1.13.1" 
+  echo make distclean && \
+  make distclean
+
+  # configure
+  echo ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" --libdir="$PACKAGES/iconv/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
+  ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" --libdir="$PACKAGES/iconv/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
+
+  # make
+  echo make $HOSTTARGETFLAGS $ENVIRONMENT
+  make $HOSTTARGETFLAGS $ENVIRONMENT
+
+  # make install
+  make install $HOSTTARGETFLAGS $ENVIRONMENT
+  make install $HOSTTARGETFLAGS $ENVIRONMENT
+
+fi
 
 #./configure $CACHE_FILE --prefix="$PACKAGES/iconv" --disable-shared $HOSTTARGETFLAGS&&
Index: /main/trunk/greenstone2/common-src/packages/gdbm/gdbm-1.8.3/configure
===================================================================
--- /main/trunk/greenstone2/common-src/packages/gdbm/gdbm-1.8.3/configure	(revision 21431)
+++ /main/trunk/greenstone2/common-src/packages/gdbm/gdbm-1.8.3/configure	(revision 21432)
@@ -7520,25 +7520,10 @@
 
 
-echo "$as_me:$LINENO: checking to see if architecture is 64-bit" >&5
-echo $ECHO_N "checking to see if architecture is 64-bit... $ECHO_C" >&6
-arch_64bit=no
-case "$host_cpu" in
-x86_64) arch_64bit=yes ;;
-esac
-
-if test "$arch_64bit" = yes; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-  if test -z "$COMPAT32BITFLAGS" ; then
-    COMPAT32BITFLAGS="-m32"
-  fi
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-  if test -z "$COMPAT32BITFLAGS" ; then
-    COMPAT32BITFLAGS=
-  fi
-fi
-export COMPAT32BITFLAGS
+
+
+cat >>confdefs.h <<_ACEOF
+#define COMPAT32BITFLAGS $COMPAT32BITFLAGS
+_ACEOF
+
 
 
Index: /main/trunk/greenstone2/common-src/packages/gdbm/gdbm-1.8.3/configure.in
===================================================================
--- /main/trunk/greenstone2/common-src/packages/gdbm/gdbm-1.8.3/configure.in	(revision 21431)
+++ /main/trunk/greenstone2/common-src/packages/gdbm/gdbm-1.8.3/configure.in	(revision 21432)
@@ -16,24 +16,28 @@
 dnl AC_C_BIGENDIAN([])
 
-AC_MSG_CHECKING(to see if architecture is 64-bit)
-arch_64bit=no
-case "$host_cpu" in
-x86_64) arch_64bit=yes ;;
-esac
+dnl AC_MSG_CHECKING(to see if architecture is 64-bit)
+dnl arch_64bit=no
+dnl case "$host_cpu" in
+dnl x86_64) arch_64bit=yes ;;
+dnl esac
+dnl 
+dnl if test "$arch_64bit" = yes; then
+dnl   AC_MSG_RESULT(yes)
+dnl   if test -z "$COMPAT32BITFLAGS" ; then
+dnl     COMPAT32BITFLAGS="-m32"
+dnl     LIBTOOLCOMPAT32BITFLAGS="-Wl,-m32"
+dnl   fi
+dnl else
+dnl   AC_MSG_RESULT(no)
+dnl   if test -z "$COMPAT32BITFLAGS" ; then
+dnl     COMPAT32BITFLAGS=
+dnl     LIBTOOLCOMPAT32BITFLAGS=
+dnl   fi
+dnl fi
+dnl export COMPAT32BITFLAGS
+dnl AC_SUBST(COMPAT32BITFLAGS)
 
-if test "$arch_64bit" = yes; then
-  AC_MSG_RESULT(yes)
-  if test -z "$COMPAT32BITFLAGS" ; then
-    COMPAT32BITFLAGS="-m32"
-    LIBTOOLCOMPAT32BITFLAGS="-Wl,-m32"
-  fi
-else
-  AC_MSG_RESULT(no)
-  if test -z "$COMPAT32BITFLAGS" ; then
-    COMPAT32BITFLAGS=
-    LIBTOOLCOMPAT32BITFLAGS=
-  fi
-fi
-export COMPAT32BITFLAGS
+
+AC_DEFINE_UNQUOTED(COMPAT32BITFLAGS, $COMPAT32BITFLAGS)
 AC_SUBST(COMPAT32BITFLAGS)
 
Index: /main/trunk/greenstone2/configure
===================================================================
--- /main/trunk/greenstone2/configure	(revision 21431)
+++ /main/trunk/greenstone2/configure	(revision 21432)
@@ -3248,4 +3248,14 @@
   fi
 fi
+
+# Only need compat32bitflag if using MG or MGPP
+if test "$ENABLE_MG" = "0" ; then
+  COMPAT32BITFLAGS=
+else
+  if test "$ENABLE_MGPP" = "0" ; then
+    COMPAT32BITFLAGS=
+  fi
+fi
+
 export COMPAT32BITFLAGS
 
Index: /main/trunk/greenstone2/configure.in
===================================================================
--- /main/trunk/greenstone2/configure.in	(revision 21431)
+++ /main/trunk/greenstone2/configure.in	(revision 21432)
@@ -189,4 +189,14 @@
   fi
 fi
+
+# Only need compat32bitflag if using MG or MGPP
+if test "$ENABLE_MG" = "0" ; then
+  COMPAT32BITFLAGS=
+else
+  if test "$ENABLE_MGPP" = "0" ; then
+    COMPAT32BITFLAGS=
+  fi
+fi
+
 export COMPAT32BITFLAGS
 AC_SUBST(COMPAT32BITFLAGS)
Index: /main/trunk/greenstone2/runtime-src/configure
===================================================================
--- /main/trunk/greenstone2/runtime-src/configure	(revision 21431)
+++ /main/trunk/greenstone2/runtime-src/configure	(revision 21432)
@@ -3205,4 +3205,14 @@
   fi
 fi
+
+# Only need compat32bitflag if using MG or MGPP
+if test "$ENABLE_MG" = "0" ; then
+  COMPAT32BITFLAGS=
+else
+  if test "$ENABLE_MGPP" = "0" ; then
+    COMPAT32BITFLAGS=
+  fi
+fi
+
 export COMPAT32BITFLAGS
 
Index: /main/trunk/greenstone2/runtime-src/configure.in
===================================================================
--- /main/trunk/greenstone2/runtime-src/configure.in	(revision 21431)
+++ /main/trunk/greenstone2/runtime-src/configure.in	(revision 21432)
@@ -159,4 +159,14 @@
   fi
 fi
+
+# Only need compat32bitflag if using MG or MGPP
+if test "$ENABLE_MG" = "0" ; then
+  COMPAT32BITFLAGS=
+else
+  if test "$ENABLE_MGPP" = "0" ; then
+    COMPAT32BITFLAGS=
+  fi
+fi
+
 export COMPAT32BITFLAGS
 AC_SUBST(COMPAT32BITFLAGS)
