From: Bruno Haible Date: Sat, 20 Nov 2010 23:00:16 +0000 (+0100) Subject: Port to uClibc. X-Git-Tag: v0.18.2~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdeb7900808778bf76001854dfaf108024e272d1;p=thirdparty%2Fgettext.git Port to uClibc. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index e5154da80..1b987e757 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,16 @@ +2010-11-20 Bruno Haible + + 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 . + 2010-11-20 Bruno Haible Fix a comment. diff --git a/gettext-runtime/intl/localename.c b/gettext-runtime/intl/localename.c index 89a9692bb..3ed7cf4a0 100644 --- a/gettext-runtime/intl/localename.c +++ b/gettext-runtime/intl/localename.c @@ -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 . */ @@ -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 diff --git a/gettext-runtime/intl/printf-parse.c b/gettext-runtime/intl/printf-parse.c index 5fe8da673..7ae6d8998 100644 --- a/gettext-runtime/intl/printf-parse.c +++ b/gettext-runtime/intl/printf-parse.c @@ -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; diff --git a/gettext-runtime/intl/printf-parse.h b/gettext-runtime/intl/printf-parse.h index 82e5359b6..2dfd8b00f 100644 --- a/gettext-runtime/intl/printf-parse.h +++ b/gettext-runtime/intl/printf-parse.h @@ -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 diff --git a/gettext-runtime/intl/relocatable.c b/gettext-runtime/intl/relocatable.c index f0ac6d105..243248ec5 100644 --- a/gettext-runtime/intl/relocatable.c +++ b/gettext-runtime/intl/relocatable.c @@ -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. */ diff --git a/gettext-runtime/intl/vasnprintf.c b/gettext-runtime/intl/vasnprintf.c index 87389ebad..1e521c8c5 100644 --- a/gettext-runtime/intl/vasnprintf.c +++ b/gettext-runtime/intl/vasnprintf.c @@ -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'; diff --git a/gettext-runtime/libasprintf/ChangeLog b/gettext-runtime/libasprintf/ChangeLog index d3dbb49de..0c2fcaeca 100644 --- a/gettext-runtime/libasprintf/ChangeLog +++ b/gettext-runtime/libasprintf/ChangeLog @@ -1,3 +1,12 @@ +2010-11-20 Bruno Haible + + 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 . + 2010-11-20 Bruno Haible Fix a comment. diff --git a/gettext-runtime/libasprintf/printf-parse.c b/gettext-runtime/libasprintf/printf-parse.c index 5fe8da673..7ae6d8998 100644 --- a/gettext-runtime/libasprintf/printf-parse.c +++ b/gettext-runtime/libasprintf/printf-parse.c @@ -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; diff --git a/gettext-runtime/libasprintf/printf-parse.h b/gettext-runtime/libasprintf/printf-parse.h index 82e5359b6..2dfd8b00f 100644 --- a/gettext-runtime/libasprintf/printf-parse.h +++ b/gettext-runtime/libasprintf/printf-parse.h @@ -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 diff --git a/gettext-runtime/libasprintf/vasnprintf.c b/gettext-runtime/libasprintf/vasnprintf.c index 87389ebad..1e521c8c5 100644 --- a/gettext-runtime/libasprintf/vasnprintf.c +++ b/gettext-runtime/libasprintf/vasnprintf.c @@ -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'; diff --git a/gettext-runtime/m4/ChangeLog b/gettext-runtime/m4/ChangeLog index a3136283d..526884840 100644 --- a/gettext-runtime/m4/ChangeLog +++ b/gettext-runtime/m4/ChangeLog @@ -1,3 +1,10 @@ +2010-11-20 Bruno Haible + + 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 . + 2010-10-04 Bruno Haible Make option --with-libpth-prefix work. diff --git a/gettext-runtime/m4/glibc2.m4 b/gettext-runtime/m4/glibc2.m4 index f148c12c4..b92208a1c 100644 --- a/gettext-runtime/m4/glibc2.m4 +++ b/gettext-runtime/m4/glibc2.m4 @@ -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 #ifdef __GNU_LIBRARY__ - #if (__GLIBC__ >= 2) + #if (__GLIBC__ >= 2) && !defined __UCLIBC__ Lucky GNU user #endif #endif diff --git a/gettext-runtime/m4/glibc21.m4 b/gettext-runtime/m4/glibc21.m4 index 68ada9d4d..bd08b381e 100644 --- a/gettext-runtime/m4/glibc21.m4 +++ b/gettext-runtime/m4/glibc21.m4 @@ -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 #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], diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog index 7a8ee1449..82049d2e2 100644 --- a/gnulib-local/ChangeLog +++ b/gnulib-local/ChangeLog @@ -1,3 +1,9 @@ +2010-11-20 Bruno Haible + + Port to uClibc. + * lib/gettext.h: Treat uClibc like a non-glibc platform. + Reported by Mike Frysinger . + 2010-10-10 Bruno Haible Rely more on libtool. diff --git a/gnulib-local/lib/gettext.h b/gnulib-local/lib/gettext.h index e591089ce..0647fc3c0 100644 --- a/gnulib-local/lib/gettext.h +++ b/gnulib-local/lib/gettext.h @@ -54,7 +54,7 @@ it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include -# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H +# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif