Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] RFC: musl: Fix gettext support
@ 2016-01-30 22:51 Bernd Kuhls
  2016-01-31  7:33 ` Thomas Petazzoni
  2016-02-01 16:11 ` Peter Korsgaard
  0 siblings, 2 replies; 8+ messages in thread
From: Bernd Kuhls @ 2016-01-30 22:51 UTC (permalink / raw)
  To: buildroot

The issue is discussed here:
http://thread.gmane.org/gmane.comp.lib.uclibc.buildroot/127196

I consider this patch an ugly hack but I could compile ~900 packages
without a gettext-related error, so I put this patch up for discussion.

Fixes
http://autobuild.buildroot.net/results/911/9115ddb411ec15eb8bfa1d4f03a804f48e77ff76/
and many similar errors

To test use the defconfig mentioned above, then

make clean
make dos2unix (build will succeed either with or without this patch)

make clean
make gettext
make dos2unix (build fails because gettext replaced musl's libintl.h)

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/Makefile.in        |  6 ++++++
 package/gettext/gettext.mk | 14 ++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/package/Makefile.in b/package/Makefile.in
index c5652af..16ab17f 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -340,6 +340,11 @@ else
 BR2_AC_CV_C_BIGENDIAN = ac_cv_c_bigendian=no
 endif
 
+# configure script misdetects musl gettext support
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+BR2_GT_CV_FUNC_GNUGETTEXT1_LIBC = gt_cv_func_gnugettext1_libc=yes
+endif
+
 TARGET_CONFIGURE_ARGS = \
 	$(BR2_AC_CV_TRAP_CHECK) \
 	ac_cv_func_mmap_fixed_mapped=yes \
@@ -350,6 +355,7 @@ TARGET_CONFIGURE_ARGS = \
 	ac_cv_func_calloc_0_nonnull=yes \
 	ac_cv_func_realloc_0_nonnull=yes \
 	lt_cv_sys_lib_search_path_spec="" \
+	$(BR2_GT_CV_FUNC_GNUGETTEXT1_LIBC) \
 	$(BR2_AC_CV_C_BIGENDIAN)
 
 ################################################################################
diff --git a/package/gettext/gettext.mk b/package/gettext/gettext.mk
index 0b4e5dd..f388ea8 100644
--- a/package/gettext/gettext.mk
+++ b/package/gettext/gettext.mk
@@ -27,6 +27,20 @@ GETTEXT_CONF_OPTS += \
 	--disable-relocatable \
 	--without-emacs
 
+# musl provides a gettext implementation, but gettext does not
+# recognize it as being a valid implementation.
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+GETTEXT_CONF_ENV += \
+	ac_cv_gnu_library_2_1=yes \
+	ac_cv_gnu_library_2=yes
+
+# prevent gettext overwriting musl's libintl.h
+define GETTEXT_DO_NOT_INSTALL_LIBINTL_H
+	$(SED) '/\$$(INSTALL_DATA) libintl.h/d' $(@D)/gettext-runtime/intl/Makefile.in
+endef
+GETTEXT_POST_PATCH_HOOKS = GETTEXT_DO_NOT_INSTALL_LIBINTL_H
+endif
+
 HOST_GETTEXT_CONF_OPTS = \
 	--disable-libasprintf \
 	--disable-acl \
-- 
2.7.0.rc3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-02-01 22:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-30 22:51 [Buildroot] [PATCH 1/1] RFC: musl: Fix gettext support Bernd Kuhls
2016-01-31  7:33 ` Thomas Petazzoni
2016-01-31  7:49   ` Bernd Kuhls
2016-01-31 20:17   ` Bernd Kuhls
2016-02-01 16:11 ` Peter Korsgaard
2016-02-01 17:45   ` Bernd Kuhls
2016-02-01 21:05   ` Bernd Kuhls
2016-02-01 22:42     ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox