diff --git a/GNUmakefile b/GNUmakefile index 3bf9c5b4..cf5fc572 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -30,7 +30,7 @@ INSTALL = install INSTALL_PROGRAM = $(INSTALL) INSTALL_DATA = $(INSTALL) -m 644 -# Solaris provides a non-Posix shell at /usr/bin +# Solaris provides a non-Posix grep at /usr/bin ifneq ($(wildcard /usr/xpg4/bin),) GREP ?= /usr/xpg4/bin/grep else @@ -120,11 +120,7 @@ HAS_NEWLIB := $(shell $(CXX) -x c++ $(CXXFLAGS) -dM -E adhoc.cpp.proto 2>&1 | $( # Base CXXFLAGS used if the user did not specify them ifeq ($(SUN_COMPILER),1) - ifeq ($(SUNCC_512_OR_LATER),1) - CXXFLAGS ?= -DNDEBUG -g3 -xO3 - else - CXXFLAGS ?= -DNDEBUG -g -xO3 - endif + CXXFLAGS ?= -DNDEBUG -g -xO3 else CXXFLAGS ?= -DNDEBUG -g2 -O3 endif @@ -216,7 +212,7 @@ endif ICC111_OR_LATER := $(shell $(CXX) --version 2>&1 | $(GREP) -c -E "\(ICC\) ([2-9][0-9]|1[2-9]|11\.[1-9])") # Add -fPIC for targets *except* X86, X32, Cygwin or MinGW -ifeq ($(IS_X86)$(IS_CYGWIN)$(IS_MINGW)$(SUN_COMPILER),0000) +ifeq ($(IS_X86)$(IS_CYGWIN)$(IS_MINGW),000) ifeq ($(findstring -fPIC,$(CXXFLAGS)),) CXXFLAGS += -fPIC endif @@ -381,6 +377,11 @@ ifeq ($(findstring -fPIC,$(CXXFLAGS)),) CXXFLAGS += -fPIC endif +# Remove -fPIC if present. SunCC adds -KPIC +ifeq ($(SUN_COMPILER),1) + CXXFLAGS := $(subst -fPIC,,$(CXXFLAGS)) +endif + ifeq ($(IS_NEON),1) HAVE_NEON = $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -march=armv7-a -mfloat-abi=$(FP_ABI) -mfpu=neon -dM -E - 2>/dev/null | $(GREP) -i -c -E '\<__ARM_NEON\>') ifeq ($(HAVE_NEON),1) diff --git a/stdcpp.h b/stdcpp.h index 9eac8835..80da2fd7 100644 --- a/stdcpp.h +++ b/stdcpp.h @@ -56,10 +56,18 @@ namespace std { #include // uintptr_t and ptrdiff_t -#if (__cplusplus < 201103L) && (!defined(_MSC_VER) || (_MSC_VER >= 1700)) +#if defined(__SUNPRO_CC) +# if (__SUNPRO_CC >= 0x5100) +# include +# endif +#elif defined(_MSC_VER) +# if (_MSC_VER >= 1700) +# include +# else +# include +# endif +#elif (__cplusplus < 201103L) # include -#elif defined(_MSC_VER) && (_MSC_VER < 1700) -# include #endif // workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21