]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Port to uClibc.
authorBruno Haible <bruno@clisp.org>
Sat, 20 Nov 2010 23:00:16 +0000 (00:00 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 7 Jun 2011 21:38:49 +0000 (23:38 +0200)
15 files changed:
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/localename.c
gettext-runtime/intl/printf-parse.c
gettext-runtime/intl/printf-parse.h
gettext-runtime/intl/relocatable.c
gettext-runtime/intl/vasnprintf.c
gettext-runtime/libasprintf/ChangeLog
gettext-runtime/libasprintf/printf-parse.c
gettext-runtime/libasprintf/printf-parse.h
gettext-runtime/libasprintf/vasnprintf.c
gettext-runtime/m4/ChangeLog
gettext-runtime/m4/glibc2.m4
gettext-runtime/m4/glibc21.m4
gnulib-local/ChangeLog
gnulib-local/lib/gettext.h

index e5154da806f80d8b8769f005436408bad5db709e..1b987e75745e88f50d8bb5c5a0ef93d9dc4bf97c 100644 (file)
@@ -1,3 +1,16 @@
+2010-11-20  Bruno Haible  <bruno@clisp.org>
+
+       Port to uClibc.
+       * localename.c (gl_locale_name_thread_unsafe, HAVE_LOCALE_NULL): Treat
+       uClibc like a non-glibc platform.
+       * printf-parse.h (FLAG_LOCALIZED): Likewise.
+       * printf-parse.c (PRINTF_PARSE): Likewise.
+       * relocatable.c (find_shared_library_fullname): Treat uClibc like
+       glibc.
+       * vasnprintf.c (decimal_point_char): Treat uClibc like glibc.
+       (VASNPRINTF): Treat uClibc like a non-glibc platform.
+       Reported by Mike Frysinger <vapier@gentoo.org>.
+
 2010-11-20  Bruno Haible  <bruno@clisp.org>
 
        Fix a comment.
index 89a9692bbdbfef58d59b25c994f4ac30c4ff6630..3ed7cf4a01a336515fb549013f788cd6157daed9 100644 (file)
@@ -2607,7 +2607,7 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
     locale_t thread_locale = uselocale (NULL);
     if (thread_locale != LC_GLOBAL_LOCALE)
       {
-#  if __GLIBC__ >= 2
+#  if __GLIBC__ >= 2 && !defined __UCLIBC__
         /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
            glibc < 2.12.
            See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>.  */
@@ -2771,7 +2771,7 @@ gl_locale_name_thread (int category, const char *categoryname)
    However it does not specify the exact format.  Neither do SUSV2 and
    ISO C 99.  So we can use this feature only on selected systems (e.g.
    those using GNU C Library).  */
-#if defined _LIBC || (defined __GLIBC__ && __GLIBC__ >= 2)
+#if defined _LIBC || ((defined __GLIBC__ && __GLIBC__ >= 2) && !defined __UCLIBC__)
 # define HAVE_LOCALE_NULL
 #endif
 
index 5fe8da6739c9ce5c683d5b42acf56ae5618c541a..7ae6d8998da72787c01c7ff41dd072e955cea1ba 100644 (file)
@@ -207,7 +207,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                   dp->flags |= FLAG_ZERO;
                   cp++;
                 }
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
               else if (*cp == 'I')
                 {
                   dp->flags |= FLAG_LOCALIZED;
index 82e5359b63dad0e928856e245fe33a43500a51c5..2dfd8b00fad6a6e4e082e45cd7453d71a47ba6db 100644 (file)
@@ -29,7 +29,7 @@
 #define FLAG_SPACE       8      /* space flag */
 #define FLAG_ALT        16      /* # flag */
 #define FLAG_ZERO       32
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
 # define FLAG_LOCALIZED 64      /* I flag, uses localized digits */
 #endif
 
index f0ac6d1058bc5fd852ac0f8265dd617228a5013b..243248ec57a8edc3b26b887ff2c476f4c9456458 100644 (file)
@@ -344,8 +344,9 @@ DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
 static void
 find_shared_library_fullname ()
 {
-#if defined __linux__ && __GLIBC__ >= 2
-  /* Linux has /proc/self/maps. glibc 2 has the getline() function.  */
+#if defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)
+  /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
+     function.  */
   FILE *fp;
 
   /* Open the current process' maps file.  It describes one VMA per line.  */
index 87389ebadb3e61092c5521066390aa33ba614b7d..1e521c8c5726ebefad33dcc1eaa65e151cc1aa58 100644 (file)
@@ -278,7 +278,7 @@ decimal_point_char (void)
      multithread-safe on glibc systems and MacOS X systems, but is not required
      to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
      localeconv() is rarely multithread-safe.  */
-#  if HAVE_NL_LANGINFO && (__GLIBC__ || (defined __APPLE__ && defined __MACH__))
+#  if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__))
   point = nl_langinfo (RADIXCHAR);
 #  elif 1
   char pointbuf[5];
@@ -4753,7 +4753,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   *fbp++ = ' ';
                 if (flags & FLAG_ALT)
                   *fbp++ = '#';
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
                 if (flags & FLAG_LOCALIZED)
                   *fbp++ = 'I';
 #endif
@@ -4840,7 +4840,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #endif
                   *fbp = dp->conversion;
 #if USE_SNPRINTF
-# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
                 fbp[1] = '%';
                 fbp[2] = 'n';
                 fbp[3] = '\0';
index d3dbb49de01d024033f5368228416755a5855dcb..0c2fcaeca3ef0c1eb799a1864f66a064363a30a3 100644 (file)
@@ -1,3 +1,12 @@
+2010-11-20  Bruno Haible  <bruno@clisp.org>
+
+       Port to uClibc.
+       * printf-parse.h (FLAG_LOCALIZED): Treat uClibc like a non-glibc platform.
+       * printf-parse.c (PRINTF_PARSE): Likewise.
+       * vasnprintf.c (decimal_point_char): Treat uClibc like glibc.
+       (VASNPRINTF): Treat uClibc like a non-glibc platform.
+       Reported by Mike Frysinger <vapier@gentoo.org>.
+
 2010-11-20  Bruno Haible  <bruno@clisp.org>
 
        Fix a comment.
index 5fe8da6739c9ce5c683d5b42acf56ae5618c541a..7ae6d8998da72787c01c7ff41dd072e955cea1ba 100644 (file)
@@ -207,7 +207,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                   dp->flags |= FLAG_ZERO;
                   cp++;
                 }
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
               else if (*cp == 'I')
                 {
                   dp->flags |= FLAG_LOCALIZED;
index 82e5359b63dad0e928856e245fe33a43500a51c5..2dfd8b00fad6a6e4e082e45cd7453d71a47ba6db 100644 (file)
@@ -29,7 +29,7 @@
 #define FLAG_SPACE       8      /* space flag */
 #define FLAG_ALT        16      /* # flag */
 #define FLAG_ZERO       32
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
 # define FLAG_LOCALIZED 64      /* I flag, uses localized digits */
 #endif
 
index 87389ebadb3e61092c5521066390aa33ba614b7d..1e521c8c5726ebefad33dcc1eaa65e151cc1aa58 100644 (file)
@@ -278,7 +278,7 @@ decimal_point_char (void)
      multithread-safe on glibc systems and MacOS X systems, but is not required
      to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
      localeconv() is rarely multithread-safe.  */
-#  if HAVE_NL_LANGINFO && (__GLIBC__ || (defined __APPLE__ && defined __MACH__))
+#  if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__))
   point = nl_langinfo (RADIXCHAR);
 #  elif 1
   char pointbuf[5];
@@ -4753,7 +4753,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   *fbp++ = ' ';
                 if (flags & FLAG_ALT)
                   *fbp++ = '#';
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
                 if (flags & FLAG_LOCALIZED)
                   *fbp++ = 'I';
 #endif
@@ -4840,7 +4840,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #endif
                   *fbp = dp->conversion;
 #if USE_SNPRINTF
-# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
                 fbp[1] = '%';
                 fbp[2] = 'n';
                 fbp[3] = '\0';
index a3136283d2d0156a2052c4b86e7e97aae0da1e9b..5268848407e7f7a02cb24b29c2294c461e4cb48e 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-20  Bruno Haible  <bruno@clisp.org>
+
+       Port to uClibc.
+       * glibc21.m4 (gl_GLIBC21): Treat uClibc like glibc.
+       * glibc2.m4 (gt_GLIBC2): Treat uClibc like a non-glibc platform.
+       Reported by Mike Frysinger <vapier@gentoo.org>.
+
 2010-10-04  Bruno Haible  <bruno@clisp.org>
 
        Make option --with-libpth-prefix work.
index f148c12c4533ecedc470bf21ea01b540da2ff219..b92208a1c69f9048f2b06437dc7754e1fdbd9095 100644 (file)
@@ -1,5 +1,5 @@
-# glibc2.m4 serial 2
-dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
+# glibc2.m4 serial 3
+dnl Copyright (C) 2000-2002, 2004, 20082010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -15,7 +15,7 @@ AC_DEFUN([gt_GLIBC2],
         [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
index 68ada9d4d5b844e3ff5be076ec1156c542f6630e..bd08b381e83dd2cb99fc9821f32722c328e03863 100644 (file)
@@ -1,23 +1,26 @@
-# glibc21.m4 serial 4
-dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
+# glibc21.m4 serial 5
+dnl Copyright (C) 2000-2002, 2004, 20082010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-# Test for the GNU C Library, version 2.1 or newer.
+# Test for the GNU C Library, version 2.1 or newer, or uClibc.
 # From Bruno Haible.
 
 AC_DEFUN([gl_GLIBC21],
   [
-    AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
+    AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
       [ac_cv_gnu_library_2_1],
-      [AC_EGREP_CPP([Lucky GNU user],
+      [AC_EGREP_CPP([Lucky],
         [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
   Lucky GNU user
  #endif
+#endif
+#ifdef __UCLIBC__
+ Lucky user
 #endif
         ],
         [ac_cv_gnu_library_2_1=yes],
index 7a8ee1449bc50516a9bff534c788bbcd88d79405..82049d2e28011e0a34b1ca3b1adfb198f9913f9b 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-20  Bruno Haible  <bruno@clisp.org>
+
+       Port to uClibc.
+       * lib/gettext.h: Treat uClibc like a non-glibc platform.
+       Reported by Mike Frysinger <vapier@gentoo.org>.
+
 2010-10-10  Bruno Haible  <bruno@clisp.org>
 
        Rely more on libtool.
index e591089ce1f26ba3597c0afb72031e304bfa35e6..0647fc3c0afe78694ea90b0eedd1e14c4fd9ccb7 100644 (file)
@@ -54,7 +54,7 @@
    it now, to make later inclusions of <libintl.h> a NOP.  */
 #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
 # include <cstdlib>
-# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
 #  include <libintl.h>
 # endif
 #endif