1 # Shared Logic for GCC and Clang
3 FLAGS_C_CC += -Wall -Wextra -Wpointer-arith
4 CCFLAGS += -Wnon-virtual-dtor
6 # Suppress "Creating *.a" Message
9 ifeq ($(shared_libs), 1)
10 ifneq ($(static_libs_only), 1)
11 # Add all symbols to the dynamic symbol table. Needed to enable
12 # dynamic_cast<> for shared libraries. (see
13 # http://gcc.gnu.org/faq.html#dso)
16 # Make sure this version of ld supports the -E option.
18 LD_EXPORT_DEFINED := $(shell sh -c '$(LD_FOR_VERSION_TEST) -E 2>&1 | grep -E -i "(option|flag)" /dev/null; echo $$?')
20 LD_EXPORT_DEFINED := $(shell $(LD_FOR_VERSION_TEST) -E 2>&1 | grep -c -i -e '(option|flag)')
21 ifeq ($(LD_EXPORT_DEFINED),0)
27 ifeq ($(LD_EXPORT_DEFINED),1)
29 endif # LD_EXPORT_DEFINED = 1
32 # Take advantage of g++ visibility attributes to generate
33 # improved shared library binaries.
34 ifneq ($(no_hidden_visibility),1)
35 CCFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
37 CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0
38 endif # no_hidden_visibility
40 # Explicitly disable g++ visibility attributes since
41 # they are only meant for use when building shared libraries.
42 no_hidden_visibility = 1
43 CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0
44 endif # static_libs_only
46 # Explicitly disable g++ visibility attributes since
47 # they are only meant for use when building shared libraries.
48 no_hidden_visibility = 1
49 CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0
53 CCFLAGS += -std=$(c++std)
68 # If no option has been specified, set templates to automatic
69 # version of the compiler.
71 templates ?= automatic
73 # The correct flags to pass to the linker for ELF dynamic shared library
75 # If the platform file didn't already set versioned_so, default to 1.
78 ifneq ($(versioned_so),0)
79 SOFLAGS += -Wl,-h -Wl,$(SONAME)
82 ifeq ($(versioned_so),2)
83 FLAGS_C_CC += -DACE_VERSIONED_SO=2
89 STATIC_LINK_FLAG ?= -static
93 FLAGS_C_CC += -fopenmp