Переглянути джерело

add better gcc language support, allow to build objc/fortran

Waldemar Brodkorb 8 роки тому
батько
коміт
24135ba4d3

+ 0 - 1
target/config/Config.in

@@ -13,7 +13,6 @@ config ADK_TARGET_GENERIC
 
 config ADK_TARGET_UCLINUX
 	bool
-	select ADK_TARGET_WITHOUT_CXX
 
 config ADK_TARGET_SIM
 	bool

+ 0 - 8
target/config/Config.in.cpu

@@ -351,7 +351,6 @@ config ADK_TARGET_CPU_FRV
 	bool "fr-v"
 	select ADK_TARGET_WITHOUT_MMU
 	select ADK_TARGET_WITHOUT_THREADS
-	select ADK_TARGET_WITHOUT_CXX
 	depends on ADK_TARGET_ARCH_FRV
 
 # h8/300
@@ -359,7 +358,6 @@ config ADK_TARGET_CPU_H8300
 	bool "h8/300"
 	select ADK_TARGET_WITHOUT_MMU
 	select ADK_TARGET_WITHOUT_THREADS
-	select ADK_TARGET_WITHOUT_CXX
 	depends on ADK_TARGET_ARCH_H8300
 
 # hppa
@@ -627,7 +625,6 @@ config ADK_TARGET_CPU_METAG
 config ADK_TARGET_CPU_MICROBLAZE
 	bool "microblaze"
 	select ADK_TARGET_WITHOUT_THREADS if ADK_TARGET_LIB_UCLIBC_NG
-	select ADK_TARGET_WITHOUT_CXX if ADK_TARGET_LIB_UCLIBC_NG
 	select ADK_TARGET_WITH_MMU if !ADK_LINUX_UCLINUX
 	select ADK_TARGET_WITH_NPTL if ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_MUSL
 	depends on ADK_TARGET_ARCH_MICROBLAZE
@@ -710,7 +707,6 @@ config ADK_TARGET_CPU_NDS32
 config ADK_TARGET_CPU_NIOS2
 	bool "nios2"
 	select ADK_TARGET_WITH_LT if ADK_TARGET_LIB_UCLIBC_NG
-	select ADK_TARGET_WITHOUT_CXX if ADK_TARGET_LIB_UCLIBC_NG
 	select ADK_TARGET_WITH_NPTL if ADK_TARGET_LIB_GLIBC
 	select ADK_TARGET_WITH_MMU
 	select ADK_TARGET_USE_STATIC_LIBS if ADK_TARGET_LIB_UCLIBC_NG
@@ -720,7 +716,6 @@ config ADK_TARGET_CPU_NIOS2
 config ADK_TARGET_CPU_OR1K
 	bool "or1k"
 	select ADK_TARGET_WITH_LT if ADK_TARGET_LIB_UCLIBC_NG
-	select ADK_TARGET_WITHOUT_CXX if ADK_TARGET_LIB_UCLIBC_NG
 	select ADK_TARGET_WITH_NPTL if ADK_TARGET_LIB_MUSL
 	select ADK_TARGET_WITH_NPTL if ADK_TARGET_LIB_GLIBC
 	select ADK_TARGET_WITH_MMU
@@ -775,14 +770,12 @@ config ADK_TARGET_CPU_SH_SH2
 	bool "sh2"
 	select ADK_TARGET_WITHOUT_MMU
 	select ADK_TARGET_WITH_LT
-	select ADK_TARGET_WITHOUT_CXX
 	depends on ADK_TARGET_ARCH_SH
 
 config ADK_TARGET_CPU_SH_SH2A
 	bool "sh2a"
 	select ADK_TARGET_WITHOUT_MMU
 	select ADK_TARGET_WITH_LT
-	select ADK_TARGET_WITHOUT_CXX
 	depends on ADK_TARGET_ARCH_SH
 
 config ADK_TARGET_CPU_SH_SH3
@@ -848,7 +841,6 @@ config ADK_TARGET_CPU_V850
 	bool "v850"
 	select ADK_TARGET_WITHOUT_MMU
 	select ADK_TARGET_WITHOUT_THREADS
-	select ADK_TARGET_WITHOUT_CXX
 	depends on ADK_TARGET_ARCH_V850
 
 # x86

+ 0 - 4
target/config/Config.in.libc

@@ -78,7 +78,6 @@ config ADK_TARGET_LIB_GLIBC
 
 config ADK_TARGET_LIB_NEWLIB
 	bool "newlib C library"
-	select ADK_TARGET_WITHOUT_CXX
 	select ADK_TARGET_WITHOUT_THREADS
 	depends on (\
 		ADK_TARGET_ARCH_AARCH64 || \
@@ -206,9 +205,6 @@ config ADK_TARGET_WITH_NPTL
 config ADK_TARGET_WITHOUT_THREADS
 	bool
 
-config ADK_TARGET_WITHOUT_CXX
-	bool
-
 config ADK_TARGET_LIBC
 	string
 	default "uclibc-ng" if ADK_TARGET_LIB_UCLIBC_NG

+ 18 - 0
target/config/Config.in.toolchain

@@ -52,7 +52,25 @@ config ADK_TARGET_CFLAGS_OPT_O0
 
 endchoice
 
+menu "Compiler language support"
+config ADK_TOOLCHAIN_WITH_CXX
+	bool "enable C++"
+	default y if ADK_TARGET_OS_LINUX
+	default n
+
+config ADK_TOOLCHAIN_WITH_OBJC
+	bool "enable OBJC"
+	default n
+
+config ADK_TOOLCHAIN_WITH_FORTRAN
+	bool "enable Fortran"
+	default n
+
+endmenu
+
 menu "Advanced Toolchain options"
+
+
 config ADK_TOOLCHAIN_WITH_SSP
 	bool
 

+ 11 - 4
toolchain/gcc/Makefile

@@ -189,11 +189,18 @@ ifeq (${ADK_MAKE_PARALLEL},y)
 GCC_MAKEOPTS+=		-j${ADK_MAKE_JOBS}
 endif
 
-ifeq ($(ADK_TARGET_WITHOUT_CXX),y)
-LANGUAGES:=c
-else
-LANGUAGES:=c,c++
+USE_LANG:=c
+ifeq ($(ADK_TOOLCHAIN_WITH_CXX),y)
+USE_LANG+=c++
+endif
+ifeq ($(ADK_TOOLCHAIN_WITH_OBJC),y)
+USE_LANG+=objc
 endif
+ifeq ($(ADK_TOOLCHAIN_WITH_FORTRAN),y)
+USE_LANG+=fortran
+endif
+
+LANGUAGES=$(shell echo ${USE_LANG} |tr ' ' ',')
 
 include ${ADK_TOPDIR}/mk/buildhlp.mk