diff options
Diffstat (limited to 'scripts/build/companion_libs/330-gettext.sh')
-rw-r--r-- | scripts/build/companion_libs/330-gettext.sh | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/scripts/build/companion_libs/330-gettext.sh b/scripts/build/companion_libs/330-gettext.sh index 8828e5d..9fa3bdc 100644 --- a/scripts/build/companion_libs/330-gettext.sh +++ b/scripts/build/companion_libs/330-gettext.sh @@ -9,13 +9,11 @@ do_gettext_for_target() { :; } if [ "${CT_GETTEXT}" = "y" ]; then do_gettext_get() { - CT_GetFile "gettext-${CT_GETTEXT_VERSION}" \ - http://ftp.gnu.org/pub/gnu/gettext/ + CT_Fetch GETTEXT } do_gettext_extract() { - CT_Extract "gettext-${CT_GETTEXT_VERSION}" - CT_Patch "gettext" "${CT_GETTEXT_VERSION}" + CT_ExtractPatch GETTEXT } # Build gettext for running on build @@ -82,6 +80,28 @@ do_gettext_backend() { return ;; + # Starting with 0.21, gettext cannot build against uClibc-NG: gettext + # checks if it needs to use fopen wrapper (using gnulib) and newer versions + # of gnulib also check if fopen provided by the system supports 'e' and 'x' + # modes. In cross-compile environment, gnulib falls back to assuming fopen + # does not support these modes unless the target tuple is glibc or musl + # (rightly so, since these fopen modes are optional in uClibc-NG). + # Unfortunately, the fopen() wrapper does not compile against uClibc-NG's + # stdio.h then because it includes <stdio.h> after defining __need_FILE macro. + # It looks like two bugs, one in each of uClibc-ng and gnulib: + # - uClibc-ng does not include its internal headers with the definitions for the + # __BEGIN_NAMESPACE_STD/__END_NAMESPACE_STD macros, which therefore escape + # unsubstituted into the including code. + # - gnulib shouldn't expect the fopen() prototype if it only asked for FILE + # structure definition by defining the __need_FILE macro. + # Until the maintainers sort this out, disallow newer gettext versions if + # linking against uClibc-NG. + *-uclibc*) + if [ "${CT_GETTEXT_INCOMPATIBLE_WITH_UCLIBC_NG}" = "y" ]; then + CT_Abort "This version of gettext is incompatible with uClibc-NG" + fi + ;; + # A bit ugly. D__USE_MINGW_ANSI_STDIO=1 has its own {v}asprintf functions # but gettext configure doesn't see this flag when it checks for that. An # alternative may be to use CC="${host}-gcc ${cflags}" but that didn't @@ -112,7 +132,7 @@ do_gettext_backend() { CFLAGS="${cflags}" \ LDFLAGS="${ldflags}" \ ${CONFIG_SHELL} \ - "${CT_SRC_DIR}/gettext-${CT_GETTEXT_VERSION}/configure" \ + "${CT_SRC_DIR}/gettext/configure" \ --build=${CT_BUILD} \ --host="${host}" \ --prefix="${prefix}" \ @@ -133,7 +153,7 @@ do_gettext_backend() { "${extra_config[@]}" CT_DoLog EXTRA "Building gettext" - CT_DoExecLog ALL make ${JOBSFLAGS} + CT_DoExecLog ALL make ${CT_JOBSFLAGS} CT_DoLog EXTRA "Installing gettext" CT_DoExecLog ALL make install |