From: Bruno Haible Date: Sun, 21 Nov 2010 02:04:18 +0000 (+0100) Subject: Port to uClibc. X-Git-Tag: v0.18.2~109 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5728f8ee0a4e39b9856e845dd8bef07aff972186;p=thirdparty%2Fgettext.git Port to uClibc. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 53d4011b3..dcc87a64b 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,9 @@ +2010-11-20 Bruno Haible + + Port to uClibc. + * dcigettext.c (_nl_find_msg): Treat uClibc like a non-glibc platform. + * loadmsgcat.c (get_sysdep_segment_value): Likewise. + 2010-11-20 Bruno Haible Ensure that is included before __GLIBC__ is tested. diff --git a/gettext-runtime/intl/dcigettext.c b/gettext-runtime/intl/dcigettext.c index b2add5db3..540c19272 100644 --- a/gettext-runtime/intl/dcigettext.c +++ b/gettext-runtime/intl/dcigettext.c @@ -1,5 +1,5 @@ /* Implementation of the internal dcigettext function. - Copyright (C) 1995-1999, 2000-2009 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -1153,7 +1153,8 @@ _nl_find_msg (struct loaded_l10nfile *domain_file, # if HAVE_ICONV /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5, we want to use transliteration. */ -# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ +# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \ + && !defined __UCLIBC__) \ || _LIBICONV_VERSION >= 0x0105 if (strchr (outcharset, '/') == NULL) { diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c index 9d49d086f..efc008d34 100644 --- a/gettext-runtime/intl/loadmsgcat.c +++ b/gettext-runtime/intl/loadmsgcat.c @@ -760,7 +760,9 @@ get_sysdep_segment_value (const char *name) /* Test for a glibc specific printf() format directive flag. */ if (name[0] == 'I' && name[1] == '\0') { -#if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) +#if defined _LIBC \ + || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) \ + && !defined __UCLIBC__) /* The 'I' flag, in numeric format directives, replaces ASCII digits with the 'outdigits' defined in the LC_CTYPE locale facet. This is used for Farsi (Persian), some Indic languages, and maybe Arabic. */ diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 24a26d3dd..1c2db66b4 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,13 @@ +2010-11-20 Bruno Haible + + Port to uClibc. + * write-po.c (wrap): Treat uClibc like a non-glibc platform. + * format-c-parse.h (HANDLE_I_FLAG): Likewise. + * po-charset.c (po_lex_charset_set): Likewise. + * recode-sr-latin.c (process): Likewise. + * x-python.c (set_current_file_source_encoding): Likewise. + * xgettext.c (main): Likewise. + 2010-11-13 Ihar Hrachyshka (tiny change) * plural-table.c (plural_table): Added Belarusian, copied from Russian diff --git a/gettext-tools/src/format-c-parse.h b/gettext-tools/src/format-c-parse.h index a585ccd52..bacfcef1f 100644 --- a/gettext-tools/src/format-c-parse.h +++ b/gettext-tools/src/format-c-parse.h @@ -1,5 +1,5 @@ /* Parsing C format strings. - Copyright (C) 2001-2004, 2006-2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2007, 2009-2010 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -159,7 +159,8 @@ struct spec /* The 'I' flag can only occur in glibc >= 2.2. On other platforms, gettext() filters it away even if it is present in the msgstr in the .mo file. */ # define HANDLE_I_FLAG \ - (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) + ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) \ + && !defined __UCLIBC__) #else # define HANDLE_I_FLAG 1 #endif diff --git a/gettext-tools/src/po-charset.c b/gettext-tools/src/po-charset.c index a48f90c9e..4c0dcdb91 100644 --- a/gettext-tools/src/po-charset.c +++ b/gettext-tools/src/po-charset.c @@ -1,5 +1,5 @@ /* Charset handling while reading PO files. - Copyright (C) 2001-2007 Free Software Foundation, Inc. + Copyright (C) 2001-2007, 2010 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -527,7 +527,8 @@ Message conversion to user's charset might not work.\n"), /* Use iconv() to parse multibyte characters. */ #if HAVE_ICONV /* Avoid glibc-2.1 bug with EUC-KR. */ -# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + && !defined _LIBICONV_VERSION if (strcmp (po_lex_charset, "EUC-KR") == 0) po_lex_iconv = (iconv_t)(-1); else diff --git a/gettext-tools/src/recode-sr-latin.c b/gettext-tools/src/recode-sr-latin.c index 6f656949f..43b3382ae 100644 --- a/gettext-tools/src/recode-sr-latin.c +++ b/gettext-tools/src/recode-sr-latin.c @@ -1,5 +1,5 @@ /* Recode Serbian text from Cyrillic to Latin script. - Copyright (C) 2006-2007 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2010 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify @@ -275,7 +275,8 @@ process (FILE *stream) { #if HAVE_ICONV /* Avoid glibc-2.1 bug with EUC-KR. */ -# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + && !defined _LIBICONV_VERSION if (strcmp (locale_code, "EUC-KR") != 0) # endif { diff --git a/gettext-tools/src/write-po.c b/gettext-tools/src/write-po.c index 1434c2c70..dd516f2cc 100644 --- a/gettext-tools/src/write-po.c +++ b/gettext-tools/src/write-po.c @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995-1998, 2000-2009 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2010 Free Software Foundation, Inc. This file was written by Peter Miller @@ -577,7 +577,8 @@ wrap (const message_ty *mp, ostream_t stream, conv = (iconv_t)(-1); else /* Avoid glibc-2.1 bug with EUC-KR. */ -# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + && !defined _LIBICONV_VERSION if (strcmp (canon_charset, "EUC-KR") == 0) conv = (iconv_t)(-1); else diff --git a/gettext-tools/src/x-python.c b/gettext-tools/src/x-python.c index a6e84eb11..fcc515044 100644 --- a/gettext-tools/src/x-python.c +++ b/gettext-tools/src/x-python.c @@ -1,5 +1,5 @@ /* xgettext Python backend. - Copyright (C) 2002-2003, 2005-2009 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2010 Free Software Foundation, Inc. This file was written by Bruno Haible , 2002. @@ -612,7 +612,8 @@ set_current_file_source_encoding (const char *canon_encoding) iconv_t cd; /* Avoid glibc-2.1 bug with EUC-KR. */ -# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + && !defined _LIBICONV_VERSION if (strcmp (xgettext_current_file_source_encoding, "EUC-KR") == 0) cd = (iconv_t)(-1); else diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index 919f30b39..faf816118 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -682,7 +682,8 @@ xgettext cannot work without keywords to look for")); iconv_t cd; /* Avoid glibc-2.1 bug with EUC-KR. */ -# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION +# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \ + && !defined _LIBICONV_VERSION if (strcmp (xgettext_global_source_encoding, "EUC-KR") == 0) cd = (iconv_t)(-1); else diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index e751b7e5f..2f606229c 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,10 @@ +2010-11-20 Bruno Haible + + Port to uClibc. + * gettext-6-prg.c: Treat uClibc like a non-glibc platform. + * gettext-7-prg.c: Likewise. + * format-c-5-prg.c: Likewise. + 2010-08-31 Bruno Haible Avoid test leftovers on MacOS X 10.5. diff --git a/gettext-tools/tests/format-c-5-prg.c b/gettext-tools/tests/format-c-5-prg.c index 40a30513d..942320b75 100644 --- a/gettext-tools/tests/format-c-5-prg.c +++ b/gettext-tools/tests/format-c-5-prg.c @@ -1,5 +1,5 @@ /* Test program, used by the format-c-5 test. - Copyright (C) 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2004, 2006, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ #include "xsetenv.h" /* For %Id to work, we need the real setlocale(), not the fake one. */ -#if !(__GLIBC__ >= 2) +#if !(__GLIBC__ >= 2 && !defined __UCLIBC__) # include "setlocale.c" #endif @@ -55,7 +55,7 @@ main (int argc, char *argv[]) s = gettext ("father of %d children"); en = "father of %d children"; -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) +#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__ expected_translation = "Vater von %Id Kindern"; expected_result = "Vater von \xdb\xb5 Kindern"; #else diff --git a/gettext-tools/tests/gettext-6-prg.c b/gettext-tools/tests/gettext-6-prg.c index dda514c41..36a8e9d78 100644 --- a/gettext-tools/tests/gettext-6-prg.c +++ b/gettext-tools/tests/gettext-6-prg.c @@ -1,5 +1,5 @@ /* Test program, used by the gettext-6 test. - Copyright (C) 2005-2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ #include #include -#if USE_POSIX_THREADS && (__GLIBC__ >= 2 || (defined __APPLE__ && defined __MACH__)) && HAVE_USELOCALE +#if USE_POSIX_THREADS && ((__GLIBC__ >= 2 && !defined __UCLIBC__) || (defined __APPLE__ && defined __MACH__)) && HAVE_USELOCALE #include diff --git a/gettext-tools/tests/gettext-7-prg.c b/gettext-tools/tests/gettext-7-prg.c index a8e69e77e..d60efe203 100644 --- a/gettext-tools/tests/gettext-7-prg.c +++ b/gettext-tools/tests/gettext-7-prg.c @@ -1,5 +1,5 @@ /* Test program, used by the gettext-7 test. - Copyright (C) 2005-2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ #include #include -#if USE_POSIX_THREADS && (__GLIBC__ >= 2 || (defined __APPLE__ && defined __MACH__)) && HAVE_USELOCALE +#if USE_POSIX_THREADS && ((__GLIBC__ >= 2 && !defined __UCLIBC__) || (defined __APPLE__ && defined __MACH__)) && HAVE_USELOCALE #include diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog index 82049d2e2..b8aae741d 100644 --- a/gnulib-local/ChangeLog +++ b/gnulib-local/ChangeLog @@ -1,3 +1,11 @@ +2010-11-20 Bruno Haible + + Port to uClibc. + * lib/basename.h: Treat uClibc like glibc. + * lib/basename.c: Likewise. + * lib/iconv-ostream.oo.c (iconv_ostream::write_mem, + iconv_ostream::free, iconv_ostream_create): Likewise. + 2010-11-20 Bruno Haible Port to uClibc. diff --git a/gnulib-local/lib/basename.c b/gnulib-local/lib/basename.c index 76ed12149..dcab5e759 100644 --- a/gnulib-local/lib/basename.c +++ b/gnulib-local/lib/basename.c @@ -1,5 +1,5 @@ /* Return the name-within-directory of a file name. - Copyright (C) 1996-1999, 2000-2002, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 1996-1999, 2000-2002, 2004, 2006, 2010 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. @@ -22,7 +22,7 @@ /* Specification. */ #include "basename.h" -#if !(__GLIBC__ >= 2) +#if !(__GLIBC__ >= 2 || defined __UCLIBC__) #include #include diff --git a/gnulib-local/lib/basename.h b/gnulib-local/lib/basename.h index b3e4d49fb..908cc3e2c 100644 --- a/gnulib-local/lib/basename.h +++ b/gnulib-local/lib/basename.h @@ -1,5 +1,5 @@ /* Pathname hacking. - Copyright (C) 2001-2003 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2010 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -27,7 +27,7 @@ extern "C" { #endif -#if !(__GLIBC__ >= 2) +#if !(__GLIBC__ >= 2 || defined __UCLIBC__) /* When not using the GNU libc we use the basename implementation we provide here. */ extern char *gnu_basename (const char *); diff --git a/gnulib-local/lib/iconv-ostream.oo.c b/gnulib-local/lib/iconv-ostream.oo.c index 653668563..c33c53aab 100644 --- a/gnulib-local/lib/iconv-ostream.oo.c +++ b/gnulib-local/lib/iconv-ostream.oo.c @@ -1,5 +1,5 @@ /* Output stream that converts the output to another encoding. - Copyright (C) 2006-2007 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2010 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify @@ -98,7 +98,8 @@ iconv_ostream::write_mem (iconv_ostream_t stream, const void *data, size_t len) size_t res = iconv (stream->cd, (ICONV_CONST char **) &inptr, &insize, &outptr, &outsize); - #if !defined _LIBICONV_VERSION && !defined __GLIBC__ + #if !defined _LIBICONV_VERSION \ + && !(defined __GLIBC__ && !defined __UCLIBC__) /* Irix iconv() inserts a NUL byte if it cannot convert. NetBSD iconv() inserts a question mark if it cannot convert. Only GNU libiconv and GNU libc are known to prefer to fail rather @@ -152,7 +153,9 @@ iconv_ostream::free (iconv_ostream_t stream) /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */ #if defined _LIBICONV_VERSION \ - || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun) + || !(((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) \ + && !defined __UCLIBC__) \ + || defined __sun) { char outbuffer[2048]; char *outptr = outbuffer; @@ -188,7 +191,9 @@ iconv_ostream_create (const char *from_encoding, const char *to_encoding, stream->to_encoding = xstrdup (to_encoding); /* Avoid glibc-2.1 bug with EUC-KR. */ - #if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION + #if ((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) \ + && !defined __UCLIBC__) \ + && !defined _LIBICONV_VERSION if (c_strcasecmp (from_encoding, "EUC-KR") == 0 || c_strcasecmp (to_encoding, "EUC-KR") == 0) stream->cd = (iconv_t)(-1):