From: Thomas Petazzoni Date: Wed, 26 May 2010 14:14:39 +0200 Subject: [Buildroot] [git commit master] Add documentation on gettext integration Message-ID: <20100526122000.8D14F1EB@busybox.osuosl.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net commit: http://git.buildroot.net/buildroot/commit/?id=77e026bbfabe01fc4c4f3410d283dbd7d836162a branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master Signed-off-by: Thomas Petazzoni --- docs/buildroot.html | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/docs/buildroot.html b/docs/buildroot.html index abe822f..3702b44 100644 --- a/docs/buildroot.html +++ b/docs/buildroot.html @@ -798,6 +798,8 @@ community support.

  • Manual Makefile : tutorial
  • +
  • Gettext integration and + interaction with packages
  • Package directory

    @@ -1583,6 +1585,62 @@ LIBFOO_POST_PATCH_HOOKS += LIBFOO_POST_PATCH_FIXUP line 40, which is used by Buildroot to download, compile, and then install this package.

    +

    Gettext integration and + interaction with packages

    + +

    Many packages that support internationalization use the gettext + library. Dependency on this library are fairly complicated and + therefore deserves a few explanations.

    + +

    The uClibc C library doesn't implement gettext + functionality, therefore with this C library, a separate gettext + must be compiled. On the other hand, the glibc C library + does integrate its own gettext, and in this case, the separate + gettext library should not be compiled, because it creates various + kind of build failures.

    + +

    Additionnaly, some packages (such as libglib2) do require + gettext unconditionnally, while other packages (those who + support --disable-nls in general) only require + gettext when locale support is enabled.

    + +

    Therefore, Buildroot defines two configuration options:

    + +
      +
    • BR2_NEEDS_GETTEXT, which is true as soon as the + toolchain doesn't provide its own gettext implementation
    • + +
    • BR2_NEEDS_GETTEXT_IF_LOCALE, which is true if + the toolchain doesn't provide its own gettext implementation and + if locale support is enabled
    • + +
    + +

    Therefore, packages that unconditionnally need gettext should:

    + +
      +
    1. Use select BR2_PACKAGE_GNUTTEXT if + BR2_NEEDS_GETTEXT and possibly select + BR2_PACKAGE_LIBINTL if BR2_NEEDS_GETTEXT if libintl is + also needed
    2. + +
    3. Use $(if $(BR2_NEEDS_GETTEXT),gettext) in the + package DEPENDENCIES variable
    4. +
    + +

    Packages that need gettext only when locale support is enabled + should:

    + +
      +
    1. Use select BR2_PACKAGE_GNUTTEXT if + BR2_NEEDS_GETTEXT_IF_LOCALE and possibly select + BR2_PACKAGE_LIBINTL if BR2_NEEDS_GETTEXT_IF_LOCALE if + libintl is also needed
    2. + +
    3. Use $(if + $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) in the + package DEPENDENCIES variable
    4. +

    Conclusion

    -- 1.6.3.3