[OE-core] [PATCH][V2 3/3] fix cross-localedef build with gettext-native in sysroot

Andreas Müller schnitzeltony at googlemail.com
Mon Dec 15 10:31:17 UTC 2014


On Wed, Dec 3, 2014 at 1:40 PM, Andreas Müller
<schnitzeltony at googlemail.com> wrote:
> with previous patch applied and gettext build before cross-localedef,
> cross-localedef failed with.
>
> /usr/bin/ld: cannot find -lintl
>
> Signed-off-by: Andreas Müller <schnitzeltony at googlemail.com>
> ---
>  ...d-dragging-in-gettext-s-libintl.h-libintl.patch | 104 +++++++++++++++++++++
>  .../glibc/cross-localedef-native_2.20.bb           |   1 +
>  2 files changed, 105 insertions(+)
>  create mode 100644 meta/recipes-core/glibc/cross-localedef-native/avoid-dragging-in-gettext-s-libintl.h-libintl.patch
>
> diff --git a/meta/recipes-core/glibc/cross-localedef-native/avoid-dragging-in-gettext-s-libintl.h-libintl.patch b/meta/recipes-core/glibc/cross-localedef-native/avoid-dragging-in-gettext-s-libintl.h-libintl.patch
> new file mode 100644
> index 0000000..e19be03
> --- /dev/null
> +++ b/meta/recipes-core/glibc/cross-localedef-native/avoid-dragging-in-gettext-s-libintl.h-libintl.patch
> @@ -0,0 +1,104 @@
> +From d90df9d5f818df18ddccaf5405ffa65a63ea70a7 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony at googlemail.com>
> +Date: Wed, 3 Dec 2014 12:57:14 +0100
> +Subject: [PATCH] avoid dragging in gettext's libintl.h / libintl
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +modify configure.ac and configure to make sure that we don't need to revisit in
> +case autoconf is run in localedef subdirectory
> +
> +Upstream-Status: submitted [1]
> +
> +[1] https://github.com/kraj/localedef/pull/1
> +
> +Signed-off-by: Andreas Müller <schnitzeltony at googlemail.com>
> +---
> + localedef/configure         | 45 ---------------------------------------------
> + localedef/configure.ac      |  1 -
> + include/libintl.h |  2 +-
> + 3 files changed, 1 insertion(+), 47 deletions(-)
> +
> +diff --git a/localedef/configure b/localedef/configure
> +index 10f5f77..e4bb869 100755
> +--- a/localedef/configure
> ++++ b/localedef/configure
> +@@ -3893,51 +3893,6 @@ $as_echo "#define HAVE_PROGRAM_INVOCATION_SHORT_NAME 1" >>confdefs.h
> +
> + fi
> +
> +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5
> +-$as_echo_n "checking for gettext in -lintl... " >&6; }
> +-if ${ac_cv_lib_intl_gettext+:} false; then :
> +-  $as_echo_n "(cached) " >&6
> +-else
> +-  ac_check_lib_save_LIBS=$LIBS
> +-LIBS="-lintl  $LIBS"
> +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +-/* end confdefs.h.  */
> +-
> +-/* Override any GCC internal prototype to avoid an error.
> +-   Use char because int might match the return type of a GCC
> +-   builtin and then its argument prototype would still apply.  */
> +-#ifdef __cplusplus
> +-extern "C"
> +-#endif
> +-char gettext ();
> +-int
> +-main ()
> +-{
> +-return gettext ();
> +-  ;
> +-  return 0;
> +-}
> +-_ACEOF
> +-if ac_fn_c_try_link "$LINENO"; then :
> +-  ac_cv_lib_intl_gettext=yes
> +-else
> +-  ac_cv_lib_intl_gettext=no
> +-fi
> +-rm -f core conftest.err conftest.$ac_objext \
> +-    conftest$ac_exeext conftest.$ac_ext
> +-LIBS=$ac_check_lib_save_LIBS
> +-fi
> +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5
> +-$as_echo "$ac_cv_lib_intl_gettext" >&6; }
> +-if test "x$ac_cv_lib_intl_gettext" = xyes; then :
> +-  cat >>confdefs.h <<_ACEOF
> +-#define HAVE_LIBINTL 1
> +-_ACEOF
> +-
> +-  LIBS="-lintl $LIBS"
> +-
> +-fi
> +-
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nanosleep in -lposix4" >&5
> + $as_echo_n "checking for nanosleep in -lposix4... " >&6; }
> + if ${ac_cv_lib_posix4_nanosleep+:} false; then :
> +diff --git a/configure.ac b/configure.ac
> +index 33c8ff9..0004168 100644
> +--- a/localedef/configure.ac
> ++++ b/localedef/configure.ac
> +@@ -58,7 +58,6 @@ LOCAL_CHECK_FUNC([stpcpy], [#include <string.h>])
> + LOCAL_CHECK_FUNC([strsep], [#include <string.h>])
> + LOCAL_CHECK_VAR([program_invocation_name], [#include <errno.h>])
> + LOCAL_CHECK_VAR([program_invocation_short_name], [#include <errno.h>])
> +-AC_CHECK_LIB([intl], [gettext])
> + AC_CHECK_LIB([posix4], [nanosleep])
> +
> + # These two macros are taken from GCC's config/acx.m4.
> +diff --git a/include/libintl.h b/include/libintl.h
> +index 096aa8c..86143b6 100644
> +--- a/localedef/include/libintl.h
> ++++ b/localedef/include/libintl.h
> +@@ -1,5 +1,5 @@
> + #ifdef HAVE_LIBINTL_H
> +-#include_next <libintl.h>
> ++#include "../intl/libintl.h"
> + #endif
> +
> + #ifndef _
> +--
> +1.8.3.1
> +
> diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.20.bb b/meta/recipes-core/glibc/cross-localedef-native_2.20.bb
> index ccf56a9..50a280b 100644
> --- a/meta/recipes-core/glibc/cross-localedef-native_2.20.bb
> +++ b/meta/recipes-core/glibc/cross-localedef-native_2.20.bb
> @@ -19,6 +19,7 @@ PV = "2.20"
>  SRC_URI = "git://sourceware.org/git/glibc.git;branch=release/${PV}/master;name=glibc \
>             git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
>            file://fix_for_centos_5.8.patch \
> +           file://avoid-dragging-in-gettext-s-libintl.h-libintl.patch \
>             ${EGLIBCPATCHES} \
>            "
>  EGLIBCPATCHES = "\
> --
> 1.8.3.1
>
ping



More information about the Openembedded-core mailing list