From 45258ff4e23e3427b96bf3f36c393d1ac0c8f2e9 Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Wed, 23 Dec 2009 22:12:22 +0000 Subject: Fix 32/64-bit confusion on Solaris 10 x86. Patch from Oliver Jowett. --- CONTRIBUTORS.txt | 1 + configure.ac | 6 ++++-- m4/acx_check_suncc.m4 | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index bb19587f..a20efc4b 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -77,6 +77,7 @@ Patch contributors: * HPUX support. Oliver Jowett * Detect whether zlib is new enough in configure script. + * Fixes for Solaris 10 32/64-bit confusion. Evan Jones * Optimize Java serialization code when writing a small message to a stream. Michael Kucharski diff --git a/configure.ac b/configure.ac index fa54431f..e7ceb002 100644 --- a/configure.ac +++ b/configure.ac @@ -138,8 +138,10 @@ AM_CONDITIONAL([USE_EXTERNAL_PROTOC], [test "$with_protoc" != "no"]) ACX_PTHREAD AC_CXX_STL_HASH -# HACK: Make gtest's configure script pick up our copy of CXXFLAGS, since the -# flags added by ACX_CHECK_SUNCC must be used when compiling gtest too. +# HACK: Make gtest's configure script pick up our copy of CFLAGS and CXXFLAGS, +# since the flags added by ACX_CHECK_SUNCC must be used when compiling gtest +# too. +export CFLAGS export CXXFLAGS AC_CONFIG_SUBDIRS([gtest]) diff --git a/m4/acx_check_suncc.m4 b/m4/acx_check_suncc.m4 index 43887c9b..5bf72d3c 100644 --- a/m4/acx_check_suncc.m4 +++ b/m4/acx_check_suncc.m4 @@ -54,12 +54,19 @@ AC_DEFUN([ACX_CHECK_SUNCC],[ dnl This should just be set in CPPFLAGS and in LDFLAGS, but libtool dnl does the wrong thing if you don't put it into CXXFLAGS. sigh. + dnl (It also needs it in CFLAGS, or it does a different wrong thing!) AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[ CXXFLAGS="${CXXFLAGS} -m64" ac_cv_env_CXXFLAGS_set=set ac_cv_env_CXXFLAGS_value='-m64' ]) + AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],[ + CFLAGS="${CFLAGS} -m64" + ac_cv_env_CFLAGS_set=set + ac_cv_env_CFLAGS_value='-m64' + ]) + AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" ],[ CXXFLAGS="-xmemalign=8s ${CXXFLAGS}" ]) -- cgit v1.2.3