summaryrefslogtreecommitdiff
path: root/ACE
diff options
context:
space:
mode:
Diffstat (limited to 'ACE')
-rw-r--r--ACE/ChangeLog8
-rw-r--r--ACE/ace/config-macosx-snowleopard.h9
-rw-r--r--ACE/include/makeinclude/platform_clang_common.GNU110
-rw-r--r--ACE/include/makeinclude/platform_macosx_common.GNU11
4 files changed, 133 insertions, 5 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 8f7788e32bb..25e1c3fc29a 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,11 @@
+Thu Jul 15 09:11:51 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
+
+ * ace/config-macosx-snowleopard.h:
+ * include/makeinclude/platform_clang_common.GNU:
+ * include/makeinclude/platform_macosx_common.GNU:
+
+ Preliminary support for clang compiler.
+
Tue Jul 13 14:39:55 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* NEWS:
diff --git a/ACE/ace/config-macosx-snowleopard.h b/ACE/ace/config-macosx-snowleopard.h
index 4094eab621c..6869b7a6817 100644
--- a/ACE/ace/config-macosx-snowleopard.h
+++ b/ACE/ace/config-macosx-snowleopard.h
@@ -2,9 +2,16 @@
#ifndef ACE_CONFIG_MACOSX_SNOWLEOPARD_H
#define ACE_CONFIG_MACOSX_SNOWLEOPARD_H
+
#include "ace/config-macosx-leopard.h"
+#ifdef __clang__
+#ifdef ACE_HAS_GCC_ATOMIC_BUILTINS
+#undef ACE_HAS_GCC_ATOMIC_BUILTINS
+#endif
+#endif
+
// This header has been deprecated in Snow Leopard.
#define ACE_LACKS_UCONTEXT_H
-#endif ACE_CONFIG_MACOSX_SNOWLEOPARD_H
+#endif // ACE_CONFIG_MACOSX_SNOWLEOPARD_H
diff --git a/ACE/include/makeinclude/platform_clang_common.GNU b/ACE/include/makeinclude/platform_clang_common.GNU
new file mode 100644
index 00000000000..94cea192d09
--- /dev/null
+++ b/ACE/include/makeinclude/platform_clang_common.GNU
@@ -0,0 +1,110 @@
+# -*- Makefile -*-
+# $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, 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 ?=
+ifeq ($(versioned_so),1)
+ 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),)
+ ifeq ($(DLD),$(CXX_FOR_VERSION_TEST)) # only try this is we are using ld through gcc
+ LD_FOR_VERSION_TEST = $(shell $(CXX_FOR_VERSION_TEST) -print-prog-name=ld)
+ else
+ LD_FOR_VERSION_TEST = $(DLD)
+ endif # DLD = CXX_FOR_VERSION_TEST
+ # The -E option is GNU ld specific
+ ifneq ($(mingw32),1)
+ GNU_LD := $(shell sh -c '$(LD_FOR_VERSION_TEST) -v 2>&1 | grep -c "GNU ld"')
+ else
+ GNU_LD := $(if $(findstring GNU ld,$(shell $(LD_FOR_VERSION_TEST) -v)), 1, 0)
+ endif # mingw32
+endif # DLD
+
+ifeq ($(GNU_LD),1)
+ STATIC_LINK_FLAG ?= -static
+endif # GNU_LD
+
+ifeq ($(no_strict_aliasing), 1)
+ CCFLAGS += -fno-strict-aliasing
+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++ (>= 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
+
diff --git a/ACE/include/makeinclude/platform_macosx_common.GNU b/ACE/include/makeinclude/platform_macosx_common.GNU
index 5ee78669b6a..26a0d565d66 100644
--- a/ACE/include/makeinclude/platform_macosx_common.GNU
+++ b/ACE/include/makeinclude/platform_macosx_common.GNU
@@ -29,8 +29,8 @@ pipes ?= 1
CFLAGS += $(FLAGS_C_CC)
-CC = gcc
-CXX = g++
+CC ?= gcc
+CXX ?= g++
CFLAGS += -Wall -Wpointer-arith
DCFLAGS += -g
@@ -46,8 +46,11 @@ SOBUILD = -o $(VSHDIR)$*.dylib $<
# Test for template instantiation, add to SOFLAGS if versioned_so set,
# add -E to LDFLAGS if using GNU ld
-#
-include $(ACE_ROOT)/include/makeinclude/platform_g++_common.GNU
+ifeq ($(findstring g++,$(CXX)),)#
+ include $(ACE_ROOT)/include/makeinclude/platform_g++_common.GNU
+else
+ include $(ACE_ROOT)/include/makeinclude/platform_clang_common.GNU
+endif
LDFLAGS += -flat_namespace
CCFLAGS += $(CFLAGS) $(TEMPLATES_FLAG)