Fix older Solaris and SunCC compile
Found during testing on OpenCSW compile farm on Solaris 9 (host unstable9s)pull/696/head
parent
aeaa4f623f
commit
baff390f28
15
GNUmakefile
15
GNUmakefile
|
|
@ -30,7 +30,7 @@ INSTALL = install
|
||||||
INSTALL_PROGRAM = $(INSTALL)
|
INSTALL_PROGRAM = $(INSTALL)
|
||||||
INSTALL_DATA = $(INSTALL) -m 644
|
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),)
|
ifneq ($(wildcard /usr/xpg4/bin),)
|
||||||
GREP ?= /usr/xpg4/bin/grep
|
GREP ?= /usr/xpg4/bin/grep
|
||||||
else
|
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
|
# Base CXXFLAGS used if the user did not specify them
|
||||||
ifeq ($(SUN_COMPILER),1)
|
ifeq ($(SUN_COMPILER),1)
|
||||||
ifeq ($(SUNCC_512_OR_LATER),1)
|
CXXFLAGS ?= -DNDEBUG -g -xO3
|
||||||
CXXFLAGS ?= -DNDEBUG -g3 -xO3
|
|
||||||
else
|
|
||||||
CXXFLAGS ?= -DNDEBUG -g -xO3
|
|
||||||
endif
|
|
||||||
else
|
else
|
||||||
CXXFLAGS ?= -DNDEBUG -g2 -O3
|
CXXFLAGS ?= -DNDEBUG -g2 -O3
|
||||||
endif
|
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])")
|
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
|
# 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)),)
|
ifeq ($(findstring -fPIC,$(CXXFLAGS)),)
|
||||||
CXXFLAGS += -fPIC
|
CXXFLAGS += -fPIC
|
||||||
endif
|
endif
|
||||||
|
|
@ -381,6 +377,11 @@ ifeq ($(findstring -fPIC,$(CXXFLAGS)),)
|
||||||
CXXFLAGS += -fPIC
|
CXXFLAGS += -fPIC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Remove -fPIC if present. SunCC adds -KPIC
|
||||||
|
ifeq ($(SUN_COMPILER),1)
|
||||||
|
CXXFLAGS := $(subst -fPIC,,$(CXXFLAGS))
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(IS_NEON),1)
|
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\>')
|
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)
|
ifeq ($(HAVE_NEON),1)
|
||||||
|
|
|
||||||
14
stdcpp.h
14
stdcpp.h
|
|
@ -56,10 +56,18 @@ namespace std {
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
// uintptr_t and ptrdiff_t
|
// 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>
|
||||||
|
# endif
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
# if (_MSC_VER >= 1700)
|
||||||
|
# include <stdint.h>
|
||||||
|
# else
|
||||||
|
# include <stddef.h>
|
||||||
|
# endif
|
||||||
|
#elif (__cplusplus < 201103L)
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER < 1700)
|
|
||||||
# include <stddef.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21
|
// workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue