package/poke: enable uClibc-ng support
authorRomain Naour <romain.naour@gmail.com>
Mon, 17 May 2021 15:56:28 +0000 (17:56 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Tue, 18 May 2021 15:13:47 +0000 (17:13 +0200)
poke bundle gnulib that doesn't support the case where
host_os='linux-uclibc'. When cross-compiling, the guessed
answers are mostly wrong and gnulib will try to replace
snprintf with rpl_snprintf. This lead to "undefined reference
to `rpl_snprintf'" errors.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/poke/Config.in
package/poke/poke.mk

index eb2e33d5af44e920c748f9e8b2b65fa835006ff4..40e7a31bab3d749e99dbf0585273a2e6789f757c 100644 (file)
@@ -3,7 +3,6 @@ config BR2_PACKAGE_POKE
        depends on BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS # bdwgc
        depends on BR2_USE_WCHAR # needs wctomb
        depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
-       depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # gnulib
        select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # less
        select BR2_PACKAGE_BDWGC
        select BR2_PACKAGE_LESS # runtime
@@ -24,7 +23,6 @@ config BR2_PACKAGE_POKE
 
          https://www.gnu.org/software/poke/
 
-comment "poke needs a glibc or musl toolchain w/ NPTL, wchar"
+comment "poke needs a toolchain w/ NPTL, wchar"
        depends on BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS
-       depends on !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL) \
-               ||!BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_USE_WCHAR
+       depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_USE_WCHAR
index 7c3c81d93c551289c92781fc0805e3e865351d9d..406acf15e0072903bede206a545a0f73023e76c2 100644 (file)
@@ -16,6 +16,31 @@ POKE_AUTORECONF = YES
 
 POKE_DEPENDENCIES = host-flex host-bison host-pkgconf bdwgc readline
 
+# poke bundle gnulib that doesn't support the case where
+# host_os='linux-uclibc'. When cross-compiling, the guessed
+# answers are mostly wrong and gnulib will try to replace
+# snprintf with rpl_snprintf. This lead to "undefined reference
+# to `rpl_snprintf'" errors.
+ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
+POKE_CONF_ENV = gl_cv_func_printf_positions=yes \
+       gl_cv_func_snprintf_retval_c99=yes \
+       gl_cv_func_printf_sizes_c99=yes \
+       gl_cv_func_printf_infinite_long_double=yes \
+       gl_cv_func_snprintf_retval_c99=yes \
+       gl_cv_func_snprintf_truncation_c99=yes \
+       gl_cv_func_snprintf_usable=yes \
+       gl_cv_func_strerror_0_works=yes \
+       gl_cv_header_working_stdint_h=yes \
+       gl_cv_func_printf_infinite=yes \
+       gl_cv_func_printf_flag_zero=yes \
+       gl_cv_func_printf_enomem=yes \
+       gl_cv_func_printf_directive_f=yes \
+       gl_cv_func_printf_directive_a=yes \
+       gl_cv_func_snprintf_directive_n=yes \
+       gl_cv_func_vsnprintf_posix=yes \
+       gl_cv_func_vsnprintf_zerosize_c99=yes
+endif
+
 POKE_CONF_OPTS = \
        --disable-gui \
        --disable-libnbd \