| 1 |
# -*- Makefile -*- |
| 2 |
|
| 3 |
ifneq ($(CROSS_COMPILE),) |
| 4 |
CROSS-COMPILE = 1 |
| 5 |
# Build using the cross-tools |
| 6 |
override_cross_compile ?= 0 |
| 7 |
ifeq ($(override_cross_compile),0) |
| 8 |
CC = ${CROSS_COMPILE}clang${CROSS_COMPILE_SUFFIX} |
| 9 |
CXX = ${CROSS_COMPILE}clang++${CROSS_COMPILE_SUFFIX} |
| 10 |
AR = ${CROSS_COMPILE}ar${CROSS_COMPILE_SUFFIX} |
| 11 |
endif |
| 12 |
# Cross-linker requires this for linked in shared libs that depend |
| 13 |
# themselves on other shared libs (not directly linked in) |
| 14 |
LDFLAGS += -Wl,-rpath-link,$(ACE_ROOT)/lib |
| 15 |
ifneq (,$(HOST_ROOT)) |
| 16 |
TAO_IDLFLAGS += -g $(HOST_ROOT)/bin/ace_gperf |
| 17 |
TAO_IDL = $(HOST_ROOT)/bin/tao_idl |
| 18 |
TAO_IDL_DEP = $(TAO_IDL) |
| 19 |
# make sure to use the host compiler, not the cross-compiler |
| 20 |
# as preprocessor for the cross-compiled idl tools |
| 21 |
TAO_IDL_PREPROCESSOR = clang |
| 22 |
endif |
| 23 |
endif |
| 24 |
|
| 25 |
ifeq ($(CXX),insure) |
| 26 |
# insure does not pass through the -dumpversion option. |
| 27 |
CXX_FOR_VERSION_TEST ?= g++ |
| 28 |
else |
| 29 |
CXX_FOR_VERSION_TEST ?= $(CXX) |
| 30 |
endif |
| 31 |
|
| 32 |
CXX_VERSION := $(shell $(CXX_FOR_VERSION_TEST) -dumpversion) |
| 33 |
CXX_FULL_VERSION := $(shell $(CXX_FOR_VERSION_TEST) --version) |
| 34 |
|
| 35 |
# Only modify LDFLAGS if DLD has been set. |
| 36 |
ifneq ($(DLD),) |
| 37 |
ifeq ($(DLD),$(CXX_FOR_VERSION_TEST)) # only try this is we are using ld through gcc |
| 38 |
LD_FOR_VERSION_TEST = $(subst \,/,$(shell $(CXX_FOR_VERSION_TEST) -print-prog-name=ld)) |
| 39 |
else |
| 40 |
LD_FOR_VERSION_TEST = $(DLD) |
| 41 |
endif # DLD = CXX_FOR_VERSION_TEST |
| 42 |
# The -E option is GNU ld specific |
| 43 |
GNU_LD := $(if $(findstring GNU ld,$(shell $(LD_FOR_VERSION_TEST) -v 2>&1)), 1, 0) |
| 44 |
endif # DLD |
| 45 |
|
| 46 |
ifeq ($(GNU_LD),1) |
| 47 |
STATIC_LINK_FLAG ?= -static |
| 48 |
endif # GNU_LD |
| 49 |
|
| 50 |
ifeq ($(no_strict_aliasing), 1) |
| 51 |
CCFLAGS += -fno-strict-aliasing |
| 52 |
endif |
| 53 |
|
| 54 |
# Things Clang has in common with GCC |
| 55 |
include $(ACE_ROOT)/include/makeinclude/platform_gcc_clang_common.GNU |