summaryrefslogtreecommitdiff
path: root/include/makeinclude/platform_sunos5_kcc.GNU
blob: 80554e48bb1749d2db711befeef94895beb2bec7 (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
# $Id$  -*- Makefile -*-

# SunOS 5.x (Solaris 2.x) with KAI C++ 3.3e

debug = 1
distrib = 0
threads = 1
exceptions = 1

# I(kitty) don't know anything about this combination. Making it explicit.
# XXX: Get the flags from the Kai web-site and fill it in.
templates = explicit

# Turn on the proper flags for explicit template instantiation.
#
ifeq ($(templates),explicit)
  ifeq ($(TEMPLATES_FLAG),) # Turn on flags if none is speficied.
    TEMPLATES_FLAG=
  endif
  CPPFLAGS += -DACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION
endif

# These are required for KCC 3.4g compiler.
LDFLAGS += --one_instantiation_per_object
CCFLAGS += --one_instantiation_per_object

ifeq ($(threads),1)
  CFLAGS += --thread_safe
  LDFLAGS += --thread_safe
  ARFLAGS = --thread_safe
else
  ARFLAGS =
  CCFLAGS += -DACE_HAS_THREADS=0
endif # threads

CC              = KCC
CXX             = KCC

DCFLAGS         += +K0 -g
DLD             = $(CXX)
LD              = $(CXX)

ifeq (1,$(exceptions))
  CCFLAGS += --exceptions
else
  CCFLAGS   += --no_exceptions
  LDFLAGS   += --no_exceptions
endif



LIBS        += -Bdynamic -lsocket -lnsl -lgen -ldl -lposix4
MATHLIB	     = -lm
CPPFLAGS    += $(CFLAGS)
OCFLAGS     += +K3 -o
PIC          = -KPIC
AR           = KCC
ARFLAGS     += -Bstatic -o
RANLIB       = echo
SOFLAGS      += -G $(CPPFLAGS)


ifdef static_libs_only
  ifneq ($(static_libs_only),0)
    static_libs=1
  endif
endif
ifneq ($(static_libs),0)
  CCFLAGS   += --one_instantiation_per_object
endif



#### Create template repository to avoid compiler warning.
TEMPLATE_REPOSITORY = Templates.DB

ifdef CLEANUP_BIN
  #### Builds .shobj/$*.o file, then .shobj/$*.so file.  The .o files
  #### are used for building libraries and executables.  But, it seems
  #### to be necessary to build the .so files (with -G) in order to get
  #### all template instantiations.
  SOBUILD = $(COMPILE.cc) $(PIC) -o $(VSHDIR)$*.o $<; \
            $(SOLINK.cc) -o $@ -h $@ $(LDFLAGS) $(VSHDIR)$*.o
else
  #### Optimize builds when no executables are built in the current
  #### directory.  Only a library is being created, and -G is used
  #### in that step.  Therefore, all templates instantations are
  #### included in the library.  This optimization saves almost 11 Mb
  #### (2.6 percent) and 27 minutes (22 percent) on the entire ACE
  #### build on a 168 MHz Sun Ultra2.
  ####
  #### Sun C++ won't allow the output from a compile to be named with
  #### a .so extension.  Rather than muck with the ACE build rules and
  #### risk upsetting builds on other platforms, just ln the output
  #### after building it.
  SOBUILD = $(RM) $@; $(COMPILE.cc) $(PIC) -o $(VSHDIR)$*.o $< && \
                      /bin/ln $(VSHDIR)$*.o $@
endif # CLEANUP_BIN

#### The following macro overrides enable creation of fast executables.
#### They _don't_ support fast compilation :-)
#### To use, add fast=1 to your "make" invocation.
####
#### -g is incompatible with -fast.  If you need -g, you can
#### use "-fast -O3".
####
ifeq (1,$(fast))
  CFLAGS += -fast +K3
  DCFLAGS =
  LDFLAGS += -fast +K3
endif # fast