diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2020-12-12 20:16:42 -0600 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2020-12-12 20:16:42 -0600 |
commit | a57bc28640439754c2fb622a9d3c539583b65009 (patch) | |
tree | 6c3c0585e167352f3fa0ec2f72e16d32a9152b61 /ACE/include | |
parent | f20449cfa0dc696c3ee40b69b01204607bc990af (diff) | |
download | ATCD-a57bc28640439754c2fb622a9d3c539583b65009.tar.gz |
platform_gcc_clang_common.GNU
Diffstat (limited to 'ACE/include')
-rw-r--r-- | ACE/include/makeinclude/platform_android.GNU | 1 | ||||
-rw-r--r-- | ACE/include/makeinclude/platform_clang_common.GNU | 83 | ||||
-rw-r--r-- | ACE/include/makeinclude/platform_g++_common.GNU | 104 | ||||
-rw-r--r-- | ACE/include/makeinclude/platform_gcc_clang_common.GNU | 104 |
4 files changed, 108 insertions, 184 deletions
diff --git a/ACE/include/makeinclude/platform_android.GNU b/ACE/include/makeinclude/platform_android.GNU index fb57916c758..e58667b98eb 100644 --- a/ACE/include/makeinclude/platform_android.GNU +++ b/ACE/include/makeinclude/platform_android.GNU @@ -95,7 +95,6 @@ else export CROSS_COMPILE endif -FLAGS_C_CC += -Wpointer-arith ifeq ($(threads),1) CPPFLAGS += -D_REENTRANT ifdef PLATFORM_AIO_SUPPORT diff --git a/ACE/include/makeinclude/platform_clang_common.GNU b/ACE/include/makeinclude/platform_clang_common.GNU index 075ac65fbf8..ca5541490a3 100644 --- a/ACE/include/makeinclude/platform_clang_common.GNU +++ b/ACE/include/makeinclude/platform_clang_common.GNU @@ -29,11 +29,6 @@ ifneq ($(CROSS_COMPILE),) endif endif -ifeq ($(openmp),1) -FLAGS_C_CC += -fopenmp -LDFLAGS += -fopenmp -endif - ifeq ($(CXX),insure) # insure does not pass through the -dumpversion option. CXX_FOR_VERSION_TEST ?= g++ @@ -43,32 +38,7 @@ endif CXX_VERSION := $(shell $(CXX_FOR_VERSION_TEST) -dumpversion) -# If no option has been specified, set templates to automatic -# version of the compiler. -# -templates ?= automatic - -# The correct flags to pass to the linker for ELF dynamic shared library -# versioning. -# If the platform file didn't already set versioned_so, default to 1. -versioned_so ?= 1 -with_ld ?= -ifneq ($(versioned_so),0) - ifeq ($(with_ld),hpux) - SOFLAGS += -Wl,+h -Wl,$(SONAME) - else - ifeq ($(with_ld),aix) - # What to do here??? - else - SOFLAGS += -Wl,-h -Wl,$(SONAME) - endif - endif -endif - -static_libs_only ?= - CXX_FULL_VERSION := $(shell $(CXX_FOR_VERSION_TEST) --version) -gcc_template_instantiation_visibility ?= 0 # Only modify LDFLAGS if DLD has been set. ifneq ($(DLD),) @@ -89,54 +59,5 @@ ifeq ($(no_strict_aliasing), 1) CCFLAGS += -fno-strict-aliasing endif -ifeq ($(c++11),1) - CCFLAGS += -std=c++11 -endif # c++11 - -ifeq ($(shared_libs), 1) - ifneq ($(static_libs_only), 1) - # 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 ($(GNU_LD),1) - # Make sure this version of ld supports the -E option. - ifneq ($(mingw32),1) - LD_EXPORT_DEFINED := $(shell sh -c '$(LD_FOR_VERSION_TEST) -E 2>&1 | egrep -i "(option|flag)" /dev/null; echo $$?') - else - LD_EXPORT_DEFINED := $(shell $(LD_FOR_VERSION_TEST) -E 2>&1 | grep -c -i -e '(option|flag)') - ifeq ($(LD_EXPORT_DEFINED),0) - LD_EXPORT_DEFINED:=1 - else - LD_EXPORT_DEFINED:=0 - endif - endif # mingw32 - ifeq ($(LD_EXPORT_DEFINED),1) - LDFLAGS += -Wl,-E - endif # LD_EXPORT_DEFINED = 1 - endif # GNU ld - - # Take advantage of G++ (>= 4.x) visibility attributes to generate - # improved shared library binaries. - ifneq ($(no_hidden_visibility),1) - CCFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden - ifeq ($(gcc_template_instantiation_visibility),1) - CCFLAGS += -DACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS=1 - endif # gcc_template_instantiation_visibility - else - CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0 - endif # no_hidden_visibility - else - # Explicitly disable G++ (>= 4.x) visibility attributes since - # they are only meant for use when building shared libraries. - no_hidden_visibility = 1 - CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0 - endif # static_libs_only -else - # Explicitly disable G++ (>= 4.x) visibility attributes since - # they are only meant for use when building shared libraries. - no_hidden_visibility = 1 - CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0 -endif # shared_libs - -FLAGS_C_CC += -W -Wall +# Things Clang has in common with GCC +include $(ACE_ROOT)/include/makeinclude/platform_gcc_clang_common.GNU diff --git a/ACE/include/makeinclude/platform_g++_common.GNU b/ACE/include/makeinclude/platform_g++_common.GNU index 6afda33beab..603dc6dad5a 100644 --- a/ACE/include/makeinclude/platform_g++_common.GNU +++ b/ACE/include/makeinclude/platform_g++_common.GNU @@ -1,10 +1,5 @@ # -*- Makefile -*- -ifeq ($(openmp),1) -FLAGS_C_CC += -fopenmp -LDFLAGS += -fopenmp -endif - ifeq ($(insure),1) CC = insure CXX = insure @@ -86,52 +81,7 @@ ifeq ($(findstring $(CXX_MAJOR_VERSION),4),$(CXX_MAJOR_VERSION)) c++11 ?= 1 endif -ifeq ($(c++20),1) - CCFLAGS += -std=c++20 -else - ifeq ($(c++17),1) - CCFLAGS += -std=c++17 - else - ifeq ($(c++14),1) - CCFLAGS += -std=c++14 - else - ifeq ($(c++11),1) - CCFLAGS += -std=c++11 - endif # c++11 - endif # c++14 - endif #c++17 -endif #c++20 - -# If no option has been specified, set templates to automatic -# version of the compiler. -# -templates ?= automatic - -# The correct flags to pass to the linker for ELF dynamic shared library -# versioning. -# If the platform file didn't already set versioned_so, default to 1. -versioned_so ?= 1 -with_ld ?= -ifneq ($(versioned_so),0) - ifeq ($(with_ld),hpux) - SOFLAGS += -Wl,+h -Wl,$(SONAME) - else - ifeq ($(with_ld),aix) - # What to do here??? - else - SOFLAGS += -Wl,-h -Wl,$(SONAME) - endif - endif -endif - -ifeq ($(versioned_so),2) - FLAGS_C_CC += -DACE_VERSIONED_SO=2 -endif - -static_libs_only ?= - CXX_FULL_VERSION := $(shell $(CXX_FOR_VERSION_TEST) --version) -gcc_template_instantiation_visibility ?= 0 # Only modify LDFLAGS if DLD has been set. ifneq ($(DLD),) @@ -148,10 +98,6 @@ ifneq ($(DLD),) endif # mingw32 endif # DLD -ifeq ($(GNU_LD),1) - STATIC_LINK_FLAG ?= -static -endif # GNU_LD - ifeq ($(no-optimize-sibling-calls), 1) FLAGS_C_CC += -fno-optimize-sibling-calls endif @@ -170,52 +116,6 @@ else endif endif -ifeq ($(shared_libs), 1) - ifneq ($(static_libs_only), 1) - # 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 ($(GNU_LD),1) - # Make sure this version of ld supports the -E option. - ifneq ($(mingw32),1) - LD_EXPORT_DEFINED := $(shell sh -c '$(LD_FOR_VERSION_TEST) -E 2>&1 | egrep -i "(option|flag)" /dev/null; echo $$?') - else - LD_EXPORT_DEFINED := $(shell $(LD_FOR_VERSION_TEST) -E 2>&1 | grep -c -i -e '(option|flag)') - ifeq ($(LD_EXPORT_DEFINED),0) - LD_EXPORT_DEFINED:=1 - else - LD_EXPORT_DEFINED:=0 - endif - endif # mingw32 - ifeq ($(LD_EXPORT_DEFINED),1) - LDFLAGS += -Wl,-E - endif # LD_EXPORT_DEFINED = 1 - endif # GNU ld - - # Take advantage of g++ visibility attributes to generate - # improved shared library binaries. - ifneq ($(no_hidden_visibility),1) - CCFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden - ifeq ($(gcc_template_instantiation_visibility),1) - CCFLAGS += -DACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS=1 - endif # gcc_template_instantiation_visibility - else - CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0 - endif # no_hidden_visibility - else - # Explicitly disable g++ visibility attributes since - # they are only meant for use when building shared libraries. - no_hidden_visibility = 1 - CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0 - endif # static_libs_only -else - # Explicitly disable g++ visibility attributes since - # they are only meant for use when building shared libraries. - no_hidden_visibility = 1 - CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0 -endif # shared_libs - minimaltoc ?= 0 ifeq ($(minimaltoc),1) FLAGS_C_CC += -mminimal-toc @@ -235,5 +135,5 @@ endif pipes ?= 1 -FLAGS_C_CC += -Wall -W -Wpointer-arith -CCFLAGS += -Wnon-virtual-dtor +# Things GCC has in common with Clang +include $(ACE_ROOT)/include/makeinclude/platform_gcc_clang_common.GNU diff --git a/ACE/include/makeinclude/platform_gcc_clang_common.GNU b/ACE/include/makeinclude/platform_gcc_clang_common.GNU new file mode 100644 index 00000000000..d4fa8a78ca6 --- /dev/null +++ b/ACE/include/makeinclude/platform_gcc_clang_common.GNU @@ -0,0 +1,104 @@ +# Shared Logic for GCC and Clang + +FLAGS_C_CC += -Wall -Wextra -Wpointer-arith +CCFLAGS += -Wnon-virtual-dtor + +gcc_template_instantiation_visibility ?= 0 +ifeq ($(shared_libs), 1) + ifneq ($(static_libs_only), 1) + # 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 ($(GNU_LD),1) + # Make sure this version of ld supports the -E option. + ifneq ($(mingw32),1) + LD_EXPORT_DEFINED := $(shell sh -c '$(LD_FOR_VERSION_TEST) -E 2>&1 | egrep -i "(option|flag)" /dev/null; echo $$?') + else + LD_EXPORT_DEFINED := $(shell $(LD_FOR_VERSION_TEST) -E 2>&1 | grep -c -i -e '(option|flag)') + ifeq ($(LD_EXPORT_DEFINED),0) + LD_EXPORT_DEFINED:=1 + else + LD_EXPORT_DEFINED:=0 + endif + endif # mingw32 + ifeq ($(LD_EXPORT_DEFINED),1) + LDFLAGS += -Wl,-E + endif # LD_EXPORT_DEFINED = 1 + endif # GNU ld + + # Take advantage of g++ visibility attributes to generate + # improved shared library binaries. + ifneq ($(no_hidden_visibility),1) + CCFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden + ifeq ($(gcc_template_instantiation_visibility),1) + CCFLAGS += -DACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS=1 + endif # gcc_template_instantiation_visibility + else + CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0 + endif # no_hidden_visibility + else + # Explicitly disable g++ visibility attributes since + # they are only meant for use when building shared libraries. + no_hidden_visibility = 1 + CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0 + endif # static_libs_only +else + # Explicitly disable g++ visibility attributes since + # they are only meant for use when building shared libraries. + no_hidden_visibility = 1 + CPPFLAGS += -DACE_HAS_CUSTOM_EXPORT_MACROS=0 +endif # shared_libs + +ifeq ($(c++20),1) + CCFLAGS += -std=c++20 +else + ifeq ($(c++17),1) + CCFLAGS += -std=c++17 + else + ifeq ($(c++14),1) + CCFLAGS += -std=c++14 + else + ifeq ($(c++11),1) + CCFLAGS += -std=c++11 + endif # c++11 + endif # c++14 + endif #c++17 +endif #c++20 + +# If no option has been specified, set templates to automatic +# version of the compiler. +# +templates ?= automatic + +# The correct flags to pass to the linker for ELF dynamic shared library +# versioning. +# If the platform file didn't already set versioned_so, default to 1. +versioned_so ?= 1 +with_ld ?= +ifneq ($(versioned_so),0) + ifeq ($(with_ld),hpux) + SOFLAGS += -Wl,+h -Wl,$(SONAME) + else + ifeq ($(with_ld),aix) + # What to do here??? + else + SOFLAGS += -Wl,-h -Wl,$(SONAME) + endif + endif +endif + +ifeq ($(versioned_so),2) + FLAGS_C_CC += -DACE_VERSIONED_SO=2 +endif + +static_libs_only ?= + +ifeq ($(GNU_LD),1) + STATIC_LINK_FLAG ?= -static +endif # GNU_LD + +ifeq ($(openmp),1) + FLAGS_C_CC += -fopenmp + LDFLAGS += -fopenmp +endif |