summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config_host.mk.in1
-rw-r--r--configure.in23
-rw-r--r--solenv/gbuild/platform/IOS_ARM_GCC.mk2
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk2
-rw-r--r--solenv/inc/unxgcc.mk5
-rw-r--r--solenv/inc/unxiosr.mk5
-rw-r--r--solenv/inc/unxmacx.mk5
7 files changed, 35 insertions, 8 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index 2eed3c1bb3ca..f0ea88326e71 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -42,6 +42,7 @@ export CDR_LIBS=@CDR_LIBS@
export CLASSPATH=@CLASSPATH@
export CL_X64=@CL_X64@
export COM=@COM@
+export COM_GCC_IS_CLANG=@COM_GCC_IS_CLANG@
export COMEX=@COMEX@
export COMMONS_CODEC_JAR=@COMMONS_CODEC_JAR@
export COMMONS_HTTPCLIENT_JAR=@COMMONS_HTTPCLIENT_JAR@
diff --git a/configure.in b/configure.in
index 3d3d7e982502..6e51f3507c28 100644
--- a/configure.in
+++ b/configure.in
@@ -2442,9 +2442,9 @@ if test "$_os" = "WINNT"; then
fi
dnl ===================================================================
-dnl Test the gcc version, 3 is OK
+dnl Test the gcc version
dnl ===================================================================
-if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) -a "$GCC" = "yes"; then
+if test "$GCC" = "yes"; then
AC_MSG_CHECKING([the GNU C compiler version])
_gcc_version=`$CC -dumpversion`
_gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
@@ -2465,10 +2465,27 @@ if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) -a "$GCC" = "yes"; then
AC_MSG_RESULT([implicitly using CC=$CC])
fi
else
- AC_MSG_RESULT([checked (gcc $_gcc_version)])
+ AC_MSG_RESULT([gcc $_gcc_version])
fi
fi
+dnl ===================================================================
+dnl Is it actually Clang?
+dnl ===================================================================
+
+if test "$GCC" = "yes"; then
+ AC_MSG_CHECKING([whether GCC is actually Clang])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #ifndef __clang__
+ you lose
+ #endif
+ int foo=42;
+ ]])],
+ [AC_MSG_RESULT([yes])
+ COM_GCC_IS_CLANG=TRUE],
+ [AC_MSG_RESULT([no])])
+fi
+AC_SUBST(COM_GCC_IS_CLANG)
#
# prefix C with ccache if needed
diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index 03bae7b54b01..3483213ec1b3 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -69,7 +69,7 @@ gb_CXXFLAGS := \
# No idea if -malign-natural is needed, but macosx.mk uses it...
# Why it isn't used in gb_CFLAGS I have no idea.
# Anyway, Clang doesn't have this option.
-ifeq (,$(findstring /clang,$(CXX)))
+ifneq ($(COM_GCC_IS_CLANG),TRUE)
gb_CXXFLAGS += \
-malign-natural
endif
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index b6aff7fdefc6..cf770630ca78 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -121,7 +121,7 @@ gb_LinkTarget_EXCEPTIONFLAGS := \
-fexceptions
# Clang doesn't have this option
-ifeq (,$(findstring /clang,$(CXX)))
+ifneq ($(COM_GCC_IS_CLANG),TRUE)
gb_LinkTarget_EXCEPTIONFLAGS += \
-fno-enforce-eh-specs
endif
diff --git a/solenv/inc/unxgcc.mk b/solenv/inc/unxgcc.mk
index 14983dd5b019..3765b2dd6cea 100644
--- a/solenv/inc/unxgcc.mk
+++ b/solenv/inc/unxgcc.mk
@@ -78,7 +78,10 @@ CFLAGSENABLESYMBOLS=-g
# flags for the C++ Compiler
CFLAGSCC= -pipe $(ARCH_FLAGS)
# Flags for enabling exception handling
-CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+CFLAGSEXCEPTIONS=-fexceptions
+.IF "$(COM_GCC_IS_CLANG)" != "TRUE"
+CFLAGSEXCEPTIONS+=-fno-enforce-eh-specs
+.ENDIF
# Flags for disabling exception handling
CFLAGS_NO_EXCEPTIONS=-fno-exceptions
diff --git a/solenv/inc/unxiosr.mk b/solenv/inc/unxiosr.mk
index 6ddb15af841e..6928b94842ac 100644
--- a/solenv/inc/unxiosr.mk
+++ b/solenv/inc/unxiosr.mk
@@ -57,7 +57,10 @@ OBJCFLAGS=-fexceptions -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS
OBJCXXFLAGS:=-x objective-c++ $(OBJCFLAGS)
# Comp Flags for files that need exceptions enabled (C and C++)
-CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+CFLAGSEXCEPTIONS=-fexceptions
+.IF "$(COM_GCC_IS_CLANG)" != "TRUE"
+CFLAGSEXCEPTIONS+=-fno-enforce-eh-specs
+.ENDIF
# Comp Flags for files that do not need exceptions enabled (C and C++)
CFLAGS_NO_EXCEPTIONS=-fno-exceptions
diff --git a/solenv/inc/unxmacx.mk b/solenv/inc/unxmacx.mk
index b0c862ec17c1..0cb0b62ee02f 100644
--- a/solenv/inc/unxmacx.mk
+++ b/solenv/inc/unxmacx.mk
@@ -103,7 +103,10 @@ OBJCFLAGS=-fobjc-exceptions
OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
# Comp Flags for files that need exceptions enabled (C and C++)
-CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+CFLAGSEXCEPTIONS=-fexceptions
+.IF "$(COM_GCC_IS_CLANG)" != "TRUE"
+CFLAGSEXCEPTIONS+=-fno-enforce-eh-specs
+.ENDIF
# Comp Flags for files that do not need exceptions enabled (C and C++)
CFLAGS_NO_EXCEPTIONS=-fno-exceptions