diff --recursive '--context=2' --unidirectional-new-file '--exclude=CVS' gettext-0.18.1-reference/gettext-runtime/intl/threadlib.c gettext-0.18.1-modified/gettext-runtime/intl/threadlib.c
*** gettext-0.18.1-reference/gettext-runtime/intl/threadlib.c	Sat Dec 12 16:08:01 2009
--- gettext-0.18.1-modified/gettext-runtime/intl/threadlib.c	Sun Jan  9 19:34:07 2011
***************
*** 31,34 ****
--- 31,37 ----
  
  # if PTHREAD_IN_USE_DETECTION_HARD
+ #include <strings.h>
+ #include <errno.h>
+ #include <sys/utsname.h>
  
  /* The function to be executed by a dummy thread.  */
***************
*** 45,48 ****
--- 48,84 ----
    static int result; /* 1: linked with -lpthread, 0: only with libc */
  
+   /* dynamic detection for running on Solaris 5.10 or higher; starting
+    * with Solaris 10 the libc resolves correctly the POSIX threads
+    * symbols. */
+   if (!tested)
+   {
+ 	  struct utsname un;
+ 	  if(uname(&un) != -1)
+ 	  {
+ 		  if(strcmp(un.sysname, "SunOS") == 0)
+ 		  {
+ 			  char* dot = strchr(un.release, '.');
+ 			  errno = 0;
+ 			  if(dot != (char*)0)
+ 			  {
+ 				  int minor = atoi(dot + 1);
+ 				  *dot = '\0';
+ 				  if(!errno)
+ 				  {
+ 					  int major = atoi(un.release);
+ 					  if(!errno)
+ 					  {
+ 						  if(major >= 5 && minor >= 10)
+ 						  {
+ 							  tested = 1;
+ 							  result = 1;
+ 						  }
+ 					  }
+ 				  }
+ 			  }
+ 		  }
+ 	  }
+   }
+   
    if (!tested)
      {
diff --recursive '--context=2' --unidirectional-new-file '--exclude=CVS' gettext-0.18.1-reference/gettext-tools/gnulib-lib/glthread/threadlib.c gettext-0.18.1-modified/gettext-tools/gnulib-lib/glthread/threadlib.c
*** gettext-0.18.1-reference/gettext-tools/gnulib-lib/glthread/threadlib.c	Mon May 24 11:42:37 2010
--- gettext-0.18.1-modified/gettext-tools/gnulib-lib/glthread/threadlib.c	Sun Jan  9 19:35:42 2011
***************
*** 30,33 ****
--- 30,36 ----
  
  # if PTHREAD_IN_USE_DETECTION_HARD
+ #include <strings.h>
+ #include <errno.h>
+ #include <sys/utsname.h>
  
  /* The function to be executed by a dummy thread.  */
***************
*** 44,47 ****
--- 47,83 ----
    static int result; /* 1: linked with -lpthread, 0: only with libc */
  
+   /* dynamic detection for running on Solaris 5.10 or higher; starting
+    * with Solaris 10 the libc resolves correctly the POSIX threads
+    * symbols. */
+   if (!tested)
+   {
+ 	  struct utsname un;
+ 	  if(uname(&un) != -1)
+ 	  {
+ 		  if(strcmp(un.sysname, "SunOS") == 0)
+ 		  {
+ 			  char* dot = strchr(un.release, '.');
+ 			  errno = 0;
+ 			  if(dot != (char*)0)
+ 			  {
+ 				  int minor = atoi(dot + 1);
+ 				  *dot = '\0';
+ 				  if(!errno)
+ 				  {
+ 					  int major = atoi(un.release);
+ 					  if(!errno)
+ 					  {
+ 						  if(major >= 5 && minor >= 10)
+ 						  {
+ 							  tested = 1;
+ 							  result = 1;
+ 						  }
+ 					  }
+ 				  }
+ 			  }
+ 		  }
+ 	  }
+   }
+   
    if (!tested)
      {
diff --recursive '--context=2' --unidirectional-new-file '--exclude=CVS' gettext-0.18.1-reference/gettext-tools/libgettextpo/glthread/threadlib.c gettext-0.18.1-modified/gettext-tools/libgettextpo/glthread/threadlib.c
*** gettext-0.18.1-reference/gettext-tools/libgettextpo/glthread/threadlib.c	Tue Feb 16 22:33:14 2010
--- gettext-0.18.1-modified/gettext-tools/libgettextpo/glthread/threadlib.c	Sun Jan  9 19:36:18 2011
***************
*** 30,33 ****
--- 30,36 ----
  
  # if PTHREAD_IN_USE_DETECTION_HARD
+ #include <strings.h>
+ #include <errno.h>
+ #include <sys/utsname.h>
  
  /* The function to be executed by a dummy thread.  */
***************
*** 44,47 ****
--- 47,83 ----
    static int result; /* 1: linked with -lpthread, 0: only with libc */
  
+   /* dynamic detection for running on Solaris 5.10 or higher; starting
+    * with Solaris 10 the libc resolves correctly the POSIX threads
+    * symbols. */
+   if (!tested)
+   {
+ 	  struct utsname un;
+ 	  if(uname(&un) != -1)
+ 	  {
+ 		  if(strcmp(un.sysname, "SunOS") == 0)
+ 		  {
+ 			  char* dot = strchr(un.release, '.');
+ 			  errno = 0;
+ 			  if(dot != (char*)0)
+ 			  {
+ 				  int minor = atoi(dot + 1);
+ 				  *dot = '\0';
+ 				  if(!errno)
+ 				  {
+ 					  int major = atoi(un.release);
+ 					  if(!errno)
+ 					  {
+ 						  if(major >= 5 && minor >= 10)
+ 						  {
+ 							  tested = 1;
+ 							  result = 1;
+ 						  }
+ 					  }
+ 				  }
+ 			  }
+ 		  }
+ 	  }
+   }
+   
    if (!tested)
      {
