diff --git a/config/stdlib/stlport.hpp b/config/stdlib/stlport.hpp
index 98fdd43..baa72e1 100644
--- a/config/stdlib/stlport.hpp
+++ b/config/stdlib/stlport.hpp
@@ -126,6 +126,10 @@
       && (defined(__STL_VENDOR_GLOBAL_CSTD) || defined (_STLP_VENDOR_GLOBAL_CSTD))
 #     define BOOST_NO_STDC_NAMESPACE
 #     define BOOST_NO_EXCEPTION_STD_NAMESPACE
+
+// necessary on Android so that BOOST_FUNCTION_STD_NS::type_info with
+// empty BOOST_FUNCTION_STD_NS works
+using std::type_info;
 #  endif
 #elif defined(__BORLANDC__) && __BORLANDC__ < 0x560
 // STLport doesn't import std::abs correctly:
@@ -157,7 +161,7 @@ namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy;
 // only if BOOST_NO_STDC_NAMESPACE is not defined (if it is then we do the import 
 // into std:: ourselves).
 //
-#if defined(_STLP_NO_NATIVE_WIDE_FUNCTIONS) && !defined(BOOST_NO_STDC_NAMESPACE)
+#if 1 || defined(_STLP_NO_NATIVE_WIDE_FUNCTIONS) && !defined(BOOST_NO_STDC_NAMESPACE)
 #  define BOOST_NO_CWCHAR
 #  define BOOST_NO_CWCTYPE
 #endif
diff --git a/detail/sp_counted_impl.hpp b/detail/sp_counted_impl.hpp
index 6963f59..ef575d2 100644
--- a/detail/sp_counted_impl.hpp
+++ b/detail/sp_counted_impl.hpp
@@ -36,6 +36,11 @@
 #endif
 
 #include <typeinfo>         // std::type_info in get_deleter
+#if defined(BOOST_HAVE_TYPEINFO)
+# define BOOST_TYPES_EQUAL(_x, _y) ((_x) == (_y))
+#else
+# define BOOST_TYPES_EQUAL(_x, _y) true
+#endif
 #include <cstddef>          // std::size_t
 
 namespace boost
@@ -147,7 +152,7 @@ public:
 
     virtual void * get_deleter( std::type_info const & ti )
     {
-        return ti == typeid(D)? &del: 0;
+        return BOOST_TYPES_EQUAL(ti, typeid(D))? &del: 0;
     }
 
 #if defined(BOOST_SP_USE_STD_ALLOCATOR)
@@ -217,7 +222,7 @@ public:
 
     virtual void * get_deleter( std::type_info const & ti )
     {
-        return ti == typeid( D )? &d_: 0;
+        return BOOST_TYPES_EQUAL(ti, typeid( D ))? &d_: 0;
     }
 };
 
diff --git a/function/function_base.hpp b/function/function_base.hpp
index aa7376a..b73c844 100644
--- a/function/function_base.hpp
+++ b/function/function_base.hpp
@@ -46,7 +46,9 @@
 
 // Borrowed from Boost.Python library: determines the cases where we
 // need to use std::type_info::name to compare instead of operator==.
-# if (defined(__GNUC__) && __GNUC__ >= 3) \
+# if !defined(BOOST_HAVE_TYPEINFO)
+#  define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) true
+# elif (defined(__GNUC__) && __GNUC__ >= 3) \
  || defined(_AIX) \
  || (   defined(__sgi) && defined(__host_mips))
 #  include <cstring>
@@ -239,7 +241,11 @@ namespace boost {
             return;
 
           case get_functor_type_tag:
+#ifdef BOOST_HAVE_TYPEID
             out_buffer.const_obj_ptr = &typeid(F);
+#else
+            boost::throw_exception(std::runtime_error("no rtti"));
+#endif
             return;
           }
         }
@@ -279,8 +285,10 @@ namespace boost {
           else if (op == destroy_functor_tag)
             out_buffer.func_ptr = 0;
           else /* op == check_functor_type_tag */ {
+#ifdef BOOST_HAVE_TYPEID
             const BOOST_FUNCTION_STD_NS::type_info& check_type = 
               *static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
+#endif
             if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
               out_buffer.obj_ptr = &in_buffer.func_ptr;
             else
@@ -301,8 +309,10 @@ namespace boost {
             // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type.
             reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor();
           } else /* op == check_functor_type_tag */ {
+#ifdef BOOST_HAVE_TYPEINFO
             const BOOST_FUNCTION_STD_NS::type_info& check_type = 
               *static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
+#endif
             if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
               out_buffer.obj_ptr = &in_buffer.data;
             else
@@ -362,8 +372,10 @@ namespace boost {
 #  endif // BOOST_NO_STD_ALLOCATOR
             out_buffer.obj_ptr = 0;
           } else /* op == check_functor_type_tag */ {
+#ifdef BOOST_HAVE_TYPEID
             const BOOST_FUNCTION_STD_NS::type_info& check_type = 
               *static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
+#endif
             if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
               out_buffer.obj_ptr = in_buffer.obj_ptr;
             else
@@ -401,7 +413,11 @@ namespace boost {
           typedef typename get_function_tag<functor_type>::type tag_type;
           switch (op) {
           case get_functor_type_tag:
+#ifdef BOOST_HAVE_TYPEID
             out_buffer.const_obj_ptr = &typeid(functor_type);
+#else
+            boost::throw_exception(std::runtime_error("no rtti"));
+#endif
             return;
 
           default:
@@ -504,13 +520,21 @@ public:
       if this is empty. */
   const BOOST_FUNCTION_STD_NS::type_info& target_type() const
   {
-    if (!vtable) return typeid(void);
+    if (!vtable) {
+#ifdef BOOST_HAVE_TYPEID
+        return typeid(void);
+#else
+        boost::throw_exception(std::runtime_error("no rtti"));
+        return *(BOOST_FUNCTION_STD_NS::type_info *)0;
+#endif
+    }
 
     detail::function::function_buffer type;
     vtable->manager(functor, type, detail::function::get_functor_type_tag);
     return *static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(type.const_obj_ptr);
   }
 
+#ifdef BOOST_HAVE_TYPEID
   template<typename Functor>
     Functor* target()
     {
@@ -522,7 +546,9 @@ public:
                       detail::function::check_functor_type_tag);
       return static_cast<Functor*>(type_result.obj_ptr);
     }
+#endif
 
+#ifdef BOOST_HAVE_TYPEID
   template<typename Functor>
 #if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
     const Functor* target( Functor * = 0 ) const
@@ -540,6 +566,7 @@ public:
       // can't do the static_cast that we should do.
       return (const Functor*)(type_result.obj_ptr);
     }
+#endif
 
   template<typename F>
     bool contains(const F& f) const
diff --git a/shared_ptr.hpp b/shared_ptr.hpp
index 9edc86f..838dbaf 100644
--- a/shared_ptr.hpp
+++ b/shared_ptr.hpp
@@ -523,6 +523,7 @@ template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::
 
 #endif // __GNUC__ < 3
 
+#ifdef BOOST_HAVE_TYPEINFO
 // get_deleter (experimental)
 
 #if ( defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3) ) || \
@@ -546,6 +547,7 @@ template<class D, class T> D * get_deleter(shared_ptr<T> const & p)
 }
 
 #endif
+#endif // BOOST_HAVE_TYPEINFO
 
 } // namespace boost
 
diff --git a/throw_exception.hpp b/throw_exception.hpp
index bb79a37..b68ca89 100644
--- a/throw_exception.hpp
+++ b/throw_exception.hpp
@@ -25,6 +25,18 @@
 # include <exception>
 #endif
 
+#ifndef BOOST_HAVE_BADALLOC
+namespace std
+{
+    class bad_alloc : public exception {
+    public:
+        bad_alloc() throw() {}
+        virtual ~bad_alloc() throw() {}
+        virtual const char* what() const throw() { return "bad alloc"; }
+    };
+}
+#endif
+
 namespace boost
 {
 
