Index: configure.in
===================================================================
RCS file: /cvs/tools/config_office/configure.in,v
retrieving revision 1.221
diff -u -r1.221 configure.in
--- config_office/configure.in	4 Oct 2007 07:48:20 -0000	1.221
+++ config_office/configure.in	17 Oct 2007 12:12:45 -0000
@@ -408,9 +408,10 @@
 
                           Usage: --with-stlport4=<absolute path to stlport4 home>
 
-                          Warning!!, --without-stlport4 is possible with
-                          gcc >= 3.3.3, but will break ABI compatability
-], WITH_STLPORT=$withval , WITH_STLPORT=yes)
+                          Warning!!, disabling with --without-stlport4 or 
+                          enabling with --with-stlport4 on a platform that
+                          defaults to the opposite will break ABI compatability
+], WITH_STLPORT=$withval , WITH_STLPORT=auto)
 AC_ARG_WITH(jdk-home,
 [  --with-jdk-home         if you have installed JDK 1.3 or later on your system
                           please supply the path here.
@@ -2059,6 +2060,30 @@
 else
 
 dnl ===================================================================
+dnl Checks for what the default STL should be
+dnl ===================================================================
+   AC_MSG_CHECKING([what the default STL should be])
+   DEFAULT_TO_STLPORT="yes"
+   if test "$_os" = "Linux"; then
+     case "$build_cpu" in
+       i?86)
+         DEFAULT_TO_STLPORT="yes"
+         ;;
+       *)
+         DEFAULT_TO_STLPORT="no"
+         ;;
+     esac
+   fi
+   if test "$DEFAULT_TO_STLPORT" = "yes"; then
+      AC_MSG_RESULT([stlport])
+   else
+      AC_MSG_RESULT([gcc])
+   fi
+   if test "$WITH_STLPORT" = "auto"; then
+      WITH_STLPORT=$DEFAULT_TO_STLPORT
+   fi
+
+dnl ===================================================================
 dnl Checks for STLPORT4
 dnl ===================================================================
    AC_MSG_CHECKING([for STLport4 headers])
@@ -2066,9 +2091,17 @@
    USE_SYSTEM_STL=""
    if test "$WITH_STLPORT" = "yes"; then
       AC_MSG_RESULT([using internal stlport.])
+      if test "$DEFAULT_TO_STLPORT" != "yes"; then
+         AC_MSG_WARN([using stlport. Warning breaks your ABI compatability!])
+         echo "using stlport. Warning breaks your ABI compatability!" >>warn
+      fi
    elif test "$WITH_STLPORT" = "no"; then
-      AC_MSG_RESULT([use system STL instead, Warning breaks your ABI compatability!])
+      AC_MSG_RESULT([use system STL])
       USE_SYSTEM_STL="YES"
+      if test "$DEFAULT_TO_STLPORT" != "no"; then
+         AC_MSG_WARN([using system STL. Warning breaks your ABI compatability!])
+         echo "using system STL. Warning breaks your ABI compatability!" >>warn
+      fi
    else
       STLPORT4=$WITH_STLPORT
       if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
@@ -2113,6 +2146,10 @@
 			   fi
 		   fi
 	   fi
+      if test "$DEFAULT_TO_STLPORT" != "yes"; then
+         AC_MSG_WARN([using stlport. Warning breaks your ABI compatability!])
+         echo "using stlport. Warning breaks your ABI compatability!" >>warn
+      fi
    fi
 fi
 
@@ -2145,23 +2182,42 @@
 fi
 AC_SUBST(ALLOC)
 
+dnl Check whether there's a C pre-processor.
+if test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "NetBSD" ; then
+   AC_PROG_CPP
+fi
+dnl Check whether there's a C++ pre-processor.
+if test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "NetBSD" ; then
+   AC_PROG_CXXCPP
+fi
+
 dnl ===================================================================
-dnl hash_map hackery
+dnl system stl sanity tests
 dnl ===================================================================
 if test "$USE_SYSTEM_STL" = "YES"; then
-   AC_MSG_CHECKING([if hash_map will be in __gnu_cxx namespace])
    AC_LANG_SAVE
+   AC_MSG_CHECKING([if hash_map will be in __gnu_cxx namespace])
    AC_LANG_CPLUSPLUS
    AC_TRY_COMPILE([#include <ext/hash_map>
 using namespace __gnu_cxx;
 ],[hash_map<int, int> t; return 0;],
   ac_cv_cxx_have_ext_hash_map=yes, ac_cv_cxx_have_ext_hash_map=no)
-   AC_LANG_RESTORE
+
    if test "$ac_cv_cxx_have_ext_hash_map" = "no"; then
-      AC_MSG_ERROR([Can't find hash_map. Try with stlport enabled])
+      AC_MSG_ERROR([Can't find hash_map. Try with --with-stlport])
    else
       AC_MSG_RESULT([$ac_cv_cxx_have_ext_hash_map])
    fi
+
+   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
+      AC_MSG_CHECKING([if STL headers are visibility safe])
+      AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
+      AC_MSG_RESULT([$stlvisok])
+      if test "$stlvisok" = "no"; then
+         AC_MSG_ERROR([Your gcc STL headers are not visibility safe. Try with --with-stlport])
+      fi
+   fi
+   AC_LANG_RESTORE
 fi
 
 dnl ===================================================================
@@ -2547,14 +2603,6 @@
 dnl ===================================================================
 dnl Checks for programs.
 dnl ===================================================================
-dnl Check whether there's a C pre-processor.
-if test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "NetBSD" ; then
-   AC_PROG_CPP
-fi
-dnl Check whether there's a C++ pre-processor.
-if test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "NetBSD" ; then
-   AC_PROG_CXXCPP
-fi
 
 dnl ===================================================================
 dnl Check whether we already have dmake
Index: settings/settings.mk
===================================================================
RCS file: /cvs/api/odk/settings/settings.mk,v
retrieving revision 1.23
diff -u -r1.23 settings.mk
--- odk/settings/settings.mk	31 Jul 2007 13:58:07 -0000	1.23
+++ odk/settings/settings.mk	18 Oct 2007 13:41:31 -0000
@@ -229,10 +229,12 @@
 PACKAGE_LIB_DIR=linux_x86.plt
 UNOPKG_PLATFORM=Linux_x86
 JAVA_PROC_TYPE=i386
+STLPORTLIB=-lstlport_gcc
 
 ifeq "$(PROCTYPE)" "x86_64"
 PACKAGE_LIB_DIR=linux_x86_64.plt
 UNOPKG_PLATFORM=Linux_x86_64
+STLPORTLIB=
 # needs deeper investigation for intel 64 bit
 JAVA_PROC_TYPE=amd64
 endif
@@ -289,7 +291,6 @@
 SALHELPERLIB=-luno_salhelper$(COMID)
 REGLIB=-lreg
 STORELIB=-lstore
-STLPORTLIB=-lstlport_gcc
 
 EMPTYSTRING=
 PATH_SEPARATOR=:
