bug-gnulib
[Top][All Lists]
Advanced

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

Re: Please do not install a charset.alias file under Mac OS X


From: Bruno Haible
Subject: Re: Please do not install a charset.alias file under Mac OS X
Date: Sun, 25 Jan 2009 20:15:58 +0100
User-agent: KMail/1.9.9

Vincent Lefevre wrote:
> > I hardcoded the contents of charset.alias for glibc systems, so as to
> > avoid such conflicts for RPM and Debian packaging tools. Shall I do
> > the same for MacOS X? It will resolve the problem with the conflict,
> > but users will then not be able to customize the file.
> 
> I don't see why they would need to customize it.

OK. Then a hardcoded aliases list will do. I'm applying this.


2009-01-25  Bruno Haible  <address@hidden>

        Don't install charset.alias on MacOS X >= 10.3.
        * lib/localcharset.c (DARWIN7): New macro.
        (get_charset_aliases): Hardcode the result for Darwin7.
        * modules/localcharset (install-exec-local): Don't install
        charset.alias on MacOS X >= 10.3, if the file does not yet exist.

--- lib/localcharset.c.orig     2009-01-25 20:13:24.000000000 +0100
+++ lib/localcharset.c  2009-01-25 18:54:07.000000000 +0100
@@ -1,6 +1,6 @@
 /* Determine a canonical name for the current locale's character encoding.
 
-   Copyright (C) 2000-2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2009 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
@@ -28,6 +28,10 @@
 #include <string.h>
 #include <stdlib.h>
 
+#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
+# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */
+#endif
+
 #if defined _WIN32 || defined __WIN32__
 # define WIN32_NATIVE
 #endif
@@ -112,7 +116,7 @@
   cp = charset_aliases;
   if (cp == NULL)
     {
-#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
+#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined 
__CYGWIN__)
       FILE *fp;
       const char *dir;
       const char *base = "charset.alias";
@@ -213,6 +217,39 @@
 
 #else
 
+# if defined DARWIN7
+      /* To avoid the trouble of installing a file that is shared by many
+        GNU packages -- many packaging systems have problems with this --,
+        simply inline the aliases here.  */
+      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
+          "ISO8859-2" "\0" "ISO-8859-2" "\0"
+          "ISO8859-4" "\0" "ISO-8859-4" "\0"
+          "ISO8859-5" "\0" "ISO-8859-5" "\0"
+          "ISO8859-7" "\0" "ISO-8859-7" "\0"
+          "ISO8859-9" "\0" "ISO-8859-9" "\0"
+          "ISO8859-13" "\0" "ISO-8859-13" "\0"
+          "ISO8859-15" "\0" "ISO-8859-15" "\0"
+          "KOI8-R" "\0" "KOI8-R" "\0"
+          "KOI8-U" "\0" "KOI8-U" "\0"
+          "CP866" "\0" "CP866" "\0"
+          "CP949" "\0" "CP949" "\0"
+          "CP1131" "\0" "CP1131" "\0"
+          "CP1251" "\0" "CP1251" "\0"
+          "eucCN" "\0" "GB2312" "\0"
+          "GB2312" "\0" "GB2312" "\0"
+          "eucJP" "\0" "EUC-JP" "\0"
+          "eucKR" "\0" "EUC-KR" "\0"
+          "Big5" "\0" "BIG5" "\0"
+          "Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
+          "GBK" "\0" "GBK" "\0"
+          "GB18030" "\0" "GB18030" "\0"
+          "SJIS" "\0" "SHIFT_JIS" "\0"
+          "ARMSCII-8" "\0" "ARMSCII-8" "\0"
+          "PT154" "\0" "PT154" "\0"
+        /*"ISCII-DEV" "\0" "?" "\0"*/
+          "*" "\0" "UTF-8" "\0";
+# endif
+
 # if defined VMS
       /* To avoid the troubles of an extra file charset.alias_vms in the
         sources of many GNU packages, simply inline the aliases here.  */
--- modules/localcharset.orig   2009-01-25 20:13:25.000000000 +0100
+++ modules/localcharset        2009-01-25 18:45:42.000000000 +0100
@@ -42,7 +42,9 @@
 install-exec-local: all-local
        if test $(GLIBC21) = no; then \
          case '$(host_os)' in \
-           cygwin* | mingw* | pw32* | cegcc*) \
+           darwin[56]*) \
+             need_charset_alias=true ;; \
+           darwin* | cygwin* | mingw* | pw32* | cegcc*) \
              need_charset_alias=false ;; \
            *) \
              need_charset_alias=true ;; \




reply via email to

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