--- config_office/configure.in.old	2007-08-30 16:18:42.000000000 +0200
+++ config_office/configure.in	2007-08-31 17:57:18.000000000 +0200
@@ -2440,10 +2440,6 @@ you must use the "--with-jdk-home" confi
              AC_MSG_ERROR([In order to successfully build OpenOffice.org using the IBM JDK,
 you must use the "--with-jdk-home" configure option explicitly])
         fi
-        if test "$_jdk_ver" -gt 10402; then
-             AC_MSG_WARN([IBM JDK might be too recent, maximum version tested is 1.4.2])
-             echo "IBM JDK might be too recent, maximum version tested is 1.4.2" >>warn
-        fi
 
         JAVA_HOME=$with_jdk_home
 	
@@ -2639,6 +2635,7 @@ if test "$SOLAR_JAVA" != ""; then
     fi
 fi
 
+AWTLIB=
 if test "$SOLAR_JAVA" != ""; then
    AC_MSG_CHECKING([for jawt lib name])
    if test "$JDK" = "gcj"; then 
@@ -2654,6 +2651,29 @@ if test "$SOLAR_JAVA" != ""; then
       CFLAGS=$save_CFLAGS
       LDFLAGS=$save_LDFLAGS
    fi
+   # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
+   # A workaround is to link also against libpmawt.so
+   if test "$JDK" = "ibm" ; then
+      save_CFLAGS=$CFLAGS
+      save_LDFLAGS=$LDFLAGS
+      save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
+      CFLAGS="$CFLAGS -I$JAVA_HOME/include"
+      LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
+      LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
+      export LD_LIBRARY_PATH
+      exec 6>/dev/null # no output
+      AC_CHECK_HEADER(jni.h, [],
+                    [AC_MSG_ERROR([jni.h could not be found.])], [])
+      AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
+      if test -z "$AWTLIB"; then
+         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
+         AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
+      fi
+      exec 6>&1 # output on again
+      CFLAGS=$save_CFLAGS
+      LDFLAGS=$save_LDFLAGS
+      LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
+   fi
    if test -z "$AWTLIB"; then
       AWTLIB=-ljawt
    fi
--- config_office/set_soenv.in.old	2007-08-30 16:18:42.000000000 +0200
+++ config_office/set_soenv.in	2007-08-31 16:56:20.000000000 +0200
@@ -464,7 +464,12 @@ elsif ( $platform =~ m/linux-gnu/ ) 
          if ( $JDK eq "gcj" ) {
             $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
             $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."client";
-            $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
+            $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; }
+         elsif ($JDK =~ m/^[Ii][Bb][Mm]/)
+         {  $JRELIBDIR     = '$JAVA_HOME'.$ds."jre".$ds."bin";
+            $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."bin".$ds."classic";
+            $JRETHREADDIR  = '$JAVA_HOME'.$ds."jre".$ds."bin";
+            $JREEXTRALIBDIR = '$JAVA_HOME'.$ds."jre".$ds."bin".$ds."xawt";
          }
       }
 
@@ -1717,6 +1722,8 @@ if ( $JDK ne "gcj" ) {
 }
 else {
    ToFile( "JAVACISGCJ",       '@JAVACISGCJ@',      "e" );
+}
+if ( $GUI eq "UNX" ) {
    ToFile( "AWTLIB",           '@AWTLIB@',          "e" );
 }
 if ( '@JDK@' ne '' )
