From e44e6c0e1cef349b35b009d2d34c64faf2f8ce7b Mon Sep 17 00:00:00 2001 From: wl Date: Fri, 2 Jan 2009 08:41:44 +0000 Subject: * config.rpath, m4/codeset.m4, m4/glibc21.m4, m4/iconv.m4, m4/lib-link.m4, m4/lib-prefix.m4, src/include/localcharset.h, src/libs/libgroff/config.charset, src/libs/libgroff/localcharset.c, src/libs/libgroff/ref-add.sin, src/libs/libgroff/ref-del.sin: Updated from `gnulib' git repository. * configure: Regenerated. --- src/include/localcharset.h | 17 ++++--- src/libs/libgroff/config.charset | 77 +++++++++++++++++------------- src/libs/libgroff/localcharset.c | 100 ++++++++++++++++++++++++++++----------- src/libs/libgroff/ref-add.sin | 19 ++++---- src/libs/libgroff/ref-del.sin | 19 ++++---- 5 files changed, 143 insertions(+), 89 deletions(-) (limited to 'src') diff --git a/src/include/localcharset.h b/src/include/localcharset.h index 129e4a4a..5030210d 100644 --- a/src/include/localcharset.h +++ b/src/include/localcharset.h @@ -2,20 +2,19 @@ Copyright (C) 2000-2003 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. - 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 - by the Free Software Foundation; either version 2, or (at your option) + 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 + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LOCALCHARSET_H #define _LOCALCHARSET_H diff --git a/src/libs/libgroff/config.charset b/src/libs/libgroff/config.charset index 9090c803..7534e3f2 100755 --- a/src/libs/libgroff/config.charset +++ b/src/libs/libgroff/config.charset @@ -1,22 +1,21 @@ #! /bin/sh # Output a system dependent table of character encoding aliases. # -# Copyright (C) 2000-2004 Free Software Foundation, Inc. +# Copyright (C) 2000-2004, 2006-2008 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 -# by the Free Software Foundation; either version 2, or (at your option) +# 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 +# the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU Library General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The table consists of lines of the form # ALIAS CANONICAL @@ -31,21 +30,21 @@ # The current list of GNU canonical charset names is as follows. # # name MIME? used by which systems -# ASCII, ANSI_X3.4-1968 glibc solaris freebsd darwin -# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd darwin -# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd darwin +# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin +# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin +# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin # ISO-8859-3 Y glibc solaris -# ISO-8859-4 Y osf solaris freebsd darwin -# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd darwin +# ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin +# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin # ISO-8859-6 Y glibc aix hpux solaris -# ISO-8859-7 Y glibc aix hpux irix osf solaris darwin +# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin # ISO-8859-8 Y glibc aix hpux osf solaris # ISO-8859-9 Y glibc aix hpux irix osf solaris darwin -# ISO-8859-13 glibc darwin +# ISO-8859-13 glibc netbsd openbsd darwin # ISO-8859-14 glibc -# ISO-8859-15 glibc aix osf solaris freebsd darwin -# KOI8-R Y glibc solaris freebsd darwin -# KOI8-U Y glibc freebsd darwin +# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin +# KOI8-R Y glibc solaris freebsd netbsd openbsd darwin +# KOI8-U Y glibc freebsd netbsd openbsd darwin # KOI8-T glibc # CP437 dos # CP775 dos @@ -58,7 +57,7 @@ # CP862 dos # CP864 dos # CP865 dos -# CP866 freebsd darwin dos +# CP866 freebsd netbsd openbsd darwin dos # CP869 dos # CP874 woe32 dos # CP922 aix @@ -71,22 +70,22 @@ # CP1125 dos # CP1129 aix # CP1250 woe32 -# CP1251 glibc solaris darwin woe32 +# CP1251 glibc solaris netbsd openbsd darwin woe32 # CP1252 aix woe32 # CP1253 woe32 # CP1254 woe32 # CP1255 glibc woe32 # CP1256 woe32 # CP1257 woe32 -# GB2312 Y glibc aix hpux irix solaris freebsd darwin -# EUC-JP Y glibc aix hpux irix osf solaris freebsd darwin -# EUC-KR Y glibc aix hpux irix osf solaris freebsd darwin -# EUC-TW glibc aix hpux irix osf solaris -# BIG5 Y glibc aix hpux osf solaris freebsd darwin +# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin +# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin +# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin +# EUC-TW glibc aix hpux irix osf solaris netbsd +# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin # BIG5-HKSCS glibc solaris # GBK glibc aix osf solaris woe32 dos -# GB18030 glibc solaris -# SHIFT_JIS Y hpux osf solaris freebsd darwin +# GB18030 glibc solaris netbsd +# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin # JOHAB glibc solaris woe32 # TIS-620 glibc aix hpux osf solaris # VISCII Y glibc @@ -100,7 +99,7 @@ # HP-KANA8 hpux # DEC-KANJI osf # DEC-HANYU osf -# UTF-8 Y glibc aix hpux osf solaris darwin +# UTF-8 Y glibc aix hpux osf solaris netbsd darwin # # Note: Names which are not marked as being a MIME name should not be used in # Internet protocols for information interchange (mail, news, etc.). @@ -388,6 +387,8 @@ case "$os" in echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-13 ISO-8859-13" echo "ISO8859-15 ISO-8859-15" echo "eucCN GB2312" echo "eucJP EUC-JP" @@ -396,6 +397,16 @@ case "$os" in echo "BIG5 BIG5" echo "SJIS SHIFT_JIS" ;; + openbsd*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-13 ISO-8859-13" + echo "ISO8859-15 ISO-8859-15" + ;; darwin[56]*) # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name @@ -467,8 +478,8 @@ case "$os" in # space nevertheless. echo "* UTF-8" ;; - beos*) - # BeOS has a single locale, and it has UTF-8 encoding. + beos* | haiku*) + # BeOS and Haiku have a single locale, and it has UTF-8 encoding. echo "* UTF-8" ;; msdosdjgpp*) @@ -480,7 +491,7 @@ case "$os" in echo "# If you find that the encoding given for your language and" echo "# country is not the one your DOS machine actually uses, just" echo "# correct it in this file, and send a mail to" - echo "# Juan Manuel Guerrero " + echo "# Juan Manuel Guerrero " echo "# and Bruno Haible ." echo "#" echo "C ASCII" diff --git a/src/libs/libgroff/localcharset.c b/src/libs/libgroff/localcharset.c index d03ab79d..fb495191 100644 --- a/src/libs/libgroff/localcharset.c +++ b/src/libs/libgroff/localcharset.c @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008 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 @@ -18,46 +18,40 @@ /* Written by Bruno Haible . */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include /* Specification. */ #include "localcharset.h" -#if HAVE_STDDEF_H -# include -#endif - +#include #include -#if HAVE_STRING_H -# include -#else -# include -#endif -#if HAVE_STDLIB_H -# include -#endif +#include +#include #if defined _WIN32 || defined __WIN32__ -# undef WIN32 /* avoid warning on mingw32 */ -# define WIN32 +# define WIN32_NATIVE #endif #if defined __EMX__ /* Assume EMX program runs on OS/2, even if compiled under DOS. */ -# define OS2 +# ifndef OS2 +# define OS2 +# endif #endif -#if !defined WIN32 +#if !defined WIN32_NATIVE # if HAVE_LANGINFO_CODESET # include # else -# if HAVE_SETLOCALE +# if 0 /* see comment below */ # include # endif # endif -#elif defined WIN32 +# ifdef __CYGWIN__ +# define WIN32_LEAN_AND_MEAN +# include +# endif +#elif defined WIN32_NATIVE # define WIN32_LEAN_AND_MEAN # include #endif @@ -72,6 +66,11 @@ # define relocate(pathname) (pathname) #endif +/* Get LIBDIR. */ +#ifndef LIBDIR +# include "configmake.h" +#endif + #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') @@ -113,7 +112,7 @@ get_charset_aliases (void) cp = charset_aliases; if (cp == NULL) { -#if !(defined VMS || defined WIN32) +#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) FILE *fp; const char *dir; const char *base = "charset.alias"; @@ -239,7 +238,7 @@ get_charset_aliases (void) "DECKOREAN" "\0" "EUC-KR" "\0"; # endif -# if defined WIN32 +# if defined WIN32_NATIVE || defined __CYGWIN__ /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ @@ -291,13 +290,60 @@ locale_charset (void) const char *codeset; const char *aliases; -#if !(defined WIN32 || defined OS2) +#if !(defined WIN32_NATIVE || defined OS2) # if HAVE_LANGINFO_CODESET /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); +# ifdef __CYGWIN__ + /* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always + returns "US-ASCII". As long as this is not fixed, return the suffix + of the locale name from the environment variables (if present) or + the codepage as a number. */ + if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) + { + const char *locale; + static char buf[2 + 10 + 1]; + + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + if (locale != NULL && locale[0] != '\0') + { + /* If the locale name contains an encoding after the dot, return + it. */ + const char *dot = strchr (locale, '.'); + + if (dot != NULL) + { + const char *modifier; + + dot++; + /* Look for the possible @... trailer and remove it, if any. */ + modifier = strchr (dot, '@'); + if (modifier == NULL) + return dot; + if (modifier - dot < sizeof (buf)) + { + memcpy (buf, dot, modifier - dot); + buf [modifier - dot] = '\0'; + return buf; + } + } + } + + /* Woe32 has a function returning the locale's codepage as a number. */ + sprintf (buf, "CP%u", GetACP ()); + codeset = buf; + } +# endif + # else /* On old systems which lack it, use setlocale or getenv. */ @@ -307,7 +353,7 @@ locale_charset (void) (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't use setlocale here; it would return "C" when it doesn't support the locale name the user has set. */ -# if HAVE_SETLOCALE && 0 +# if 0 locale = setlocale (LC_CTYPE, NULL); # endif if (locale == NULL || locale[0] == '\0') @@ -328,7 +374,7 @@ locale_charset (void) # endif -#elif defined WIN32 +#elif defined WIN32_NATIVE static char buf[2 + 10 + 1]; diff --git a/src/libs/libgroff/ref-add.sin b/src/libs/libgroff/ref-add.sin index 0e2b97b0..bc5cc797 100644 --- a/src/libs/libgroff/ref-add.sin +++ b/src/libs/libgroff/ref-add.sin @@ -2,22 +2,21 @@ # # Copyright (C) 2000 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 -# by the Free Software Foundation; either version 2, or (at your option) +# 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 +# the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU Library General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# Written by Bruno Haible . +# Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// diff --git a/src/libs/libgroff/ref-del.sin b/src/libs/libgroff/ref-del.sin index 1fafbfc0..e9301bf2 100644 --- a/src/libs/libgroff/ref-del.sin +++ b/src/libs/libgroff/ref-del.sin @@ -2,22 +2,21 @@ # # Copyright (C) 2000 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 -# by the Free Software Foundation; either version 2, or (at your option) +# 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 +# the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU Library General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# Written by Bruno Haible . +# Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// -- cgit v1.2.1