From 4e774e71aab27befd69d092676610ff77e531188 Mon Sep 17 00:00:00 2001 From: Aleksandar Fabijanic Date: Wed, 28 May 2008 19:08:40 +0000 Subject: [PATCH] SunOS build consolidation: build/config/SunOS renamed to SunOS-SunForte added build/config/SunOS-SunStudio modified build/rules/global to select proper configuration based on detected Sun compiler version disabled spurious hidevf warning for Data/testsuite and Data/SQLite Sun build --- Data/SQLite/Makefile | 8 +++ Data/testsuite/Makefile | 8 +++ build/config/{SunOS => SunOS-SunForte} | 0 build/config/SunOS-SunStudio | 70 ++++++++++++++++++++++++++ build/rules/compile | 2 +- build/rules/global | 30 +++++++++-- 6 files changed, 113 insertions(+), 5 deletions(-) rename build/config/{SunOS => SunOS-SunForte} (100%) create mode 100644 build/config/SunOS-SunStudio diff --git a/Data/SQLite/Makefile b/Data/SQLite/Makefile index 299e74ae8..e6746f4cd 100644 --- a/Data/SQLite/Makefile +++ b/Data/SQLite/Makefile @@ -11,6 +11,14 @@ include $(POCO_BASE)/build/rules/global SYSFLAGS += -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK \ -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_TCL_VARIABLE +ifeq ($(findstring SunOS,$(POCO_HOST_OSNAME)),SunOS) + POCO_SUN_FORTE = $(findstring SunOS-SunForte, $(POCO_CONFIG)) + POCO_SUN_STUDIO = $(findstring SunOS-SunStudio, $(POCO_CONFIG)) + ifneq (,$or ($(POCO_SUN_FORTE), $(POCO_SUN_STUDIO))) + CXXFLAGS += -erroff=hidevf + endif +endif + objects = Binder Extractor SessionImpl Connector \ SQLiteException SQLiteStatementImpl Utility \ sqlite3 diff --git a/Data/testsuite/Makefile b/Data/testsuite/Makefile index ac02462b1..edb07e0b4 100644 --- a/Data/testsuite/Makefile +++ b/Data/testsuite/Makefile @@ -8,6 +8,14 @@ include $(POCO_BASE)/build/rules/global +ifeq ($(findstring SunOS,$(POCO_HOST_OSNAME)),SunOS) + POCO_SUN_FORTE = $(findstring SunOS-SunForte, $(POCO_CONFIG)) + POCO_SUN_STUDIO = $(findstring SunOS-SunStudio, $(POCO_CONFIG)) + ifneq (,$or ($(POCO_SUN_FORTE), $(POCO_SUN_STUDIO))) + CXXFLAGS += -erroff=hidevf + endif +endif + objects = DataTestSuite Driver \ DataTest SessionPoolTest \ Binder Extractor Preparation SessionImpl Connector TestStatementImpl diff --git a/build/config/SunOS b/build/config/SunOS-SunForte similarity index 100% rename from build/config/SunOS rename to build/config/SunOS-SunForte diff --git a/build/config/SunOS-SunStudio b/build/config/SunOS-SunStudio new file mode 100644 index 000000000..d2cb68d51 --- /dev/null +++ b/build/config/SunOS-SunStudio @@ -0,0 +1,70 @@ +# +# $Id: //poco/Main/build/config/SunStudio#1 $ +# +# SunStudio +# +# Build settings for SunOS/Sun Studio C++ +# + +# +# General Settings +# +LINKMODE = SHARED + +# +# Tools +# +CC = cc +CXX = CC +LINK = $(CXX) +LIB = $(CXX) -xar -o $@ +RANLIB = ranlib +SHLIB = $(CXX) $(LINKFLAGS) -G -o $@ -h$(notdir $@) +SHLIBLN = $(POCO_BASE)/build/script/shlibln +STRIP = +DEP = $(POCO_BASE)/build/script/makedepend.SunCC +SHELL = sh +RM = rm -rf +CP = cp +MKDIR = mkdir -p + +# +# Extension for Shared Libraries +# +SHAREDLIBEXT = .so.$(target_version) +SHAREDLIBLINKEXT = .so + +# +# Compiler and Linker Flags +# +CFLAGS = -mt -Isrc +CFLAGS32 = +CFLAGS64 = -m64 +CXXFLAGS = -m32 -mt -library=stlport4 +CXXFLAGS32 = +CXXFLAGS64 = -m64 +LINKFLAGS = -m32 -mt -library=stlport4 +LINKFLAGS32 = -m32 +LINKFLAGS64 = -m64 +STATICOPT_CC = +STATICOPT_CXX = +STATICOPT_LINK = -Bstatic +SHAREDOPT_CC = -KPIC +SHAREDOPT_CXX = -KPIC +SHAREDOPT_LINK = -Bdynamic +DEBUGOPT_CC = -g -xs -D_DEBUG=$(DEBUGLEVEL) +DEBUGOPT_CXX = -g -xs -D_DEBUG=$(DEBUGLEVEL) +DEBUGOPT_LINK = -g -xs +RELEASEOPT_CC = -O -DNDEBUG +RELEASEOPT_CXX = -O -DNDEBUG +RELEASEOPT_LINK = + +# +# System Specific Flags +# +SYSFLAGS = -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS + +# +# System Specific Libraries +# +SYSLIBS = -lpthread -lrt -lxnet -lsocket -lnsl -lresolv -ldl diff --git a/build/rules/compile b/build/rules/compile index 556ae2281..a3c876c69 100644 --- a/build/rules/compile +++ b/build/rules/compile @@ -1,7 +1,7 @@ # # $Id: //poco/Main/build/rules/compile#8 $ # -# compiile +# compile # # Compile rule definitions for makefiles # diff --git a/build/rules/global b/build/rules/global index d2fec3772..437e461e8 100644 --- a/build/rules/global +++ b/build/rules/global @@ -55,13 +55,35 @@ ifeq ($(findstring MINGW,$(POCO_HOST_OSNAME)),MINGW) POCO_HOST_OSNAME = MinGW endif + +# Begin Sun platforms +# +# Pure Solaris or GNU (Nexenta), Sun Forte and Sun Studio compilers supported +# (on Nexenta, the default compiler is g++) +# + ifeq ($(findstring SunOS,$(POCO_HOST_OSNAME)),SunOS) -POCO_HOST_ALL_OSNAME = $(shell uname -a) -ifeq ($(findstring Nexenta,$(POCO_HOST_ALL_OSNAME)),Nexenta) -POCO_HOST_OSNAME = Nexenta -endif + # detect if this is Nexenta platform + POCO_HOST_ALL_OSNAME := $(shell uname -a) + ifeq ($(findstring Nexenta,$(POCO_HOST_ALL_OSNAME)),Nexenta) + POCO_HOST_OSNAME := Nexenta + else # Up to version 5.5 SunOS-SunForte config is used, 5.6 and above use SunOS-SunStudio + POCO_COMPILER_NAME := $(shell CC -V 2>&1) + POCO_COMPILER_VERSION := $(subst .,,$(filter 5.%,$(POCO_COMPILER_NAME))) + + ifeq (0, $(shell test $(POCO_COMPILER_VERSION) -gt 55; echo $$?)) + POCO_CONFIG := SunOS-SunStudio + else + POCO_CONFIG := SunOS-SunForte + endif + endif endif +# +# End Sun Platforms +# + + # # If POCO_CONFIG is not set, use the OS name as configuration name #