Port to uClibc.
authorBruno Haible <bruno@clisp.org>
Sat, 20 Nov 2010 17:54:00 +0000 (18:54 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 20 Nov 2010 17:54:00 +0000 (18:54 +0100)
* lib/relocatable.c (find_shared_library_fullname): Treat uClibc like
glibc.
* lib/strerror_r.c: Likewise.
* m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Likewise.
* m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Likewise.
* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Likewise.
* m4/glibc21.m4 (gl_GLIBC21): Likewise.
* tests/test-sigaction.c (handler, main): Likewise.
* lib/localename.c (gl_locale_name_thread_unsafe, HAVE_LOCALE_NULL):
Treat uClibc like a non-glibc platform.
* lib/propername.c (proper_name_utf8): Likewise.
* lib/spawn.in.h: Likewise.
* lib/striconv.c (mem_cd_iconv, str_cd_iconv, str_iconv): Likewise.
* lib/striconveh.c (iconveh_open, iconv_carefully, iconv_carefully_1,
mem_cd_iconveh_internal): Likewise.
* lib/striconveha.c (mem_iconveha, str_iconveha): Likewise.
* lib/string.in.h (memchr, memrchr, rawmemchr, strchrnul, strpbrk,
strstr, strcasestr): Likewise.
* lib/unicodeio.c (unicode_to_mb): Likewise.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Likewise.
* m4/getline.m4 (gl_FUNC_GETLINE): Likewise.
* m4/glibc2.m4 (gt_GLIBC2): Likewise.
* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Likewise.
* m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE, gl_FUNC_MEMMEM): Likewise.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_A): Likewise.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE, gl_FUNC_STRCASESTR):
Likewise.
* m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE, gl_FUNC_STRSTR): Likewise.
* m4/strtod.m4 (gl_FUNC_STRTOD): Likewise.
* m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H): Likewise.
* m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise.
* m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Likewise.
* m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
* m4/wchar_h.m4 (gl_WCHAR_H): Likewise.
* tests/test-getopt.h (OPTIND_MIN): Likewise.
* tests/test-striconveha.c (main): Likewise.
* doc/posix-functions/getdelim.texi: Mention an uClibc bug.
* doc/posix-functions/getline.texi: Likewise.
Reported by Mike Frysinger <vapier@gentoo.org>.

56 files changed:
ChangeLog
build-aux/link-warning.h
doc/posix-functions/getdelim.texi
doc/posix-functions/getline.texi
lib/fcntl.in.h
lib/freading.c
lib/freading.h
lib/gettext.h
lib/hard-locale.c
lib/localename.c
lib/mbrtowc.c
lib/printf-parse.c
lib/printf-parse.h
lib/propername.c
lib/relocatable.c
lib/spawn.in.h
lib/strerror_r.c
lib/striconv.c
lib/striconveh.c
lib/striconveha.c
lib/string.in.h
lib/unicodeio.c
lib/uniconv/u16-conv-from-enc.c
lib/uniconv/u16-conv-to-enc.c
lib/uniconv/u16-strconv-to-enc.c
lib/uniconv/u32-conv-from-enc.c
lib/uniconv/u32-conv-to-enc.c
lib/uniconv/u32-strconv-to-enc.c
lib/unistr/u8-stpncpy.c
lib/unistr/u8-strnlen.c
lib/vasnprintf.c
lib/xmalloc.c
m4/arpa_inet_h.m4
m4/duplocale.m4
m4/fsusage.m4
m4/getdelim.m4
m4/getline.m4
m4/glibc2.m4
m4/glibc21.m4
m4/iconv_open.m4
m4/memmem.m4
m4/printf.m4
m4/strcasestr.m4
m4/strstr.m4
m4/strtod.m4
m4/sys_ioctl_h.m4
m4/sys_select_h.m4
m4/sys_socket_h.m4
m4/sys_times_h.m4
m4/unistd_h.m4
m4/wchar_h.m4
tests/test-getopt.h
tests/test-sigaction.c
tests/test-striconveha.c
tests/test-vasnprintf-posix.c
tests/test-vasnprintf-posix3.c

index 294b3aa..2aa86b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,49 @@
 2010-11-20  Bruno Haible  <bruno@clisp.org>
 
+       Port to uClibc.
+       * lib/relocatable.c (find_shared_library_fullname): Treat uClibc like
+       glibc.
+       * lib/strerror_r.c: Likewise.
+       * m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Likewise.
+       * m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Likewise.
+       * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Likewise.
+       * m4/glibc21.m4 (gl_GLIBC21): Likewise.
+       * tests/test-sigaction.c (handler, main): Likewise.
+       * lib/localename.c (gl_locale_name_thread_unsafe, HAVE_LOCALE_NULL):
+       Treat uClibc like a non-glibc platform.
+       * lib/propername.c (proper_name_utf8): Likewise.
+       * lib/spawn.in.h: Likewise.
+       * lib/striconv.c (mem_cd_iconv, str_cd_iconv, str_iconv): Likewise.
+       * lib/striconveh.c (iconveh_open, iconv_carefully, iconv_carefully_1,
+       mem_cd_iconveh_internal): Likewise.
+       * lib/striconveha.c (mem_iconveha, str_iconveha): Likewise.
+       * lib/string.in.h (memchr, memrchr, rawmemchr, strchrnul, strpbrk,
+       strstr, strcasestr): Likewise.
+       * lib/unicodeio.c (unicode_to_mb): Likewise.
+       * m4/getdelim.m4 (gl_FUNC_GETDELIM): Likewise.
+       * m4/getline.m4 (gl_FUNC_GETLINE): Likewise.
+       * m4/glibc2.m4 (gt_GLIBC2): Likewise.
+       * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Likewise.
+       * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE, gl_FUNC_MEMMEM): Likewise.
+       * m4/printf.m4 (gl_PRINTF_DIRECTIVE_A): Likewise.
+       * m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE, gl_FUNC_STRCASESTR):
+       Likewise.
+       * m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE, gl_FUNC_STRSTR): Likewise.
+       * m4/strtod.m4 (gl_FUNC_STRTOD): Likewise.
+       * m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H): Likewise.
+       * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise.
+       * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Likewise.
+       * m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise.
+       * m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
+       * m4/wchar_h.m4 (gl_WCHAR_H): Likewise.
+       * tests/test-getopt.h (OPTIND_MIN): Likewise.
+       * tests/test-striconveha.c (main): Likewise.
+       * doc/posix-functions/getdelim.texi: Mention an uClibc bug.
+       * doc/posix-functions/getline.texi: Likewise.
+       Reported by Mike Frysinger <vapier@gentoo.org>.
+
+2010-11-20  Bruno Haible  <bruno@clisp.org>
+
        nproc: Fix condition.
        * lib/nproc.c: Test HAVE_PTHREAD_GETAFFINITY_NP, not
        HAVE_PTHREAD_AFFINITY_NP.
index 4c1e32d..cd01b50 100644 (file)
@@ -24,7 +24,7 @@
      Testing __GLIBC__ is sufficient for asserting that GNU ld is in use.
      Testing __ELF__ guarantees the ELF object format.
      Testing __GNUC__ is necessary for the compound expression syntax.  */
-# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__
+# if (defined __GLIBC__ || defined __UCLIBC__) && defined __ELF__ && defined __GNUC__
 #  define GL_LINK_WARNING(message) \
      GL_LINK_WARNING1 (__FILE__, __LINE__, message)
 #  define GL_LINK_WARNING1(file, line, message) \
index fac1196..fb59375 100644 (file)
@@ -22,4 +22,7 @@ FreeBSD 8.0.
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+This function has quadratic running time for long lines on some platforms:
+uClibc 0.9.31.
 @end itemize
index 375473b..a3f7d64 100644 (file)
@@ -25,4 +25,7 @@ FreeBSD 8.0.
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+This function has quadratic running time for long lines on some platforms:
+uClibc 0.9.31.
 @end itemize
index 13f5dde..6d1888d 100644 (file)
@@ -32,7 +32,7 @@
    extern "C" { ... } block, which leads to errors in C++ mode with the
    overridden <sys/stat.h> from gnulib.  These errors are known to be gone
    with g++ version >= 4.3.  */
-#if !defined __GLIBC__ || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
 # include <sys/stat.h>
 #endif
 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
index bb78a1b..202c3f7 100644 (file)
@@ -23,7 +23,7 @@
 
 /* Don't use glibc's __freading function in glibc < 2.7, see
    <http://sourceware.org/bugzilla/show_bug.cgi?id=4359>  */
-#if !(HAVE___FREADING && (!defined __GLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)))
+#if !(HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)))
 
 bool
 freading (FILE *fp)
index 9b3b6c6..5bc12fb 100644 (file)
@@ -32,7 +32,7 @@
 
    STREAM must not be wide-character oriented.  */
 
-#if HAVE___FREADING && (!defined __GLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
+#if HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
 /* Solaris >= 7, not glibc >= 2.2, but glibc >= 2.7  */
 
 # include <stdio_ext.h>
index 6a069c4..892bf22 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
index c868ac0..14a0036 100644 (file)
@@ -26,6 +26,8 @@
 
 #ifdef __GLIBC__
 # define GLIBC_VERSION __GLIBC__
+#elif defined __UCLIBC__
+# define GLIBC_VERSION 2
 #else
 # define GLIBC_VERSION 0
 #endif
index ea646c5..d398053 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 5c2650e..25dac59 100644 (file)
@@ -91,7 +91,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
 
     /* Here m > 0.  */
 
-# if __GLIBC__
+# if __GLIBC__ || defined __UCLIBC__
     /* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
     mbtowc (NULL, NULL, 0);
 # endif
index d54ce6d..04072a5 100644 (file)
@@ -206,7 +206,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 67a4a2a..6bd11df 100644 (file)
@@ -33,7 +33,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 3971f3f..fd105ee 100644 (file)
@@ -198,7 +198,8 @@ proper_name_utf8 (const char *name_ascii, const char *name_utf8)
       name_converted = alloc_name_converted =
         xstr_iconv (name_utf8, "UTF-8", locale_code);
 
-# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
+# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
+      && !defined __UCLIBC__) \
      || _LIBICONV_VERSION >= 0x0105
       {
         char *converted_translit;
index f0ac6d1..243248e 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 26c3c10..b29e25a 100644 (file)
@@ -32,7 +32,7 @@
 
 /* Get definitions of 'struct sched_param' and 'sigset_t'.
    But avoid namespace pollution on glibc systems.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <sched.h>
 # include <signal.h>
 #endif
index ec89762..dc7ea88 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <errno.h>
 
-#if HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2) && !EXTEND_STRERROR_R
+#if HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__) && !EXTEND_STRERROR_R
 
 /* The system's strerror_r function is OK, except that its third argument
    is 'int', not 'size_t'.  */
@@ -90,7 +90,7 @@ strerror_r (int errnum, char *buf, size_t buflen)
   return (ret < 0 ? errno : ret);
 }
 
-#elif __GLIBC__ >= 2 && HAVE___XPG_STRERROR_R /* glibc >= 2.3.4 */ && !EXTEND_STRERROR_R
+#elif (__GLIBC__ >= 2 || defined __UCLIBC__) && HAVE___XPG_STRERROR_R /* glibc >= 2.3.4 */ && !EXTEND_STRERROR_R
 
 int
 strerror_r (int errnum, char *buf, size_t buflen)
@@ -101,7 +101,7 @@ strerror_r (int errnum, char *buf, size_t buflen)
   return (ret < 0 ? errno : 0);
 }
 
-#else /* (__GLIBC__ >= 2 ? !HAVE___XPG_STRERROR_R : !HAVE_DECL_STRERROR_R) || EXTEND_STRERROR_R */
+#else /* (__GLIBC__ >= 2 || defined __UCLIBC__ ? !HAVE___XPG_STRERROR_R : !HAVE_DECL_STRERROR_R) || EXTEND_STRERROR_R */
 
 # include "glthread/lock.h"
 
index 35bae57..19b3d3c 100644 (file)
@@ -1,5 +1,5 @@
 /* Charset conversion.
-   Copyright (C) 2001-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -50,7 +50,8 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
 
   /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
   /* Set to the initial state.  */
   iconv (cd, NULL, NULL, NULL, NULL);
 # endif
@@ -82,7 +83,7 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
             else
               return -1;
           }
-# 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
@@ -97,7 +98,8 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
       }
     /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
     {
       char *outptr = tmpbuf;
       size_t outsize = tmpbufsize;
@@ -131,7 +133,8 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
 
   /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
   /* Return to the initial state.  */
   iconv (cd, NULL, NULL, NULL, NULL);
 # endif
@@ -156,7 +159,7 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
             else
               goto fail;
           }
-# 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
@@ -170,7 +173,8 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
       }
     /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
     {
       size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
 
@@ -207,7 +211,7 @@ str_cd_iconv (const char *src, iconv_t cd)
      to a trailing NUL byte in the output.  But not for UTF-7.  So that this
      function is usable for UTF-7, we have to exclude the NUL byte from the
      conversion and add it by hand afterwards.  */
-# 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
@@ -272,7 +276,8 @@ str_cd_iconv (const char *src, iconv_t cd)
 
   /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
   /* Set to the initial state.  */
   iconv (cd, NULL, NULL, NULL, NULL);
 # endif
@@ -324,7 +329,8 @@ str_cd_iconv (const char *src, iconv_t cd)
       }
     /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
     for (;;)
       {
         /* Here outptr + outbytes_remaining = result + result_size - 1.  */
@@ -410,7 +416,8 @@ str_iconv (const char *src, const char *from_codeset, const char *to_codeset)
       char *result;
 
       /* 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 (c_strcasecmp (from_codeset, "EUC-KR") == 0
           || c_strcasecmp (to_codeset, "EUC-KR") == 0)
         {
index 8d73d29..efbbe72 100644 (file)
@@ -52,7 +52,8 @@ iconveh_open (const char *to_codeset, const char *from_codeset, iconveh_t *cdp)
   iconv_t cd2;
 
   /* 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 (c_strcasecmp (from_codeset, "EUC-KR") == 0
       || c_strcasecmp (to_codeset, "EUC-KR") == 0)
     {
@@ -79,7 +80,9 @@ iconveh_open (const char *to_codeset, const char *from_codeset, iconveh_t *cdp)
     }
 
   if (STRCASEEQ (to_codeset, "UTF-8", 'U','T','F','-','8',0,0,0,0)
-# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 || _LIBICONV_VERSION >= 0x0105
+# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
+      && !defined __UCLIBC__) \
+     || _LIBICONV_VERSION >= 0x0105
       || c_strcasecmp (to_codeset, "UTF-8//TRANSLIT") == 0
 # endif
      )
@@ -136,7 +139,7 @@ iconveh_close (const iconveh_t *cd)
 /* iconv_carefully is like iconv, except that it stops as soon as it encounters
    a conversion error, and it returns in *INCREMENTED a boolean telling whether
    it has incremented the input pointers past the error location.  */
-# 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
@@ -244,7 +247,7 @@ iconv_carefully_1 (iconv_t cd,
 
   *inbuf = inptr;
   *inbytesleft = inptr_end - inptr;
-# 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
@@ -403,7 +406,8 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
 
     /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
     /* Set to the initial state.  */
     iconv (cd, NULL, NULL, NULL, NULL);
 # endif
@@ -531,7 +535,8 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
   /* Now get the conversion state back to the initial state.
      But avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 #if defined _LIBICONV_VERSION \
-    || !((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) || defined __sun)
+    || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+         || defined __sun)
   for (;;)
     {
       char *outptr = result + length;
@@ -606,7 +611,8 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
 
     /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
     /* Set to the initial state.  */
     if (cd1 != (iconv_t)(-1))
       iconv (cd1, NULL, NULL, NULL, NULL);
@@ -658,7 +664,8 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
             /* Now get the conversion state of CD1 back to the initial state.
                But avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
             if (cd1 != (iconv_t)(-1))
               res1 = iconv (cd1, NULL, NULL, &out1ptr, &out1size);
             else
@@ -740,7 +747,8 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
                     /* Now get the conversion state of CD1 back to the initial
                        state.  But avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
                     if (cd2 != (iconv_t)(-1))
                       res2 = iconv (cd2, NULL, NULL, &out2ptr, &out2size);
                     else
@@ -883,7 +891,7 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
                               }
                             length = out2ptr - result;
                           }
-# 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.
index ade0ec7..2849065 100644 (file)
@@ -1,5 +1,5 @@
 /* Character set conversion with error handling and autodetection.
-   Copyright (C) 2002, 2005, 2007, 20092010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005, 2007, 2009-2010 Free Software Foundation, Inc.
    Written by Bruno Haible.
 
    This program is free software: you can redistribute it and/or modify
@@ -226,7 +226,9 @@ mem_iconveha (const char *src, size_t srclen,
 
   /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
      we want to use transliteration.  */
-#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 || _LIBICONV_VERSION >= 0x0105
+#if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
+     && !defined __UCLIBC__) \
+    || _LIBICONV_VERSION >= 0x0105
   if (transliterate)
     {
       int retval;
@@ -326,7 +328,9 @@ str_iconveha (const char *src,
 
   /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
      we want to use transliteration.  */
-#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 || _LIBICONV_VERSION >= 0x0105
+#if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
+     && !defined __UCLIBC__) \
+    || _LIBICONV_VERSION >= 0x0105
   if (transliterate)
     {
       char *result;
index 0c431c5..2167caf 100644 (file)
@@ -87,7 +87,7 @@ _GL_CXXALIAS_SYS_CAST2 (memchr,
                         void *, (void const *__s, int __c, size_t __n),
                         void const *, (void const *__s, int __c, size_t __n));
 # endif
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
 _GL_CXXALIASWARN1 (memchr, void const *,
@@ -172,7 +172,7 @@ _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
 _GL_CXXALIAS_SYS_CAST2 (memrchr,
                         void *, (void const *, int, size_t),
                         void const *, (void const *, int, size_t));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
 _GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
@@ -202,7 +202,7 @@ _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
 _GL_CXXALIAS_SYS_CAST2 (rawmemchr,
                         void *, (void const *__s, int __c_in),
                         void const *, (void const *__s, int __c_in));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
 _GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
@@ -293,7 +293,7 @@ _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
 _GL_CXXALIAS_SYS_CAST2 (strchrnul,
                         char *, (char const *__s, int __c_in),
                         char const *, (char const *__s, int __c_in));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
 _GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
@@ -439,7 +439,7 @@ _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
 _GL_CXXALIAS_SYS_CAST2 (strpbrk,
                         char *, (char const *__s, char const *__accept),
                         const char *, (char const *__s, char const *__accept));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
 _GL_CXXALIASWARN1 (strpbrk, char const *,
@@ -541,7 +541,7 @@ _GL_CXXALIAS_SYS_CAST2 (strstr,
                         char *, (const char *haystack, const char *needle),
                         const char *, (const char *haystack, const char *needle));
 # endif
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
 _GL_CXXALIASWARN1 (strstr, const char *,
@@ -590,7 +590,7 @@ _GL_CXXALIAS_SYS_CAST2 (strcasestr,
                         char *, (const char *haystack, const char *needle),
                         const char *, (const char *haystack, const char *needle));
 # endif
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
 _GL_CXXALIASWARN1 (strcasestr, const char *,
index 6f1f61d..1ba8a28 100644 (file)
@@ -140,7 +140,9 @@ unicode_to_mb (unsigned int code,
 
       /* Avoid glibc-2.1 bug and Solaris 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)
 
       /* Get back to the initial shift state.  */
       res = iconv (utf8_to_local, NULL, NULL, &outptr, &outbytesleft);
index dc4c21d..919709f 100644 (file)
@@ -28,7 +28,7 @@
 #include "unistr.h"
 
 /* Name of UTF-16 encoding with machine dependent endianness and alignment.  */
-#if defined _LIBICONV_VERSION || (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#if defined _LIBICONV_VERSION || (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__)
 # ifdef WORDS_BIGENDIAN
 #  define UTF16_NAME "UTF-16BE"
 # else
index cce454d..1091394 100644 (file)
@@ -31,7 +31,7 @@
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
 
 /* Name of UTF-16 encoding with machine dependent endianness and alignment.  */
-#if defined _LIBICONV_VERSION || (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#if defined _LIBICONV_VERSION || (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__)
 # ifdef WORDS_BIGENDIAN
 #  define UTF16_NAME "UTF-16BE"
 # else
index c8e00e7..e841e7d 100644 (file)
@@ -31,7 +31,7 @@
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
 
 /* Name of UTF-16 encoding with machine dependent endianness and alignment.  */
-#if defined _LIBICONV_VERSION || (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#if defined _LIBICONV_VERSION || (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__)
 # ifdef WORDS_BIGENDIAN
 #  define UTF16_NAME "UTF-16BE"
 # else
index f5c6e8e..cb9a9ee 100644 (file)
@@ -31,7 +31,7 @@
    alignment.  */
 #if defined _LIBICONV_VERSION
 # define UTF32_NAME "UCS-4-INTERNAL"
-#elif (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#elif ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
 # define UTF32_NAME "WCHAR_T"
 #endif
 
index 7bfc9f4..f26478f 100644 (file)
@@ -34,7 +34,7 @@
    alignment.  */
 #if defined _LIBICONV_VERSION
 # define UTF32_NAME "UCS-4-INTERNAL"
-#elif (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#elif ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
 # define UTF32_NAME "WCHAR_T"
 #endif
 
index fd45013..b347735 100644 (file)
@@ -34,7 +34,7 @@
    alignment.  */
 #if defined _LIBICONV_VERSION
 # define UTF32_NAME "UCS-4-INTERNAL"
-#elif (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#elif ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
 # define UTF32_NAME "WCHAR_T"
 #endif
 
index a456bea..5047c7b 100644 (file)
@@ -25,7 +25,7 @@
 /* Specification.  */
 #include "unistr.h"
 
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
 
 # include <string.h>
 
index e732ea2..12ab53d 100644 (file)
@@ -25,7 +25,7 @@
 /* Specification.  */
 #include "unistr.h"
 
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 || defined __UCLIBC__
 
 # include <string.h>
 
index 18c5e39..63a9f97 100644 (file)
@@ -279,7 +279,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];
@@ -4754,7 +4754,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
@@ -4841,7 +4841,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 f06d44f..e9761c3 100644 (file)
@@ -31,7 +31,7 @@
 /* 1 if calloc is known to be compatible with GNU calloc.  This
    matters if we are not also using the calloc module, which defines
    HAVE_CALLOC_GNU and supports the GNU API even on non-GNU platforms.  */
-#if defined HAVE_CALLOC_GNU || defined __GLIBC__
+#if defined HAVE_CALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__)
 enum { HAVE_GNU_CALLOC = 1 };
 #else
 enum { HAVE_GNU_CALLOC = 0 };
index 15a30e2..490a005 100644 (file)
@@ -1,5 +1,5 @@
-# arpa_inet_h.m4 serial 8
-dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 9
+dnl Copyright (C) 2006, 2008-2010 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.
@@ -26,7 +26,7 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
 /* On some systems, this header is not self-consistent.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ || defined __UCLIBC__)
 # include <sys/socket.h>
 #endif
 #include <arpa/inet.h>
index 4fc6137..6ddccb6 100644 (file)
@@ -1,4 +1,4 @@
-# duplocale.m4 serial 4
+# duplocale.m4 serial 5
 dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -31,17 +31,20 @@ int main ()
 }]])],
          [gl_cv_func_duplocale_works=yes],
          [gl_cv_func_duplocale_works=no],
-         [dnl Guess it works except on glibc < 2.12 and AIX.
+         [dnl Guess it works except on glibc < 2.12, uClibc, and AIX.
           case "$host_os" in
             aix*) gl_cv_func_duplocale_works="guessing no";;
             *-gnu*)
-              AC_EGREP_CPP([Unlucky GNU user], [
+              AC_EGREP_CPP([Unlucky], [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12)
   Unlucky GNU user
  #endif
 #endif
+#ifdef __UCLIBC__
+ Unlucky user
+#endif
                 ],
                 [gl_cv_func_duplocale_works="guessing no"],
                 [gl_cv_func_duplocale_works="guessing yes"])
index 68684c2..897ee4c 100644 (file)
@@ -1,4 +1,4 @@
-# serial 26
+# serial 27
 # Obtaining file system usage information.
 
 # Copyright (C) 1997-1998, 2000-2001, 2003-2010 Free Software Foundation, Inc.
@@ -48,7 +48,7 @@ if test $ac_fsusage_space = no; then
   # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS.
   AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs],
                  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#if defined __GLIBC__ && defined __linux__
+#if (defined __GLIBC__ || defined __UCLIBC__) && defined __linux__
 Do not use statvfs on systems with GNU libc on Linux, because that function
 stats all preceding entries in /proc/mounts, and that makes df hang if even
 one of the corresponding file systems is hard-mounted, but not available.
index 4beb150..2bbd5cf 100644 (file)
@@ -1,4 +1,4 @@
-# getdelim.m4 serial 6
+# getdelim.m4 serial 7
 
 dnl Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
 dnl
@@ -57,7 +57,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
          [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
index 8300560..0f8e313 100644 (file)
@@ -1,4 +1,4 @@
-# getline.m4 serial 21
+# getline.m4 serial 22
 
 dnl Copyright (C) 1998-2003, 2005-2007, 2009-2010 Free Software Foundation,
 dnl Inc.
@@ -65,7 +65,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
          [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
index f148c12..b92208a 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 68ada9d..bd08b38 100644 (file)
@@ -1,17 +1,17 @@
-# 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__
@@ -19,6 +19,9 @@ AC_DEFUN([gl_GLIBC21],
   Lucky GNU user
  #endif
 #endif
+#ifdef __UCLIBC__
+ Lucky user
+#endif
         ],
         [ac_cv_gnu_library_2_1=yes],
         [ac_cv_gnu_library_2_1=no])
index 8219ecf..7b24880 100644 (file)
@@ -1,4 +1,4 @@
-# iconv_open.m4 serial 8
+# iconv_open.m4 serial 9
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -16,7 +16,7 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
     dnl We know that GNU libiconv and GNU libc do.
     AC_EGREP_CPP([gnu_iconv], [
       #include <iconv.h>
-      #if defined _LIBICONV_VERSION || defined __GLIBC__
+      #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
        gnu_iconv
       #endif
       ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no])
index fbaa7fb..898d4c7 100644 (file)
@@ -1,4 +1,4 @@
-# memmem.m4 serial 17
+# memmem.m4 serial 18
 dnl Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009, 2010 Free Software
 dnl Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
@@ -35,7 +35,8 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
            [
 #ifdef __GNU_LIBRARY__
  #include <features.h>
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
   Lucky user
  #endif
 #elif defined __CYGWIN__
@@ -98,7 +99,8 @@ static void quit (int sig) { exit (sig + 128); }
            [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
   Lucky user
  #endif
 #endif
index e850862..0751eab 100644 (file)
@@ -1,4 +1,4 @@
-# printf.m4 serial 35
+# printf.m4 serial 36
 dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -533,7 +533,7 @@ int main ()
              AC_EGREP_CPP([BZ2908], [
                #include <features.h>
                #ifdef __GNU_LIBRARY__
-                #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
+                #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__
                  BZ2908
                 #endif
                #endif
index d17105e..e6a9f8a 100644 (file)
@@ -1,4 +1,4 @@
-# strcasestr.m4 serial 16
+# strcasestr.m4 serial 17
 dnl Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -38,7 +38,8 @@ AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE],
              [
 #ifdef __GNU_LIBRARY__
  #include <features.h>
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
   Lucky user
  #endif
 #elif defined __CYGWIN__
@@ -106,7 +107,8 @@ static void quit (int sig) { exit (sig + 128); }
            [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
   Lucky user
  #endif
 #endif
index d7f33f2..258ae5f 100644 (file)
@@ -1,4 +1,4 @@
-# strstr.m4 serial 10
+# strstr.m4 serial 11
 dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -31,7 +31,8 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
            [
 #ifdef __GNU_LIBRARY__
  #include <features.h>
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
   Lucky user
  #endif
 #elif defined __CYGWIN__
@@ -94,7 +95,8 @@ static void quit (int sig) { exit (sig + 128); }
            [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
   Lucky user
  #endif
 #endif
index 922a538..2b85774 100644 (file)
@@ -1,4 +1,4 @@
-# strtod.m4 serial 17
+# strtod.m4 serial 18
 dnl Copyright (C) 2002-2003, 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -101,7 +101,8 @@ numeric_equal (double x, double y)
            [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
   Lucky user
  #endif
 #endif
index f6face2..5c342a5 100644 (file)
@@ -1,4 +1,4 @@
-# sys_ioctl_h.m4 serial 8
+# sys_ioctl_h.m4 serial 9
 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -38,7 +38,7 @@ AC_DEFUN([gl_SYS_IOCTL_H],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[#include <sys/ioctl.h>
 /* Some platforms declare ioctl in the wrong header.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <unistd.h>
 #endif
     ]], [ioctl])
index 95e7818..0e8063e 100644 (file)
@@ -1,4 +1,4 @@
-# sys_select_h.m4 serial 14
+# sys_select_h.m4 serial 15
 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -61,7 +61,7 @@ AC_DEFUN([gl_HEADER_SYS_SELECT],
   gl_WARN_ON_USE_PREPARE([[
 /* Some systems require prerequisite headers.  */
 #include <sys/types.h>
-#if !defined __GLIBC__ && HAVE_SYS_TIME_H
+#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
 #include <sys/select.h>
index 9f4db56..f10317e 100644 (file)
@@ -1,4 +1,4 @@
-# sys_socket_h.m4 serial 17
+# sys_socket_h.m4 serial 18
 dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -64,7 +64,7 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
   gl_WARN_ON_USE_PREPARE([[
 /* Some systems require prerequisite headers.  */
 #include <sys/types.h>
-#if !defined __GLIBC__ && HAVE_SYS_TIME_H
+#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
 #include <sys/select.h>
index f60b1fa..fc6c7e8 100644 (file)
@@ -1,5 +1,5 @@
 # Configure a replacement for <sys/times.h>.
-# serial 6
+# serial 7
 
 # Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -30,7 +30,7 @@ AC_DEFUN([gl_SYS_TIMES_H],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
 /* Some systems have incomplete headers.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <time.h>
 #endif
 #include <sys/times.h>
index 48d06c7..01dfb04 100644 (file)
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 46
+# unistd_h.m4 serial 47
 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,7 @@ AC_DEFUN([gl_UNISTD_H],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[#include <unistd.h>
 /* Some systems declare various items in the wrong headers.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <fcntl.h>
 # include <stdio.h>
 # include <stdlib.h>
index 8cae82d..c1fc304 100644 (file)
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Eric Blake.
 
-# wchar_h.m4 serial 33
+# wchar_h.m4 serial 34
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -38,7 +38,7 @@ AC_DEFUN([gl_WCHAR_H],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
 /* Some systems require additional headers.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <stddef.h>
 # include <stdio.h>
 # include <time.h>
index 12859ac..e4e6fac 100644 (file)
@@ -21,7 +21,7 @@
 /* The glibc/gnulib implementation of getopt supports setting optind =
    0, but not all other implementations do.  This matters for getopt.
    But for getopt_long, we require GNU compatibility.  */
-#if defined __GETOPT_PREFIX || (__GLIBC__ >= 2)
+#if defined __GETOPT_PREFIX || (__GLIBC__ >= 2 && !defined __UCLIBC__)
 # define OPTIND_MIN 0
 #elif HAVE_DECL_OPTRESET
 # define OPTIND_MIN (optreset = 1)
index 73579d9..93607dd 100644 (file)
@@ -71,7 +71,7 @@ handler (int sig)
       /* This assertion fails on glibc-2.3.6 systems with LinuxThreads,
          when this program is linked with -lpthread, due to the sigaction()
          override in libpthread.so.  */
-#if !defined __GLIBC__
+#if !(defined __GLIBC__ || defined __UCLIBC__)
       ASSERT (sa.sa_handler == SIG_DFL);
 #endif
       break;
@@ -101,7 +101,7 @@ main (void)
   sa.sa_handler = SIG_DFL;
   ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0);
   ASSERT ((old_sa.sa_flags & SA_SIGINFO) == 0);
-#if !defined __GLIBC__ /* see above */
+#if !(defined __GLIBC__ || defined __UCLIBC__) /* see above */
   ASSERT (old_sa.sa_handler == SIG_DFL);
 #endif
 
index 1da674e..dd7eab1 100644 (file)
@@ -401,7 +401,7 @@ main ()
     }
 # endif
 
-# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 || _LIBICONV_VERSION >= 0x0105
+# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) && !defined __UCLIBC__) || _LIBICONV_VERSION >= 0x0105
   /* Test conversion from UTF-8 to ISO-8859-1 with transliteration.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -577,7 +577,7 @@ main ()
     }
 # endif
 
-# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 || _LIBICONV_VERSION >= 0x0105
+# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) && !defined __UCLIBC__) || _LIBICONV_VERSION >= 0x0105
   /* Test conversion from UTF-8 to ISO-8859-1 with transliteration.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
index c0e9ea2..87c5898 100644 (file)
@@ -3659,7 +3659,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
   }
 #endif
 
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
   /* Test that the 'I' flag is supported.  */
   {
     size_t length;
index e0237fa..a2e5c68 100644 (file)
@@ -32,7 +32,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
   /* glibc >= 2.2 supports the 'I' flag, and in glibc >= 2.2.3 the fa_IR
      locale defines the 'outdigits' to be U+06F0..U+06F9.
      So we test for glibc >= 2.3.  */
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
+#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__
   /* Test that the 'I' flag is supported.  */
   {
     size_t length;
@@ -75,7 +75,7 @@ test_asnprintf ()
 int
 main (int argc, char *argv[])
 {
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
+#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__
   /* Select a locale with Arabic 'outdigits'.  */
   if (setlocale (LC_ALL, "fa_IR.UTF-8") == NULL)
     {