dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.568 2008/10/29 09:27:24 petere Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.571 2008/10/30 12:28:51 petere Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
choke me
@%:@endif], [ICC=[yes]], [ICC=[no]])
+# Check if it's Sun Studio compiler. We assume that
+# __SUNPRO_C will be defined for Sun Studio compilers
+AC_TRY_COMPILE([], [@%:@ifndef __SUNPRO_C
+choke me
+@%:@endif], [SUN_STUDIO_CC=yes], [SUN_STUDIO_CC=no])
+
+AC_SUBST(SUN_STUDIO_CC)
+
unset CFLAGS
#
if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then
ACX_PTHREAD # set thread flags
-# Some platforms use these, so just defineed them. They can't hurt if they
-# are not supported.
+# Some platforms use these, so just define them. They can't hurt if they
+# are not supported. For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS
+# enables 5-arg getpwuid_r, among other things.
PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_ERROR([thread test program failed
-This platform is not thread-safe. Check the file 'config.log'for the
+This platform is not thread-safe. Check the file 'config.log' for the
exact reason.
You can use the configure option --enable-thread-safety-force to force