bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iconv_open: work around a Solaris 10 problem


From: Bruno Haible
Subject: iconv_open: work around a Solaris 10 problem
Date: Sun, 30 Aug 2009 14:31:46 +0200
User-agent: KMail/1.9.9

On Solaris 10, iconv_open needs to be replaced as well. The gettext
test suite notices this.

2009-08-30  Bruno Haible  <address@hidden>

        Work around iconv_open problem on Solaris.
        * lib/iconv_open-solaris.gperf: New file.
        * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Also handle Solaris.
        * modules/iconv_open (Files): Add lib/iconv_open-solaris.gperf.
        (Makefile.am): Add rule for iconv_open-solaris.h. Augment
        BUILT_SOURCES, MOSTLYCLEANFILES, MAINTAINERCLEANFILES, EXTRA_DIST.
        * doc/posix-functions/iconv_open.texi: Mention the Solaris problem.

============================= lib/iconv_open-solaris.gperf ====================
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
%struct-type
%language=ANSI-C
%define slot-name standard_name
%define hash-function-name mapping_hash
%define lookup-function-name mapping_lookup
%readonly-tables
%global-table
%define word-array-name mappings
%pic
%%
# On Solaris 10, look in the "iconv -l" output. Some aliases are advertised but
# not actually supported by the iconv() function and by the 'iconv' program.
# For example:
#   $ echo abc | iconv -f 646 -t ISO-8859-1
#   Not supported 646 to ISO-8859-1
#   $ echo abc | iconv -f 646 -t ISO8859-1
$   abc
ASCII, "646"
ISO-8859-1, "ISO8859-1"
ISO-8859-2, "ISO8859-2"
ISO-8859-3, "ISO8859-3"
ISO-8859-4, "ISO8859-4"
ISO-8859-5, "ISO8859-5"
ISO-8859-6, "ISO8859-6"
ISO-8859-7, "ISO8859-7"
ISO-8859-8, "ISO8859-8"
ISO-8859-9, "ISO8859-9"
ISO-8859-15, "ISO8859-15"
CP1251, "ansi-1251"
===============================================================================
--- doc/posix-functions/iconv_open.texi.orig    2009-08-30 14:25:10.000000000 
+0200
+++ doc/posix-functions/iconv_open.texi 2009-08-30 14:22:10.000000000 +0200
@@ -20,7 +20,7 @@
 @item
 This function recognizes only non-standard aliases for many encodings (not
 the IANA registered encoding names) on many platforms:
-AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1.
+AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10.
 @end itemize
 
 Portability problems fixed by Gnulib module @code{iconv_open-utf}:
--- m4/iconv_open.m4.orig       2009-08-30 14:25:10.000000000 +0200
+++ m4/iconv_open.m4    2009-08-30 14:20:36.000000000 +0200
@@ -1,4 +1,4 @@
-# iconv_open.m4 serial 5
+# iconv_open.m4 serial 6
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,10 +21,11 @@
     if test $gl_func_iconv_gnu = no; then
       iconv_flavor=
       case "$host_os" in
-        aix*)  iconv_flavor=ICONV_FLAVOR_AIX ;;
-        irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
-        hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
-        osf*)  iconv_flavor=ICONV_FLAVOR_OSF ;;
+        aix*)     iconv_flavor=ICONV_FLAVOR_AIX ;;
+        irix*)    iconv_flavor=ICONV_FLAVOR_IRIX ;;
+        hpux*)    iconv_flavor=ICONV_FLAVOR_HPUX ;;
+        osf*)     iconv_flavor=ICONV_FLAVOR_OSF ;;
+        solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
       esac
       if test -n "$iconv_flavor"; then
         AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor],
--- modules/iconv_open.orig     2009-08-30 14:25:10.000000000 +0200
+++ modules/iconv_open  2009-08-30 14:23:29.000000000 +0200
@@ -8,6 +8,7 @@
 lib/iconv_open-hpux.gperf
 lib/iconv_open-irix.gperf
 lib/iconv_open-osf.gperf
+lib/iconv_open-solaris.gperf
 m4/iconv_h.m4
 m4/iconv_open.m4
 
@@ -54,10 +55,13 @@
 iconv_open-osf.h: iconv_open-osf.gperf
        $(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > 
$(srcdir)/iconv_open-osf.h-t
        mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
-BUILT_SOURCES        += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h 
iconv_open-osf.h
-MOSTLYCLEANFILES     += iconv_open-aix.h-t iconv_open-hpux.h-t 
iconv_open-irix.h-t iconv_open-osf.h-t
-MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h 
iconv_open-osf.h
-EXTRA_DIST           += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h 
iconv_open-osf.h
+iconv_open-solaris.h: iconv_open-solaris.gperf
+       $(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > 
$(srcdir)/iconv_open-solaris.h-t
+       mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
+BUILT_SOURCES        += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h 
iconv_open-osf.h iconv_open-solaris.h
+MOSTLYCLEANFILES     += iconv_open-aix.h-t iconv_open-hpux.h-t 
iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t
+MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h 
iconv_open-osf.h iconv_open-solaris.h
+EXTRA_DIST           += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h 
iconv_open-osf.h iconv_open-solaris.h
 
 Include:
 <iconv.h>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]