summaryrefslogtreecommitdiff
path: root/include/makeinclude/platform_g++_common.GNU
blob: 84bc99b7b0e309b0cc3aabbefe5ec3fae420d31a (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
# $Id$
#
# Common file help turn on/off explicit template instantiation

ifeq ($(CXX),insure)
  # insure does not pass through the -dumpversion option.
  CXX_FOR_VERSION_TEST = g++
else
  CXX_FOR_VERSION_TEST = $(CXX)
endif

CXX_VERSION := $(shell $(CXX_FOR_VERSION_TEST) -dumpversion)

# If no option has been specified, try to enable templates based on the
# version of the compiler.
#
ifeq ($(templates),)
  ifeq (2.95,$(findstring 2.95,$(CXX_VERSION)))
    templates = automatic
  else
    ifeq (3.,$(findstring 3.,$(CXX_VERSION)))
      templates = automatic
    else
      ifeq (2.96,$(findstring 2.96,$(CXX_VERSION)))
        templates = automatic
      else
        ifeq (egcs, $(findstring egcs, $(CXX_VERSION)))
          templates = explicit
        else
          templates = explicit
        endif
      endif
    endif
  endif
endif

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

ifeq (,$(with_ld))
 with_ld = gnu
endif

# The correct flags to pass to the linker for ELF dynamic shared library
# versioning
#
ifneq ($(SONAME),)
  ifeq ($(with_ld),hpux)
    SOFLAGS += -Wl,+h -Wl,$(SONAME)
  else
    ifneq ($(with_ld),vxworks)
      ifneq ($(with_ld),aix)
        SOFLAGS += -Wl,-h -Wl,$(SONAME)
      endif
    endif
  endif
endif

# Add all symbols to the dynamic symbol table.  Needed to enable dynamic_cast 
# for shared libraries. (see http://gcc.gnu.org/faq.html#dso)
ifeq ($(shared_libs), 1)
  ifneq ($(static_libs_only), 1)
    ifeq ($(with_ld), gnu)
      LDFLAGS += -Wl,-E
    endif # macosx
  endif # static_libs_only
endif # shared_libs