Skip to content

Commit 492a8b1

Browse files
committed
toolchain: separate c++ compiler from libstdc++ presence
We may want a c++ compiler, but no libstdc++ on the system. For example, firmware that isn't linked with the system libstdc++. These packages can depend on BR2_CPP instead of BR2_INSTALL_LIBSTDCPP. Signed-off-by: Jeremy Kerr <[email protected]>
1 parent f3fbf3a commit 492a8b1

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

package/Makefile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ else
361361
DISABLE_IPV6= --disable-ipv6
362362
endif
363363

364-
ifneq ($(BR2_INSTALL_LIBSTDCPP),y)
364+
ifneq ($(BR2_CPP),y)
365365
TARGET_CONFIGURE_OPTS+=CXX=false
366366
endif
367367

package/gcc/Config.in.host

+11-3
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,21 @@ config BR2_EXTRA_GCC_CONFIG_OPTIONS
126126
initial, gcc intermediate and gcc final passes.
127127

128128
config BR2_TOOLCHAIN_BUILDROOT_CXX
129-
bool "Enable C++ support"
130-
select BR2_INSTALL_LIBSTDCPP
129+
bool "Enable C++ compiler support"
130+
select BR2_CPP
131131
depends on !(BR2_GCC_VERSION_4_2_2_AVR32_2_1_5 && \
132132
BR2_TOOLCHAIN_BUILDROOT_LOCALE)
133133
help
134134
Enable this option if you want your toolchain to support the
135-
C++ language and you want C++ libraries to be installed on
135+
C++ language.
136+
137+
config BR2_TOOLCHAIN_BUILDROOT_LIBSTDCPP
138+
bool "Install C++ libraries"
139+
default y
140+
select BR2_INSTALL_LIBSTDCPP
141+
depends on BR2_TOOLCHAIN_BUILDROOT_CXX
142+
help
143+
Enable this option if you want C++ libraries to be installed on
136144
your target system.
137145

138146
comment "C++ support broken in uClibc with locale enabled with gcc 4.2"

package/gcc/gcc-final/gcc-final.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ endef
4343

4444
# Languages supported by the cross-compiler
4545
GCC_FINAL_CROSS_LANGUAGES-y = c
46-
GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_LIBSTDCPP) += c++
46+
GCC_FINAL_CROSS_LANGUAGES-$(BR2_CPP) += c++
4747
GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_FORTRAN) += fortran
4848
GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_OBJC) += objc
4949
GCC_FINAL_CROSS_LANGUAGES = $(subst $(space),$(comma),$(GCC_FINAL_CROSS_LANGUAGES-y))

toolchain/toolchain-common.in

+4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ config BR2_USE_WCHAR
2626
config BR2_ENABLE_LOCALE
2727
bool
2828

29+
config BR2_CPP
30+
bool
31+
2932
config BR2_INSTALL_LIBSTDCPP
3033
bool
34+
select BR2_CPP
3135

3236
config BR2_TOOLCHAIN_HAS_THREADS
3337
bool

0 commit comments

Comments
 (0)