summaryrefslogtreecommitdiff
path: root/cpp/config/Make.rules.SunOS
blob: 8c54d512fa8b36a734cfb64a02e542cc0a690a33 (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
115
# **********************************************************************
#
# Copyright (c) 2003-2015 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.
#

#
# If CXX is not defined anywhere, the default (from gmake) is g++.
#
CXX = CC

# This variable is used to determine the machine type.
# For SPARC machines: sun4u and sun4v
# For x86/x64 machines:        i86pc
#
MACHINE_TYPE           := $(shell uname -m)


ifeq ($(CXX),CC)
    #
    # Recent version of Sun CC
    #
    ifeq ($(LP64),yes)
         CXXARCHFLAGS   += -m64
    else
	 CXXARCHFLAGS   += -m32
    endif

    #
    # wvarhidenmem,wvarhidemem: various name hiding
    # notemsource: Could not find source for <template name>

    #
    CXXWARNFLAGS     = +w -xwe -errtags -erroff=wvarhidenmem,wvarhidemem,notemsource
    CXXSCOPEFLAGS    = -xldscope=hidden

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

    ifneq ($(GENPIC),no)
	CXXFLAGS     += -xcode=pic32
    endif

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

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

    mklib            = $(CXX) -xar -o $(1) $(2)

    CXXLIBS          = -lCrun -lCstd

    ifneq ($(embedded_runpath_prefix),)
         LDPLATFORMFLAGS    = -norunpath -R $(runpath_libdir) -z text $(PLATFORMLIBDIRS)
    else
         LDPLATFORMFLAGS    = -norunpath -z text $(PLATFORMLIBDIRS)
    endif

endif

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

ifeq ($(CXX),g++)

    CC			    = gcc

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

    CXXFLAGS		    = $(CXXARCHFLAGS) -Wall -D_REENTRANT

    ifeq ($(STATICLIBS),)
	CXXFLAGS	    += -fPIC
    endif

    ifeq ($(OPTIMIZE),yes)
        CXXFLAGS	    += -O2 -DNDEBUG
    else
        CXXFLAGS	    += -g
    endif

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

    mklib		    = ar cr $(1) $(2)

    ifneq ($(embedded_runpath_prefix),)
         LDPLATFORMFLAGS    = -R $(runpath_libdir):/usr/sfw/$(libsubdir) $(PLATFORMLIBDIRS)
    else
         LDPLATFORMFLAGS    = -R /usr/sfw/$(libsubdir) $(PLATFORMLIBDIRS)
    endif

    ifeq ($(MACHINE_TYPE),i86pc)
        ICONV_LIB	    = -liconv
    endif
endif

rpathlink                   = -L$(1)

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

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