Support "Solaris 10 using recent Sun Studio".

Patch from Monty Taylor <monty.taylor@gmail.com>.
pull/3335/head
kenton@google.com 16 years ago
parent 1ea526879c
commit 25bc5cdc9c
  1. 1
      CHANGES.txt
  2. 2
      CONTRIBUTORS.txt
  3. 9
      configure.ac
  4. 37
      m4/ac_system_extensions.m4
  5. 1
      src/google/protobuf/stubs/strutil.cc
  6. 1
      src/google/protobuf/stubs/strutil_unittest.cc
  7. 1
      src/gtest/gtest.cc

@ -41,6 +41,7 @@
* Simplify template usage to work with MSVC 2003.
* Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup.
(This affected Fedora 9 in particular.)
* Now works on "Solaris 10 using recent Sun Studio".
Java
* New overload of mergeFrom() which parses a slice of a byte array instead

@ -51,3 +51,5 @@ Non-Google patch contributors:
* Added @Override annotation to generated Java code where appropriate.
Vincent Choinière <Choiniere.Vincent@hydro.qc.ca>
* Tru64 support.
Monty Taylor <monty.taylor@gmail.com>
* Solaris 10 + Sun Studio fix.

@ -12,13 +12,22 @@ AC_INIT([protobuf],[2.0.3-SNAPSHOT],[protobuf@googlegroups.com])
AC_CONFIG_SRCDIR(src/google/protobuf/message.cc)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
ACX_USE_SYSTEM_EXTENSIONS
AC_PROG_LIBTOOL
AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
AS_IF([test "$SUNCC" = "yes"],[
CFLAGS="$CFLAGS -xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
CXXFLAGS="$CXXFLAGS -xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4 -template=no%extdef"
])
# Checks for header files.
AC_HEADER_STDC

@ -0,0 +1,37 @@
dnl Provide AC_USE_SYSTEM_EXTENSIONS for old autoconf machines.
AC_DEFUN([ACX_USE_SYSTEM_EXTENSIONS],[
ifdef([AC_USE_SYSTEM_EXTENSIONS],[
AC_USE_SYSTEM_EXTENSIONS
],[
AC_BEFORE([$0], [AC_COMPILE_IFELSE])
AC_BEFORE([$0], [AC_RUN_IFELSE])
AC_REQUIRE([AC_GNU_SOURCE])
AC_REQUIRE([AC_AIX])
AC_REQUIRE([AC_MINIX])
AH_VERBATIM([__EXTENSIONS__],
[/* Enable extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif])
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
[ac_cv_safe_to_define___extensions__],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
# define __EXTENSIONS__ 1
AC_INCLUDES_DEFAULT])],
[ac_cv_safe_to_define___extensions__=yes],
[ac_cv_safe_to_define___extensions__=no])])
test $ac_cv_safe_to_define___extensions__ = yes &&
AC_DEFINE([__EXTENSIONS__])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([_TANDEM_SOURCE])
])
])

@ -35,6 +35,7 @@
#include <float.h> // FLT_DIG and DBL_DIG
#include <limits>
#include <limits.h>
#include <stdio.h>
#ifdef _WIN32
// MSVC has only _snprintf, not snprintf.

@ -34,6 +34,7 @@
#include <google/protobuf/testing/googletest.h>
#include <gtest/gtest.h>
#include <locale.h>
namespace google {
namespace protobuf {

@ -40,6 +40,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#ifdef GTEST_OS_LINUX

Loading…
Cancel
Save