From 1e799ecb61574c73db3a4f2a95fa4cbf4b48242d Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja@tarantool.org>
Date: Wed, 10 Apr 2013 19:24:24 +0400
Subject: [PATCH] -static-libgcc only if use libgcc

---
 CMakeLists.txt | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 622b5d30b0..957783c2a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -184,8 +184,13 @@ if (ENABLE_STATIC)
     add_compile_flags("C;CXX" "-static")
 endif()
 
-# Compile with builtin libgcc by default.
-if (NOT TARGET_OS_DARWIN)
+#
+# On CentOS the default gcc is way older than gcc 4.6, required
+# to compile Tarantool. To make the package compiled with gcc 4.6
+# usable on a system which has only gcc 4.1, statically link with
+# builtin libgcc by default.
+#
+if (CMAKE_COMPILER_IS_GNUCC and not CMAKE_COMPILER_IS_CLANG)
     add_compile_flags("C;CXX;OBJC;OBJCXX" "-static-libgcc")
 endif()
 
-- 
GitLab