avatar
Sergey A. Sokolov has added 7975a94864
Imported from SRPM
... ... --- /dev/null
... ... +++ b/.abf.yml
... ... @@ -0,0 +1,3 @@
1
sources:
2
  a2ps-4.14.tar.gz: 365abbbe4b7128bf70dad16d06e23c5701874852
3
  i18n-fonts-0.1.tar.gz: 0dbd08fd6d2e09b4dde2d681788c081dddfb635c
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13-autoenc.patch
... ... @@ -0,0 +1,40 @@
1
--- a2ps-4.13.rh/src/main.c	Fri Feb 23 17:39:02 2001
2
+++ a2ps-4.13.euc/src/main.c	Fri Feb 23 23:07:40 2001
3
@@ -31,6 +31,8 @@
4
 /*                                                                      */
5
 /************************************************************************/
6
 #include <assert.h>
7
+#include <string.h>
8
+#include <locale.h>
9
 
10
 #include "a2ps.h"
11
 #include "argmatch.h"
12
@@ -925,6 +927,7 @@
13
 main (int argc, char *argv[])
14
 {
15
   int argn;
16
+  char *locale;
17
 
18
   /* Architecture specific initialization. */
19
 #ifdef __EMX__
20
@@ -947,6 +950,9 @@
21
   setlocale (LC_CTYPE, "");
22
   setlocale (LC_PAPER, "");
23
 
24
+  locale = setlocale (LC_ALL, "");
25
+  /* fprintf(stderr, "locale : %s\n", locale); */
26
+
27
   bindtextdomain (PACKAGE, LOCALEDIR);
28
   textdomain (PACKAGE);
29
 
30
@@ -1013,6 +1019,10 @@
31
      yet read sheets. */
32
   sheets_map = sheets_map_new ();
33
   style_sheets = new_style_sheets ();
34
+
35
+  /* Process special case: Japanese Document */
36
+  if (! strncmp (locale, "ja", 2) )
37
+    job->requested_encoding_name = xstrdup ("euc-jp");
38
 
39
   /* Process the command line options. */
40
   argn = a2ps_handle_options (job, argc, argv);
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13-conf.patch
... ... @@ -0,0 +1,35 @@
1
diff -up a2ps-4.14/configure.conf a2ps-4.14/configure
2
--- a2ps-4.14/configure.conf	2008-04-27 01:01:04.000000000 +0200
3
+++ a2ps-4.14/configure	2008-04-27 01:04:12.000000000 +0200
4
@@ -30758,9 +30758,13 @@ fi
5
 echo $ECHO_N "checking for PostScript fonts path... $ECHO_C" >&6; }
6
 # Try to find some PostScript fonts.
7
 # Find out if ghostscript is installed
8
+# for ac_dir in /usr/local/ghostscript/fonts \
9
+#  /usr/local/share/ghostscript/fonts;
10
 ac_psfont_path=
11
-for ac_dir in /usr/local/ghostscript/fonts \
12
-  /usr/local/share/ghostscript/fonts;
13
+for ac_dir in /usr/share/fonts/default/Type1 \
14
+    /usr/share/fonts/default/ghostscript \
15
+    /usr/share/X11/fonts/Type1 \
16
+    /usr/share/fonts/culmus ;
17
 do
18
   if test "cd $ac_dir 2>/dev/null && echo *.afm"; then
19
     ac_psfont_path="$ac_psfont_path:$ac_dir";
20
diff -up a2ps-4.14/configure.in.conf a2ps-4.14/configure.in
21
--- a2ps-4.14/configure.in.conf	2008-04-27 01:00:54.000000000 +0200
22
+++ a2ps-4.14/configure.in	2008-04-27 01:03:52.000000000 +0200
23
@@ -207,8 +207,10 @@ AC_MSG_CHECKING(for PostScript fonts pat
24
 # Try to find some PostScript fonts.
25
 # Find out if ghostscript is installed
26
 ac_psfont_path=
27
-for ac_dir in /usr/local/ghostscript/fonts \
28
-  /usr/local/share/ghostscript/fonts;
29
+for ac_dir in /usr/share/fonts/default/Type1 \
30
+    /usr/share/fonts/default/ghostscript \
31
+    /usr/share/X11/fonts/Type1 \
32
+    /usr/share/fonts/culmus ;
33
 do
34
   if test "cd $ac_dir 2>/dev/null && echo *.afm"; then
35
     ac_psfont_path="$ac_psfont_path:$ac_dir";
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13-etc.patch
... ... @@ -0,0 +1,59 @@
1
diff -up a2ps-4.14/etc/a2ps_cfg.in.etc a2ps-4.14/etc/a2ps_cfg.in
2
--- a2ps-4.14/etc/a2ps_cfg.in.etc	2007-12-29 02:38:58.000000000 +0100
3
+++ a2ps-4.14/etc/a2ps_cfg.in	2008-04-27 01:27:55.000000000 +0200
4
@@ -73,6 +73,7 @@ LibraryPath: @libpath@
5
 # It may be useful to extend it so that a2ps can see some
6
 # TeX or X11 resources: it likes AFM files and PF[AB] files.
7
 #AppendLibraryPath: foo
8
+AppendLibraryPath: @apppath@
9
 
10
 
11
 #################################################################
12
diff -up a2ps-4.14/etc/Makefile.am.etc a2ps-4.14/etc/Makefile.am
13
--- a2ps-4.14/etc/Makefile.am.etc	2002-07-19 14:07:27.000000000 +0200
14
+++ a2ps-4.14/etc/Makefile.am	2008-04-27 01:27:55.000000000 +0200
15
@@ -2,7 +2,7 @@
16
 ## Makefile for a2ps' etc library directory.
17
 
18
 ogonkifydir=$(datadir)/ogonkify
19
-libpath = $(pkgdatadir)/sheets:$(pkgdatadir)/ps:$(pkgdatadir)/encoding:$(pkgdatadir)/afm:$(ogonkifydir)/afm:$(pkgdatadir)/ppd:$(pkgdatadir)/fonts:$(ogonkifydir)/fonts:$(pkgdatadir)
20
+libpath = $(sysconfdir)/$(PACKAGE):$(pkgdatadir)/sheets:$(pkgdatadir)/ps:$(pkgdatadir)/encoding:$(pkgdatadir)/afm:$(ogonkifydir)/afm:$(pkgdatadir)/ppd:$(pkgdatadir)/fonts:$(ogonkifydir)/fonts:$(pkgdatadir)
21
 
22
 pkgdata_DATA = README
23
 
24
@@ -40,7 +40,9 @@ DISTCLEANFILES = a2ps.cfg README
25
 
26
 # Building the correct a2ps.cfg
27
 a2ps.cfg: a2ps_cfg Makefile
28
-	sed "s!@libpath@!$(libpath)!" a2ps_cfg > a2ps.cfg
29
+	sed -e "s!@libpath@!$(libpath)!" \
30
+	    -e "s!@apppath@!$(PSFONT_PATH)!" \
31
+	    a2ps_cfg > a2ps.cfg
32
 
33
 # Building a time stamp to know the version.
34
 README: README.in Makefile
35
diff -up a2ps-4.14/etc/Makefile.in.etc a2ps-4.14/etc/Makefile.in
36
--- a2ps-4.14/etc/Makefile.in.etc	2007-12-29 04:28:07.000000000 +0100
37
+++ a2ps-4.14/etc/Makefile.in	2008-04-27 01:30:55.000000000 +0200
38
@@ -262,7 +262,7 @@ sysconfdir = @sysconfdir@
39
 target_alias = @target_alias@
40
 tex = @tex@
41
 ogonkifydir = $(datadir)/ogonkify
42
-libpath = $(pkgdatadir)/sheets:$(pkgdatadir)/ps:$(pkgdatadir)/encoding:$(pkgdatadir)/afm:$(ogonkifydir)/afm:$(pkgdatadir)/ppd:$(pkgdatadir)/fonts:$(ogonkifydir)/fonts:$(pkgdatadir)
43
+libpath = $(sysconfdir)/$(PACKAGE):$(pkgdatadir)/sheets:$(pkgdatadir)/ps:$(pkgdatadir)/encoding:$(pkgdatadir)/afm:$(ogonkifydir)/afm:$(pkgdatadir)/ppd:$(pkgdatadir)/fonts:$(ogonkifydir)/fonts:$(pkgdatadir)
44
 pkgdata_DATA = README
45
 dsysconf = $(DESTDIR)$(sysconfdir)
46
 EXTRA_DIST = README.in
47
@@ -482,7 +482,9 @@ uninstall-local:
48
 
49
 # Building the correct a2ps.cfg
50
 a2ps.cfg: a2ps_cfg Makefile
51
-	sed "s!@libpath@!$(libpath)!" a2ps_cfg > a2ps.cfg
52
+	sed -e "s!@libpath@!$(libpath)!" \
53
+	    -e "s!@apppath@!$(PSFONT_PATH)!" \
54
+	    a2ps_cfg > a2ps.cfg
55
 
56
 # Building a time stamp to know the version.
57
 README: README.in Makefile
58
diff -up a2ps-4.14/Makefile.am.etc a2ps-4.14/Makefile.am
59
diff -up a2ps-4.14/Makefile.in.etc a2ps-4.14/Makefile.in
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13-eucjp.patch
... ... @@ -0,0 +1,1417 @@
1
diff -up a2ps-4.14/config.h.in.euc a2ps-4.14/config.h.in
2
--- a2ps-4.14/config.h.in.euc	2007-12-29 04:28:05.000000000 +0100
3
+++ a2ps-4.14/config.h.in	2008-04-27 10:39:24.000000000 +0200
4
@@ -24,6 +24,9 @@
5
 /* Define if TIOCGWINSZ requires sys/ioctl.h */
6
 #undef GWINSZ_IN_SYS_IOCTL
7
 
8
+/* Define if you want to support japanese  */
9
+#undef ENABLE_KANJI
10
+ 
11
 /* Define to 1 if you have the `alarm' function. */
12
 #undef HAVE_ALARM
13
 
14
diff -up a2ps-4.14/configure.euc a2ps-4.14/configure
15
--- a2ps-4.14/configure.euc	2008-04-27 10:39:24.000000000 +0200
16
+++ a2ps-4.14/configure	2008-04-27 10:41:39.000000000 +0200
17
@@ -1587,7 +1587,8 @@ Optional Packages:
18
   --with-medium=medium    specify the default medium (A4, Letter, Legal, etc.)
19
                           default=A4
20
   --with-encoding=enc     specify the default encoding (ascii, latin1,
21
-                          latin2... latin6, hp etc.) default=latin1
22
+                          latin2... latin6, euc-jp, hp etc.) default=latin1
23
+  --enable-kanji 	  support Japanese (default=yes)
24
 
25
 Some influential environment variables:
26
   CC          C compiler command
27
@@ -22521,7 +22522,7 @@ fi
28
 
29
 for ac_header in sys/time.h sys/stat.h sys/types.h sys/ioctl.h  \
30
  math.h string.h strings.h stdlib.h unistd.h stdarg.h pwd.h malloc.h \
31
- memory.h errno.h fcntl.h stdbool.h fnmatch.h
32
+ memory.h errno.h fcntl.h stdbool.h fnmatch.h iconv.h
33
 do
34
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
35
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
36
@@ -30947,6 +30948,22 @@ fi
37
 
38
 
39
 
40
+# Check whether --enable-kanji or --disable-kanji was given.
41
+if test "${enable_kanji+set}" = set; then
42
+  enableval="$enable_kanji"
43
+  SUPPORT_KANJI=$enableval
44
+else
45
+  SUPPORT_KANJI=yes
46
+fi
47
+
48
+if test "$SUPPORT_KANJI" = "yes"; then
49
+	cat >> confdefs.h <<\EOF
50
+#define ENABLE_KANJI 1
51
+EOF
52
+#	ENCODING=euc-jp
53
+fi
54
+
55
+
56
 ########################
57
 # Nice special printers
58
 ########################
59
diff -up a2ps-4.14/configure.in.euc a2ps-4.14/configure.in
60
--- a2ps-4.14/configure.in.euc	2008-04-27 10:39:24.000000000 +0200
61
+++ a2ps-4.14/configure.in	2008-04-27 10:39:24.000000000 +0200
62
@@ -72,7 +72,7 @@ AC_HEADER_SYS_WAIT
63
 AC_HEADER_DIRENT
64
 AC_CHECK_HEADERS(sys/time.h sys/stat.h sys/types.h sys/ioctl.h  \
65
  math.h string.h strings.h stdlib.h unistd.h stdarg.h pwd.h malloc.h \
66
- memory.h errno.h fcntl.h stdbool.h fnmatch.h)
67
+ memory.h errno.h fcntl.h stdbool.h fnmatch.h iconv.h)
68
 
69
 ## --------------------- ##
70
 ## Checks for typedefs.  ##
71
@@ -276,11 +276,23 @@ AC_SUBST(MEDIUM)
72
 #
73
 AC_ARG_WITH(encoding,
74
 AC_HELP_STRING([--with-encoding=enc],
75
-               [specify the default encoding (ascii, latin1, latin2... latin6, hp etc.) [default=latin1]]),
76
+               [specify the default encoding (ascii, latin1, latin2... latin6, euc-jp, hp etc.) [default=latin1]]),
77
 ENCODING=$with_encoding,
78
 ENCODING=latin1)
79
 AC_SUBST(ENCODING)
80
 
81
+#
82
+# use libjcode
83
+#
84
+AC_ARG_ENABLE(kanji,
85
+	[  --enable-kanji	  support Japanese/kanji (default: yes)],
86
+			SUPPORT_KANJI=$enableval, SUPPORT_KANJI=yes)
87
+if test "$SUPPORT_KANJI" = "yes"; then
88
+	AC_DEFINE(ENABLE_KANJI)
89
+	dnl ENCODING=euc-jp
90
+fi
91
+
92
+
93
 ########################
94
 # Nice special printers
95
 ########################
96
diff -up a2ps-4.14/encoding/encoding.map.euc a2ps-4.14/encoding/encoding.map
97
--- a2ps-4.14/encoding/encoding.map.euc	2007-12-29 02:39:21.000000000 +0100
98
+++ a2ps-4.14/encoding/encoding.map	2008-04-27 10:39:24.000000000 +0200
99
@@ -93,6 +93,12 @@ koi8r			koi8
100
 koi8			koi8
101
 koi			koi8
102
 
103
+euc-jp			euc-jp
104
+eucjp			euc-jp
105
+japanese		euc-jp
106
+ja			euc-jp
107
+jp			euc-jp
108
+
109
 ########################################################################
110
 # Some architectures specific char sets
111
 ########################################################################
112
diff -up /dev/null a2ps-4.14/encoding/euc-jp.edf
113
--- /dev/null	2008-04-27 11:55:27.307012118 +0200
114
+++ a2ps-4.14/encoding/euc-jp.edf	2008-04-27 10:39:24.000000000 +0200
115
@@ -0,0 +1,109 @@
116
+# Description of the EUC-JP encoding
117
+# Copyright (c) 1988, 89, 90, 91, 92, 93 Miguel Santana
118
+# Copyright (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana
119
+#
120
+
121
+#
122
+# This file is part of a2ps.
123
+# 
124
+# This program is free software; you can redistribute it and/or modify
125
+# it under the terms of the GNU General Public License as published by
126
+# the Free Software Foundation; either version 2, or (at your option)
127
+# any later version.
128
+#
129
+# This program is distributed in the hope that it will be useful,
130
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
131
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
132
+# GNU General Public License for more details.
133
+#
134
+# You should have received a copy of the GNU General Public License
135
+# along with this program; see the file COPYING.  If not, write to
136
+# the Free Software Foundation, 59 Temple Place - Suite 330,
137
+# Boston, MA 02111-1307, USA.
138
+#
139
+
140
+Name: EUC-JP
141
+
142
+# This text is reproduced by a courtesy of Roman Czyborra
143
+# http://czyborra.com/charsets/iso8859.html
144
+Documentation
145
+The EUC-JP character set, often simply referred to as Latin 1,
146
+covers most West European languages, such as French, Spanish, Catalan,
147
+Basque, Portuguese, Italian, Albanian, Rhaeto-Romanic, Dutch, German,
148
+Danish, Swedish, Norwegian, Finnish, Faroese, Icelandic, Irish,
149
+Scottish, and English, incidentally also Afrikaans and Swahili, thus
150
+in effect also the entire American continent, Australia and the
151
+southern two-thirds of Africa. The lack of the ligatures Dutch IJ,
152
+French OE and ,,German`` quotation marks is considered tolerable.
153
+
154
+The lack of the new C=-resembling Euro currency symbol U+20AC has
155
+opened the discussion of a new Latin0.
156
+EndDocumentation
157
+
158
+# If there is an unknown font requested, use Courier
159
+Default: Courier
160
+
161
+# Automatic spell checking :)
162
+Substitute: 	Times			Times-Roman
163
+Substitute: 	Helvetica-Italic	Helvetica-Oblique
164
+Substitute: 	Helvetica-BoldItalic	Helvetica-BoldOblique
165
+
166
+
167
+# SlantFont for Japanese Italic Kanji font
168
+#		new font			source font		value
169
+SlantFont:	Ryumin-Light-EUC-H-Italic	Ryumin-Light-EUC-H	0.2
170
+SlantFont:	GothicBBB-Medium-EUC-H-Italic	GothicBBB-Medium-EUC-H	0.2
171
+
172
+# Compose font for japanese EUC code
173
+#		target font		additional font			width	size rate
174
+DefaultComposite:			Ryumin-Light-EUC-H		1.0	1.1
175
+
176
+# 1:2 fixed
177
+#DefaultComposite:			Ryumin-Light-EUC-H		1.0	0.8333
178
+
179
+# 1:1 fixed
180
+#DefaultComposite:			Ryumin-Light-EUC-H		1.0	1.6666
181
+
182
+Composite:	Helvetica		GothicBBB-Medium-EUC-H		1.0	1.1
183
+Composite:	Helvetica-Oblique	GothicBBB-Medium-EUC-H-Italic	1.0 	1.1
184
+Composite:	Helvetica-Bold		GothicBBB-Medium-EUC-H  	1.0 	1.1
185
+Composite:	Helvetica-BoldOblique	GothicBBB-Medium-EUC-H-Italic	1.0	1.1
186
+
187
+Composite:	Courier-Oblique		Ryumin-Light-EUC-H-Italic	1.0	1.1
188
+Composite:	Courier-Bold		GothicBBB-Medium-EUC-H		1.0	1.1
189
+Composite:	Courier-BoldOblique	GothicBBB-Medium-EUC-H-Italic	1.0	1.1
190
+Composite:	Times-Bold		GothicBBB-Medium-EUC-H		1.0	1.1
191
+
192
+Vector:
193
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
194
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
195
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
196
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
197
+space exclam quotedbl numbersign dollar percent ampersand quoteright
198
+parenleft parenright asterisk plus comma minus period slash
199
+zero one two three four five six seven
200
+eight nine colon semicolon less equal greater question
201
+at A B C D E F G
202
+H I J K L M N O
203
+P Q R S T U V W
204
+X Y Z bracketleft backslash bracketright asciicircum underscore
205
+quoteleft a b c d e f g
206
+h i j k l m n o
207
+p q r s t u v w
208
+x y z braceleft bar braceright asciitilde .notdef
209
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
210
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
211
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
212
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
213
+space exclamdown cent sterling currency yen brokenbar section
214
+dieresis copyright ordfeminine guillemotleft logicalnot hyphen registered macron
215
+degree plusminus twosuperior threesuperior acute mu paragraph bullet
216
+cedilla onesuperior ordmasculine guillemotright onequarter onehalf threequarters questiondown
217
+Agrave Aacute Acircumflex Atilde Adieresis Aring AE Ccedilla
218
+Egrave Eacute Ecircumflex Edieresis Igrave Iacute Icircumflex Idieresis
219
+Eth Ntilde Ograve Oacute Ocircumflex Otilde Odieresis multiply
220
+Oslash Ugrave Uacute Ucircumflex Udieresis Yacute Thorn germandbls
221
+agrave aacute acircumflex atilde adieresis aring ae ccedilla
222
+egrave eacute ecircumflex edieresis igrave iacute icircumflex idieresis
223
+eth ntilde ograve oacute ocircumflex otilde odieresis divide
224
+oslash ugrave uacute ucircumflex udieresis yacute thorn ydieresis
225
diff -up a2ps-4.14/encoding/Makefile.am.euc a2ps-4.14/encoding/Makefile.am
226
--- a2ps-4.14/encoding/Makefile.am.euc	2007-12-29 02:39:27.000000000 +0100
227
+++ a2ps-4.14/encoding/Makefile.am	2008-04-27 10:39:24.000000000 +0200
228
@@ -16,7 +16,7 @@ major_encodings = ascii.edf iso1.edf
229
 minor_encodings = \
230
 ms-cp1250.edf hp.edf mac.edf ibm-cp437.edf ibm-cp850.edf iso2.edf	\
231
 iso3.edf iso4.edf iso5.edf iso7.edf iso9.edf iso10.edf iso13.edf	\
232
-iso15.edf koi8.edf ms-cp1251.edf
233
+iso15.edf koi8.edf ms-cp1251.edf euc-jp.edf
234
 
235
 if EXTENSIONS
236
 encodings_DATA = encoding.map $(major_encodings) $(minor_encodings)
237
diff -up a2ps-4.14/encoding/Makefile.in.euc a2ps-4.14/encoding/Makefile.in
238
--- a2ps-4.14/encoding/Makefile.in.euc	2007-12-29 04:28:07.000000000 +0100
239
+++ a2ps-4.14/encoding/Makefile.in	2008-04-27 10:39:24.000000000 +0200
240
@@ -270,7 +270,7 @@ major_encodings = ascii.edf iso1.edf
241
 minor_encodings = \
242
 ms-cp1250.edf hp.edf mac.edf ibm-cp437.edf ibm-cp850.edf iso2.edf	\
243
 iso3.edf iso4.edf iso5.edf iso7.edf iso9.edf iso10.edf iso13.edf	\
244
-iso15.edf koi8.edf ms-cp1251.edf
245
+iso15.edf koi8.edf ms-cp1251.edf euc-jp.edf
246
 
247
 @EXTENSIONS_FALSE@encodings_DATA = encoding.map $(major_encodings)
248
 @EXTENSIONS_TRUE@encodings_DATA = encoding.map $(major_encodings) $(minor_encodings)
249
diff -up a2ps-4.14/lib/encoding.c.euc a2ps-4.14/lib/encoding.c
250
--- a2ps-4.14/lib/encoding.c.euc	2007-12-29 02:37:54.000000000 +0100
251
+++ a2ps-4.14/lib/encoding.c	2008-04-27 10:39:24.000000000 +0200
252
@@ -37,6 +37,9 @@
253
 #include "document.h"
254
 #include "quotearg.h"
255
 #include "strverscmp.h"
256
+#ifdef ENABLE_KANJI
257
+int use_jcode = false;
258
+#endif
259
 
260
 /* Suffix of the Encoding Description Files */
261
 #define EDF_SUFFIX ".edf"
262
@@ -389,15 +392,25 @@ font_entry_set_used (struct hash_table_s
263
  * Association of suffixes rules, and corresponding style sheet
264
  * (The hashing is upon `alias')
265
  */
266
+struct slantfont_info {
267
+  char * name;
268
+  char * src;
269
+  float raito;
270
+};
271
+
272
 struct encoding {
273
   char * key;			/* e.g. latin1			*/
274
   char * name;			/* e.g. ISO Latin 1		*/
275
+  int    composite_flag;		/* flag for composite font	*/
276
   uchar * documentation;		/* Useful pieces of text	*/
277
 
278
   char * default_font;		/* When a font can't be used
279
 				   define the font to use	*/
280
   struct pair_htable * substitutes;	/* e.g. in latin2, don't use
281
 					 * Courier, but Courier-Ogonki	*/
282
+  struct pair_htable * composite;
283
+
284
+  struct slantfont_info     slantfont[NB_FACES];
285
 
286
   char * vector[256];	/* Define the char set			*/
287
   struct darray * font_names_used;
288
@@ -407,6 +420,9 @@ struct encoding {
289
   struct hash_table_s * fonts;	/* Contains cells that are
290
 				 * 1. name of font, 2. int wx[256] 	*/
291
   unsigned int * faces_wx[NB_FACES];
292
+
293
+  unsigned int   composite_wx[NB_FACES];     /* fixed length font width*/
294
+  float          composite_raito[NB_FACES];  /* size raito of additonal and orinal font */
295
 };
296
 
297
 /*
298
@@ -423,9 +439,12 @@ encoding_new (const char * key)
299
   res->name = NULL;
300
   res->default_font = NULL;
301
   res->documentation = NULL;
302
+  res->composite_flag = false;
303
 
304
   /* Vector will be set by setup */
305
   res->substitutes = pair_table_new ();
306
+  res->composite = pair_table_new ();
307
+  res->slantfont[0].name = NULL;
308
   res->font_names_used = da_new ("List of font names", 10,
309
 				 da_linear, 10,
310
 				 (da_print_func_t) da_str_print,
311
@@ -471,6 +490,34 @@ encoding_add_font_substitute (struct enc
312
 }
313
 
314
 /*
315
+ * Add a composite font in the current encoding
316
+ */
317
+static void
318
+encoding_add_composite_font (struct encoding * encoding,
319
+			      const char * orig, const char * subs,
320
+			      int wx, float raito)
321
+{
322
+  encoding->composite_flag = true;
323
+  pair_add2 (encoding->composite, orig, subs, wx, raito);
324
+}
325
+
326
+/*
327
+ * Add a composite font in the current encoding
328
+ */
329
+static void
330
+encoding_add_slant_font (struct encoding * encoding,
331
+			 const char * new, const char * src,
332
+			 float raito)
333
+{
334
+  static num =  0;
335
+  encoding->slantfont[num].name = strdup(new);
336
+  encoding->slantfont[num].src  = strdup(src);
337
+  encoding->slantfont[num].raito = raito;
338
+  encoding->slantfont[num+1].name = NULL;
339
+  num++;
340
+}
341
+
342
+/*
343
  * When FONT_NAME is used with ENCODING, return the
344
  * real font name to use (e.g., in latin2, Courier-Ogonki
345
  * should be returned when asked for Courier).
346
@@ -514,6 +561,77 @@ encoding_resolve_font_substitute (struct
347
     }
348
 
349
   message (msg_enc,
350
+	   (stderr, "In encoding %s, composite font for %s is resolved as %s\n",
351
+	    encoding->key, font_name, res));
352
+  return res;
353
+}
354
+
355
+/*
356
+ * Get composite font size and raito
357
+ */
358
+static int
359
+composite_font_info_get_wx(struct a2ps_job * job,
360
+			   struct encoding * encoding,
361
+			   const char * font_list)
362
+{
363
+  int wx= -1;
364
+  char * font_list_copy;
365
+  char * font_name;
366
+  astrcpy (font_list_copy, font_list);
367
+  font_name = strtok (font_list_copy, ",<>;");
368
+
369
+  wx = pair_get_wx (encoding->composite, font_name);
370
+  if (wx<0)
371
+      wx = pair_get_wx (encoding->composite, "default_composite__");
372
+
373
+  return wx;
374
+}
375
+
376
+static float
377
+composite_font_info_get_raito(struct a2ps_job * job,
378
+			      struct encoding * encoding,
379
+			      const char * font_list)
380
+{
381
+  float raito= -1;
382
+  char * font_list_copy;
383
+  char * font_name;
384
+
385
+  astrcpy (font_list_copy, font_list);
386
+  font_name = strtok (font_list_copy, ",<>;");
387
+
388
+  raito = pair_get_raito (encoding->composite, font_name);
389
+  if (raito<0)
390
+      raito = pair_get_raito (encoding->composite, "default_composite__");
391
+  return raito;
392
+}
393
+
394
+const char *
395
+encoding_resolve_composite_font (struct a2ps_job * job,
396
+				  struct encoding * encoding,
397
+				  const char * font_list)
398
+{
399
+  const char * res = NULL;
400
+  char * font_list_copy;
401
+  char * font_name;
402
+
403
+  astrcpy (font_list_copy, font_list);
404
+  font_name = strtok (font_list_copy, ",<>;");
405
+
406
+  /* Find if there is a substitute for that font */
407
+  res = pair_get (encoding->composite, font_name);
408
+
409
+  /* We've found nothing interesting.  Last chance is the default
410
+   * font */
411
+  if (!res)
412
+    {
413
+      res = pair_get (encoding->composite, "default_composite__");
414
+
415
+      if (!res)
416
+	error (1, 0, "Cannot find font %s, nor any composite font",
417
+	       font_name);
418
+    }
419
+  
420
+  message (msg_enc,
421
 	   (stderr, "In encoding %s, font %s is resolved as %s\n",
422
 	    encoding->key, font_name, res));
423
   return res;
424
@@ -585,6 +703,12 @@ load_encoding_description_file (a2ps_job
425
 	{
426
 	  token2 = GET_TOKEN (NULL);
427
 	  CHECK_TOKEN ();
428
+#ifdef ENABLE_KANJI
429
+	  if( strcmp(token2, "EUC-JP")== 0)
430
+	    use_jcode = true;
431
+	  else 
432
+	    use_jcode = false;
433
+#endif
434
 	  encoding->name = xstrdup (token2);
435
 	}
436
       else if (strequ (token, "Default:"))
437
@@ -633,6 +757,66 @@ load_encoding_description_file (a2ps_job
438
 	  subs = token2;
439
 	  encoding_add_font_substitute (encoding, orig, subs);
440
 	}
441
+      else if (strequ (token, "DefaultComposite:"))
442
+	{
443
+	  char * orig, * subs;
444
+	  int wx;
445
+	  float raito;
446
+
447
+	  token2 = GET_TOKEN (NULL);
448
+	  CHECK_TOKEN ();
449
+	  subs = token2;
450
+	  token2 = GET_TOKEN (NULL);
451
+	  CHECK_TOKEN ();
452
+	  wx = (int)atof(token2)*1000;
453
+	  token2 = GET_TOKEN (NULL);
454
+	  CHECK_TOKEN ();
455
+	  raito = atof(token2);
456
+	  encoding_add_composite_font(encoding, "default_composite__",
457
+				      subs, wx, raito);
458
+	}
459
+      else if (strequ (token, "Composite:"))
460
+	{
461
+	  char * orig, * subs;
462
+	  int wx;
463
+	  float raito;
464
+
465
+	  token2 = GET_TOKEN (NULL);
466
+	  CHECK_TOKEN ();
467
+	  orig = token2;
468
+	  token2 = GET_TOKEN (NULL);
469
+	  CHECK_TOKEN ();
470
+	  subs = token2;
471
+	  token2 = GET_TOKEN (NULL);
472
+	  CHECK_TOKEN ();
473
+	  wx = (int)atof(token2)*1000;
474
+	  token2 = GET_TOKEN (NULL);
475
+	  CHECK_TOKEN ();
476
+	  raito = atof(token2);
477
+	  encoding_add_composite_font(encoding, orig, subs, wx, raito);
478
+	}
479
+      else if (strequ (token, "SlantFont:"))
480
+	{
481
+	  char * new, * src;
482
+	  float raito;
483
+	  unsigned int num;
484
+
485
+	  token2 = GET_TOKEN (NULL);
486
+	  CHECK_TOKEN ();
487
+	  new = token2;
488
+	  token2 = GET_TOKEN (NULL);
489
+	  CHECK_TOKEN ();
490
+	  src = token2;
491
+	  token2 = GET_TOKEN (NULL);
492
+	  CHECK_TOKEN ();
493
+	  raito = atof(token2);
494
+	  for (num = 0 ; encoding->slantfont[num].name ; num ++ );
495
+	  if (num > sizeof encoding->slantfont - 1){
496
+	      error_at_line (1, 0, fname, firstline,
497
+			   _("too many slant font: `%s'"), new);
498
+	  }
499
+	  encoding_add_slant_font(encoding, new, src, raito);
500
+	}
501
       else
502
         error_at_line (1, 0, fname, firstline,
503
                        _("invalid option `%s'"), quotearg (token));
504
@@ -754,6 +938,15 @@ encoding_char_exists (struct encoding * 
505
 }
506
 
507
 /*
508
+ * Return the flag of composite flag
509
+ */
510
+int
511
+encoding_get_composite_flag (struct encoding * enc)
512
+{
513
+  return enc->composite_flag;
514
+}
515
+
516
+/*
517
  * Prepare the environment (a dictionary) for the support
518
  * of ENCODING, dump it into STREAM.
519
  *
520
@@ -766,9 +959,11 @@ dump_encoding_setup (FILE * stream,
521
 		     struct encoding * encoding)
522
 {
523
   size_t i, nb;
524
+  size_t ns;
525
   const char * real_font_name;		/* After subsitution	*/
526
   char ** font_names = (char **) encoding->font_names_used->content;
527
 
528
+
529
   /* How many fonts are there? */
530
   da_qsort (encoding->font_names_used);
531
   da_unique (encoding->font_names_used, (da_map_func_t) free);
532
@@ -787,15 +982,46 @@ dump_encoding_setup (FILE * stream,
533
    * in the current ENCODING	*/
534
   nb = encoding->font_names_used->len;
535
 
536
+  /* The number of slant fonts */
537
+  for (i= 0, ns=0 ; encoding->slantfont[i].name ; i++ )
538
+      ns++;
539
+
540
   /* Create the dictionary and fill it */
541
   fprintf (stream, "%% Dictionary for %s support\n",
542
 	  encoding->name);
543
-  fprintf (stream, "/%sdict %d dict begin\n", encoding->key, nb);
544
+  fprintf (stream, "/%sdict %d dict begin\n", encoding->key,
545
+	   (encoding->composite_flag == true)? nb+nb+ns:nb+ns);
546
   for (i = 0 ; i < nb ; i++)
547
     fprintf (stream, "  /f%s %sEncoding /%s reencode_font\n",
548
 	     font_names [i],
549
 	     encoding->name,
550
 	     encoding_resolve_font_substitute (job, encoding, font_names [i]));
551
+
552
+  /* Slant font setting */
553
+  for (i = 0 ; encoding->slantfont[i].name ; i++ )
554
+    fprintf (stream, "  /%s /%s %f slantfont  definefont pop\n",
555
+	     encoding->slantfont[i].name,
556
+	     encoding->slantfont[i].src,
557
+	     encoding->slantfont[i].raito);
558
+
559
+  /*
560
+   * Composite font setting.
561
+   * If kanji font size is larger than alphabet character, 
562
+   * set base font size to kanji charactor size.
563
+   */
564
+  if (encoding->composite_flag == true) {
565
+    for (i = 0 ; i < nb ; i++)
566
+      fprintf (stream, "  /f%s /f%s /%s %f %f false  compositefont "
567
+	               "%f scalefont def\n",
568
+	       font_names [i],
569
+	       font_names [i],
570
+	       encoding_resolve_composite_font (job, encoding, font_names [i]),
571
+	       encoding->composite_raito[i],
572
+	       (encoding->composite_raito[i] > 1.0)?
573
+	       0: (1-encoding->composite_raito[i])/2.0,
574
+	       (encoding->composite_raito[i] > 1.0)?
575
+	       1.0/encoding->composite_raito[i]: 1.0 );
576
+  }
577
   fputs ("currentdict end def\n", stream);
578
 }
579
 
580
@@ -939,6 +1165,22 @@ encoding_build_faces_wx (a2ps_job * job,
581
 				   true_font_name,
582
 				   encoding->vector,
583
 				   encoding->faces_wx [face]);
584
+
585
+      if (encoding->composite_flag)
586
+	{
587
+	  encoding->composite_raito[i] =
588
+	    composite_font_info_get_raito(job, encoding, 
589
+					  job->face_eo_font [face]);
590
+
591
+	  encoding->composite_wx[i] =
592
+	    composite_font_info_get_wx(job, encoding, 
593
+				       job->face_eo_font [face]);
594
+
595
+	  /* If kanji font size is larger than alphabet character, 
596
+	     fit kanji charactor size to base font size */
597
+	  if (encoding->composite_raito[i] < 1.0)
598
+	      encoding->composite_wx[i] *= encoding->composite_raito[i]; 
599
+	}
600
     }
601
 }
602
 
603
@@ -1073,6 +1315,13 @@ char_WX (a2ps_job * job, uchar c)
604
   return 0;	/* For -Wall */
605
 }
606
 
607
+unsigned int
608
+char_composite_WX (a2ps_job * job, uchar c)
609
+{
610
+  return (job->encoding->composite_wx[job->status->face]/
611
+	  job->encoding->composite_raito[job->status->face]);
612
+}
613
+
614
 /*
615
  *	Returns the WX of a string (including M- and ^)
616
  */
617
diff -up a2ps-4.14/lib/encoding.h.euc a2ps-4.14/lib/encoding.h
618
--- a2ps-4.14/lib/encoding.h.euc	2007-12-29 02:58:17.000000000 +0100
619
+++ a2ps-4.14/lib/encoding.h	2008-04-27 10:39:24.000000000 +0200
620
@@ -43,6 +43,7 @@ struct a2ps_job;	/* Declared in jobs.h w
621
  */
622
 unsigned int char_WX PARAMS ((struct a2ps_job * job, uchar c));
623
 unsigned int string_WX PARAMS ((struct a2ps_job * job, uchar * string));
624
+unsigned int char_composite_WX PARAMS ((struct a2ps_job * job, uchar c));
625
 
626
 
627
 /************************************************************************/
628
@@ -56,6 +57,7 @@ void encoding_self_print PARAMS ((struct
629
 					FILE * stream));
630
 int encoding_char_exists PARAMS ((struct encoding * enc,
631
 					enum face_e face, uchar c));
632
+int encoding_get_composite_flag (struct encoding * enc);
633
 struct encoding *
634
 get_encoding_by_alias PARAMS ((struct a2ps_job * job, 
635
 			       char *string));
636
@@ -71,6 +73,12 @@ const char * encoding_resolve_font_subst
637
 		 struct encoding * encoding,
638
 		 const char * font_name));
639
 
640
+
641
+const char * encoding_resolve_composite_font
642
+	PARAMS ((struct a2ps_job * job,
643
+		 struct encoding * encoding,
644
+		 const char * font_name));
645
+
646
 /*
647
  * Have a struct encoding determine the faces_wx
648
  */
649
diff -up a2ps-4.14/lib/pair_ht.c.euc a2ps-4.14/lib/pair_ht.c
650
--- a2ps-4.14/lib/pair_ht.c.euc	2007-12-29 02:58:21.000000000 +0100
651
+++ a2ps-4.14/lib/pair_ht.c	2008-04-27 10:39:24.000000000 +0200
652
@@ -49,6 +49,8 @@ struct pair
653
 {
654
   char * key;
655
   char * value;
656
+  float  raito;
657
+  int    wx;
658
 };
659
 
660
 /*
661
@@ -165,6 +167,37 @@ pair_add (struct hash_table_s * table,
662
 }
663
 
664
 /*
665
+ *  Add a pair, with your own allocation for them.
666
+ * It KEY is yet used, override its value with VALUE
667
+ */
668
+void
669
+pair_add2 (struct hash_table_s * table,
670
+	  const char * key, const char * value, int wx, float raito)
671
+{
672
+  struct pair * item, token;
673
+  
674
+  token.key = (char *) key;
675
+  item = (struct pair *) hash_find_item (table, &token);
676
+
677
+  if (item) {
678
+    if (item->value)
679
+      free (item->value);
680
+  } else {
681
+    item = XMALLOC (struct pair, 1);
682
+    item->key = xstrdup(key);
683
+    item->wx    = wx;
684
+    item->raito = raito;
685
+  }
686
+  
687
+  if (value)
688
+    item->value = xstrdup (value);
689
+  else
690
+    item->value = NULL;
691
+
692
+  hash_insert (table, item);
693
+}
694
+
695
+/*
696
  * Remove a pair and free it.
697
  * It KEY is yet used, override its value with VALUE
698
  */
699
@@ -201,6 +234,34 @@ pair_get (struct hash_table_s * table, c
700
     return NULL;
701
 }
702
 
703
+int
704
+pair_get_wx (struct hash_table_s * table, const char * key)
705
+{
706
+  struct pair * item, token;
707
+  
708
+  token.key = (char *) key;
709
+  item = (struct pair *) hash_find_item (table, &token);
710
+
711
+  if (item)
712
+    return item->wx;
713
+  else
714
+    return -1;
715
+}
716
+
717
+float
718
+pair_get_raito (struct hash_table_s * table, const char * key)
719
+{
720
+  struct pair * item, token;
721
+  
722
+  token.key = (char *) key;
723
+  item = (struct pair *) hash_find_item (table, &token);
724
+
725
+  if (item)
726
+    return item->raito;
727
+  else
728
+    return -1;
729
+}
730
+
731
 /*
732
  * Return the content of the hash table, ordered
733
  */
734
diff -up a2ps-4.14/lib/pair_ht.h.euc a2ps-4.14/lib/pair_ht.h
735
--- a2ps-4.14/lib/pair_ht.h.euc	2007-12-29 02:58:21.000000000 +0100
736
+++ a2ps-4.14/lib/pair_ht.h	2008-04-27 10:39:24.000000000 +0200
737
@@ -56,6 +56,10 @@ void pair_table_free PARAMS ((struct pai
738
 void pair_add PARAMS ((struct pair_htable * table, 
739
 		       const char * key, const char * value));
740
 
741
+void pair_add2 PARAMS ((struct pair_htable * table, 
742
+		       const char * key, const char * value,
743
+			int wx, float raito));
744
+
745
 /*
746
  * The key and value of the matching item  will be free'd
747
  * (No problem if KEY matches nothing)
748
@@ -68,6 +72,10 @@ void pair_delete PARAMS ((struct pair_ht
749
  */
750
 char * pair_get PARAMS ((struct pair_htable * table,
751
 			 const char * key));
752
+int    pair_get_wx PARAMS ((struct pair_htable * table,
753
+			    const char * key));
754
+float  pair_get_raito PARAMS ((struct pair_htable * table,
755
+			       const char * key));
756
 
757
 void pair_table_list_short PARAMS ((struct pair_htable * table,
758
 				    FILE * stream));
759
diff -up a2ps-4.14/lib/psgen.c.euc a2ps-4.14/lib/psgen.c
760
--- a2ps-4.14/lib/psgen.c.euc	2007-12-29 02:58:22.000000000 +0100
761
+++ a2ps-4.14/lib/psgen.c	2008-04-27 10:39:24.000000000 +0200
762
@@ -875,6 +875,7 @@ ps_print_char (a2ps_job * job, int c, en
763
   print:
764
   default:
765
     {
766
+      static mb_flag= 0;
767
       uchar buf[256];
768
       int nchars;
769
       *buf = '\0';
770
@@ -889,6 +890,29 @@ ps_print_char (a2ps_job * job, int c, en
771
     job->status->face_declared = false;
772
   }
773
 
774
+  if (c > 127 && encoding_get_composite_flag (job->encoding) &&
775
+      job->status->face != Symbol) {
776
+    if (mb_flag) {
777
+        nchars = ps_escape_char (job, mb_flag, buf) + 
778
+	         ps_escape_char (job, c, buf);
779
+	job->status->wx += char_composite_WX(job, c);
780
+	job->status->column += nchars;
781
+	if (line_full) {
782
+	    if (job->folding) {
783
+	        fold_line (job, new_face);
784
+		job->status->column = nchars*2;
785
+		job->status->wx = char_composite_WX(job, c);
786
+	    } else {
787
+	      job->status->is_in_cut = true;
788
+	      return;
789
+	    }
790
+	}
791
+	mb_flag = 0;
792
+    } else {
793
+        mb_flag = c;
794
+	return;
795
+    }
796
+  } else {
797
       nchars = ps_escape_char (job, c, buf);
798
       job->status->wx += char_WX (job, c);
799
       job->status->column += nchars;
800
@@ -902,8 +926,9 @@ ps_print_char (a2ps_job * job, int c, en
801
 	  return;
802
 	}
803
       }
804
+  }
805
       output (jdiv, "%s", buf);
806
-      job->status->chars++;
807
+      job->status->chars+=nchars;
808
     }
809
     break;
810
   }
811
diff -up a2ps-4.14/ps/base.ps.euc a2ps-4.14/ps/base.ps
812
--- a2ps-4.14/ps/base.ps.euc	2007-12-29 02:58:26.000000000 +0100
813
+++ a2ps-4.14/ps/base.ps	2008-04-27 10:39:24.000000000 +0200
814
@@ -153,7 +153,11 @@
815
 % Return the y size of the current font
816
 % - => fontsize
817
 /currentfontsize {
818
-  currentfont /FontMatrix get 3 get 1000 mul
819
+  currentfont /FontType get 0 eq {
820
+    currentfont /FontMatrix get 3 get
821
+  }{
822
+    currentfont /FontMatrix get 3 get 1000 mul
823
+  } ifelse
824
 } bind def
825
 
826
 % reencode the font
827
@@ -200,6 +204,144 @@
828
   end 
829
 } bind def
830
 
831
+% composite fonts for ASCII-EUC mixed string
832
+% Version 1.2 1/31/1990
833
+% Orignal Ken'ichi HANDA (handa@etl.go.jp)
834
+% Modified Norio Katayama (katayama@rd.nacsis.ac.jp),1998
835
+% Extend & Fix Koji Nakamaru (maru@on.cs.keio.ac.jp), 1999
836
+% Anyone can freely copy, modify, distribute this program.
837
+
838
+/copyfont {	% font-dic extra-entry-count  copyfont  font-dic
839
+	1 index maxlength add dict begin
840
+	{	1 index /FID ne 2 index /UniqueID ne and
841
+		{def} {pop pop} ifelse
842
+	} forall
843
+	currentdict
844
+	end
845
+} bind def
846
+
847
+/compositefont { % ASCIIFontName EUCFontName RomanScale RomanOffset Rot(T/F) compositefont font
848
+    /RomanRotation exch def
849
+    /RomanOffset exch def
850
+    /RomanScale exch def
851
+    userdict /fixeucfont_dict known not {
852
+	userdict begin
853
+	    /fixeucfont_dict 2 dict begin
854
+		/UpperByteEncoding [
855
+		    16#00 1 16#20 { pop 0 } for
856
+		    16#21 1 16#28 { 16#20 sub } for
857
+		    16#29 1 16#2F { pop 0 } for
858
+		    16#30 1 16#74 { 16#27 sub } for
859
+		    16#75 1 16#FF { pop 0 } for
860
+		] def
861
+	        /LowerByteEncoding [
862
+		    16#00 1 16#A0 { pop /.notdef } for
863
+		    16#A1 1 16#FE { 16#80 sub 16 2 string cvrs
864
+				    (cXX) dup 1 4 -1 roll
865
+				    putinterval cvn } for
866
+		    /.notdef
867
+		] def
868
+		currentdict
869
+	    end def
870
+	end
871
+    } if
872
+    findfont dup /FontType get 0 eq {
873
+	14 dict begin
874
+	    %
875
+	    % 7+8 bit EUC font
876
+	    %
877
+	    12 dict begin
878
+		/EUCFont exch def
879
+		/FontInfo (7+8 bit EUC font) readonly def
880
+		/PaintType 0 def
881
+		/FontType 0 def
882
+		/FontMatrix matrix def
883
+		% /FontName
884
+		/Encoding fixeucfont_dict /UpperByteEncoding get def
885
+		/FMapType 2 def
886
+		EUCFont /WMode known
887
+		{ EUCFont /WMode get /WMode exch def }
888
+		{ /WMode 0 def } ifelse
889
+		/FDepVector [
890
+		    EUCFont /FDepVector get 0 get
891
+		    [ 16#21 1 16#28 {} for 16#30 1 16#74 {} for ]
892
+		    {
893
+			13 dict begin
894
+			    /EUCFont EUCFont def
895
+			    /UpperByte exch 16#80 add def	
896
+			    % /FontName
897
+			    /FontInfo (EUC lower byte font) readonly def
898
+			    /PaintType 0 def
899
+			    /FontType 3 def
900
+			    /FontMatrix matrix def
901
+			    /FontBBox {0 0 0 0} def
902
+			    /Encoding
903
+				fixeucfont_dict /LowerByteEncoding get def
904
+			    % /UniqueID
905
+			    % /WMode
906
+			    /BuildChar {
907
+				gsave
908
+				exch dup /EUCFont get setfont
909
+				/UpperByte get
910
+				2 string
911
+				dup 0 4 -1 roll put
912
+				dup 1 4 -1 roll put
913
+				dup stringwidth setcharwidth
914
+				0 0 moveto show
915
+				grestore
916
+			    } bind def
917
+			    currentdict
918
+			end
919
+			/lowerbytefont exch definefont
920
+		    } forall
921
+		] def
922
+		currentdict
923
+	    end
924
+	    /eucfont exch definefont
925
+	    exch
926
+	    findfont 1 copyfont dup begin
927
+		RomanRotation {
928
+			/FontMatrix FontMatrix
929
+			[ 0 RomanScale neg RomanScale 0 RomanOffset neg 0 ]
930
+			matrix concatmatrix def
931
+		}{
932
+			/FontMatrix FontMatrix
933
+			[ RomanScale 0 0 RomanScale 0 RomanOffset ] matrix concatmatrix
934
+			def
935
+			/CDevProc
936
+			    {pop pop pop pop 0 exch -1000 exch 2 div 880} def
937
+		} ifelse
938
+	    end
939
+	    /asciifont exch definefont
940
+	    exch
941
+	    /FDepVector [ 4 2 roll ] def
942
+	    /FontType 0 def
943
+	    /WMode 0 def
944
+	    /FMapType 4 def
945
+	    /FontMatrix matrix def
946
+	    /Encoding [0 1] def
947
+	    /FontBBox {0 0 0 0} def
948
+%	    /FontHeight 1.0 def % XXXX
949
+	    /FontHeight RomanScale 1.0 ge { RomanScale }{ 1.0 } ifelse def
950
+	    /Descent -0.3 def   % XXXX
951
+	    currentdict
952
+	end
953
+	/tmpfont exch definefont
954
+	pop
955
+	/tmpfont findfont
956
+    }{
957
+	pop findfont 0 copyfont
958
+    } ifelse
959
+} def	
960
+
961
+/slantfont {	% FontName slant-degree  slantfont  font'
962
+    exch findfont 1 copyfont begin
963
+    [ 1 0 4 -1 roll 1 0 0 ] FontMatrix exch matrix concatmatrix
964
+    /FontMatrix exch def
965
+    currentdict
966
+    end
967
+} def
968
+
969
 % Function print line number (<string> # -)
970
 /# {
971
   gsave
972
diff -up /dev/null a2ps-4.14/README.eucJP
973
--- /dev/null	2008-04-27 11:55:27.307012118 +0200
974
+++ a2ps-4.14/README.eucJP	2008-04-27 10:39:24.000000000 +0200
975
@@ -0,0 +1,100 @@
976
+a2ps euc-jp kanji supported patch:
977
+by SATO Satoru <ss@gnome.gr.jp>
978
+
979
+These patches enables a2ps to support the files written in EUC-JP (and other
980
+Japanese encodings). I only arranged patches created by FURUKAWA Yasuyuki,
981
+KATAYAMA Yukio, and replaced libjcode by customized jcode.[ch] (by KITAME
982
+Takuo).
983
+
984
+Notes from the orginal patch by FURUKAWA Yukihiro is follows.
985
+(sorry, it is written in japanese only):
986
+
987
+a2ps 4.12Ǵ뤿Υѥå
988
+				ر
989
+				 Ƿ <yasu@on.cs.keio.ac.jp>
990
+
991
+composite font Ȥäƴɽ뤿ΥѥåǤ
992
+composite fontˤϡһ פ(Ϥܸghostscript
993
+)fixeucfont ١a2psѤ¿򤤤ƤޤѤ
994
+뤳Ȥǡ2ХEUCASCIIʸPostscriptΰäȴñˤ
995
996
+
997
+CompositeեȤˡˤĤ
998
+¤ϥѥå˴ޤޤƤޤΤǡȤꤢפȤϻפ
999
+⤷Ƥޤ
1000
+
1001
+encodingե($prefix/share/a2ps/encoding/βΥե)ˤ
1002
+Composite:٤ӡDefaultComposite:٤˻Ǥޤ
1003
+СѸեȤбEUC󥳡ǥ󥰤ܸեȤ
1004
+ƹԤޤޤκݡեȾѤȴꤷʤƤϤ
1005
+ޤ󡣼ȴˤäơϸեȤꤷƤϤޤ
1006
+
1007
+--------------------------------------------------
1008
+#	                  ܸե          ե	ȾѤȴ
1009
+DefaultComposite:         Ryumin-Light-EUC-H      1             1.1	
1010
+#	    Ѹե  ܸե	  ե	ȾѤȴ
1011
+Composite:  Helvetica     GothicBBB-Medium-EUC-H  1		1.1
1012
+--------------------------------------------------
1013
+
1014
+ޤȼδʤߤΤǡSlantFontȤΤδ
1015
+եȤǤޤ
1016
+
1017
+--------------------------------------------------
1018
+#               ܸե̾	ܸե	
1019
+SlantFont:	Ryumin-Light-EUC-H-Italic	Ryumin-Light-EUC-H	0.2
1020
+--------------------------------------------------
1021
+
1022
+SlantFontΥեȤCompositeե(2)ѤǤ
1023
1024
+
1025
+Υѥåξܺ٥ǡ
1026
+  ǰʤ2ХEUCɤȤǥ󥰤򤷤Ƥޤ
1027
+    ΤᡢޤʳθͤƤޤġ
1028
+  Ҹ ϺlibjcodeȤäϥեδ󥳡ǥ
1029
+    󥰤򤹤٤EUCѴƽ褦ˤƤޤꥸ
1030
+    ʥlibjcodeϡSJISEUCȽ꤬ŤäΤ¿ष
1031
+    Ƥޤ
1032
+  ޤtexdelegate(contrib/texi2dvi4a2ps)桢TeXɥ饤ФˤpTeX
1033
+    ȷᤦƤޤ줬ʤ顢㤨NTT-jTeXѤ
1034
+    硢ĶѿTEXˡjtex٤LATEXˤϡjlatex٤ꤷƤ
1035
+  compositefonta2psѤ¿ޥƤޤեȤι
1036
+    ʤɤξ˸ǷǤƤս꤬ޤ(XXXǥ
1037
+    Ƥޤ)Τᤢޤ㤤Ȼפޤ
1038
+
1039
+ȾѤѤ1/2礭ˤ
1040
+ѥåǥեȤǤʸȾʸ礭ΥХ󥹤ϡ
1041
+(ĿŪʥ󥹤)ꤹ褦˥塼˥󥰤Ƥޤ⤷ƥ
1042
+ɽƤơΤᡢȾʸѤΤ礦Ⱦʬˤ
1043
+Ȥнˡ񤤤Ƥޤ
1044
+
1045
+󥹥ȡ塢$prefix/share/a2ps/encoding/euc-jpˡ
1046
+
1047
+--------------------------------------------------
1048
+DefaultComposite:         Ryumin-Light-EUC-H      1.0  1.1
1049
+--------------------------------------------------
1050
+
1051
+ȤΤȻפޤǸΡ1.1٤0.8342٤ѹƲ
1052
+Ρޥʸ˴ؤƤϤ˾ߤη̤Ȼפޤ
1053
+
1054
+¾եȤʤɤ⡢㤨
1055
+
1056
+--------------------------------------------------
1057
+Composite: Courier-Bold   GothicBBB-Medium-EUC-H  1.0  0.8342
1058
+--------------------------------------------------
1059
+
1060
+Τ褦ѹФȻפޤʤCourierĤʤե
1061
+(Helvetica)ϤȤȥץݡʥեȤʤΤǡˤϤǤ
1062
1063
+
1064
+
1065
+
1066
+ۤˤĤ
1067
+ʤäơΥѥåϡ
1068
+
1069
+Ҹ Ϻlibjcode    һ פfixeucfont 
1070
+
1071
+Ȥ߹ƤǤΤǻ伫ȤΥɤϼ¤ϤۤȤɤޤġ
1072
+
1073
+伫ȤΥɤϺա¤˴ؤƤʤ¤ߤĤϤޤ
1074
+󡣤ʳΥɤ¿ᡢϸλꤤ
1075
1076
diff -up a2ps-4.14/src/buffer.c.euc a2ps-4.14/src/buffer.c
1077
--- a2ps-4.14/src/buffer.c.euc	2007-12-29 02:58:34.000000000 +0100
1078
+++ a2ps-4.14/src/buffer.c	2008-04-27 10:39:24.000000000 +0200
1079
@@ -41,6 +41,21 @@
1080
 #include "argmatch.h"
1081
 #include "buffer.h"
1082
 #include <assert.h>
1083
+
1084
+#ifdef HAVE_CONFIG_H
1085
+# include <config.h>
1086
+#endif
1087
+
1088
+#ifdef ENABLE_KANJI
1089
+#  include <stdio.h>
1090
+#  include <stdlib.h>
1091
+#  include <string.h>
1092
+#  include <locale.h>
1093
+#  include <errno.h>
1094
+#  include <iconv.h>
1095
+extern use_jcode;
1096
+#endif
1097
+
1098
 
1099
 /****************************************************************/
1100
 /*		 	Handling of the various eol styles	*/
1101
@@ -526,3 +541,278 @@ buffer_test (const char *filename)
1102
   buffer_release (&buffer);
1103
 }
1104
 #endif
1105
+
1106
+/**
1107
+ * from jcode.c by Takuo KITAME <kitame@northeye.org>
1108
+ */
1109
+#ifdef ENABLE_KANJI
1110
+
1111
+enum {
1112
+    JCODE_ASCII,
1113
+    JCODE_EUC,
1114
+    JCODE_JIS,
1115
+    JCODE_SJIS,
1116
+    EUCORSJIS };
1117
+
1118
+#define ESC          0x1b
1119
+#define SS2          0x8e
1120
+
1121
+#define JCODE_LOCALE_EUC   "ja", "ja_JP", "ja_JP.ujis", "ja_JP.EUC", "ja_JP.eucJP"
1122
+#define JCODE_LOCALE_JIS   "ja_JP.JIS", "ja_JP.jis", "ja_JP.iso-2022-jp"
1123
+#define JCODE_LOCALE_SJIS  "ja_JP.SJIS", "ja_JP.sjis"
1124
+
1125
+/****************************************************************************/
1126
+/* Japanese string code detector */
1127
+/****************************************************************************/
1128
+int 
1129
+detect_kanji(unsigned char *str)
1130
+{
1131
+    int expected = JCODE_ASCII;
1132
+    register int c;
1133
+    int c1, c2;
1134
+    int euc_c = 0, sjis_c = 0;
1135
+    unsigned char *ptr = str;
1136
+    
1137
+    while((c = (int)*ptr)!= '\0') {
1138
+        if(c == ESC) {
1139
+            if((c = (int)*(++ptr)) == '\0')
1140
+                break;
1141
+            if(c == '$') {
1142
+                if((c = (int)*(++ptr)) == '\0')
1143
+                    break;
1144
+                if(c == 'B' || c == '@')
1145
+                    return JCODE_JIS;
1146
+            }
1147
+            ptr++;
1148
+            continue;
1149
+        }
1150
+        if((c >= 0x81 && c <= 0x8d) || (c >= 0x8f && c <= 0x9f))
1151
+            return JCODE_SJIS;
1152
+        
1153
+        if(c == SS2) {
1154
+            if((c = (int)*(++ptr)) == '\0')
1155
+                break;
1156
+            if((c >= 0x40 && c <= 0x7e) ||
1157
+               (c >= 0x80 && c <= 0xa0) || 
1158
+               (c >= 0xe0 && c <= 0xfc))
1159
+                return JCODE_SJIS;
1160
+            if(c >= 0xa1 && c <= 0xdf)
1161
+                break;
1162
+            
1163
+            ptr++;
1164
+            continue;
1165
+        }        
1166
+        if(c >= 0xa1 && c <= 0xdf) {
1167
+            if((c = (int)*(++ptr)) == '\0')
1168
+                break;
1169
+            
1170
+            if (c >= 0xe0 && c <= 0xfe)
1171
+                return JCODE_EUC;
1172
+            if (c >= 0xa1 && c <= 0xdf) {
1173
+                expected = EUCORSJIS;
1174
+                ptr++;
1175
+                continue;
1176
+            }
1177
+#if 1
1178
+            if(c == 0xa0 || (0xe0 <= c && c <= 0xfe))
1179
+                return JCODE_EUC;
1180
+            else {
1181
+                expected = EUCORSJIS;
1182
+                ptr++;
1183
+                continue;
1184
+            }
1185
+#else
1186
+            if(c <= 0x9f)
1187
+                return JCODE_SJIS;
1188
+            if(c >= 0xf0 && c <= 0xfe)
1189
+                return JCODE_EUC;
1190
+#endif
1191
+            
1192
+            if(c >= 0xe0 && c <= 0xef) {
1193
+                expected = EUCORSJIS;
1194
+                while(c >= 0x40) {
1195
+                    if(c >= 0x81) {
1196
+                        if(c <= 0x8d || (c >= 0x8f && c <= 0x9f))
1197
+                            return JCODE_SJIS;
1198
+                        else if(c >= 0xfd && c <= 0xfe) {
1199
+                            return JCODE_EUC;
1200
+                        }
1201
+                    }
1202
+                    if((c = (int)*(++ptr)) == '\0')
1203
+                        break;
1204
+                }
1205
+                ptr++;
1206
+                continue;
1207
+            }
1208
+            
1209
+            if(c >= 0xe0 && c <= 0xef) {
1210
+                if((c = (int)*(++ptr)) == '\0')
1211
+                    break;
1212
+                if((c >= 0x40 && c <= 0x7e) || (c >= 0x80 && c <= 0xa0))
1213
+                    return JCODE_SJIS;
1214
+                if(c >= 0xfd && c <= 0xfe)
1215
+                    return JCODE_EUC;
1216
+                if(c >= 0xa1 && c <= 0xfc)
1217
+                    expected = EUCORSJIS;
1218
+            }
1219
+        }
1220
+#if 1
1221
+        if (0xf0 <= c && c <= 0xfe)
1222
+            return JCODE_EUC;
1223
+#endif
1224
+        ptr++;
1225
+    }
1226
+
1227
+   ptr = str;
1228
+   c2 = 0;
1229
+   while((c1 = (int)*ptr++) != '\0') {
1230
+       if(((c2 >  0x80 && c2 < 0xa0) || (c2 >= 0xe0 && c2 < 0xfd)) &&
1231
+          ((c1 >= 0x40 && c1 < 0x7f) || (c1 >= 0x80 && c1 < 0xfd)))
1232
+           sjis_c++, c1 = *ptr++;
1233
+       c2 = c1;
1234
+   }
1235
+   if(sjis_c == 0)
1236
+       expected = JCODE_EUC;
1237
+   else {
1238
+       ptr = str, c2 = 0;
1239
+       while((c1 = (int)*ptr++) != '\0') {
1240
+	     if((c2 > 0xa0  && c2 < 0xff) &&
1241
+            (c1 > 0xa0  && c1 < 0xff))
1242
+             euc_c++, c1 = *ptr++;
1243
+	     c2 = c1;
1244
+       }
1245
+       if(sjis_c > euc_c)
1246
+           expected = JCODE_SJIS;
1247
+       else
1248
+           expected = JCODE_EUC;
1249
+   }
1250
+   return expected;
1251
+}
1252
+
1253
+int
1254
+int_detect_JCode(char *str)
1255
+{
1256
+    int detected;
1257
+
1258
+    if(!str)
1259
+        return 0;
1260
+
1261
+    detected = detect_kanji((unsigned char *)str);
1262
+    
1263
+    if(detected == JCODE_ASCII)
1264
+        return JCODE_ASCII;
1265
+    
1266
+    switch(detected) {
1267
+    case JCODE_EUC:
1268
+        return JCODE_EUC;
1269
+        break;
1270
+    case JCODE_JIS:
1271
+        return JCODE_JIS;
1272
+        break;
1273
+    case JCODE_SJIS:  
1274
+        return JCODE_SJIS;
1275
+        break;
1276
+    default:
1277
+        return JCODE_ASCII;
1278
+        break;
1279
+    }
1280
+    
1281
+    /* not reached */
1282
+    return 0;
1283
+}
1284
+
1285
+const char *
1286
+detect_JCode(char *str)
1287
+{
1288
+    int detected;
1289
+
1290
+    if(!str)
1291
+        return NULL;
1292
+
1293
+    detected = detect_kanji((unsigned char *)str);
1294
+    
1295
+    if(detected == JCODE_ASCII)
1296
+        return "ASCII";
1297
+
1298
+    switch(detected) {
1299
+    case JCODE_EUC:
1300
+        return "EUC-JP";
1301
+        break;
1302
+    case JCODE_JIS:
1303
+        return "ISO-2022-JP";
1304
+        break;
1305
+    case JCODE_SJIS:  
1306
+        return "SJIS";
1307
+        break;
1308
+    default:
1309
+        return "ASCII";
1310
+        break;
1311
+    }
1312
+    
1313
+    /* not reached */
1314
+    return 0;
1315
+}
1316
+
1317
+char *
1318
+kanji_conv_auto(char *str, const char *dstset)
1319
+{
1320
+    unsigned char *buf, *ret;
1321
+    iconv_t cd;
1322
+    size_t insize = 0;
1323
+    size_t outsize = 0;
1324
+    size_t nconv = 0;
1325
+    char *inptr;
1326
+    char *outptr;
1327
+    char srcset[16];
1328
+    
1329
+    if(!str)
1330
+        return NULL;
1331
+    
1332
+    switch (int_detect_JCode(str)) {
1333
+    case JCODE_EUC:
1334
+        strcpy(srcset, "EUC-JP");
1335
+        break;
1336
+    case JCODE_JIS:
1337
+        strcpy(srcset, "ISO-2022-JP");
1338
+        break;
1339
+    case JCODE_SJIS:
1340
+        strcpy(srcset, "SJIS");
1341
+        break;
1342
+    default:
1343
+        return strdup(str);
1344
+        break;
1345
+    }
1346
+    
1347
+    buf = (unsigned char *)malloc(strlen(str)* 4 + 1);
1348
+    if(!buf)
1349
+        return NULL;
1350
+    
1351
+    insize = strlen(str);
1352
+    inptr = str;
1353
+    outsize = strlen(str) * 4 ;
1354
+    outptr = buf;
1355
+    
1356
+    cd = iconv_open(dstset, srcset);
1357
+    if(cd == (iconv_t) -1) {
1358
+        if(errno == EINVAL)
1359
+            return strdup(str);
1360
+    }
1361
+    
1362
+    nconv = iconv(cd, (const char **)&inptr, &insize, &outptr, &outsize);
1363
+    if(nconv == (size_t) -1) {
1364
+        if (errno == EINVAL)
1365
+            memmove (buf, inptr, insize);
1366
+    } else
1367
+        iconv(cd, NULL, NULL, &outptr, &outsize);
1368
+    
1369
+    *outptr = '\0';
1370
+    iconv_close(cd);
1371
+    
1372
+    ret = strdup(buf);
1373
+    free(buf);
1374
+    
1375
+    return ret;
1376
+}
1377
+
1378
+#endif
1379
+
1380
diff -up a2ps-4.14/src/buffer.h.euc a2ps-4.14/src/buffer.h
1381
--- a2ps-4.14/src/buffer.h.euc	2007-12-29 02:58:35.000000000 +0100
1382
+++ a2ps-4.14/src/buffer.h	2008-04-27 10:39:24.000000000 +0200
1383
@@ -104,4 +104,15 @@ void buffer_sample_get PARAMS ((buffer_t
1384
 void buffer_save PARAMS ((buffer_t * buffer, const char * filename));
1385
 
1386
 #define buffer_is_empty(Buf) (Buf->curr >= Buf->len)
1387
+
1388
+
1389
+/**
1390
+ * from jcode.h by Takuo KITAME
1391
+ */
1392
+
1393
+char *kanji_conv_auto(char *str, const char *dstset);
1394
+
1395
+const char *detect_JCode(char *str);
1396
+int int_detect_JCode(char *str);
1397
+
1398
 #endif
1399
diff -up a2ps-4.14/src/Makefile.am.euc a2ps-4.14/src/Makefile.am
1400
--- a2ps-4.14/src/Makefile.am.euc	2007-12-29 02:36:09.000000000 +0100
1401
+++ a2ps-4.14/src/Makefile.am	2008-04-27 10:39:24.000000000 +0200
1402
@@ -33,13 +33,13 @@ DEFS = @DEFS@ -DLOCALEDIR=\"$(datadir)/l
1403
 a2ps_SOURCES = main.c \
1404
 read.c sshread.c ssheet.c select.c generate.c 			\
1405
 delegate.c regex.c buffer.c versions.c ffaces.c			\
1406
-version-etc.c long-options.c					\
1407
+version-etc.c long-options.c jcode.c				\
1408
 parsessh.y lexssh.l lexps.l sheets-map.l
1409
 
1410
 noinst_HEADERS = main.h \
1411
 read.h sshread.h ssheet.h select.h generate.h			\
1412
 delegate.h regex.h buffer.h versions.h ffaces.h			\
1413
-version-etc.h long-options.h					\
1414
+version-etc.h long-options.h jcode.h				\
1415
 yy2ssh.h lexps.h
1416
 
1417
 BUILT_SOURCES = parsessh.c parsessh.h
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13-euckr.patch
... ... @@ -0,0 +1,148 @@
1
diff -up a2ps-4.14/encoding/encoding.map.euckr a2ps-4.14/encoding/encoding.map
2
--- a2ps-4.14/encoding/encoding.map.euckr	2008-04-27 01:46:59.000000000 +0200
3
+++ a2ps-4.14/encoding/encoding.map	2008-04-27 01:46:59.000000000 +0200
4
@@ -100,6 +100,12 @@ japanese		euc-jp
5
 ja			euc-jp
6
 jp			euc-jp
7
 
8
+euc-kr			euc-kr
9
+euc-kr			euc-kr
10
+korean			euc-kr
11
+ko			euc-kr
12
+kr			euc-kr
13
+
14
 ########################################################################
15
 # Some architectures specific char sets
16
 ########################################################################
17
diff -up /dev/null a2ps-4.14/encoding/euc-kr.edf
18
--- /dev/null	2008-04-26 20:48:40.298012400 +0200
19
+++ a2ps-4.14/encoding/euc-kr.edf	2008-04-27 01:46:59.000000000 +0200
20
@@ -0,0 +1,104 @@
21
+# Description of the EUC-KR encoding
22
+# Copyright (c) 1988, 89, 90, 91, 92, 93 Miguel Santana
23
+# Copyright (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana
24
+# Copyright (c) 2003 Red Hat Inc.
25
+#
26
+
27
+#
28
+# This file is part of a2ps.
29
+# 
30
+# This program is free software; you can redistribute it and/or modify
31
+# it under the terms of the GNU General Public License as published by
32
+# the Free Software Foundation; either version 2, or (at your option)
33
+# any later version.
34
+#
35
+# This program is distributed in the hope that it will be useful,
36
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
37
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
38
+# GNU General Public License for more details.
39
+#
40
+# You should have received a copy of the GNU General Public License
41
+# along with this program; see the file COPYING.  If not, write to
42
+# the Free Software Foundation, 59 Temple Place - Suite 330,
43
+# Boston, MA 02111-1307, USA.
44
+#
45
+
46
+#
47
+# This file is derived from euc-jp.edf.
48
+# Just font is renamed.
49
+# The bug should go into our bugilla. http://bugzilla.redhat.com/
50
+#
51
+
52
+Name: EUC-KR
53
+
54
+Documentation
55
+EUC-KR is Korean charset.
56
+EndDocumentation
57
+
58
+# If there is an unknown font requested, use Courier
59
+Default: Courier
60
+
61
+# Automatic spell checking :)
62
+Substitute: 	Times			Times-Roman
63
+Substitute: 	Helvetica-Italic	Helvetica-Oblique
64
+Substitute: 	Helvetica-BoldItalic	Helvetica-BoldOblique
65
+
66
+
67
+# SlantFont for Korean font
68
+#		new font			source font		value
69
+SlantFont:	Baekmuk-Gulim--KSC-EUC-H-Italic	Baekmuk-Gulim--KSC-EUC-H	0.2
70
+SlantFont:	Baekmuk-Dotum--KSC-EUC-H-Italic	Baekmuk-Dotum--KSC-EUC-H	0.2
71
+
72
+# Compose font for Korean EUC code
73
+#		target font		additional font			width	size rate
74
+DefaultComposite:			Baekmuk-Gulim--KSC-EUC-H		1.0	1.1
75
+
76
+# 1:2 fixed
77
+#DefaultComposite:			Baekmuk-Gulim--KSC-EUC-H		1.0	0.8333
78
+
79
+# 1:1 fixed
80
+#DefaultComposite:			Baekmuk-Gulim--KSC-EUC-H		1.0	1.6666
81
+
82
+Composite:	Helvetica		Baekmuk-Dotum--KSC-EUC-H		1.0	1.1
83
+Composite:	Helvetica-Oblique	Baekmuk-Dotum--KSC-EUC-H-Italic	1.0 	1.1
84
+Composite:	Helvetica-Bold		Baekmuk-Dotum--KSC-EUC-H  	1.0 	1.1
85
+Composite:	Helvetica-BoldOblique	Baekmuk-Dotum--KSC-EUC-H-Italic	1.0	1.1
86
+
87
+Composite:	Courier-Oblique		Baekmuk-Gulim--KSC-EUC-H-Italic	1.0	1.1
88
+Composite:	Courier-Bold		Baekmuk-Dotum--KSC-EUC-H		1.0	1.1
89
+Composite:	Courier-BoldOblique	Baekmuk-Dotum--KSC-EUC-H-Italic	1.0	1.1
90
+Composite:	Times-Bold		Baekmuk-Dotum--KSC-EUC-H		1.0	1.1
91
+
92
+Vector:
93
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
94
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
95
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
96
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
97
+space exclam quotedbl numbersign dollar percent ampersand quoteright
98
+parenleft parenright asterisk plus comma minus period slash
99
+zero one two three four five six seven
100
+eight nine colon semicolon less equal greater question
101
+at A B C D E F G
102
+H I J K L M N O
103
+P Q R S T U V W
104
+X Y Z bracketleft backslash bracketright asciicircum underscore
105
+quoteleft a b c d e f g
106
+h i j k l m n o
107
+p q r s t u v w
108
+x y z braceleft bar braceright asciitilde .notdef
109
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
110
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
111
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
112
+.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
113
+space exclamdown cent sterling currency yen brokenbar section
114
+dieresis copyright ordfeminine guillemotleft logicalnot hyphen registered macron
115
+degree plusminus twosuperior threesuperior acute mu paragraph bullet
116
+cedilla onesuperior ordmasculine guillemotright onequarter onehalf threequarters questiondown
117
+Agrave Aacute Acircumflex Atilde Adieresis Aring AE Ccedilla
118
+Egrave Eacute Ecircumflex Edieresis Igrave Iacute Icircumflex Idieresis
119
+Eth Ntilde Ograve Oacute Ocircumflex Otilde Odieresis multiply
120
+Oslash Ugrave Uacute Ucircumflex Udieresis Yacute Thorn germandbls
121
+agrave aacute acircumflex atilde adieresis aring ae ccedilla
122
+egrave eacute ecircumflex edieresis igrave iacute icircumflex idieresis
123
+eth ntilde ograve oacute ocircumflex otilde odieresis divide
124
+oslash ugrave uacute ucircumflex udieresis yacute thorn ydieresis
125
diff -up a2ps-4.14/encoding/Makefile.am.euckr a2ps-4.14/encoding/Makefile.am
126
--- a2ps-4.14/encoding/Makefile.am.euckr	2008-04-27 01:46:59.000000000 +0200
127
+++ a2ps-4.14/encoding/Makefile.am	2008-04-27 01:47:58.000000000 +0200
128
@@ -16,7 +16,7 @@ major_encodings = ascii.edf iso1.edf
129
 minor_encodings = \
130
 ms-cp1250.edf hp.edf mac.edf ibm-cp437.edf ibm-cp850.edf iso2.edf	\
131
 iso3.edf iso4.edf iso5.edf iso7.edf iso9.edf iso10.edf iso13.edf	\
132
-iso15.edf koi8.edf ms-cp1251.edf euc-jp.edf
133
+iso15.edf koi8.edf ms-cp1251.edf euc-jp.edf euc-kr.edf
134
 
135
 if EXTENSIONS
136
 encodings_DATA = encoding.map $(major_encodings) $(minor_encodings)
137
diff -up a2ps-4.14/encoding/Makefile.in.euckr a2ps-4.14/encoding/Makefile.in
138
--- a2ps-4.14/encoding/Makefile.in.euckr	2008-04-27 01:46:59.000000000 +0200
139
+++ a2ps-4.14/encoding/Makefile.in	2008-04-27 01:48:09.000000000 +0200
140
@@ -270,7 +270,7 @@ major_encodings = ascii.edf iso1.edf
141
 minor_encodings = \
142
 ms-cp1250.edf hp.edf mac.edf ibm-cp437.edf ibm-cp850.edf iso2.edf	\
143
 iso3.edf iso4.edf iso5.edf iso7.edf iso9.edf iso10.edf iso13.edf	\
144
-iso15.edf koi8.edf ms-cp1251.edf euc-jp.edf
145
+iso15.edf koi8.edf ms-cp1251.edf euc-jp.edf euc-kr.edf
146
 
147
 @EXTENSIONS_FALSE@encodings_DATA = encoding.map $(major_encodings)
148
 @EXTENSIONS_TRUE@encodings_DATA = encoding.map $(major_encodings) $(minor_encodings)
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13-glibcpaper.patch
... ... @@ -0,0 +1,86 @@
1
--- a2ps-4.13/lib/jobs.c.glibcpaper	Sat Jan 15 18:15:07 2000
2
+++ a2ps-4.13/lib/jobs.c	Tue Feb 20 18:44:48 2001
3
@@ -138,6 +138,7 @@
4
   setlocale (LC_MESSAGES, "");
5
 #endif
6
   setlocale (LC_CTYPE, "");
7
+  setlocale (LC_PAPER, "");
8
 
9
   bindtextdomain (PACKAGE, LOCALEDIR);
10
   textdomain (PACKAGE);
11
--- a2ps-4.13/lib/options.c.glibcpaper	Tue Aug 31 13:42:41 1999
12
+++ a2ps-4.13/lib/options.c	Tue Feb 20 18:44:48 2001
13
@@ -54,6 +54,8 @@
14
 #include "argv.h"
15
 #include "quotearg.h"
16
 #include "filalign.h"
17
+#include <locale.h>
18
+#include <langinfo.h>
19
 
20
 #define MAN_LINES               66	/* no lines for a man */
21
 extern char *program_name;
22
@@ -281,7 +283,8 @@
23
   struct opt_optarg *opt_optarg_head = NULL;
24
   struct opt_optarg *opt_optarg = NULL;
25
   int res;
26
-
27
+  unsigned int paper_height=0;
28
+  
29
   /* Reset optind so that getopt is reinitialized. */
30
   optind = 0;
31
 
32
@@ -545,7 +548,14 @@
33
 	break;
34
 
35
       case 'M':                 		/* select a medium */
36
-	xstrcpy (job->medium_request, optarg);
37
+          if(strcasecmp("_glibc",optarg)==0){
38
+              paper_height = ((union { char *string; unsigned int word; })nl_langinfo(_NL_PAPER_HEIGHT)).word;
39
+              if(paper_height==279) /* US Letter */
40
+                  strcpy(optarg,"letter");
41
+              else /* Everyone else */
42
+                  strcpy(optarg,"a4");
43
+          }
44
+          xstrcpy (job->medium_request, optarg);
45
 	break;
46
 
47
       case 'n':				/* n copies */
48
--- a2ps-4.13/src/main.c.glibcpaper	Wed Jan 26 19:29:15 2000
49
+++ a2ps-4.13/src/main.c	Tue Feb 20 18:45:18 2001
50
@@ -945,6 +945,7 @@
51
   setlocale (LC_MESSAGES, "");
52
 #endif
53
   setlocale (LC_CTYPE, "");
54
+  setlocale (LC_PAPER, "");
55
 
56
   bindtextdomain (PACKAGE, LOCALEDIR);
57
   textdomain (PACKAGE);
58
--- a2ps-4.13/doc/a2ps.texi.glibcpaper	Wed Jan 23 12:36:30 2002
59
+++ a2ps-4.13/doc/a2ps.texi	Wed Jan 23 12:40:08 2002
60
@@ -1363,6 +1363,12 @@
61
 ask the library @code{libpaper} for the medium to use.  This choice is
62
 valid only if @code{libpaper} was available when @pack{} was configured.
63
 See the man page of @code{paperconf} for more information.
64
+
65
+The special @var{medium} @samp{_glibc} (which, in this Red Hat Linux
66
+version of @samp{a2ps}, is the default) means that you want the medium
67
+to be determined by the locale category @samp{LC_PAPER}.  Note that this
68
+information is obtained from environment variables which may not be set
69
+up in non-interactive environments (such as in a cron job).
70
 @end defvr
71
 
72
 @defvr {Option}  -r
73
--- a2ps-4.13/man/a2ps.1.glibcpaper	Wed Jan 23 12:42:36 2002
74
+++ a2ps-4.13/man/a2ps.1	Wed Jan 23 12:45:05 2002
75
@@ -60,6 +60,11 @@
76
 .TP
77
 \fB\-M\fR, \fB\-\-medium\fR=\fINAME\fR
78
 use output medium NAME
79
+
80
+The default behaviour is to use the locale category
81
+\fBLC_PAPER\fR to determine the medium to use.  Note that this
82
+information is obtained from environment variables which may not be set
83
+up in non-interactive environments (such as in a cron job).
84
 .TP
85
 \fB\-r\fR, \fB\-\-landscape\fR
86
 print in landscape mode
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13-gnusource.patch
... ... @@ -0,0 +1,18 @@
1
--- a2ps-4.13/src/main.c.gnusource	2003-10-17 17:07:05.000000000 +0100
2
+++ a2ps-4.13/src/main.c	2003-10-17 17:07:17.000000000 +0100
3
@@ -30,6 +30,7 @@
4
 /*                      I n c l u d e   f i l e s                       */
5
 /*                                                                      */
6
 /************************************************************************/
7
+#define _GNU_SOURCE
8
 #include <assert.h>
9
 #include <string.h>
10
 #include <langinfo.h>
11
@@ -105,7 +106,6 @@
12
    defined twice, see lib/confg.gperf, handling of `Options:'. */
13
 
14
 char *program_name;
15
-const char *program_invocation_name;
16
 
17
 /* Stores the data of liba2ps.  */
18
 
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13-hebrew.patch
... ... @@ -0,0 +1,118 @@
1
diff -up a2ps-4.14/encoding/encoding.map.hebrew a2ps-4.14/encoding/encoding.map
2
--- a2ps-4.14/encoding/encoding.map.hebrew	2008-04-27 01:50:14.000000000 +0200
3
+++ a2ps-4.14/encoding/encoding.map	2008-04-27 01:50:14.000000000 +0200
4
@@ -65,6 +65,9 @@ iso-8859-5		iso5
5
 iso7			iso7
6
 iso-8859-7		iso7
7
 
8
+iso8			iso8
9
+iso-8859-8		iso8
10
+
11
 # The following lines _are_not_an_error_.
12
 # This is the right correspondance between ISO-8859 names
13
 # and the Latin n nick name.
14
diff -up /dev/null a2ps-4.14/encoding/iso8.edf
15
--- /dev/null	2008-04-26 20:48:40.298012400 +0200
16
+++ a2ps-4.14/encoding/iso8.edf	2008-04-27 01:50:14.000000000 +0200
17
@@ -0,0 +1,77 @@
18
+# Description of the ISO-8859-8 encoding
19
+# Copyright (c) 1988, 89, 90, 91, 92, 93 Miguel Santana
20
+# Copyright (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana
21
+#
22
+
23
+#
24
+# This file is part of a2ps.
25
+# 
26
+# This program is free software; you can redistribute it and/or modify
27
+# it under the terms of the GNU General Public License as published by
28
+# the Free Software Foundation; either version 2, or (at your option)
29
+# any later version.
30
+#
31
+# This program is distributed in the hope that it will be useful,
32
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
33
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
34
+# GNU General Public License for more details.
35
+#
36
+# You should have received a copy of the GNU General Public License
37
+# along with this program; see the file COPYING.  If not, write to
38
+# the Free Software Foundation, 59 Temple Place - Suite 330,
39
+# Boston, MA 02111-1307, USA.
40
+#
41
+
42
+Name: ISO-8859-8
43
+
44
+# This text is reproduced by a courtesy of Roman Czyborra
45
+# http://czyborra.com/charsets/iso8859.html
46
+Documentation
47
+The Hebrew (8bit) encoding
48
+EndDocumentation
49
+
50
+# This file has been specifically adapted for use with Hebrew Culmus fonts
51
+
52
+# If there is an unknown font requested, use Courier
53
+Default: MiriamMonoCLM-Book
54
+
55
+# Automatic spell checking :)
56
+Substitute: 	Times			DavidCLM-Medium
57
+Substitute: 	Helvetica		NachlieliCLM-Light
58
+Substitute: 	Helvetica-Bold		NachlieliCLM-Bold
59
+Substitute:	Courier			MiriamMonoCLM-Book
60
+Substitute:	Courier-Bold		MiriamMonoCLM-Bold
61
+
62
+Vector:
63
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
64
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
65
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
66
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
67
+space exclam quotedbl numbersign dollar percent ampersand quotesingle
68
+parenleft parenright asterisk plus comma hyphen period slash
69
+zero one two three four five six seven
70
+eight nine colon semicolon less equal greater question
71
+at A B C D E F G
72
+H I J K L M N O
73
+P Q R S T U V W
74
+X Y Z bracketleft backslash bracketright asciicircum underscore
75
+grave a b c d e f g
76
+h i j k l m n o
77
+p q r s t u v w
78
+x y z braceleft bar braceright asciitilde .notdef
79
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
80
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
81
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
82
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
83
+space exclamdown cent sterling currency yen brokenbar section
84
+dieresis copyright ordfeminine guillemotleft logicalnot hyphen registered macron
85
+degree plusminus twosuperior threesuperior acute mu paragraph bullet
86
+cedilla onesuperior ordmasculine guillemotright onequarter onehalf threequarters .notdef
87
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
88
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
89
+notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
90
+notdef .notdef .notdef .notdef .notdef .notdef .notdef underscoredbl
91
+afii57664 afii57665 afii57666 afii57667 afii57668 afii57669 afii57670 afii57671
92
+afii57672 afii57673 afii57674 afii57675 afii57676 afii57677 afii57678 afii57679 
93
+afii57680 afii57681 afii57682 afii57683 afii57684 afii57685 afii57686 afii57687 
94
+afii57688 afii57689 afii57690 .notdef .notdef .notdef .notdef .notdef 
95
diff -up a2ps-4.14/encoding/Makefile.am.hebrew a2ps-4.14/encoding/Makefile.am
96
--- a2ps-4.14/encoding/Makefile.am.hebrew	2008-04-27 01:51:14.000000000 +0200
97
+++ a2ps-4.14/encoding/Makefile.am	2008-04-27 01:52:11.000000000 +0200
98
@@ -15,7 +15,7 @@ encodingsdir = $(pkgdatadir)/encoding
99
 major_encodings = ascii.edf iso1.edf
100
 minor_encodings = \
101
 ms-cp1250.edf hp.edf mac.edf ibm-cp437.edf ibm-cp850.edf iso2.edf	\
102
-iso3.edf iso4.edf iso5.edf iso7.edf iso9.edf iso10.edf iso13.edf	\
103
+iso3.edf iso4.edf iso5.edf iso7.edf iso8.edf iso9.edf iso10.edf iso13.edf	\
104
 iso15.edf koi8.edf ms-cp1251.edf euc-jp.edf euc-kr.edf
105
 
106
 if EXTENSIONS
107
diff -up a2ps-4.14/encoding/Makefile.in.hebrew a2ps-4.14/encoding/Makefile.in
108
--- a2ps-4.14/encoding/Makefile.in.hebrew	2008-04-27 01:50:14.000000000 +0200
109
+++ a2ps-4.14/encoding/Makefile.in	2008-04-27 01:52:01.000000000 +0200
110
@@ -269,7 +269,7 @@ encodingsdir = $(pkgdatadir)/encoding
111
 major_encodings = ascii.edf iso1.edf
112
 minor_encodings = \
113
 ms-cp1250.edf hp.edf mac.edf ibm-cp437.edf ibm-cp850.edf iso2.edf	\
114
-iso3.edf iso4.edf iso5.edf iso7.edf iso9.edf iso10.edf iso13.edf	\
115
+iso3.edf iso4.edf iso5.edf iso7.edf iso8.edf iso9.edf iso10.edf iso13.edf	\
116
 iso15.edf koi8.edf ms-cp1251.edf euc-jp.edf euc-kr.edf
117
 
118
 @EXTENSIONS_FALSE@encodings_DATA = encoding.map $(major_encodings)
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13-security.patch
... ... @@ -0,0 +1,65 @@
1
--- a2ps-4.13/lib/routines.c.security	Sat Oct 16 05:46:37 1999
2
+++ a2ps-4.13/lib/routines.c	Mon Feb 12 17:45:15 2001
3
@@ -242,3 +242,50 @@
4
   /* Don't complain if you can't unlink.  Who cares of a tmp file? */
5
   unlink (filename);
6
 }
7
+
8
+/*
9
+ * Securely generate a temp file, and make sure it gets
10
+ * deleted upon exit.
11
+ */
12
+static char **	tempfiles;
13
+static unsigned	ntempfiles;
14
+
15
+static void
16
+cleanup_tempfiles()
17
+{
18
+	while (ntempfiles--)
19
+		unlink(tempfiles[ntempfiles]);
20
+}
21
+
22
+char *
23
+safe_tempnam(const char *pfx)
24
+{
25
+	char	*dirname, *filename;
26
+	int	fd;
27
+
28
+	if (!(dirname = getenv("TMPDIR")))
29
+		dirname = "/tmp";
30
+
31
+	tempfiles = (char **) realloc(tempfiles,
32
+			(ntempfiles+1) * sizeof(char *));
33
+	if (tempfiles == NULL)
34
+		return NULL;
35
+
36
+	filename = malloc(strlen(dirname) + strlen(pfx) + sizeof("/XXXXXX"));
37
+	if (!filename)
38
+		return NULL;
39
+
40
+	sprintf(filename, "%s/%sXXXXXX", dirname, pfx);
41
+
42
+	if ((fd = mkstemp(filename)) < 0) {
43
+		free(filename);
44
+		return NULL;
45
+	}
46
+	close(fd);
47
+
48
+	if (ntempfiles == 0)
49
+		atexit(cleanup_tempfiles);
50
+	tempfiles[ntempfiles++] = filename;
51
+
52
+	return filename;
53
+}
54
--- a2ps-4.13/lib/routines.h.security	Mon Oct 18 21:24:41 1999
55
+++ a2ps-4.13/lib/routines.h	Mon Feb 12 17:39:30 2001
56
@@ -255,7 +255,8 @@
57
 /* If _STR_ is not defined, give it a tempname in _TMPDIR_ */
58
 #define tempname_ensure(Str)				\
59
 do {							\
60
-  (Str) = (Str) ? (Str) : tempnam (NULL, "a2_");	\
61
+  (Str) = (Str) ? (Str) : safe_tempnam("a2_");	\
62
 } while (0)
63
+char * safe_tempnam(const char *);
64
 
65
 #endif
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13b-attr.patch
... ... @@ -0,0 +1,92 @@
1
--- a2ps-4.13/lib/fonts.c.attr	Wed Jan  9 14:41:27 2002
2
+++ a2ps-4.13/lib/fonts.c	Wed Jan  9 14:42:01 2002
3
@@ -2173,7 +2173,7 @@
4
  * in the encoding specific dictionary
5
  */
6
 int
7
-font_is_to_reencode (PARAM_UNUSED struct a2ps_job * job, const char * key)
8
+font_is_to_reencode (struct a2ps_job * job PARAM_UNUSED, const char * key)
9
 {
10
   return !strequ (key, "Symbol");
11
 }
12
--- a2ps-4.13/lib/lister.c.attr	Wed Jan  9 14:41:30 2002
13
+++ a2ps-4.13/lib/lister.c	Wed Jan  9 14:42:28 2002
14
@@ -333,7 +333,7 @@
15
 }
16
 
17
 void
18
-lister_fprint_vertical (struct lister * lister, PARAM_UNUSED FILE *unused,
19
+lister_fprint_vertical (struct lister * lister, FILE *unused PARAM_UNUSED,
20
 			void **items, size_t item_number,
21
 			lister_width_t item_width_fn,
22
 			lister_print_t item_print_fn)
23
@@ -483,7 +483,7 @@
24
 /* FIXME: document */
25
 
26
 void
27
-lister_fprint_horizontal (struct lister * lister, PARAM_UNUSED FILE *unused,
28
+lister_fprint_horizontal (struct lister * lister, FILE *unused PARAM_UNUSED,
29
 			  void **items, size_t item_number,
30
 			  lister_width_t item_width_fn,
31
 			  lister_print_t item_print_fn)
32
@@ -577,7 +577,7 @@
33
 */
34
 
35
 void
36
-lister_fprint_separated (struct lister * lister,PARAM_UNUSED FILE *unused,
37
+lister_fprint_separated (struct lister * lister,FILE *unused PARAM_UNUSED,
38
 			 void **items, size_t item_number,
39
 			 lister_width_t item_width_fn,
40
 			 lister_print_t item_print_fn)
41
--- a2ps-4.13/lib/media.c.attr	Wed Jan  9 14:41:33 2002
42
+++ a2ps-4.13/lib/media.c	Wed Jan  9 14:42:35 2002
43
@@ -190,7 +190,7 @@
44
 
45
 /* Is libpaper used? */
46
 bool
47
-a2ps_medium_libpaper_p (PARAM_UNUSED a2ps_job * job, const char * name)
48
+a2ps_medium_libpaper_p (a2ps_job * job PARAM_UNUSED, const char * name)
49
 {
50
   return strequ (name, LIBPAPER_MEDIUM) ? true : false;
51
 }
52
--- a2ps-4.13/lib/pathwalk.c.attr	Wed Jan  9 14:41:38 2002
53
+++ a2ps-4.13/lib/pathwalk.c	Wed Jan  9 14:42:47 2002
54
@@ -425,14 +425,14 @@
55
 /* Helping functions for pw_glob. */
56
 
57
 static bool
58
-pw_filter_fnmatch (PARAM_UNUSED const char * dir, const char *file,
59
+pw_filter_fnmatch (const char * dir PARAM_UNUSED, const char *file,
60
 		   const char *pattern)
61
 {
62
   return !fnmatch (pattern, file, 0);
63
 }
64
 
65
 static void
66
-pw_filter_da_append (PARAM_UNUSED const char * dir, const char *file,
67
+pw_filter_da_append (const char * dir PARAM_UNUSED, const char *file,
68
 		     struct darray *da)
69
 {
70
   da_append (da, xstrdup (file));
71
--- a2ps-4.13/lib/routines.c.attr	Wed Jan  9 14:41:42 2002
72
+++ a2ps-4.13/lib/routines.c	Wed Jan  9 14:42:54 2002
73
@@ -235,7 +235,7 @@
74
  * Unlink the file FILENAME.
75
  */
76
 void
77
-unlink2 (PARAM_UNUSED void * dummy, const char * filename)
78
+unlink2 (void * dummy PARAM_UNUSED, const char * filename)
79
 {
80
   message (msg_tool | msg_file, (stderr, "Unlinking file `%s'\n", filename));
81
 
82
--- a2ps-4.13/lib/fonts.l.attr	Wed Jan  9 14:58:38 2002
83
+++ a2ps-4.13/lib/fonts.l	Wed Jan  9 14:58:52 2002
84
@@ -585,7 +585,7 @@
85
  * in the encoding specific dictionary
86
  */
87
 int
88
-font_is_to_reencode (PARAM_UNUSED struct a2ps_job * job, const char * key)
89
+font_is_to_reencode (struct a2ps_job * job PARAM_UNUSED, const char * key)
90
 {
91
   return !strequ (key, "Symbol");
92
 }
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13b-encoding.patch
... ... @@ -0,0 +1,50 @@
1
--- a2ps-4.13/etc/a2ps-site.cfg.in.encoding	2000-01-15 23:39:36.000000000 +0000
2
+++ a2ps-4.13/etc/a2ps-site.cfg.in	2002-08-05 10:22:20.000000000 +0100
3
@@ -11,7 +11,7 @@
4
 #################################################################
5
 
6
 # Default encoding
7
-Options: --encoding=@ENCODING@
8
+#Options: --encoding=@ENCODING@
9
 
10
 # Default medium
11
 Options: --medium=@MEDIUM@
12
--- a2ps-4.13/src/main.c.encoding	2002-08-05 10:22:20.000000000 +0100
13
+++ a2ps-4.13/src/main.c	2002-08-05 10:22:20.000000000 +0100
14
@@ -32,6 +32,7 @@
15
 /************************************************************************/
16
 #include <assert.h>
17
 #include <string.h>
18
+#include <langinfo.h>
19
 #include <locale.h>
20
 
21
 #include "a2ps.h"
22
@@ -1021,9 +1022,8 @@
23
   sheets_map = sheets_map_new ();
24
   style_sheets = new_style_sheets ();
25
 
26
-  /* Process special case: Japanese Document */
27
-  if (! strncmp (locale, "ja", 2) )
28
-    job->requested_encoding_name = xstrdup ("euc-jp");
29
+  /* Use locale to set default encoding. */
30
+  job->requested_encoding_name = xstrdup (nl_langinfo (CODESET));
31
 
32
   /* Process the command line options. */
33
   argn = a2ps_handle_options (job, argc, argv);
34
--- a2ps-4.13/encoding/encoding.map.encoding	2002-08-05 10:22:20.000000000 +0100
35
+++ a2ps-4.13/encoding/encoding.map	2002-08-05 10:38:55.000000000 +0100
36
@@ -45,6 +45,7 @@
37
 latin1			iso1
38
 iso1			iso1
39
 iso-8859-1		iso1
40
+ansi_x3.4-1968		iso1
41
 
42
 latin2			iso2
43
 iso2			iso2
44
@@ -128,3 +129,6 @@
45
 # Apple' Macintosh
46
 mac			mac
47
 macintosh		mac
48
+
49
+# We don't handle UTF-8 at all yet.  Sometimes latin1 will work...
50
+utf-8			iso1
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13b-numeric.patch
... ... @@ -0,0 +1,10 @@
1
--- a2ps-4.13/src/main.c.numeric	Wed Jan  9 14:59:46 2002
2
+++ a2ps-4.13/src/main.c	Wed Jan  9 15:03:52 2002
3
@@ -951,6 +951,7 @@
4
   setlocale (LC_PAPER, "");
5
 
6
   locale = setlocale (LC_ALL, "");
7
+  setlocale (LC_NUMERIC, "C");
8
   /* fprintf(stderr, "locale : %s\n", locale); */
9
 
10
   bindtextdomain (PACKAGE, LOCALEDIR);
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.13b-tilde.patch
... ... @@ -0,0 +1,11 @@
1
--- a2ps-4.13/encoding/koi8.edf.tilde	2002-06-21 12:59:41.000000000 +0100
2
+++ a2ps-4.13/encoding/koi8.edf	2002-06-21 13:00:02.000000000 +0100
3
@@ -60,7 +60,7 @@
4
 greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y
5
 Z bracketleft backslash bracketright asciicircum underscore quoteleft
6
 a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar
7
-braceright tilde .notdef .notdef .notdef .notdef .notdef guillmotleft
8
+braceright asciitilde .notdef .notdef .notdef .notdef .notdef guillmotleft
9
 guillmotright afii61352 .notdef .notdef .notdef .notdef .notdef
10
 .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
11
 .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-4.14-texinfo-nodes.patch
... ... @@ -0,0 +1,128 @@
1
diff -up a2ps-4.14/doc/regex.texi_old a2ps-4.14/doc/regex.texi
2
--- a2ps-4.14/doc/regex.texi_old	2002-03-04 19:46:24.000000000 +0100
3
+++ a2ps-4.14/doc/regex.texi	2008-05-16 11:34:42.000000000 +0200
4
@@ -121,7 +121,7 @@ Regular Expression Syntax
5
 
6
 * Syntax Bits::
7
 * Predefined Syntaxes::
8
-* Collating Elements vs. Characters::
9
+* Collating Elements vs Characters::
10
 * The Backslash Character::
11
 
12
 Common Operators
13
@@ -305,7 +305,7 @@ In the following sections, we describe t
14
 @menu
15
 * Syntax Bits::
16
 * Predefined Syntaxes::
17
-* Collating Elements vs. Characters::
18
+* Collating Elements vs Characters::
19
 * The Backslash Character::
20
 @end menu
21
 
22
@@ -470,7 +470,7 @@ operator (based on how @code{RE_NO_BK_PA
23
 @end table
24
 
25
 
26
-@node Predefined Syntaxes, Collating Elements vs. Characters, Syntax Bits, Regular Expression Syntax
27
+@node Predefined Syntaxes, Collating Elements vs Characters, Syntax Bits, Regular Expression Syntax
28
 @section Predefined Syntaxes
29
 
30
 If you're programming with Regex, you can set a pattern buffer's
31
@@ -552,8 +552,8 @@ The predefined syntaxes--taken directly 
32
    | RE_NO_BK_VBAR          | RE_UNMATCHED_RIGHT_PAREN_ORD)
33
 @end example
34
 
35
-@node Collating Elements vs. Characters, The Backslash Character, Predefined Syntaxes, Regular Expression Syntax
36
-@section Collating Elements vs.@: Characters
37
+@node Collating Elements vs Characters, The Backslash Character, Predefined Syntaxes, Regular Expression Syntax
38
+@section Collating Elements vs@: Characters
39
 
40
 @sc{posix} generalizes the notion of a character to that of a
41
 collating element.  It defines a @dfn{collating element} to be ``a
42
@@ -577,7 +577,7 @@ collating element.  For example, the Spa
43
 Since @sc{posix}'s ``collating element'' preserves the essential idea of
44
 a ``character,'' we use the latter, more familiar, term in this document.
45
 
46
-@node The Backslash Character,  , Collating Elements vs. Characters, Regular Expression Syntax
47
+@node The Backslash Character,  , Collating Elements vs Characters, Regular Expression Syntax
48
 @section The Backslash Character
49
 
50
 @cindex @samp{\}
51
diff -up a2ps-4.14/doc/a2ps.texi_old a2ps-4.14/doc/a2ps.texi
52
--- a2ps-4.14/doc/a2ps.texi_old	2008-05-16 11:34:21.000000000 +0200
53
+++ a2ps-4.14/doc/a2ps.texi	2008-05-16 11:42:11.000000000 +0200
54
@@ -371,11 +371,11 @@ Contributions
55
 
56
 Frequently asked questions
57
 
58
-* Why Does ...?::               Questions on Error
59
-* How Can I ...?::              a2ps' How-To
60
-* Please tell me...::           Existential Questions on a2ps
61
+* Why Does?::                   Questions on Error
62
+* How Can I?::                  a2ps' How-To
63
+* Please tell me::              Existential Questions on a2ps
64
 
65
-Why Does...?
66
+Why Does?
67
 
68
 * It Prints Nothing::           The printer issues nothing
69
 * It Prints in Simplex::        While I asked for Duplex
70
@@ -385,7 +385,7 @@ Why Does...?
71
 * It Says my File is Binary::   And refuses to print it
72
 * It Refuses to Change the Font Size::
73
 
74
-How Can I ...?
75
+How Can I?
76
 
77
 * Leave Room for Binding::      Specifying Margins
78
 * Print stdin::                 Using a2ps in a pipe chain
79
@@ -395,7 +395,7 @@ How Can I ...?
80
 * Non PostScript Printers::     Using GhostScript
81
 * Man Pages with Underlines::   Now it Prints With Italics
82
 
83
-Please tell me...
84
+Please tell me
85
 
86
 * Is a2ps Y2K compliant?::      Printing dates in short format
87
 * The Options Have Changed::    Respect The Users
88
@@ -6198,13 +6198,13 @@ question about the options, etc.  It has
89
 suggestions, not to contact the authors.
90
 
91
 @menu
92
-* Why Does ...?::               Questions on Error
93
-* How Can I ...?::              a2ps' How-To
94
-* Please tell me...::           Existential Questions on a2ps
95
+* Why Does?::                   Questions on Error
96
+* How Can I?::                  a2ps' How-To
97
+* Please tell me::              Existential Questions on a2ps
98
 @end menu
99
 
100
-@node Why Does ...?
101
-@section Why Does...?
102
+@node Why Does?
103
+@section Why Does?
104
 
105
 Error related questions.
106
 
107
@@ -6426,8 +6426,8 @@ Note that the `pure' options (no side-ef
108
 virtual pages are @samp{--columns} and @samp{--rows}.
109
 
110
 @c -----------------------------How can I ? ------------------------------
111
-@node How Can I ...?
112
-@section How Can I ...?
113
+@node How Can I?
114
+@section How Can I?
115
 
116
 A mini how-to on @pack{}.
117
 
118
@@ -6561,8 +6561,8 @@ Use @samp{a2ps --pro=ul}.
119
 
120
 
121
 @c -------------------------- Please Tell me ? ------------------------------
122
-@node Please tell me...
123
-@section Please tell me...
124
+@node Please tell me
125
+@section Please tell me
126
 
127
 Wondering something?
128
 
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-CVE-2014-0466.patch
... ... @@ -0,0 +1,24 @@
1
diff -up a2ps-4.14/contrib/fixps.in.CVE-2014-0466 a2ps-4.14/contrib/fixps.in
2
--- a2ps-4.14/contrib/fixps.in.CVE-2014-0466	2014-04-01 15:35:04.168904356 +0100
3
+++ a2ps-4.14/contrib/fixps.in	2014-04-01 15:35:36.509060292 +0100
4
@@ -389,7 +389,7 @@ if test $task != check; then
5
   	eval "$command" ;;
6
       gs)
7
         $verbose "$program: making a full rewrite of the file ($gs)." >&2
8
-  	$gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
9
+  	$gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
10
     esac
11
   )
12
 fi
13
diff -up a2ps-4.14/contrib/fixps.m4.CVE-2014-0466 a2ps-4.14/contrib/fixps.m4
14
--- a2ps-4.14/contrib/fixps.m4.CVE-2014-0466	2014-04-01 15:35:06.885917452 +0100
15
+++ a2ps-4.14/contrib/fixps.m4	2014-04-01 15:35:48.748119336 +0100
16
@@ -307,7 +307,7 @@ if test $task != check; then
17
   	eval "$command" ;;
18
       gs)
19
         $verbose "$program: making a full rewrite of the file ($gs)." >&2
20
-  	$gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
21
+  	$gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
22
     esac
23
   )
24
 fi
... ... --- /dev/null
... ... +++ b/a2ps-U.patch
... ... @@ -0,0 +1,22 @@
1
--- a2ps-4.13/contrib/pdiff.in.U	2005-05-05 12:46:05.000000000 +0100
2
+++ a2ps-4.13/contrib/pdiff.in	2005-05-05 12:47:34.000000000 +0100
3
@@ -182,7 +182,7 @@
4
     # We need the total number of lines
5
     lines=`wc -l $file1 $file2 | sed -n 3p`
6
     lines=`set -- $lines && echo $1`
7
-    $diff_prog $diff_options -$lines $file1 $file2	\
8
+    $diff_prog $diff_options -U$lines $file1 $file2	\
9
        | $a2ps -gEudiff $a2ps_options || exit 1
10
     ;;
11
 esac
12
--- a2ps-4.13/contrib/pdiff.m4.U	2005-05-05 12:47:54.000000000 +0100
13
+++ a2ps-4.13/contrib/pdiff.m4	2005-05-05 12:53:10.000000000 +0100
14
@@ -100,7 +100,7 @@
15
     # We need the total number of lines
16
     lines=`wc -l $file1 $file2 | sed -n 3p`
17
     lines=`set -- $lines && echo $1`
18
-    $diff_prog $diff_options -$lines $file1 $file2	\
19
+    $diff_prog $diff_options -U$lines $file1 $file2	\
20
        | $a2ps -gEudiff $a2ps_options || exit 1
21
     ;;
22
 esac
view file @ 7975a94864
... ... --- /dev/null
... ... +++ b/a2ps-aarch64.patch
... ... @@ -0,0 +1,1629 @@
1
diff -up a2ps-4.14/auxdir/config.guess.aarch64 a2ps-4.14/auxdir/config.guess
2
--- a2ps-4.14/auxdir/config.guess.aarch64	2007-12-29 03:28:06.000000000 +0000
3
+++ a2ps-4.14/auxdir/config.guess	2013-04-29 13:13:51.035686658 +0100
4
@@ -1,10 +1,10 @@
5
 #! /bin/sh
6
 # Attempt to guess a canonical system name.
7
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
8
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
9
-#   Inc.
10
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
11
+#   2011, 2012 Free Software Foundation, Inc.
12
 
13
-timestamp='2007-07-22'
14
+timestamp='2012-09-25'
15
 
16
 # This file is free software; you can redistribute it and/or modify it
17
 # under the terms of the GNU General Public License as published by
18
@@ -17,9 +17,7 @@ timestamp='2007-07-22'
19
 # General Public License for more details.
20
 #
21
 # You should have received a copy of the GNU General Public License
22
-# along with this program; if not, write to the Free Software
23
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
24
-# 02110-1301, USA.
25
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
26
 #
27
 # As a special exception to the GNU General Public License, if you
28
 # distribute this file as part of a program that contains a
29
@@ -27,16 +25,16 @@ timestamp='2007-07-22'
30
 # the same distribution terms that you use for the rest of that program.
31
 
32
 
33
-# Originally written by Per Bothner <per@bothner.com>.
34
-# Please send patches to <config-patches@gnu.org>.  Submit a context
35
-# diff and a properly formatted ChangeLog entry.
36
+# Originally written by Per Bothner.  Please send patches (context
37
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
38
+# entry.
39
 #
40
 # This script attempts to guess a canonical system name similar to
41
 # config.sub.  If it succeeds, it prints the system name on stdout, and
42
 # exits with 0.  Otherwise, it exits with 1.
43
 #
44
-# The plan is that this can be called by configure scripts if you
45
-# don't specify an explicit build system type.
46
+# You can get the latest version of this script from:
47
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
48
 
49
 me=`echo "$0" | sed -e 's,.*/,,'`
50
 
51
@@ -56,7 +54,8 @@ version="\
52
 GNU config.guess ($timestamp)
53
 
54
 Originally written by Per Bothner.
55
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
56
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
57
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
58
 Free Software Foundation, Inc.
59
 
60
 This is free software; see the source for copying conditions.  There is NO
61
@@ -144,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` |
62
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
63
     *:NetBSD:*:*)
64
 	# NetBSD (nbsd) targets should (where applicable) match one or
65
-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
66
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
67
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
68
 	# switched to ELF, *-*-netbsd* would select the old
69
 	# object file format.  This provides both forward
70
@@ -170,7 +169,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
71
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
72
 		eval $set_cc_for_build
73
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
74
-			| grep __ELF__ >/dev/null
75
+			| grep -q __ELF__
76
 		then
77
 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
78
 		    # Return netbsd for either.  FIX?
79
@@ -180,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
80
 		fi
81
 		;;
82
 	    *)
83
-	        os=netbsd
84
+		os=netbsd
85
 		;;
86
 	esac
87
 	# The OS release
88
@@ -201,6 +200,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
89
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
90
 	echo "${machine}-${os}${release}"
91
 	exit ;;
92
+    *:Bitrig:*:*)
93
+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
94
+	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
95
+	exit ;;
96
     *:OpenBSD:*:*)
97
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
98
 	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
99
@@ -223,7 +226,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
100
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
101
 		;;
102
 	*5.*)
103
-	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
104
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
105
 		;;
106
 	esac
107
 	# According to Compaq, /usr/sbin/psrinfo has been available on
108
@@ -269,7 +272,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
109
 	# A Xn.n version is an unreleased experimental baselevel.
110
 	# 1.2 uses "1.2" for uname -r.
111
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
112
-	exit ;;
113
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
114
+	exitcode=$?
115
+	trap '' 0
116
+	exit $exitcode ;;
117
     Alpha\ *:Windows_NT*:*)
118
 	# How do we know it's Interix rather than the generic POSIX subsystem?
119
 	# Should we change UNAME_MACHINE based on the output of uname instead
120
@@ -295,12 +301,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
121
 	echo s390-ibm-zvmoe
122
 	exit ;;
123
     *:OS400:*:*)
124
-        echo powerpc-ibm-os400
125
+	echo powerpc-ibm-os400
126
 	exit ;;
127
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
128
 	echo arm-acorn-riscix${UNAME_RELEASE}
129
 	exit ;;
130
-    arm:riscos:*:*|arm:RISCOS:*:*)
131
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
132
 	echo arm-unknown-riscos
133
 	exit ;;
134
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
135
@@ -324,14 +330,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
136
 	case `/usr/bin/uname -p` in
137
 	    sparc) echo sparc-icl-nx7; exit ;;
138
 	esac ;;
139
+    s390x:SunOS:*:*)
140
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
141
+	exit ;;
142
     sun4H:SunOS:5.*:*)
143
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
144
 	exit ;;
145
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
146
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
147
 	exit ;;
148
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
149
+	echo i386-pc-auroraux${UNAME_RELEASE}
150
+	exit ;;
151
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
152
-	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
153
+	eval $set_cc_for_build
154
+	SUN_ARCH="i386"
155
+	# If there is a compiler, see if it is configured for 64-bit objects.
156
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
157
+	# This test works for both compilers.
158
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
159
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
160
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
161
+		grep IS_64BIT_ARCH >/dev/null
162
+	    then
163
+		SUN_ARCH="x86_64"
164
+	    fi
165
+	fi
166
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
167
 	exit ;;
168
     sun4*:SunOS:6*:*)
169
 	# According to config.sub, this is the proper way to canonicalize
170
@@ -375,23 +400,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
171
     # MiNT.  But MiNT is downward compatible to TOS, so this should
172
     # be no problem.
173
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
174
-        echo m68k-atari-mint${UNAME_RELEASE}
175
+	echo m68k-atari-mint${UNAME_RELEASE}
176
 	exit ;;
177
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
178
 	echo m68k-atari-mint${UNAME_RELEASE}
179
-        exit ;;
180
+	exit ;;
181
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
182
-        echo m68k-atari-mint${UNAME_RELEASE}
183
+	echo m68k-atari-mint${UNAME_RELEASE}
184
 	exit ;;
185
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
186
-        echo m68k-milan-mint${UNAME_RELEASE}
187
-        exit ;;
188
+	echo m68k-milan-mint${UNAME_RELEASE}
189
+	exit ;;
190
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
191
-        echo m68k-hades-mint${UNAME_RELEASE}
192
-        exit ;;
193
+	echo m68k-hades-mint${UNAME_RELEASE}
194
+	exit ;;
195
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
196
-        echo m68k-unknown-mint${UNAME_RELEASE}
197
-        exit ;;
198
+	echo m68k-unknown-mint${UNAME_RELEASE}
199
+	exit ;;
200
     m68k:machten:*:*)
201
 	echo m68k-apple-machten${UNAME_RELEASE}
202
 	exit ;;
203
@@ -461,8 +486,8 @@ EOF
204
 	echo m88k-motorola-sysv3
205
 	exit ;;
206
     AViiON:dgux:*:*)
207
-        # DG/UX returns AViiON for all architectures
208
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
209
+	# DG/UX returns AViiON for all architectures
210
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
211
 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
212
 	then
213
 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
214
@@ -475,7 +500,7 @@ EOF
215
 	else
216
 	    echo i586-dg-dgux${UNAME_RELEASE}
217
 	fi
218
- 	exit ;;
219
+	exit ;;
220
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
221
 	echo m88k-dolphin-sysv3
222
 	exit ;;
223
@@ -532,7 +557,7 @@ EOF
224
 		echo rs6000-ibm-aix3.2
225
 	fi
226
 	exit ;;
227
-    *:AIX:*:[45])
228
+    *:AIX:*:[4567])
229
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
230
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
231
 		IBM_ARCH=rs6000
232
@@ -575,52 +600,52 @@ EOF
233
 	    9000/[678][0-9][0-9])
234
 		if [ -x /usr/bin/getconf ]; then
235
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
236
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
237
-                    case "${sc_cpu_version}" in
238
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
239
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
240
-                      532)                      # CPU_PA_RISC2_0
241
-                        case "${sc_kernel_bits}" in
242
-                          32) HP_ARCH="hppa2.0n" ;;
243
-                          64) HP_ARCH="hppa2.0w" ;;
244
+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
245
+		    case "${sc_cpu_version}" in
246
+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
247
+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
248
+		      532)                      # CPU_PA_RISC2_0
249
+			case "${sc_kernel_bits}" in
250
+			  32) HP_ARCH="hppa2.0n" ;;
251
+			  64) HP_ARCH="hppa2.0w" ;;
252
 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
253
-                        esac ;;
254
-                    esac
255
+			esac ;;
256
+		    esac
257
 		fi
258
 		if [ "${HP_ARCH}" = "" ]; then
259
 		    eval $set_cc_for_build
260
-		    sed 's/^              //' << EOF >$dummy.c
261
+		    sed 's/^		//' << EOF >$dummy.c
262
 
263
-              #define _HPUX_SOURCE
264
-              #include <stdlib.h>
265
-              #include <unistd.h>
266
-
267
-              int main ()
268
-              {
269
-              #if defined(_SC_KERNEL_BITS)
270
-                  long bits = sysconf(_SC_KERNEL_BITS);
271
-              #endif
272
-                  long cpu  = sysconf (_SC_CPU_VERSION);
273
-
274
-                  switch (cpu)
275
-              	{
276
-              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
277
-              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
278
-              	case CPU_PA_RISC2_0:
279
-              #if defined(_SC_KERNEL_BITS)
280
-              	    switch (bits)
281
-              		{
282
-              		case 64: puts ("hppa2.0w"); break;
283
-              		case 32: puts ("hppa2.0n"); break;
284
-              		default: puts ("hppa2.0"); break;
285
-              		} break;
286
-              #else  /* !defined(_SC_KERNEL_BITS) */
287
-              	    puts ("hppa2.0"); break;
288
-              #endif
289
-              	default: puts ("hppa1.0"); break;
290
-              	}
291
-                  exit (0);
292
-              }
293
+		#define _HPUX_SOURCE
294
+		#include <stdlib.h>
295
+		#include <unistd.h>
296
+
297
+		int main ()
298
+		{
299
+		#if defined(_SC_KERNEL_BITS)
300
+		    long bits = sysconf(_SC_KERNEL_BITS);
301
+		#endif
302
+		    long cpu  = sysconf (_SC_CPU_VERSION);
303
+
304
+		    switch (cpu)
305
+			{
306
+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
307
+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
308
+			case CPU_PA_RISC2_0:
309
+		#if defined(_SC_KERNEL_BITS)
310
+			    switch (bits)
311
+				{
312
+				case 64: puts ("hppa2.0w"); break;
313
+				case 32: puts ("hppa2.0n"); break;
314
+				default: puts ("hppa2.0"); break;
315
+				} break;
316
+		#else  /* !defined(_SC_KERNEL_BITS) */
317
+			    puts ("hppa2.0"); break;
318
+		#endif
319
+			default: puts ("hppa1.0"); break;
320
+			}
321
+		    exit (0);
322
+		}
323
 EOF
324
 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
325
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
326
@@ -640,7 +665,7 @@ EOF
327
 	    # => hppa64-hp-hpux11.23
328
 
329
 	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
330
-		grep __LP64__ >/dev/null
331
+		grep -q __LP64__
332
 	    then
333
 		HP_ARCH="hppa2.0w"
334
 	    else
335
@@ -711,22 +736,22 @@ EOF
336
 	exit ;;
337
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
338
 	echo c1-convex-bsd
339
-        exit ;;
340
+	exit ;;
341
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
342
 	if getsysinfo -f scalar_acc
343
 	then echo c32-convex-bsd
344
 	else echo c2-convex-bsd
345
 	fi
346
-        exit ;;
347
+	exit ;;
348
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
349
 	echo c34-convex-bsd
350
-        exit ;;
351
+	exit ;;
352
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
353
 	echo c38-convex-bsd
354
-        exit ;;
355
+	exit ;;
356
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
357
 	echo c4-convex-bsd
358
-        exit ;;
359
+	exit ;;
360
     CRAY*Y-MP:*:*:*)
361
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
362
 	exit ;;
363
@@ -750,14 +775,14 @@ EOF
364
 	exit ;;
365
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
366
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
367
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
368
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
369
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
370
-        exit ;;
371
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
372
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
373
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
374
+	exit ;;
375
     5000:UNIX_System_V:4.*:*)
376
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
377
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
378
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
379
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
380
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
381
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
382
 	exit ;;
383
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
384
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
385
@@ -769,40 +794,51 @@ EOF
386
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
387
 	exit ;;
388
     *:FreeBSD:*:*)
389
-	case ${UNAME_MACHINE} in
390
-	    pc98)
391
-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
392
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
393
+	case ${UNAME_PROCESSOR} in
394
 	    amd64)
395
 		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
396
 	    *)
397
-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
398
+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
399
 	esac
400
 	exit ;;
401
     i*:CYGWIN*:*)
402
 	echo ${UNAME_MACHINE}-pc-cygwin
403
 	exit ;;
404
+    *:MINGW64*:*)
405
+	echo ${UNAME_MACHINE}-pc-mingw64
406
+	exit ;;
407
     *:MINGW*:*)
408
 	echo ${UNAME_MACHINE}-pc-mingw32
409
 	exit ;;
410
+    i*:MSYS*:*)
411
+	echo ${UNAME_MACHINE}-pc-msys
412
+	exit ;;
413
     i*:windows32*:*)
414
-    	# uname -m includes "-pc" on this system.
415
-    	echo ${UNAME_MACHINE}-mingw32
416
+	# uname -m includes "-pc" on this system.
417
+	echo ${UNAME_MACHINE}-mingw32
418
 	exit ;;
419
     i*:PW*:*)
420
 	echo ${UNAME_MACHINE}-pc-pw32
421
 	exit ;;
422
-    *:Interix*:[3456]*)
423
-    	case ${UNAME_MACHINE} in
424
+    *:Interix*:*)
425
+	case ${UNAME_MACHINE} in
426
 	    x86)
427
 		echo i586-pc-interix${UNAME_RELEASE}
428
 		exit ;;
429
-	    EM64T | authenticamd)
430
+	    authenticamd | genuineintel | EM64T)
431
 		echo x86_64-unknown-interix${UNAME_RELEASE}
432
 		exit ;;
433
+	    IA64)
434
+		echo ia64-unknown-interix${UNAME_RELEASE}
435
+		exit ;;
436
 	esac ;;
437
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
438
 	echo i${UNAME_MACHINE}-pc-mks
439
 	exit ;;
440
+    8664:Windows_NT:*)
441
+	echo x86_64-pc-mks
442
+	exit ;;
443
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
444
 	# How do we know it's Interix rather than the generic POSIX subsystem?
445
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
446
@@ -832,20 +868,68 @@ EOF
447
     i*86:Minix:*:*)
448
 	echo ${UNAME_MACHINE}-pc-minix
449
 	exit ;;
450
-    arm*:Linux:*:*)
451
+    aarch64:Linux:*:*)
452
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
453
 	exit ;;
454
+    aarch64_be:Linux:*:*)
455
+	UNAME_MACHINE=aarch64_be
456
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
457
+	exit ;;
458
+    alpha:Linux:*:*)
459
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
460
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
461
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
462
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
463
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
464
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
465
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
466
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
467
+	esac
468
+	objdump --private-headers /bin/sh | grep -q ld.so.1
469
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
470
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
471
+	exit ;;
472
+    arm*:Linux:*:*)
473
+	eval $set_cc_for_build
474
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
475
+	    | grep -q __ARM_EABI__
476
+	then
477
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
478
+	else
479
+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
480
+		| grep -q __ARM_PCS_VFP
481
+	    then
482
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
483
+	    else
484
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
485
+	    fi
486
+	fi
487
+	exit ;;
488
     avr32*:Linux:*:*)
489
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
490
 	exit ;;
491
     cris:Linux:*:*)
492
-	echo cris-axis-linux-gnu
493
+	echo ${UNAME_MACHINE}-axis-linux-gnu
494
 	exit ;;
495
     crisv32:Linux:*:*)
496
-	echo crisv32-axis-linux-gnu
497
+	echo ${UNAME_MACHINE}-axis-linux-gnu
498
 	exit ;;
499
     frv:Linux:*:*)
500
-    	echo frv-unknown-linux-gnu
501
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
502
+	exit ;;
503
+    hexagon:Linux:*:*)
504
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
505
+	exit ;;
506
+    i*86:Linux:*:*)
507
+	LIBC=gnu
508
+	eval $set_cc_for_build
509
+	sed 's/^	//' << EOF >$dummy.c
510
+	#ifdef __dietlibc__
511
+	LIBC=dietlibc
512
+	#endif
513
+EOF
514
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
515
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
516
 	exit ;;
517
     ia64:Linux:*:*)
518
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
519
@@ -856,74 +940,33 @@ EOF
520
     m68*:Linux:*:*)
521
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
522
 	exit ;;
523
-    mips:Linux:*:*)
524
+    mips:Linux:*:* | mips64:Linux:*:*)
525
 	eval $set_cc_for_build
526
 	sed 's/^	//' << EOF >$dummy.c
527
 	#undef CPU
528
-	#undef mips
529
-	#undef mipsel
530
+	#undef ${UNAME_MACHINE}
531
+	#undef ${UNAME_MACHINE}el
532
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
533
-	CPU=mipsel
534
+	CPU=${UNAME_MACHINE}el
535
 	#else
536
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
537
-	CPU=mips
538
+	CPU=${UNAME_MACHINE}
539
 	#else
540
 	CPU=
541
 	#endif
542
 	#endif
543
 EOF
544
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
545
-	    /^CPU/{
546
-		s: ::g
547
-		p
548
-	    }'`"
549
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
550
-	;;
551
-    mips64:Linux:*:*)
552
-	eval $set_cc_for_build
553
-	sed 's/^	//' << EOF >$dummy.c
554
-	#undef CPU
555
-	#undef mips64
556
-	#undef mips64el
557
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
558
-	CPU=mips64el
559
-	#else
560
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
561
-	CPU=mips64
562
-	#else
563
-	CPU=
564
-	#endif
565
-	#endif
566
-EOF
567
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
568
-	    /^CPU/{
569
-		s: ::g
570
-		p
571
-	    }'`"
572
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
573
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
574
 	;;
575
     or32:Linux:*:*)
576
-	echo or32-unknown-linux-gnu
577
-	exit ;;
578
-    ppc:Linux:*:*)
579
-	echo powerpc-unknown-linux-gnu
580
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
581
 	exit ;;
582
-    ppc64:Linux:*:*)
583
-	echo powerpc64-unknown-linux-gnu
584
+    padre:Linux:*:*)
585
+	echo sparc-unknown-linux-gnu
586
 	exit ;;
587
-    alpha:Linux:*:*)
588
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
589
-	  EV5)   UNAME_MACHINE=alphaev5 ;;
590
-	  EV56)  UNAME_MACHINE=alphaev56 ;;
591
-	  PCA56) UNAME_MACHINE=alphapca56 ;;
592
-	  PCA57) UNAME_MACHINE=alphapca56 ;;
593
-	  EV6)   UNAME_MACHINE=alphaev6 ;;
594
-	  EV67)  UNAME_MACHINE=alphaev67 ;;
595
-	  EV68*) UNAME_MACHINE=alphaev68 ;;
596
-        esac
597
-	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
598
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
599
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
600
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
601
+	echo hppa64-unknown-linux-gnu
602
 	exit ;;
603
     parisc:Linux:*:* | hppa:Linux:*:*)
604
 	# Look for CPU level
605
@@ -933,14 +976,17 @@ EOF
606
 	  *)    echo hppa-unknown-linux-gnu ;;
607
 	esac
608
 	exit ;;
609
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
610
-	echo hppa64-unknown-linux-gnu
611
+    ppc64:Linux:*:*)
612
+	echo powerpc64-unknown-linux-gnu
613
+	exit ;;
614
+    ppc:Linux:*:*)
615
+	echo powerpc-unknown-linux-gnu
616
 	exit ;;
617
     s390:Linux:*:* | s390x:Linux:*:*)
618
 	echo ${UNAME_MACHINE}-ibm-linux
619
 	exit ;;
620
     sh64*:Linux:*:*)
621
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
622
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
623
 	exit ;;
624
     sh*:Linux:*:*)
625
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
626
@@ -948,78 +994,18 @@ EOF
627
     sparc:Linux:*:* | sparc64:Linux:*:*)
628
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
629
 	exit ;;
630
+    tile*:Linux:*:*)
631
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
632
+	exit ;;
633
     vax:Linux:*:*)
634
 	echo ${UNAME_MACHINE}-dec-linux-gnu
635
 	exit ;;
636
     x86_64:Linux:*:*)
637
-	echo x86_64-unknown-linux-gnu
638
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
639
 	exit ;;
640
-    xtensa:Linux:*:*)
641
-    	echo xtensa-unknown-linux-gnu
642
+    xtensa*:Linux:*:*)
643
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
644
 	exit ;;
645
-    i*86:Linux:*:*)
646
-	# The BFD linker knows what the default object file format is, so
647
-	# first see if it will tell us. cd to the root directory to prevent
648
-	# problems with other programs or directories called `ld' in the path.
649
-	# Set LC_ALL=C to ensure ld outputs messages in English.
650
-	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
651
-			 | sed -ne '/supported targets:/!d
652
-				    s/[ 	][ 	]*/ /g
653
-				    s/.*supported targets: *//
654
-				    s/ .*//
655
-				    p'`
656
-        case "$ld_supported_targets" in
657
-	  elf32-i386)
658
-		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
659
-		;;
660
-	  a.out-i386-linux)
661
-		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
662
-		exit ;;
663
-	  coff-i386)
664
-		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
665
-		exit ;;
666
-	  "")
667
-		# Either a pre-BFD a.out linker (linux-gnuoldld) or
668
-		# one that does not give us useful --help.
669
-		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
670
-		exit ;;
671
-	esac
672
-	# Determine whether the default compiler is a.out or elf
673
-	eval $set_cc_for_build
674
-	sed 's/^	//' << EOF >$dummy.c
675
-	#include <features.h>
676
-	#ifdef __ELF__
677
-	# ifdef __GLIBC__
678
-	#  if __GLIBC__ >= 2
679
-	LIBC=gnu
680
-	#  else
681
-	LIBC=gnulibc1
682
-	#  endif
683
-	# else
684
-	LIBC=gnulibc1
685
-	# endif
686
-	#else
687
-	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
688
-	LIBC=gnu
689
-	#else
690
-	LIBC=gnuaout
691
-	#endif
692
-	#endif
693
-	#ifdef __dietlibc__
694
-	LIBC=dietlibc
695
-	#endif
696
-EOF
697
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
698
-	    /^LIBC/{
699
-		s: ::g
700
-		p
701
-	    }'`"
702
-	test x"${LIBC}" != x && {
703
-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
704
-		exit
705
-	}
706
-	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
707
-	;;
708
     i*86:DYNIX/ptx:4*:*)
709
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
710
 	# earlier versions are messed up and put the nodename in both
711
@@ -1027,11 +1013,11 @@ EOF
712
 	echo i386-sequent-sysv4
713
 	exit ;;
714
     i*86:UNIX_SV:4.2MP:2.*)
715
-        # Unixware is an offshoot of SVR4, but it has its own version
716
-        # number series starting with 2...
717
-        # I am not positive that other SVR4 systems won't match this,
718
+	# Unixware is an offshoot of SVR4, but it has its own version
719
+	# number series starting with 2...
720
+	# I am not positive that other SVR4 systems won't match this,
721
 	# I just have to hope.  -- rms.
722
-        # Use sysv4.2uw... so that sysv4* matches it.
723
+	# Use sysv4.2uw... so that sysv4* matches it.
724
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
725
 	exit ;;
726
     i*86:OS/2:*:*)
727
@@ -1048,7 +1034,7 @@ EOF
728
     i*86:syllable:*:*)
729
 	echo ${UNAME_MACHINE}-pc-syllable
730
 	exit ;;
731
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
732
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
733
 	echo i386-unknown-lynxos${UNAME_RELEASE}
734
 	exit ;;
735
     i*86:*DOS:*:*)
736
@@ -1063,7 +1049,7 @@ EOF
737
 	fi
738
 	exit ;;
739
     i*86:*:5:[678]*)
740
-    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
741
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
742
 	case `/bin/uname -X | grep "^Machine"` in
743
 	    *486*)	     UNAME_MACHINE=i486 ;;
744
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
745
@@ -1091,10 +1077,13 @@ EOF
746
 	exit ;;
747
     pc:*:*:*)
748
 	# Left here for compatibility:
749
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
750
-        # the processor, so we play safe by assuming i386.
751
-	echo i386-pc-msdosdjgpp
752
-        exit ;;
753
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
754
+	# the processor, so we play safe by assuming i586.
755
+	# Note: whatever this is, it MUST be the same as what config.sub
756
+	# prints for the "djgpp" host, or else GDB configury will decide that
757
+	# this is a cross-build.
758
+	echo i586-pc-msdosdjgpp
759
+	exit ;;
760
     Intel:Mach:3*:*)
761
 	echo i386-pc-mach3
762
 	exit ;;
763
@@ -1129,8 +1118,18 @@ EOF
764
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
765
 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
766
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
767
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
768
-          && { echo i486-ncr-sysv4; exit; } ;;
769
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
770
+	  && { echo i486-ncr-sysv4; exit; } ;;
771
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
772
+	OS_REL='.3'
773
+	test -r /etc/.relid \
774
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
775
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
776
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
777
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
778
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
779
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
780
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
781
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
782
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
783
 	exit ;;
784
@@ -1143,7 +1142,7 @@ EOF
785
     rs6000:LynxOS:2.*:*)
786
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
787
 	exit ;;
788
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
789
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
790
 	echo powerpc-unknown-lynxos${UNAME_RELEASE}
791
 	exit ;;
792
     SM[BE]S:UNIX_SV:*:*)
793
@@ -1163,10 +1162,10 @@ EOF
794
 		echo ns32k-sni-sysv
795
 	fi
796
 	exit ;;
797
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
798
-                      # says <Richard.M.Bartel@ccMail.Census.GOV>
799
-        echo i586-unisys-sysv4
800
-        exit ;;
801
+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
802
+			# says <Richard.M.Bartel@ccMail.Census.GOV>
803
+	echo i586-unisys-sysv4
804
+	exit ;;
805
     *:UNIX_System_V:4*:FTX*)
806
 	# From Gerald Hewes <hewes@openmarket.com>.
807
 	# How about differentiating between stratus architectures? -djm
808
@@ -1192,11 +1191,11 @@ EOF
809
 	exit ;;
810
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
811
 	if [ -d /usr/nec ]; then
812
-	        echo mips-nec-sysv${UNAME_RELEASE}
813
+		echo mips-nec-sysv${UNAME_RELEASE}
814
 	else
815
-	        echo mips-unknown-sysv${UNAME_RELEASE}
816
+		echo mips-unknown-sysv${UNAME_RELEASE}
817
 	fi
818
-        exit ;;
819
+	exit ;;
820
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
821
 	echo powerpc-be-beos
822
 	exit ;;
823
@@ -1206,6 +1205,12 @@ EOF
824
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
825
 	echo i586-pc-beos
826
 	exit ;;
827
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
828
+	echo i586-pc-haiku
829
+	exit ;;
830
+    x86_64:Haiku:*:*)
831
+	echo x86_64-unknown-haiku
832
+	exit ;;
833
     SX-4:SUPER-UX:*:*)
834
 	echo sx4-nec-superux${UNAME_RELEASE}
835
 	exit ;;
836
@@ -1233,6 +1238,16 @@ EOF
837
     *:Darwin:*:*)
838
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
839
 	case $UNAME_PROCESSOR in
840
+	    i386)
841
+		eval $set_cc_for_build
842
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
843
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
844
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
845
+		      grep IS_64BIT_ARCH >/dev/null
846
+		  then
847
+		      UNAME_PROCESSOR="x86_64"
848
+		  fi
849
+		fi ;;
850
 	    unknown) UNAME_PROCESSOR=powerpc ;;
851
 	esac
852
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
853
@@ -1248,7 +1263,10 @@ EOF
854
     *:QNX:*:4*)
855
 	echo i386-pc-qnx
856
 	exit ;;
857
-    NSE-?:NONSTOP_KERNEL:*:*)
858
+    NEO-?:NONSTOP_KERNEL:*:*)
859
+	echo neo-tandem-nsk${UNAME_RELEASE}
860
+	exit ;;
861
+    NSE-*:NONSTOP_KERNEL:*:*)
862
 	echo nse-tandem-nsk${UNAME_RELEASE}
863
 	exit ;;
864
     NSR-?:NONSTOP_KERNEL:*:*)
865
@@ -1293,13 +1311,13 @@ EOF
866
 	echo pdp10-unknown-its
867
 	exit ;;
868
     SEI:*:*:SEIUX)
869
-        echo mips-sei-seiux${UNAME_RELEASE}
870
+	echo mips-sei-seiux${UNAME_RELEASE}
871
 	exit ;;
872
     *:DragonFly:*:*)
873
 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
874
 	exit ;;
875
     *:*VMS:*:*)
876
-    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
877
+	UNAME_MACHINE=`(uname -p) 2>/dev/null`
878
 	case "${UNAME_MACHINE}" in
879
 	    A*) echo alpha-dec-vms ; exit ;;
880
 	    I*) echo ia64-dec-vms ; exit ;;
881
@@ -1314,11 +1332,14 @@ EOF
882
     i*86:rdos:*:*)
883
 	echo ${UNAME_MACHINE}-pc-rdos
884
 	exit ;;
885
+    i*86:AROS:*:*)
886
+	echo ${UNAME_MACHINE}-pc-aros
887
+	exit ;;
888
+    x86_64:VMkernel:*:*)
889
+	echo ${UNAME_MACHINE}-unknown-esx
890
+	exit ;;
891
 esac
892
 
893
-#echo '(No uname command or uname output not recognized.)' 1>&2
894
-#echo "