From 54d64798e1e14b526c3cc1142961972cff9f1e8a Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Thu, 13 May 2010 22:21:08 +0200 Subject: Add a BR2_NEEDS_GETTEXT option When using an external toolchain that uses the glibc or eglibc C libraries, compiling a separate gettext and libintl is not needed and is even a source of confusion, causing build failures. These build failures are due to the fact that when libintl is compiled, it replaces the C library libintl.h by its own, which does #define gettext libintl_gettext. Then, when packages want to use gettext, autoconf realize that gettext is available in the C library and therefore do not add -lintl to the LDFLAGS, causing the build failure because the program has been compiled to use libintl_gettext but this function is not available. Therefore, we should only use gettext if a uClibc internal toolchain or a uClibc external toolchain. If an external glibc toolchain is used, gettext shouldn't be used. In order to implement that, we introduce the BR2_NEEDS_GETTEXT option, which is hidden to the user, and whose value is computed automatically from the rest of the configuration. Signed-off-by: Thomas Petazzoni --- toolchain/Config.in.2 | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'toolchain') diff --git a/toolchain/Config.in.2 b/toolchain/Config.in.2 index f04f18a21..fc6759dd6 100644 --- a/toolchain/Config.in.2 +++ b/toolchain/Config.in.2 @@ -56,6 +56,14 @@ config BR2_ENABLE_LOCALE_WHITELIST will be available on the target - That purely depends on the support for that locale in the selected packages. +# uClibc toolchains require a separatly-compiled gettext/libintl when +# locale support is enabled. This isn't necessary with glibc +# toolchains as glibc includes gettext/libintl. +config BR2_NEEDS_GETTEXT + bool + default y if (BR2_TOOLCHAIN_BUILDROOT && BR2_ENABLE_LOCALE) + default y if (BR2_TOOLCHAIN_EXTERNAL_UCLIBC && BR2_ENABLE_LOCALE) + config BR2_USE_WCHAR bool "Enable WCHAR support" help -- cgit v1.2.3 From fad3b5a7bee8ce6dd1cf17f230de693d8ed9230f Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 14 May 2010 13:24:43 +0200 Subject: external toolchain: check BR2_INSTALL_LIBSTDCPP Verify that the value of BR2_INSTALL_LIBSTDCPP set by the user in the Buildroot configuration really matches the external toolchain capabilities by checking that a C++ cross-compiler is available. Signed-off-by: Thomas Petazzoni --- toolchain/external-toolchain/ext-tool.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'toolchain') diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk index 2c2562cde..bb4809ccd 100644 --- a/toolchain/external-toolchain/ext-tool.mk +++ b/toolchain/external-toolchain/ext-tool.mk @@ -231,6 +231,15 @@ check_arm_abi = \ exit 1 ; \ fi ; \ +# +# Check that the external toolchain supports C++ +# +check_cplusplus = \ + if ! test -x $(TARGET_CXX) ; then \ + echo "BR2_INSTALL_LIBSTDCPP is selected but C++ support not available in external toolchain" ; \ + exit 1 ; \ + fi ; \ + # # Check that the cross-compiler given in the configuration exists # @@ -288,6 +297,9 @@ endif ifeq ($(BR2_arm),y) $(Q)$(call check_arm_abi) endif +ifeq ($(BR2_INSTALL_LIBSTDCPP),y) + $(Q)$(call check_cplusplus) +endif ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y) $(Q)$(call check_uclibc,$(SYSROOT_DIR)) else -- cgit v1.2.3