summaryrefslogtreecommitdiff
path: root/cpp/config/Make.rules.SunOS
blob: 671d87182cc3f4dc717f7216db18c6df38b94925 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# **********************************************************************
#
# Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************

#
# This file is included by Make.rules when uname is SunOS.
#

#
# The default compiler on Solaris is CC. 
# If you want to build with another compiler, you can edit this line, or
# comment it out and define CXX=<desired-compiler> in your environment.
# If CXX is not defined anywhere, the default (from gmake) is g++. 
#
CXX   = CC

ifeq ($(CXX),CC)
#
# Sun CC
#

    #
    # Which version of CC are we using?
    #
    CCVERSION               := $(filter 5.%, $(shell CC -V 2>&1))

    ifeq ($(LP64),yes)
        CXXARCHFLAGS        := -xarch=v9
    endif

    ifeq ($(CCVERSION),5.3)
        FLEX_NOLINE         := yes
        BISON_NOLINE        := yes
        TEMPLATE_REPOSITORY := SunWS_cache
    else
        ifeq ($(CCVERSION),5.4)
            CXXWARNFLAGS            := +w
            TEMPLATE_REPOSITORY     := SunWS_cache
        else
            #
            # Assumes >= 5.5
            #
            # -erroff=hidef is a (bad) work-around for
            # for Sun CC 5.5 bug #4852754
            #
            CXXWARNFLAGS            := +w -erroff=hidef
            CXXSCOPEFLAGS           := -xldscope=hidden
        endif
    endif

    #
    # -features=tmplife is needed to destroy temporary objects immediately
    # (as specified by ISO C++) instead of at the end of the current block.
    # This is very useful to avoid deadlocks when using Freeze Map 
    # iterators.
    #

    CXXFLAGS		= -KPIC -mt +p -features=tmplife $(CXXSCOPEFLAGS) $(CXXWARNFLAGS) $(CXXARCHFLAGS)


    ifeq ($(OPTIMIZE),yes)
        CXXFLAGS		:= -O -DNDEBUG $(CXXFLAGS)
    else
        CXXFLAGS		:= -g $(CXXFLAGS)
    endif

    #
    # C++ run-time libraries, necessary for linking some shared libraries.
    #
    CXXLIBS			= -lCstd -lCrun


    mkshlib                 = $(CXX) -G $(LDFLAGS) -o $(1) -h $(2) $(3) $(4)
endif

ifeq ($(CXX),gcc)
    CXX                 = g++
endif

ifeq ($(CXX),g++)

    ifeq ($(LP64),yes)
        CXXARCHFLAGS    := -m64
    endif

    CXXFLAGS		= $(CXXARCHFLAGS) -ftemplate-depth-128 -fPIC -Wall -D_REENTRANT

    ifeq ($(OPTIMIZE),yes)
        CXXFLAGS	:= -O2 -DNDEBUG $(CXXFLAGS)
    else
        CXXFLAGS	:= -g $(CXXFLAGS)
    endif
    
    mkshlib              = $(CXX) -shared $(LDFLAGS) -o $(1) -h $(2) $(3) $(4)
endif

BASELIBS		= -lIceUtil -lpthread
LIBS			= -lIce $(BASELIBS)

ICEUTIL_OS_LIBS         := -lpthread -lrt
ICE_OS_LIBS             := -ldl -lsocket

lp64suffix              := /sparcv9

ifeq ($(LP64),yes)
    export LD_LIBRARY_PATH_64	:= $(libdir):$(LD_LIBRARY_PATH_64)
else
    export LD_LIBRARY_PATH	:= $(libdir):$(LD_LIBRARY_PATH)
endif