]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Port to uClibc.
authorBruno Haible <bruno@clisp.org>
Sun, 21 Nov 2010 02:04:18 +0000 (03:04 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 7 Jun 2011 21:38:50 +0000 (23:38 +0200)
18 files changed:
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/dcigettext.c
gettext-runtime/intl/loadmsgcat.c
gettext-tools/src/ChangeLog
gettext-tools/src/format-c-parse.h
gettext-tools/src/po-charset.c
gettext-tools/src/recode-sr-latin.c
gettext-tools/src/write-po.c
gettext-tools/src/x-python.c
gettext-tools/src/xgettext.c
gettext-tools/tests/ChangeLog
gettext-tools/tests/format-c-5-prg.c
gettext-tools/tests/gettext-6-prg.c
gettext-tools/tests/gettext-7-prg.c
gnulib-local/ChangeLog
gnulib-local/lib/basename.c
gnulib-local/lib/basename.h
gnulib-local/lib/iconv-ostream.oo.c

index 53d4011b390de1482b4ba2e76f2c720b56986b65..dcc87a64b12e1f814557ff6aa1815c85047b4f43 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-20  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        Ensure that <features.h> is included before __GLIBC__ is tested.
index b2add5db3ecbd258fa92371b1e689bde565919a6..540c192728f001dc13e0202ce6e9eb275b4e2e06 100644 (file)
@@ -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)
                        {
index 9d49d086f4cd6b713ea3e9da0543af9890b06baa..efc008d34573462f6870fb9b4c556823e73caf25 100644 (file)
@@ -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.  */
index 24a26d3dd6768c093fe93929130af862e5bbc766..1c2db66b4dcb1adae4eb5ebcb64ec9436be6f39b 100644 (file)
@@ -1,3 +1,13 @@
+2010-11-20  Bruno Haible  <bruno@clisp.org>
+
+       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  <ihar.hrachyshka@gmail.com>  (tiny change)
 
        * plural-table.c (plural_table): Added Belarusian, copied from Russian
index a585ccd52e721f35e241330112fbadec7f6e51be..bacfcef1fae4a3478b2b4e07a40957a918b07829 100644 (file)
@@ -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 <haible@clisp.cons.org>, 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
index a48f90c9e456cbd0ed358533c38163e56deacbfc..4c0dcdb91763fc06321315fa27f6e6812a0268df 100644 (file)
@@ -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 <haible@clisp.cons.org>, 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
index 6f656949f881edf20f924e48bf385690f83f2bb9..43b3382ae528d39815f82a27854979c1fcd59e75 100644 (file)
@@ -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 <bruno@clisp.org>, 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
         {
index 1434c2c70a20f97fd065ac2b135f2be90b1ab91a..dd516f2ccb41c51098da4763619b171b26673289 100644 (file)
@@ -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 <millerp@canb.auug.org.au>
 
@@ -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
index a6e84eb117675b3bf1cb5b5476cbf87bf920792d..fcc5150440c8e81d936fe2a5d4e76a9637b8d3c3 100644 (file)
@@ -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 <haible@clisp.cons.org>, 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
index 919f30b39a203a60ff323878ea72ca0724d5e43c..faf816118e73a3445257353614eb56b64507f9bf 100644 (file)
@@ -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
index e751b7e5f66da0b7bc0d1fcf8c5ac1e2b0a6acf4..2f606229c9a8a4b00b4e5b78fd4ee0229b4a4bf5 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-20  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        Avoid test leftovers on MacOS X 10.5.
index 40a30513d148934558d5b84b3082308bf331f280..942320b75ac96c10b63bd7c4016e4d6e60f8f177 100644 (file)
@@ -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
index dda514c41bc893eb7a0b4b263e36567c8489d701..36a8e9d78719302367d6ee2c62df92d0da80e80f 100644 (file)
@@ -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 <stdio.h>
 #include <string.h>
 
-#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 <pthread.h>
 
index a8e69e77eca964b4689e10ed64e489492bf2af0d..d60efe2037b3b7f07e5963cc1f1080be53dc6719 100644 (file)
@@ -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 <stdio.h>
 #include <string.h>
 
-#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 <pthread.h>
 
index 82049d2e28011e0a34b1ca3b1adfb198f9913f9b..b8aae741dc0246f6641f92dcbc069a6e632101c7 100644 (file)
@@ -1,3 +1,11 @@
+2010-11-20  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        Port to uClibc.
index 76ed121499255bd5987665bef156aa022a9eff88..dcab5e7595864010c1ef339d92769e74400acf0a 100644 (file)
@@ -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 <stdio.h>
 #include <assert.h>
index b3e4d49fb82c4dd9aa263f232b70f1887d1cadc9..908cc3e2c6352bbbeb2fe346c116292d598b945d 100644 (file)
@@ -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 <haible@clisp.cons.org>, 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 *);
index 6536685637128ca3f211deb16565eb5761ec1147..c33c53aab72c80e9f40d43dbe1cbda6a893335ba 100644 (file)
@@ -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 <bruno@clisp.org>, 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):