diff mbox

[10/20] Clang support

Message ID 1407352611-7652-10-git-send-email-diorcet.yann@gmail.com
State New
Delegated to: Esben Haabendal
Headers show

Commit Message

Yann Diorcet Aug. 6, 2014, 7:16 p.m. UTC
---
 classes/c++.oeclass    | 25 ++++++++++++++++++++++---
 classes/c.oeclass      | 29 +++++++++++++++++++++++------
 conf/distro/common.inc |  1 +
 3 files changed, 46 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/classes/c++.oeclass b/classes/c++.oeclass
index 8bb21c8..f699ea9 100644
--- a/classes/c++.oeclass
+++ b/classes/c++.oeclass
@@ -17,9 +17,28 @@  export CXXFLAGS
 export BUILD_CXX
 export BUILD_CXXFLAGS
 
-BUILD_CXX	= "${BUILD_PREFIX}g++"
-HOST_CXX	= "${HOST_PREFIX}g++"
-TARGET_CXX	= "${TARGET_PREFIX}g++"
+BUILD_CXX	= "${BUILD_PREFIX}${BUILD_CXX_PROG}"
+HOST_CXX	= "${HOST_PREFIX}${HOST_CXX_PROG}"
+TARGET_CXX	= "${TARGET_PREFIX}${TARGET_CXX_PROG}"
+
+# CXX Prog
+BUILD_CXX_PROG				?= "g++"
+MACHINE_CXX_PROG			?= "g++"
+SDK_CXX_PROG				?= "g++"
+HOST_CXX_PROG:native		 	= "${BUILD_CXX_PROG}"
+HOST_CXX_PROG:cross			= "${BUILD_CXX_PROG}"
+HOST_CXX_PROG:machine			= "${MACHINE_CXX_PROG}"
+HOST_CXX_PROG:sdk			= "${SDK_CXX_PROG}"
+HOST_CXX_PROG:sdk-cross			= "${BUILD_CXX_PROG}"
+HOST_CXX_PROG:canadian-cross		= "${SDK_CXX_PROG}"
+TARGET_CXX_PROG:native			= "${BUILD_CXX_PROG}"
+TARGET_CXX_PROG:cross			= "${MACHINE_CXX_PROG}"
+TARGET_CXX_PROG:machine			= "${MACHINE_CXX_PROG}"
+TARGET_CXX_PROG:sdk			= "${SDK_CXX_PROG}"
+TARGET_CXX_PROG:sdk-cross		= "${SDK_CXX_PROG}"
+TARGET_CXX_PROG:canadian-cross		= "${MACHINE_CXX_PROG}"
+
+
 CXX		= "${HOST_CXX}"
 
 BUILD_CXXFLAGS		?= "${BUILD_CFLAGS} -fpermissive"
diff --git a/classes/c.oeclass b/classes/c.oeclass
index b236d99..24abb90 100644
--- a/classes/c.oeclass
+++ b/classes/c.oeclass
@@ -209,9 +209,26 @@  TARGET_LDFLAGS:canadian-cross	 = "${MACHINE_LDFLAGS} \
 # CC
 export CC = "${HOST_CC}"
 export BUILD_CC
-BUILD_CC	= "${BUILD_PREFIX}gcc"
-HOST_CC		= "${HOST_PREFIX}gcc"
-TARGET_CC	= "${TARGET_PREFIX}gcc"
+BUILD_CC	= "${BUILD_PREFIX}${BUILD_CC_PROG}"
+HOST_CC		= "${HOST_PREFIX}${HOST_CC_PROG}"
+TARGET_CC	= "${TARGET_PREFIX}${TARGET_CC_PROG}"
+
+# CC Prog
+BUILD_CC_PROG				?= "gcc"
+MACHINE_CC_PROG				?= "gcc"
+SDK_CC_PROG				?= "gcc"
+HOST_CC_PROG:native		 	= "${BUILD_CC_PROG}"
+HOST_CC_PROG:cross			= "${BUILD_CC_PROG}"
+HOST_CC_PROG:machine			= "${MACHINE_CC_PROG}"
+HOST_CC_PROG:sdk			= "${SDK_CC_PROG}"
+HOST_CC_PROG:sdk-cross			= "${BUILD_CC_PROG}"
+HOST_CC_PROG:canadian-cross		= "${SDK_CC_PROG}"
+TARGET_CC_PROG:native			= "${BUILD_CC_PROG}"
+TARGET_CC_PROG:cross			= "${MACHINE_CC_PROG}"
+TARGET_CC_PROG:machine			= "${MACHINE_CC_PROG}"
+TARGET_CC_PROG:sdk			= "${SDK_CC_PROG}"
+TARGET_CC_PROG:sdk-cross		= "${SDK_CC_PROG}"
+TARGET_CC_PROG:canadian-cross		= "${MACHINE_CC_PROG}"
 
 # CPP
 export CPP = "${HOST_CPP}"
@@ -230,9 +247,9 @@  TARGET_LD	= "${TARGET_PREFIX}ld"
 # CCLD
 export CCLD = "${HOST_CCLD}"
 export BUILD_CCLD
-BUILD_CCLD	= "${BUILD_PREFIX}gcc"
-HOST_CCLD	= "${HOST_PREFIX}gcc"
-TARGET_CCLD	= "${TARGET_PREFIX}gcc"
+BUILD_CCLD	= "${BUILD_PREFIX}${BUILD_CC_PROG}"
+HOST_CCLD	= "${HOST_PREFIX}${HOST_CC_PROG}"
+TARGET_CCLD	= "${TARGET_PREFIX}${TARGET_CC_PROG}"
 
 # AS
 export AS = "${HOST_AS}"
diff --git a/conf/distro/common.inc b/conf/distro/common.inc
index ef08c87..0a9e6af 100644
--- a/conf/distro/common.inc
+++ b/conf/distro/common.inc
@@ -1,5 +1,6 @@ 
 GCC_VERSION			?= "4.5.3"
 GCC_VERSION:TARGET_OS_mingw32	?= "4.5.3"
+CLANG_VERSION			?= "3.4"
 
 DISTRO_USE_sdk_linux_libc	?= "glibc:2.12.2"
 DISTRO_USE_sdk_windows_libc	?= "mingw:3.18"