Port to uClibc.

This commit is contained in:
Bruno Haible 2010-11-21 00:00:16 +01:00
parent 2a0e41d30f
commit fdeb790080
15 changed files with 62 additions and 23 deletions

View 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.

View 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

View 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;

View 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

View 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. */

View 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';

View 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.

View 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;

View 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

View 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';

View 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.

View 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, 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.
@ -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

View 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, 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.
# 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],

View 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.

View 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