Fix older Solaris and SunCC compile

Found during testing on OpenCSW compile farm on Solaris 9 (host unstable9s)
pull/696/head
Jeffrey Walton 2018-07-21 06:15:40 -04:00
parent aeaa4f623f
commit baff390f28
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 19 additions and 10 deletions

View File

@ -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
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)

View File

@ -56,10 +56,18 @@ namespace std {
#include <cmath>
// uintptr_t and ptrdiff_t
#if (__cplusplus < 201103L) && (!defined(_MSC_VER) || (_MSC_VER >= 1700))
#if defined(__SUNPRO_CC)
# if (__SUNPRO_CC >= 0x5100)
# include <stdint.h>
#elif defined(_MSC_VER) && (_MSC_VER < 1700)
# endif
#elif defined(_MSC_VER)
# if (_MSC_VER >= 1700)
# include <stdint.h>
# else
# include <stddef.h>
# endif
#elif (__cplusplus < 201103L)
# include <stdint.h>
#endif
// workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21