diff -uraN kdelibs-4.1.1.orig/ConfigureChecks.cmake kdelibs-4.1.1/ConfigureChecks.cmake
--- kdelibs-4.1.1.orig/ConfigureChecks.cmake	2008-05-21 11:09:18.000000000 +0000
+++ kdelibs-4.1.1/ConfigureChecks.cmake	2008-09-07 16:53:42.151941767 +0000
@@ -154,11 +154,11 @@
         set(UTIL_LIBRARY util)
       endif (login_in_libutil)
     endif (NOT login_in_libc)
-    if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD)
+    if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD OR CMAKE_SYSTEM_NAME MATCHES GNU/kOpenSolaris)
       set (HAVE_UTMPX)
-    else (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD)
+    else (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD OR CMAKE_SYSTEM_NAME MATCHES GNU/kOpenSolaris)
       check_function_exists(getutxent HAVE_UTMPX)
-    endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD)
+    endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD OR CMAKE_SYSTEM_NAME MATCHES GNU/kOpenSolaris)
     if (HAVE_UTMPX)
       set(utmp utmpx)
       if (login_in_libutil)
diff -uraN kdelibs-4.1.1.orig/kdecore/network/k3resolver.cpp kdelibs-4.1.1/kdecore/network/k3resolver.cpp
--- kdelibs-4.1.1.orig/kdecore/network/k3resolver.cpp	2008-05-21 11:09:04.000000000 +0000
+++ kdelibs-4.1.1/kdecore/network/k3resolver.cpp	2008-09-07 16:39:45.955736104 +0000
@@ -631,7 +631,8 @@
   do
     {
       buf = new char[buflen];
-#  ifdef Q_OS_SOLARIS // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL
+#  if defined(Q_OS_SOLARIS) && !defined(__GLIBC__)
+      // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL
       if ((pe = getprotobynumber_r(protonum, &protobuf, buf, buflen)) && (errno == ERANGE))
 #  else
       if (getprotobynumber_r(protonum, &protobuf, buf, buflen, &pe) == ERANGE)
@@ -690,7 +691,8 @@
   do
     {
       buf = new char[buflen];
-#  ifdef Q_OS_SOLARIS // Solaris uses a 4 argument getprotobyname_r which returns struct *protoent or NULL
+#  if defined(Q_OS_SOLARIS) && !defined(__GLIBC__)
+      // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL
       if ((pe = getprotobyname_r(protoname, &protobuf, buf, buflen)) && (errno == ERANGE))
 #  else
       if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE)
@@ -751,7 +753,8 @@
   do
     {
       buf = new char[buflen];
-#  ifdef Q_OS_SOLARIS // Solaris uses a 4 argument getprotobyname_r which returns struct *protoent or NULL
+#  if defined(Q_OS_SOLARIS) && !defined(__GLIBC__)
+      // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL
       if ((pe = getprotobyname_r(protoname, &protobuf, buf, buflen)) && (errno == ERANGE))
 #  else
       if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE)
@@ -807,7 +810,8 @@
   do
     {
       buf = new char[buflen];
-#  ifdef Q_OS_SOLARIS // Solaris uses a 5 argument getservbyname_r which returns struct *servent or NULL
+#  if defined(Q_OS_SOLARIS) && !defined(__GLIBC__)
+      // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL
       if ((se = getservbyname_r(servname, protoname, &servbuf, buf, buflen)) && (errno == ERANGE))
 #  else
       if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE)
@@ -863,7 +867,8 @@
   do
     {
       buf = new char[buflen];
-#  ifdef Q_OS_SOLARIS // Solaris uses a 5 argument getservbyname_r which returns struct *servent or NULL
+#  if defined(Q_OS_SOLARIS) && !defined(__GLIBC__)
+      // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL
       if ((se = getservbyname_r(servname, protoname, &servbuf, buf, buflen)) && (errno == ERANGE))
 #  else
       if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE)
@@ -923,7 +928,8 @@
   do
     {
       buf = new char[buflen];
-#  ifdef Q_OS_SOLARIS // Solaris uses a 5 argument getservbyport_r which returns struct *servent or NULL
+#  if defined(Q_OS_SOLARIS) && !defined(__GLIBC__)
+      // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL
       if ((se = getservbyport_r(port, protoname, &servbuf, buf, buflen)) && (errno == ERANGE))
 #  else
       if (getservbyport_r(port, protoname, &servbuf, buf, buflen, &se) == ERANGE)
diff -uraN kdelibs-4.1.1.orig/kdecore/sycoca/ksycoca.cpp kdelibs-4.1.1/kdecore/sycoca/ksycoca.cpp
--- kdelibs-4.1.1.orig/kdecore/sycoca/ksycoca.cpp	2008-05-21 11:09:10.000000000 +0000
+++ kdelibs-4.1.1/kdecore/sycoca/ksycoca.cpp	2008-09-07 16:42:58.262937626 +0000
@@ -50,7 +50,7 @@
 #include <sys/mman.h>
 #endif
 
-#ifdef Q_OS_SOLARIS
+#if defined Q_OS_SOLARIS && !defined(__GLIBC__)
 extern "C" int madvise(caddr_t, size_t, int);
 #endif
 

