summaryrefslogtreecommitdiff
path: root/fonts/utilities/ps2pk
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/utilities/ps2pk
Initial commit
Diffstat (limited to 'fonts/utilities/ps2pk')
-rw-r--r--fonts/utilities/ps2pk/CHANGES.type165
-rw-r--r--fonts/utilities/ps2pk/ChangeLog393
-rw-r--r--fonts/utilities/ps2pk/INSTALLATION208
-rw-r--r--fonts/utilities/ps2pk/Makefile.am144
-rw-r--r--fonts/utilities/ps2pk/Makefile.in1520
-rw-r--r--fonts/utilities/ps2pk/README240
-rw-r--r--fonts/utilities/ps2pk/README.14m35
-rw-r--r--fonts/utilities/ps2pk/README.type125
-rw-r--r--fonts/utilities/ps2pk/Xstuff.h42
-rw-r--r--fonts/utilities/ps2pk/ac/withenable.ac7
-rw-r--r--fonts/utilities/ps2pk/aclocal.m41179
-rw-r--r--fonts/utilities/ps2pk/arith.c409
-rw-r--r--fonts/utilities/ps2pk/arith.h70
-rw-r--r--fonts/utilities/ps2pk/basename.c23
-rw-r--r--fonts/utilities/ps2pk/basics.c27
-rw-r--r--fonts/utilities/ps2pk/basics.h99
-rw-r--r--fonts/utilities/ps2pk/blues.h93
-rw-r--r--fonts/utilities/ps2pk/bstring.c13
-rw-r--r--fonts/utilities/ps2pk/c-auto.in196
-rw-r--r--fonts/utilities/ps2pk/cluts.h35
-rwxr-xr-xfonts/utilities/ps2pk/configure24
-rw-r--r--fonts/utilities/ps2pk/configure.ac42
-rwxr-xr-xfonts/utilities/ps2pk/configure.texk17537
-rw-r--r--fonts/utilities/ps2pk/curves.c222
-rw-r--r--fonts/utilities/ps2pk/curves.h41
-rw-r--r--fonts/utilities/ps2pk/digit.h64
-rw-r--r--fonts/utilities/ps2pk/encoding.c353
-rw-r--r--fonts/utilities/ps2pk/ffilest.h153
-rw-r--r--fonts/utilities/ps2pk/filenames.c136
-rw-r--r--fonts/utilities/ps2pk/filenames.h27
-rw-r--r--fonts/utilities/ps2pk/flisearch.c42
-rw-r--r--fonts/utilities/ps2pk/font.h107
-rw-r--r--fonts/utilities/ps2pk/fontfcn.c300
-rw-r--r--fonts/utilities/ps2pk/fontfcn.h121
-rw-r--r--fonts/utilities/ps2pk/fontfile.h72
-rw-r--r--fonts/utilities/ps2pk/fontmisc.h63
-rw-r--r--fonts/utilities/ps2pk/fonts.h47
-rw-r--r--fonts/utilities/ps2pk/fontstruct.h224
-rw-r--r--fonts/utilities/ps2pk/fontxlfd.h43
-rw-r--r--fonts/utilities/ps2pk/fsmasks.h72
-rw-r--r--fonts/utilities/ps2pk/hdigit.h94
-rw-r--r--fonts/utilities/ps2pk/hints.c916
-rw-r--r--fonts/utilities/ps2pk/hints.h43
-rw-r--r--fonts/utilities/ps2pk/lines.c194
-rw-r--r--fonts/utilities/ps2pk/lines.h36
-rw-r--r--fonts/utilities/ps2pk/mag.168
-rw-r--r--fonts/utilities/ps2pk/mag.c156
-rw-r--r--fonts/utilities/ps2pk/objects.c1156
-rw-r--r--fonts/utilities/ps2pk/objects.h298
-rw-r--r--fonts/utilities/ps2pk/paths.c1395
-rw-r--r--fonts/utilities/ps2pk/paths.h220
-rw-r--r--fonts/utilities/ps2pk/pfb2pfa.121
-rw-r--r--fonts/utilities/ps2pk/pfb2pfa.c106
-rw-r--r--fonts/utilities/ps2pk/pictures.h48
-rw-r--r--fonts/utilities/ps2pk/pk2bm.140
-rw-r--r--fonts/utilities/ps2pk/pk2bm.c231
-rw-r--r--fonts/utilities/ps2pk/pkin.c435
-rw-r--r--fonts/utilities/ps2pk/pkin.h60
-rw-r--r--fonts/utilities/ps2pk/pkout.c578
-rw-r--r--fonts/utilities/ps2pk/pkout.h45
-rw-r--r--fonts/utilities/ps2pk/pktest.c110
-rw-r--r--fonts/utilities/ps2pk/protos.h402
-rw-r--r--fonts/utilities/ps2pk/ps2pk.1159
-rw-r--r--fonts/utilities/ps2pk/ps2pk.c708
-rw-r--r--fonts/utilities/ps2pk/psearch.c557
-rw-r--r--fonts/utilities/ps2pk/psearch.h115
-rw-r--r--fonts/utilities/ps2pk/regions.c1589
-rw-r--r--fonts/utilities/ps2pk/regions.h205
-rw-r--r--fonts/utilities/ps2pk/scanfont.c1480
-rw-r--r--fonts/utilities/ps2pk/sexpr.c25
-rw-r--r--fonts/utilities/ps2pk/spaces.c999
-rw-r--r--fonts/utilities/ps2pk/spaces.h152
-rw-r--r--fonts/utilities/ps2pk/strexpr.c292
-rw-r--r--fonts/utilities/ps2pk/strexpr.h13
-rw-r--r--fonts/utilities/ps2pk/strokes.h38
-rw-r--r--fonts/utilities/ps2pk/t1funcs.c493
-rw-r--r--fonts/utilities/ps2pk/t1hdigit.h40
-rw-r--r--fonts/utilities/ps2pk/t1imager.h152
-rw-r--r--fonts/utilities/ps2pk/t1info.c380
-rw-r--r--fonts/utilities/ps2pk/t1intf.h42
-rw-r--r--fonts/utilities/ps2pk/t1io.c287
-rw-r--r--fonts/utilities/ps2pk/t1snap.c81
-rw-r--r--fonts/utilities/ps2pk/t1stdio.h110
-rw-r--r--fonts/utilities/ps2pk/t1stub.c44
-rw-r--r--fonts/utilities/ps2pk/t1test.c529
-rw-r--r--fonts/utilities/ps2pk/tests/Symbol.afm209
-rw-r--r--fonts/utilities/ps2pk/tests/Symbol.alpha.hex29
-rw-r--r--fonts/utilities/ps2pk/tests/Symbol.alpha.pix29
-rw-r--r--fonts/utilities/ps2pk/tests/Symbol.pfa1099
-rw-r--r--fonts/utilities/ps2pk/tests/Symbol.pfbbin0 -> 31586 bytes
-rw-r--r--fonts/utilities/ps2pk/tests/Symbol10.300pkbin0 -> 9216 bytes
-rwxr-xr-xfonts/utilities/ps2pk/tests/lmmath.test24
-rw-r--r--fonts/utilities/ps2pk/tests/lmmi12.600pkbin0 -> 18700 bytes
-rwxr-xr-xfonts/utilities/ps2pk/tests/ps2pk.test43
-rw-r--r--fonts/utilities/ps2pk/texfiles.c26
-rw-r--r--fonts/utilities/ps2pk/texfiles.h29
-rw-r--r--fonts/utilities/ps2pk/token.c1170
-rw-r--r--fonts/utilities/ps2pk/token.h61
-rw-r--r--fonts/utilities/ps2pk/tokst.h508
-rw-r--r--fonts/utilities/ps2pk/trig.h33
-rw-r--r--fonts/utilities/ps2pk/type1.c1776
-rw-r--r--fonts/utilities/ps2pk/types.h33
-rw-r--r--fonts/utilities/ps2pk/usenet64
-rw-r--r--fonts/utilities/ps2pk/util.c178
-rw-r--r--fonts/utilities/ps2pk/util.h209
105 files changed, 45175 insertions, 0 deletions
diff --git a/fonts/utilities/ps2pk/CHANGES.type1 b/fonts/utilities/ps2pk/CHANGES.type1
new file mode 100644
index 0000000000..39047274df
--- /dev/null
+++ b/fonts/utilities/ps2pk/CHANGES.type1
@@ -0,0 +1,65 @@
+This are the sources as I have found them on the X11R5 distribution. In
+order to use them for my purpose (ps2pk: conversion tool for Type1 fonts to
+packed TeX fonts) a number of changes were needed (see Changelog).
+
+--Piet
+
+Piet Tutelaers
+Computer Center Room RC 1.90
+Eindhoven University of Technology
+P.O. Box 513, 5600 MB Eindhoven, NL
+
+Changelog (the main-line):
+--------------------------
+92-02: Start of ps2pk project
+ - decoupling Type1 library from X11 (changes in t1intf.h + t1funcs.h;
+ added Xstuff.h to replace X header files)
+ - user definable encoding schemes (removed hardwired ISOLatin1 and
+ Symbol encodings from t1funcs.c and replaced by encoding paramater
+ in Type1OpenScalable)
+92-03: First release 1.0 (pre-release)
+92-04: - added expansion and slanting features as suggested by Lee
+ Hetherington (changes in spaces.c, t1funcs.c)
+ - changed t1test.c in order to test above features; added ISOLatin1
+ encoding vector.
+ - README2 replaced by CHANGES (this file)
+ - MSDOS concession (thanks to Sebastian Rahtz): renamed
+ fontfilest.h to ffilest.h so it does not clash with fontfile.h
+ (affects: fontfilest.h (->ffilest.h), t1funcs.c, t1info.c and
+ t1test.c).
+ - MSDOS concession: all file extensions .c.orig and .h.orig renamed
+ to .crg respectivally .hrg
+ - patch to handle /negationslash and /mapsto from LucidaMath-Symbol
+ correctly in t1funcs.c (ILH: Lee Hetherington).
+92-05: AMIGA/Aztec:
+ - added type1.ami (contains order of objects in library)
+ - added Makefile.ami
+ - added bstring.c (contains a bzero())
+92-05: - fixed a reference to a NULL pointer in t1info.c
+ - more verbose error messages in type1 library (NDW: Norman Walsh)
+ - changed memory heuristic in type1 library from static (one chunk)
+ into dynamic (up to a maximum of 10 chunks). This was needed for
+ big fonts like daysrib.pfa (reported by Norman Walsh).
+ (Changes in t1funcs.c and t1malloc.c)
+ - added Makefile.tcc for MSDOS/Turbo C, removed Makefile.dos
+92-06: - added Makefile.djg for MSDOS/GCC 386 (djgpp)
+ - fixed bug in t1io.c so MSDOS can read its own .pfb format
+92-08: - fixed alligment problem for machines with wordlength other than 32
+ bits (patch in util.c). Reported by J"urgen Marenda
+ <marenda@ford.uni-koblenz.de> for DataGeneral AViiON (Motorola
+ M88k machine)
+ - The type1 library did not render Oblique fonts correctly.
+ Erik Schenk <schenk@cpsc.ucalgary.ca> provided a patch for
+ this problem (patches in fontfcn.c and t1util.c).
+ - Official X11.5 patches (Stephen Gildea 920728) merged in the type1
+ library version of ps2pk. These patches were available on:
+ export.lcs.mit.edu:/pub/R5/contrib-fixes/Type1.patch
+ - portability: index() in t1info.c replaced by strchr()
+94-01: Version 1.4 (bug fix release)
+ - types.h: added basic type definitions for non 32-bit platforms
+ - fontfcn.c: made `virtual memory' management dynamically
+ (reported by Norman Walsh, needed for complicated fonts)
+ - Makefile.*: improved
+ - original X11R5 sources no longer included (see X11R5 sources if
+ you want to see them)
+ - t1malloc.c removed, not longer needed.
diff --git a/fonts/utilities/ps2pk/ChangeLog b/fonts/utilities/ps2pk/ChangeLog
new file mode 100644
index 0000000000..09eebc9b8b
--- /dev/null
+++ b/fonts/utilities/ps2pk/ChangeLog
@@ -0,0 +1,393 @@
+2018-12-05 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * mag.c, pk2bm.c: check for missing arguments.
+
+2018-12-01 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * ps2pk.c: check for missing arguments.
+ tex-k mail 1 Dec 2018 08:04:39.
+
+2018-09-09 Karl Berry <karl@tug.org>
+
+ * tests/ps2pk.test: LC_ALL=LANGUAGE=C.
+
+2018-01-18 Karl Berry <karl@tug.org>
+
+ * objects.h (IfTrace0): printf %s instead of direct string
+ (from Debian).
+
+2017-03-27 Karl Berry <karl@freefriends.org>
+
+ * Makefile.am (AM_TESTS_ENVIRONMENT): use instead of TESTS_ENVIRONMENT.
+
+2016-04-03 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * arith.h, pk2bm.c: Avoid compiler warnings.
+
+2016-02-01 Karl Berry <karl@tug.org>
+
+ * configure.ac
+ Version 1.8 (February 2016).
+
+ * ps2pk.c: use PACKAGE_VERSION (from c-auto.h) instead
+ of hardwiring the number.
+
+ * mag.c,
+ * pfb2pfa.c,
+ * pk2bm.c,
+ * pktest.c: report version number in usage as with ps2pk.
+ Also say "invalid" instead of "illegal".
+
+ * *.1: uniformly use date in .TH line.
+
+ * Remove version numbers from individual files.
+
+ * Remove Piet's email address so he does not get unwanted mail,
+ since this package is maintained in TeX Live now. Ask for reports
+ to go to tex-k.
+
+2016-01-31 Luigi Scarso <luigi.scarso@gmail.com>
+
+ * pk2bm.c, pkin.c, pkin.h: Support charext.
+
+2015-07-07 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * Makefile.am: Better dependencies for 'make check'.
+
+2014-12-16 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * Makefile.am (noinst_PROGRAMS): Build pktest.
+ * pktest.c: ANSI/ISO C.
+ * tests/ps2pk.test: Test PK (pk2bm) BM (pktest) PK (pk2bm) BM.
+
+ * basics.[ch], configure.ac, encoding.c, filenames.[ch],
+ pkout.[ch], pktest.c, ps2pk.c, psearch.c, types.h:
+ Version 1.7 (December 2014).
+
+2014-12-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Applied some changes from Version 1.6beta1 (ctan.org/pkg/ps2pk).
+ Renamed ./ps2pkm => ./ps2pk.
+
+ * filenames.c: Drop charptr() and use strchr(). Whitespace.
+ * filenames.[ch]: Constify ps_resource() argument.
+
+ * pkin.c: New function pksbyte(). Replace error() => fatal().
+ Correctly handle flag bytes 5 and 6.
+ * Makefile.am (pk2bm_SOURCES): Add basics.[ch].
+ Use AM_CPPFLAGS, AM_CFLAGS, and LDADD also for pk2bm.
+
+2014-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * regions.c [WIN64]: Use __int64 (not long) as intptr_t.
+
+2014-10-14 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * paths.c: Fixed a bug introduced by the previous "Bug fix".
+
+ * tests/lmmath.test: Shell script ...
+ * tests/lmmi12.600pk: ... and data for a new test.
+ * Makefile.am, configure.ac: Add the new test.
+
+2014-10-13 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * paths.c: Bug fix: Avoid use of uninitialized variable.
+
+ * basics.h, filenames.c, fontfcn.c, pk2bm.c, pkin.c, t1io.c,
+ t1snap.c, types.h: Always include "c-auto.h" first in all C
+ files (directly or indirectly via "basics.h" or "types.h").
+
+ * configure.ac: Add AC_TYPE_(U)INT32_T and AC_TYPE_INTPTR_T.
+
+ * pkout.[ch], ps2pk.c: Replace (U)INT32 => (u)int32_t.
+
+ * arith.[ch], curves.c, ffilest.h, fsmasks.h, hints.c, lines.c,
+ objects.[ch], paths.c, regions.c, spaces.[ch], t1funcs.c,
+ t1info.c, t1stdio.h, token.c, types.h, util.[ch]: Replace
+ (U)LONG => (u)int32_t, to avoid LONG defined as long for MinGW
+ (and MSVC?).
+
+ * fontstruct.h, ps2pk.c, util.h: Change MakeAtom() return type
+ long => intptr_t (large enough for 'void *' even for WIN64).
+
+2014-10-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ More general cleanup:
+ * *.[ch]: ANSI/ISO C function prototypes and definitions.
+ Extern declarations in only in headers.
+ Drop unused functions and variables.
+ Declare functions used in only one file as static.
+ * Makefile.am: t1imager.h. t1stub.c, and trig.h are not used.
+ Enable compiler warnings.
+
+2014-10-09 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * basics.h: Declare fatal() as noreturn (gcc and MSVC).
+ * pkout.c (magnification): Fatal error if no value found.
+
+2014-10-08 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ps2pk.c: Add return type for main and GetClientResolutions.
+ * regions.c: Add return type for OptimizeRegion.
+ * t1funcs.c: Add return type for Type1RegisterFontFileFunctions.
+ * t1stub.c: Add return type for xiStub.
+
+ * encoding.c (my_string, remove_string, addcc, getcc, decimal,
+ nextsymbol, nextpsname), filenames.c (equal), objects.[ch]
+ (Pragmatics), pkout.c (optimal_size, PSPKINT, magnification),
+ regions.[ch] (BoxClip), t1stub.c (xiStub): Declare as static.
+
+ * curves.c, hints.c, objects.c, paths.c, regions.c, scanfont.c,
+ spaces.c, t1funcs.c, t1info.c, t1io.c, token.c, tokst.h,
+ type1.c: ANSI/ISO C for all static functions.
+
+ * paths.c, regions.c, scanfont.c, spaces.c, t1info.c: Add braces
+ around substructures in initializers.
+
+ * basics.[ch], encoding.c, ffilest.h, filenames.[ch],
+ fontfcn.c, mag.c, objects.c, pfb2pfa.c, pkout.c, pktest.c,
+ ps2pk.c, scanfonts.c, spaces.c, t1funcs.c, t1info.c, util.[ch]:
+ Declare various local and global variables, function parameters
+ and return values, and struct members as const.
+
+ * scanfonts.c: Add parentheses around assignment as truth value.
+
+ * regions.c: Add braces to avoid 'ambiguos else'.
+
+2014-10-07 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * pk2bm.c, paths.c, pkout.c, ps2pk.c, regions.c, t1func.c:
+ Minor cleanup to avoid compiler warnings.
+
+2014-10-07 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * t1funcs.c: Bugfix (undefined operation due to a typo).
+ * token.c: Fix ambigous behavior (sequence point).
+
+ * encoding.c, objects.c: Avoid undefined behaviour when char is
+ signed.
+
+ * arith.c: Fix formats: %dl => %d for int.
+ * paths.c, regions.c, spaces.c: Fix (debug) format specifiers:
+ %f for double* => double
+ %ld => %d for int
+ %p => %d for int
+ %x => %d for int (except for flags)
+ %x => %p for ANY*
+ %z => %p for ANY*
+
+2014-06-16 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * Makefile.am: Drop the obsolete ACLOCAL_AMFLAGS.
+
+2013-06-28 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * encoding.c, filenames.c, fontfcn.c, mag.c, pfb2pfa.c, pkout.c,
+ ps2pk.c, scanfont.c: Include Autoconf generated headers first.
+
+2012-11-20 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * Makefile.am: Avoid use of deprecated INCLUDES.
+
+2012-10-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Remove TL vs W32TeX diffs (from Akira).
+ * pkout.c: Add casts to avoid MSVC warnings.
+
+2012-10-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Reduce TL vs W32TeX diffs (from Akira).
+ * mag.c [WIN32]: Add '#include <fcntl.h>' for setmode().
+ * t1funcs.c: Add casts to avoid MSVC warnings.
+
+2012-08-23 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * pfb2pfa.c (main): Drop unnecessary nested fatal() prototype.
+
+2012-07-25 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * pkout.c (pk_runlengths): Pretend that the first pixel of an
+ empty glyph is white; avoid using uninitialized data.
+ Found by Martin Schroeder <martin@oneiros.de>.
+
+2012-07-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ps2pk.c: Invoke kpse_set_program_name() with original argv[0]
+ and program name string.
+ * mag.c, ps2pk.c: ANSI C function declarations and definitions.
+ No nested function declarations. Declare functions as static.
+ * tests/ps2pk.test: Set environment for kpatsea file search.
+
+2012-07-12 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * pk2bm.c: Cast arg2 of readchar() to avoid MSVC warning.
+
+2012-07-11 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * tests/ps2pk.test (new): Shell script for a test case.
+ * tests/Symbol.afm, tests/Symbol.pfb (new): Test input.
+ * tests/Symbol.pfa, tests/Symbol.alpha.{hex,pix},
+ tests/Symbol10.300pk (new): Expected output.
+ * Makefile.am: Adapted.
+
+2012-07-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * mag.c, pk2bm.c: Use binary mode for output files (from W32TeX).
+
+ * pfb2pfa.c: Drop unused ambiguous code.
+
+ * Makefile.am: Pk2bm does not use KPATHSEA.
+ * pk2bm.c, pkin.[ch]: ANSI C function prototypes and definitions.
+
+2011-07-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * type1.c [FABS, CEIL, FLOOR]: Use routines from libm, the
+ evaluation order of tmpx in the original macros is undefined
+ by the C-standard!
+ (ComputeStem): Fix `ambiguous else' bug (also present in t1lib
+ 5.1.2, compare libXfont 1.3.x from XOrg-7.4).
+
+2011-07-18 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * type1.c (PSFakePop): Non-void function should return a value.
+ Reported by Jack Howarth <howarth@bromo.med.uc.edu>
+ Patch from Akira, [tex-live] Sun, 17 Jul 2011 22:39:30.
+
+ * Makefile.am (AM_CFLAGS): Prepare for compiler warnings.
+
+2011-05-27 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * README: Fixed a typo.
+
+2011-05-26 Karl Berry <karl@tug.org>
+
+ * README: clarify license per authors.
+
+2011-04-18 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * t1funcs.c (Type1OpenScalable): Cast ev[i] to 'unsigned char *'
+ to avoid 'differ in signedness' warning.
+
+2011-03-07 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ps2pk.c (main): `program_invocation_name' has been renamed
+ into `kpse_invocation_name'.
+
+2010-03-09 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ps2pk.c: Use kpse_set_program_name() instead of
+ kpse_set_progname().
+
+2010-02-27 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * Makefile.am: List all used header files.
+
+2010-02-23 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * basics.c: #include "basics.h" and drop all others.
+
+2010-02-23 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * t1info.c (ComputeStdProps): Declare rc as int, not LONG,
+ because they differ for WIN32.
+ * t1stub.c: Use ANSI C protos (not only for WIN32).
+ Declare struct segment (#include "paths.h" doesn't work).
+
+2010-02-20 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * basics.c: Don't #include <win32lib.h> for MinGW32.
+ ps2pk.c (CheckFSFormat), t1funcs.c (fill): Rename function
+ param byte => Byte to avoid conflicts.
+
+2009-07-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * regions.c (NewEdge): align to sizeof(long), as in t1lib.
+ * util.c (vm_alloc): align to 64-bit boundary, as in t1lib.
+
+2009-06-23 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * fontfcn.c, regions.c, regions.h, scanfont.c, t1funcs.c:
+ drop #ifdef HAVE_PROTOTYPES, unconditionally use prototypes.
+
+2009-06-22 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * objects.c, objects.h: use ANSI C variadic function syntax.
+ * paths.c: use ANSI C prototypes instead of P[1-9]H.
+ * type1.c: use ANSI C prototypes instead of P[1-9]H or AA.
+
+2009-06-02 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * regions.c, regions.h, t1imager.h:
+ rename INFINITY -> T1_INFINITY, to avoid name conflict with
+ INFINITY from cygwin <math.h>.
+
+2009-05-07 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Adapt to TL2009 build system.
+
+2008-02-29 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * acconfig.h: removed.
+
+2008-01-31 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Convert from autoconf-2.13 to autoconf-2.59+:
+ * Makefile.in: Add @configure_input@ line.
+ * aclocal.m4 (new): Generated (aclocal -I ../m4).
+ * configure: Regenerated (autoconf).
+
+Fri Mar 13 13:41:39 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * bstring.c: more fixes from Thomas Esser in this and configure
+ setup
+
+Mon Mar 9 10:33:30 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * fixes as suggested by Melissa O'Neill <oneill@cs.sfu.ca> (from
+ Thomas Esser), for memset in bstring.c (addition to configure)
+
+Tue Feb 24 11:55:33 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * objects.[ch]: extra #ifdef KPATHSEA inside WIN32
+
+Mon Feb 16 12:36:45 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * more fixes to regions.c (Thomas Esser)
+
+Tue Feb 3 13:40:36 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * regions.c: rationalized non STDC declarations
+
+Wed Jan 28 09:44:45 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * better undef of BITS in curves.c; change in objects.h (ifdef
+ KPATHSEA instead of just WIN32) from Fabrice Popineau
+
+Tue Jan 27 14:32:25 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * configure etc: new configure.in, c-auto.in, Makefile.in from
+ Olaf Weber
+
+Tue Jan 27 13:48:14 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * patch to regions.h from Peter B
+
+Tue Jan 20 10:14:10 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * added check of function prototypes to c-auto.in
+
+Mon Jan 19 20:46:08 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * pkin.c: "remainder" clashed with some builtin, so
+ renamed to remainderPK throughout
+
+Thu Jan 1 11:08:37 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ Fixes by Peter Breitenlohner <peb@mppmu.mpg.de>
+ * curves.c: BITS redefined
+ * regions.h: incompatible pointer types
+ * types.h: AA redefined
+ * t1stub.c: struct declared inside parameter list
+
+
+
diff --git a/fonts/utilities/ps2pk/INSTALLATION b/fonts/utilities/ps2pk/INSTALLATION
new file mode 100644
index 0000000000..ebfbc1d521
--- /dev/null
+++ b/fonts/utilities/ps2pk/INSTALLATION
@@ -0,0 +1,208 @@
+
+ PS2PK installation summary
+ --------------------------
+ (March 1995)
+
+For the version which works with Karl Berry's path searching,
+run configure in this directory and use the Makefile which is
+generated. Otherwise follow the instructions below
+There needs to be a fully configured kpathsea directory
+at the same level as this.
+
+Special versions of MakeTeXPK and texmf.cnf are provided
+These are needed for the proper running of this version
+of ps2pk.
+
+ (January 1994)
+
+The ./src directory contains the sources to build the following programs:
+ - ps2pk a program to build PK fonts from PostScript type1 fonts
+ - pk2bm a program that allows to look at a PK character.
+
+To install and use these programs follow next steps:
+ 1) - Go to the ./src directory.
+
+ Select a Makefile.xxx
+ System xxx
+ ------------------------------------------------------------
+ UNIX unx A universal UNIX makefile using gcc.
+ This makefile is tailored to BSD like UNIX-es. On
+ SYS5 UNIX systems some small changes may be
+ necessary.
+
+ MSDOS bcc Borland C 3.1. The programs compile but ps2pk.exe
+ does not run (program does not fit in 640k!).
+
+ djg Delorie's port of gcc. The programs compile and run
+ on 386 compatible machines only. Ready compiled
+ versions are available that run on MSDOS or
+ MSWindows (386 with or without a coprocessor needed).
+
+ emx Eberhardt Mattes port of GCC with an extender that
+ can be used on MSDOS and OS2. Only 386.
+
+ wat For the Watcom/386 compiler.
+
+ Copy the selected Makefile.xxx to Makefile.
+
+ Edit the Makefile to adapt the T1INPUTS path and the bin and man
+ directories.
+
+ - Do a `make'. This will create the tools above.
+ The master Makefile calls the appropriate Makefile in the ./type1
+ directory to install a type1 library. If your compiler has problems
+ in compiling this library you possibly have to adapt that
+ makefile to your needs.
+
+ - Do a `make install'.
+ This will install the above programs.
+
+ - Do a `make install.man'.
+ This will install manual pages for the above programs.
+
+ 2) Testing ps2pk from ./src directory.
+ The directory ../Utopia contains the Utopia-Regular font donated by
+ Adobe. To make from this type1 font a PKfile next steps are needed:
+ setenv T1INPUTS ../Utopia (C-shell)
+ ps2pk -v -X300 Utopia-Regular.pfa (long)
+ or: ps2pk -v Utopia-Regular.pfa (short using defaults)
+
+ This will create the Utopia-Regular10.300pk font with the default
+ AdobeStandard characters derived from ../Utopia/Utopia-Regular.afm.
+ (The -v flag will show what the program is doing and which character
+ codes are generated.)
+
+ To see how for example the `Q' is rendered by ps2pk (using the IBM
+ type1 rendering software) you can use:
+ pk2bm -bcQ Utopia-Regular10.300pk
+
+ MSDOS has problems with such long names as Utopia-Regular10.300pk. That
+ is the reason that dvips uses abreviations for the PostScript names. The
+ short name for TeX's virtual font needed to use Utopia-Regular is `putr'.
+ The short name for its raw counterpart is `rputr'. To generate rputr.pk
+ the equivalent of Utopia-Regular10.300pk in directory 300dpi you have to
+ use (on MSDOS):
+ ps2pk -v Utopia-Regular 300dpi\rputr.pk
+
+ Ps2pk has some extra options. All options are explained in the manual page
+ (man/ps2pk.1). Here are the most important:
+ -X<xres> the desired X-resolution (ex: 300, 329, 360, 432, etc)
+ -E<expansion> the factor to expand a font
+ -S<slant> to get a slanted font.
+
+ 3) Using the ps2pk rendered fonts with xdvi.
+ The main reason why ps2pk is written is to use the PK fonts for
+ previewing a (La)TeX document that uses PostScript fonts. But some
+ people use the PKfonts instead of the original type1 fonts that are
+ available in the printer because they consume less virtual memory
+ or because the printing goes faster.
+
+ To use putr the TeX version of Utopia-Regular in xdvi you will need:
+ - the latest version of xdvi (supporting virtual fonts)
+ - putr.tfm and putr.vf (the virtual TeX-face of Utopia-Regular)
+ - rputr.tfm and rputr.300pk (the raw TeX-face of Utopia-Regular)
+ - testfont.tex (a plain TeX source to test the font).
+
+ We have explained how to make rputr.300pk from Utopia-Regular. How do
+ we generate rputr.tfm, putr.vf and putr.tfm? The first TFM file can be
+ generated with afm2tfm, coming with dvips, in the following way:
+ - afm2tfm Utopia/Utopia-Regular.afm -v putr.vpl rputr.tfm
+
+ The TFM/VF files for putr can be generated from the virtual property
+ list file (VPL) with vptovf:
+ - vptovf putr.vpl putr.vf putr.tfm
+
+ Now we have to verify that xdvi can find all these VF and PK fonts
+ by adding the current directory to the PATH's used for locating them:
+ - XDVIVFS (path for VF files)
+ - XDVIFONTS (path for PK files)
+
+ Now we are ready to test Utopia-Regular:
+ - tex testfont
+
+ If TeX asks for a font enter `putr' and when asked for a test
+ enter `\bigtest\bye' and you will get a testfont.dvi file.
+ (Testfont.tex is distributed with every TeX version.)
+
+ - xdvi testfont
+
+ If everything is OK you should see Utopia!
+
+ (You can try another testfont with `rputr' instead of `putr'. Explain
+ the differences!)
+
+ 4) Using Utopia-Regular with dvips.
+ Before you can run dvips to generate the PostScript output that can
+ be printed you have to make the font available to dvips by adding a
+ line to psfonts.map (normally located in /usr/local/lib/tex/ps).
+ This line tells dvips if a font is resident (available in the
+ printer) and if not how to download it. For rputr we need to add
+ next line in psfonts.map (the new version of afm2tfm will show this
+ line on the standard output):
+ rputr Utopia-Regular
+
+ and to copy or to move Utopia-Regular to /usr/local/lib/tex/ps so
+ that it will be downloaded (added to the PostScript output).
+ dvips testfont
+
+ If you have GhostScript, and your dvips is installed so that it does
+ not send the output immediately to the printer, you can check
+ testfont.ps behind your X-display with:
+ gs testfont.ps
+
+ 5) Using rputr.300pk with dvips.
+ You have to remove the line you have added to psfonts.map. Then
+ dvips will try to find a PK-font instead of the type1 font.
+
+ 6) Automatic font generation with MakeTeXPK.
+
+ If you are interested in automatically generating PK fonts from
+ either METAFONT and/or type1 sources you may want to install the
+ MTPK package. This package provides a perl script that allows
+ DVI drivers to generate missing PK sizes in a platform independant
+ way. See ftp.urc.tue.nl:pub/tex/MTPK??.gtz and the MTPK??.README
+ file for more information (under development).
+
+ 7) Although ps2pk is set up for AdobeStandardEncoding, the default used
+ by current versions of dvips, it will also accept other PostScript
+ and TeX encodings. An interesting alternative for TeX users is the new
+ TUG 8bits font standard (see: TUGboat #10 vol. 4 1990). This standard
+ is a superset of ISOLatin1 with many accented characters. The PostScript
+ encoding used by this new font is contained in etc/EC.enc. In order to
+ use it you will need afm2tfm version 7.0 (distributed with dvips5485++).
+
+ [Here you should read two danger bends!! Next in small letters . . .
+
+ As an example how an encoding scheme other than Adobe Standard can
+ be used we show how you can use the Utopia-Regular font as an
+ extended Computer Modern font. We use this encoding scheme both on
+ the TeX input side (let us call that internal encoding) and on the
+ TeX output side (we will call that external encoding). It is clear
+ that we can not use the plain macros that are still based on
+ oldstyle 7bits internal encodings. But we can use NFSS-DC a new
+ font selection scheme based on DC encodings. The DC encoding is a
+ preliminar version of the EC encoding.
+
+ How do we generate the appropriate TFM, VF and PK files?
+ rputr.300pk:
+ setenv T1INPUTS Utopia (C-shell)
+ ps2pk -e etc/EC.enc Utopia-Regular rputr.300pk
+ rputr.tfm and putr.vpl:
+ afm2tfm Utopia/Utopia-Regular.afm -p etc/EC.enc -v putr.vpl rputr.tfm
+ putr.vf putr.tfm:
+ vptovf putr.vpl putr.vf putr.tfm
+
+ How do we use it?
+ psfonts.map (add line):
+ rputr Utopia-Regular " ECEncoding ReEncodeFont " <EC.enc
+ $TEXCONFIG:
+ install here Utopia-Regular and EC.enc
+ testfont.tex (tex-nfss-dc is a special plain TeX version):
+ tex-nfss-dc testfont (choose `putr' and '\bigtest\bye')
+ xdvi testfont
+ dvips testfont.
+
+ . . .End of dangerous stuff and the small letters]
+
+--Piet
+
diff --git a/fonts/utilities/ps2pk/Makefile.am b/fonts/utilities/ps2pk/Makefile.am
new file mode 100644
index 0000000000..977442014e
--- /dev/null
+++ b/fonts/utilities/ps2pk/Makefile.am
@@ -0,0 +1,144 @@
+## $Id: Makefile.am 43617 2017-03-27 18:00:45Z karl $
+## Makefile.am for the TeX Live subdirectory texk/ps2pk/
+##
+## Copyright 2017 Karl Berry <tex-live@tug.org>
+## Copyright 2009-2015 Peter Breitenlohner <tex-live@tug.org>
+## You may freely use, modify and/or distribute this file.
+
+bin_PROGRAMS = mag pfb2pfa pk2bm ps2pk
+noinst_PROGRAMS = pktest
+
+AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -DUNIX -DKPATHSEA
+AM_CFLAGS = $(WARNING_CFLAGS)
+LDADD = $(KPATHSEA_LIBS)
+
+mag_SOURCES = \
+ basics.c \
+ basics.h \
+ mag.c
+
+pfb2pfa_SOURCES = \
+ basics.c \
+ basics.h \
+ filenames.c \
+ filenames.h \
+ pfb2pfa.c
+
+pk2bm_SOURCES = \
+ basics.c \
+ basics.h \
+ pk2bm.c \
+ pkin.c \
+ pkin.h
+
+ps2pk_SOURCES = \
+ Xstuff.h \
+ arith.c \
+ arith.h \
+ basics.c \
+ basics.h \
+ blues.h \
+ bstring.c \
+ cluts.h \
+ curves.c \
+ curves.h \
+ digit.h \
+ encoding.c \
+ ffilest.h \
+ filenames.c \
+ filenames.h \
+ font.h \
+ fontfcn.c \
+ fontfcn.h \
+ fontfile.h \
+ fontmisc.h \
+ fonts.h \
+ fontstruct.h \
+ fontxlfd.h \
+ fsmasks.h \
+ hdigit.h \
+ hints.c \
+ hints.h \
+ lines.c \
+ lines.h \
+ objects.c \
+ objects.h \
+ paths.c \
+ paths.h \
+ pictures.h \
+ pkout.c \
+ pkout.h \
+ ps2pk.c \
+ psearch.h \
+ regions.c \
+ regions.h \
+ scanfont.c \
+ spaces.c \
+ spaces.h \
+ strokes.h \
+ t1funcs.c \
+ t1hdigit.h \
+ t1info.c \
+ t1intf.h \
+ t1io.c \
+ t1snap.c \
+ t1stdio.h \
+ token.c \
+ token.h \
+ tokst.h \
+ type1.c \
+ types.h \
+ util.c \
+ util.h
+
+pktest_SOURCES = \
+ basics.c \
+ basics.h \
+ pkout.c \
+ pkout.h \
+ pktest.c
+
+$(mag_OBJECTS) $(pfb2pfa_OBJECTS) $(pk2m_OBJECTS) $(ps2pk_OBJECTS) $(pktest_OBJECTS): $(KPATHSEA_DEPEND)
+
+## Rebuild libkpathsea
+@KPATHSEA_RULE@
+
+dist_man1_MANS = mag.1 pfb2pfa.1 pk2bm.1 ps2pk.1
+
+## Tests.
+AM_TESTS_ENVIRONMENT = KPSEWHICH='$(KPSEWHICH)'; export KPSEWHICH;
+#
+TESTS = tests/lmmath.test tests/ps2pk.test
+tests/lmmath.log: ps2pk$(EXEEXT)
+tests/ps2pk.log: pfb2pfa$(EXEEXT) ps2pk$(EXEEXT) pk2bm$(EXEEXT) pktest$(EXEEXT) mag$(EXEEXT)
+#
+EXTRA_DIST = $(TESTS)
+DISTCLEANFILES =
+## tests/lmmath.test
+EXTRA_DIST += tests/lmmi12.600pk
+DISTCLEANFILES += lmmi12.600pk
+## tests/ps2pk.test
+EXTRA_DIST += tests/Symbol.afm tests/Symbol.alpha.hex tests/Symbol.alpha.pix \
+ tests/Symbol.pfa tests/Symbol.pfb tests/Symbol10.300pk
+DISTCLEANFILES += Symbol*
+
+## Not used
+EXTRA_DIST += \
+ CHANGES.type1 \
+ INSTALLATION \
+ README.14m \
+ README.type1 \
+ basename.c \
+ flisearch.c \
+ protos.h \
+ psearch.c \
+ sexpr.c \
+ strexpr.c \
+ strexpr.h \
+ t1imager.h \
+ t1stub.c \
+ t1test.c \
+ texfiles.c \
+ texfiles.h \
+ trig.h \
+ usenet
diff --git a/fonts/utilities/ps2pk/Makefile.in b/fonts/utilities/ps2pk/Makefile.in
new file mode 100644
index 0000000000..1400c0ede1
--- /dev/null
+++ b/fonts/utilities/ps2pk/Makefile.in
@@ -0,0 +1,1520 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = mag$(EXEEXT) pfb2pfa$(EXEEXT) pk2bm$(EXEEXT) \
+ ps2pk$(EXEEXT)
+noinst_PROGRAMS = pktest$(EXEEXT)
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
+ $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-warnings.m4 \
+ $(top_srcdir)/../../m4/libtool.m4 \
+ $(top_srcdir)/../../m4/ltoptions.m4 \
+ $(top_srcdir)/../../m4/ltsugar.m4 \
+ $(top_srcdir)/../../m4/ltversion.m4 \
+ $(top_srcdir)/../../m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = c-auto.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+am_mag_OBJECTS = basics.$(OBJEXT) mag.$(OBJEXT)
+mag_OBJECTS = $(am_mag_OBJECTS)
+mag_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+mag_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+am_pfb2pfa_OBJECTS = basics.$(OBJEXT) filenames.$(OBJEXT) \
+ pfb2pfa.$(OBJEXT)
+pfb2pfa_OBJECTS = $(am_pfb2pfa_OBJECTS)
+pfb2pfa_LDADD = $(LDADD)
+pfb2pfa_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_pk2bm_OBJECTS = basics.$(OBJEXT) pk2bm.$(OBJEXT) pkin.$(OBJEXT)
+pk2bm_OBJECTS = $(am_pk2bm_OBJECTS)
+pk2bm_LDADD = $(LDADD)
+pk2bm_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_pktest_OBJECTS = basics.$(OBJEXT) pkout.$(OBJEXT) pktest.$(OBJEXT)
+pktest_OBJECTS = $(am_pktest_OBJECTS)
+pktest_LDADD = $(LDADD)
+pktest_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_ps2pk_OBJECTS = arith.$(OBJEXT) basics.$(OBJEXT) bstring.$(OBJEXT) \
+ curves.$(OBJEXT) encoding.$(OBJEXT) filenames.$(OBJEXT) \
+ fontfcn.$(OBJEXT) hints.$(OBJEXT) lines.$(OBJEXT) \
+ objects.$(OBJEXT) paths.$(OBJEXT) pkout.$(OBJEXT) \
+ ps2pk.$(OBJEXT) regions.$(OBJEXT) scanfont.$(OBJEXT) \
+ spaces.$(OBJEXT) t1funcs.$(OBJEXT) t1info.$(OBJEXT) \
+ t1io.$(OBJEXT) t1snap.$(OBJEXT) token.$(OBJEXT) \
+ type1.$(OBJEXT) util.$(OBJEXT)
+ps2pk_OBJECTS = $(am_ps2pk_OBJECTS)
+ps2pk_LDADD = $(LDADD)
+ps2pk_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/arith.Po ./$(DEPDIR)/basics.Po \
+ ./$(DEPDIR)/bstring.Po ./$(DEPDIR)/curves.Po \
+ ./$(DEPDIR)/encoding.Po ./$(DEPDIR)/filenames.Po \
+ ./$(DEPDIR)/fontfcn.Po ./$(DEPDIR)/hints.Po \
+ ./$(DEPDIR)/lines.Po ./$(DEPDIR)/mag.Po ./$(DEPDIR)/objects.Po \
+ ./$(DEPDIR)/paths.Po ./$(DEPDIR)/pfb2pfa.Po \
+ ./$(DEPDIR)/pk2bm.Po ./$(DEPDIR)/pkin.Po ./$(DEPDIR)/pkout.Po \
+ ./$(DEPDIR)/pktest.Po ./$(DEPDIR)/ps2pk.Po \
+ ./$(DEPDIR)/regions.Po ./$(DEPDIR)/scanfont.Po \
+ ./$(DEPDIR)/spaces.Po ./$(DEPDIR)/t1funcs.Po \
+ ./$(DEPDIR)/t1info.Po ./$(DEPDIR)/t1io.Po \
+ ./$(DEPDIR)/t1snap.Po ./$(DEPDIR)/token.Po \
+ ./$(DEPDIR)/type1.Po ./$(DEPDIR)/util.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(mag_SOURCES) $(pfb2pfa_SOURCES) $(pk2bm_SOURCES) \
+ $(pktest_SOURCES) $(ps2pk_SOURCES)
+DIST_SOURCES = $(mag_SOURCES) $(pfb2pfa_SOURCES) $(pk2bm_SOURCES) \
+ $(pktest_SOURCES) $(ps2pk_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(dist_man1_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)c-auto.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+AM_RECURSIVE_TARGETS = cscope check recheck
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/../../build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in \
+ $(srcdir)/c-auto.in $(top_srcdir)/../../build-aux/compile \
+ $(top_srcdir)/../../build-aux/config.guess \
+ $(top_srcdir)/../../build-aux/config.sub \
+ $(top_srcdir)/../../build-aux/depcomp \
+ $(top_srcdir)/../../build-aux/install-sh \
+ $(top_srcdir)/../../build-aux/ltmain.sh \
+ $(top_srcdir)/../../build-aux/missing \
+ $(top_srcdir)/../../build-aux/test-driver \
+ ../../build-aux/ar-lib ../../build-aux/compile \
+ ../../build-aux/config.guess ../../build-aux/config.sub \
+ ../../build-aux/depcomp ../../build-aux/install-sh \
+ ../../build-aux/ltmain.sh ../../build-aux/missing \
+ ../../build-aux/texinfo.tex ../../build-aux/ylwrap ChangeLog \
+ README
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KPATHSEA_DEPEND = @KPATHSEA_DEPEND@
+KPATHSEA_INCLUDES = @KPATHSEA_INCLUDES@
+KPATHSEA_LIBS = @KPATHSEA_LIBS@
+KPSEWHICH = @KPSEWHICH@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -DUNIX -DKPATHSEA
+AM_CFLAGS = $(WARNING_CFLAGS)
+LDADD = $(KPATHSEA_LIBS)
+mag_SOURCES = \
+ basics.c \
+ basics.h \
+ mag.c
+
+pfb2pfa_SOURCES = \
+ basics.c \
+ basics.h \
+ filenames.c \
+ filenames.h \
+ pfb2pfa.c
+
+pk2bm_SOURCES = \
+ basics.c \
+ basics.h \
+ pk2bm.c \
+ pkin.c \
+ pkin.h
+
+ps2pk_SOURCES = \
+ Xstuff.h \
+ arith.c \
+ arith.h \
+ basics.c \
+ basics.h \
+ blues.h \
+ bstring.c \
+ cluts.h \
+ curves.c \
+ curves.h \
+ digit.h \
+ encoding.c \
+ ffilest.h \
+ filenames.c \
+ filenames.h \
+ font.h \
+ fontfcn.c \
+ fontfcn.h \
+ fontfile.h \
+ fontmisc.h \
+ fonts.h \
+ fontstruct.h \
+ fontxlfd.h \
+ fsmasks.h \
+ hdigit.h \
+ hints.c \
+ hints.h \
+ lines.c \
+ lines.h \
+ objects.c \
+ objects.h \
+ paths.c \
+ paths.h \
+ pictures.h \
+ pkout.c \
+ pkout.h \
+ ps2pk.c \
+ psearch.h \
+ regions.c \
+ regions.h \
+ scanfont.c \
+ spaces.c \
+ spaces.h \
+ strokes.h \
+ t1funcs.c \
+ t1hdigit.h \
+ t1info.c \
+ t1intf.h \
+ t1io.c \
+ t1snap.c \
+ t1stdio.h \
+ token.c \
+ token.h \
+ tokst.h \
+ type1.c \
+ types.h \
+ util.c \
+ util.h
+
+pktest_SOURCES = \
+ basics.c \
+ basics.h \
+ pkout.c \
+ pkout.h \
+ pktest.c
+
+dist_man1_MANS = mag.1 pfb2pfa.1 pk2bm.1 ps2pk.1
+AM_TESTS_ENVIRONMENT = KPSEWHICH='$(KPSEWHICH)'; export KPSEWHICH;
+#
+TESTS = tests/lmmath.test tests/ps2pk.test
+#
+EXTRA_DIST = $(TESTS) tests/lmmi12.600pk tests/Symbol.afm \
+ tests/Symbol.alpha.hex tests/Symbol.alpha.pix tests/Symbol.pfa \
+ tests/Symbol.pfb tests/Symbol10.300pk CHANGES.type1 \
+ INSTALLATION README.14m README.type1 basename.c flisearch.c \
+ protos.h psearch.c sexpr.c strexpr.c strexpr.h t1imager.h \
+ t1stub.c t1test.c texfiles.c texfiles.h trig.h usenet
+DISTCLEANFILES = lmmi12.600pk Symbol*
+all: c-auto.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+c-auto.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/c-auto.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status c-auto.h
+$(srcdir)/c-auto.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f c-auto.h stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ || test -f $$p1 \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+mag$(EXEEXT): $(mag_OBJECTS) $(mag_DEPENDENCIES) $(EXTRA_mag_DEPENDENCIES)
+ @rm -f mag$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(mag_OBJECTS) $(mag_LDADD) $(LIBS)
+
+pfb2pfa$(EXEEXT): $(pfb2pfa_OBJECTS) $(pfb2pfa_DEPENDENCIES) $(EXTRA_pfb2pfa_DEPENDENCIES)
+ @rm -f pfb2pfa$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pfb2pfa_OBJECTS) $(pfb2pfa_LDADD) $(LIBS)
+
+pk2bm$(EXEEXT): $(pk2bm_OBJECTS) $(pk2bm_DEPENDENCIES) $(EXTRA_pk2bm_DEPENDENCIES)
+ @rm -f pk2bm$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pk2bm_OBJECTS) $(pk2bm_LDADD) $(LIBS)
+
+pktest$(EXEEXT): $(pktest_OBJECTS) $(pktest_DEPENDENCIES) $(EXTRA_pktest_DEPENDENCIES)
+ @rm -f pktest$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pktest_OBJECTS) $(pktest_LDADD) $(LIBS)
+
+ps2pk$(EXEEXT): $(ps2pk_OBJECTS) $(ps2pk_DEPENDENCIES) $(EXTRA_ps2pk_DEPENDENCIES)
+ @rm -f ps2pk$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ps2pk_OBJECTS) $(ps2pk_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basics.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bstring.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curves.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encoding.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenames.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontfcn.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hints.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lines.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objects.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paths.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pfb2pfa.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pk2bm.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkin.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkout.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pktest.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps2pk.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regions.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanfont.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spaces.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1funcs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1info.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1io.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1snap.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/type1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+install-man1: $(dist_man1_MANS)
+ @$(NORMAL_INSTALL)
+ @list1='$(dist_man1_MANS)'; \
+ list2=''; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=../.. --prefix="$$dc_install_base" \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(PROGRAMS) $(MANS) c-auto.h
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
+ clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f ./$(DEPDIR)/arith.Po
+ -rm -f ./$(DEPDIR)/basics.Po
+ -rm -f ./$(DEPDIR)/bstring.Po
+ -rm -f ./$(DEPDIR)/curves.Po
+ -rm -f ./$(DEPDIR)/encoding.Po
+ -rm -f ./$(DEPDIR)/filenames.Po
+ -rm -f ./$(DEPDIR)/fontfcn.Po
+ -rm -f ./$(DEPDIR)/hints.Po
+ -rm -f ./$(DEPDIR)/lines.Po
+ -rm -f ./$(DEPDIR)/mag.Po
+ -rm -f ./$(DEPDIR)/objects.Po
+ -rm -f ./$(DEPDIR)/paths.Po
+ -rm -f ./$(DEPDIR)/pfb2pfa.Po
+ -rm -f ./$(DEPDIR)/pk2bm.Po
+ -rm -f ./$(DEPDIR)/pkin.Po
+ -rm -f ./$(DEPDIR)/pkout.Po
+ -rm -f ./$(DEPDIR)/pktest.Po
+ -rm -f ./$(DEPDIR)/ps2pk.Po
+ -rm -f ./$(DEPDIR)/regions.Po
+ -rm -f ./$(DEPDIR)/scanfont.Po
+ -rm -f ./$(DEPDIR)/spaces.Po
+ -rm -f ./$(DEPDIR)/t1funcs.Po
+ -rm -f ./$(DEPDIR)/t1info.Po
+ -rm -f ./$(DEPDIR)/t1io.Po
+ -rm -f ./$(DEPDIR)/t1snap.Po
+ -rm -f ./$(DEPDIR)/token.Po
+ -rm -f ./$(DEPDIR)/type1.Po
+ -rm -f ./$(DEPDIR)/util.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f ./$(DEPDIR)/arith.Po
+ -rm -f ./$(DEPDIR)/basics.Po
+ -rm -f ./$(DEPDIR)/bstring.Po
+ -rm -f ./$(DEPDIR)/curves.Po
+ -rm -f ./$(DEPDIR)/encoding.Po
+ -rm -f ./$(DEPDIR)/filenames.Po
+ -rm -f ./$(DEPDIR)/fontfcn.Po
+ -rm -f ./$(DEPDIR)/hints.Po
+ -rm -f ./$(DEPDIR)/lines.Po
+ -rm -f ./$(DEPDIR)/mag.Po
+ -rm -f ./$(DEPDIR)/objects.Po
+ -rm -f ./$(DEPDIR)/paths.Po
+ -rm -f ./$(DEPDIR)/pfb2pfa.Po
+ -rm -f ./$(DEPDIR)/pk2bm.Po
+ -rm -f ./$(DEPDIR)/pkin.Po
+ -rm -f ./$(DEPDIR)/pkout.Po
+ -rm -f ./$(DEPDIR)/pktest.Po
+ -rm -f ./$(DEPDIR)/ps2pk.Po
+ -rm -f ./$(DEPDIR)/regions.Po
+ -rm -f ./$(DEPDIR)/scanfont.Po
+ -rm -f ./$(DEPDIR)/spaces.Po
+ -rm -f ./$(DEPDIR)/t1funcs.Po
+ -rm -f ./$(DEPDIR)/t1info.Po
+ -rm -f ./$(DEPDIR)/t1io.Po
+ -rm -f ./$(DEPDIR)/t1snap.Po
+ -rm -f ./$(DEPDIR)/token.Po
+ -rm -f ./$(DEPDIR)/type1.Po
+ -rm -f ./$(DEPDIR)/util.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: all check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \
+ check-TESTS check-am clean clean-binPROGRAMS clean-cscope \
+ clean-generic clean-libtool clean-noinstPROGRAMS cscope \
+ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
+ distcheck distclean distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags distcleancheck \
+ distdir distuninstallcheck dvi dvi-am html html-am info \
+ info-am install install-am install-binPROGRAMS install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-man1 install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ recheck tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
+
+
+$(mag_OBJECTS) $(pfb2pfa_OBJECTS) $(pk2m_OBJECTS) $(ps2pk_OBJECTS) $(pktest_OBJECTS): $(KPATHSEA_DEPEND)
+
+@KPATHSEA_RULE@
+tests/lmmath.log: ps2pk$(EXEEXT)
+tests/ps2pk.log: pfb2pfa$(EXEEXT) ps2pk$(EXEEXT) pk2bm$(EXEEXT) pktest$(EXEEXT) mag$(EXEEXT)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/fonts/utilities/ps2pk/README b/fonts/utilities/ps2pk/README
new file mode 100644
index 0000000000..b718b1ca33
--- /dev/null
+++ b/fonts/utilities/ps2pk/README
@@ -0,0 +1,240 @@
+This ps2pk program (all versions) is available under the same
+permissive license as the Type 1 interpreter code that it is based on
+(and incorporates). For the exact wording, see, for example, the type1.c
+source file.
+--Piet Tutelaers and Pierre MacKay, May 2011.
+
+ps2pk is currently maintained as part of TeX Live (http://tug.org/texlive),
+and distributed through TL and CTAN.
+
+ Ps2pk-1.4 available
+ -------------------
+ (January 1994)
+
+Version 1.4 of ps2pk is now available on:
+ ftp.urc.tue.nl (address: 131.155.2.79)
+ directory: /pub/tex
+ files: ps2pk14.README ( 9k) This file
+ ps2pk14.tar.gz (237k) Sources
+
+ For MSDOS people having difficulties in handling UNIX `.tar.gz'
+ format I have made some UNIX tools (only executables) available
+ in directories:
+ /pub/unixtools/dos
+
+ See the system specific TARGZ file for some help.
+
+ Ftp.urc.tue.nl can not handle E-mail requests. But sites are free
+ to put the ps2pk14 stuff on any server that can.
+
+ I have made read-to-go 1.4 executables for MSDOS available in:
+ pub/tex/ps2pk14x/msdos/djgpp (created with DJGPP/gcc)
+ msdos/emx (created with EMX/gcc)
+
+When do you need ps2pk?
+----------------------
+Ps2pk is a tool that converts a PostScript type1 font into a corres-
+ponding TeX PK font. The tool is especially interesting if you want
+to use fully hinted type1 fonts in your DVI previewer (instead of the
+unhinted type1 fonts currently used in GhostScript) or on a printer
+that has no PostScript interpreter.
+
+In order to use the ps2pk generated fonts your driver and previewer need
+to support virtual fonts. The reason is that PostScript fonts and TeX
+fonts do have a different font encoding and handle ligatures in a
+different way. With virtual fonts the PostScript world (encoding +
+ligatures) can be mapped to the old style TeX world on which the current
+plain macro packages still are based (despite the fact that TeX3.0 can
+handle 8bits).
+
+It is also possible to use the ps2pk generated PK fonts directly
+(without virtual fonts) but in that case you need modified plain TeX
+macros in order to acces the new (changed) font features. To make TeX
+really 8bits (the reason TeX3.0 was released) TUG has proposed a new
+font standard supporting the full 8bit range (in stead of the 7bit).
+The 128 extra characters in this new TUG standard are filled up with
+characters for 17 different European languages (see: TUGboat #10 vol.
+4 1990). With ps2pk it is possible to generate PK fonts from
+PostScript fonts according to this new TUG font standard.
+
+Ps2pk and virtual fonts.
+------------------------
+In order to use ps2pk in combination with virtal fonts you need afm2tfm
+(the version belonging to dvips5.487 or newer), dvips and a previewer
+supporting virtual fonts (ex.: xdvi on UNIX).
+
+PS: the latest version of dvips can be retrieved from
+ labrea.stanford.edu:pub and xdvi from export.lcs.mit.edu:contrib
+
+Ps2pk without virtual fonts.
+----------------------------
+This road in not a paved one even for experienced TeX users! So be
+prepared that you need to build some bridges and other improvements to
+reach your goal. Or simply wait until the TeX community has switched to
+the new TUG font standard.
+
+Dvips (5.487 and higher) supports different TeX and PostScript
+encodings. If you choose for the new TUG fontstandard defined in the
+Cork meeting, as the TeX and PostScript encoding, you have to:
+ - generate a set of TFM/VF fonts for the `EC' (Extended Computer
+ Modern Font encoding) using afm2tfm and vptovf,
+ - install the new encoding vector EC.enc so it will also be used for
+ the resident/downloaded PostScript fonts
+ - install a modified version of NFSS (New Font Selection Scheme) using
+ this encoding scheme.
+
+Type1 PostScript text fonts.
+----------------------------
+Fully hinted type1 fonts are generally not PD. You have to buy them
+unless you are satisfied with the PD available GhostScript versions
+(which are currently not hinted). You don't need to be an expert to
+see the difference between hinted and unhinted fonts. If you are
+using MSDOS or MacIntosh computers you probably use Adobe Type Manager
+(ATM) a program that can render type1 fonts dynamically. With this
+program or with other programs using ATM (for example Lotus) you
+receive fully hinted type1 fonts. On MSDOS they have funny names like
+tmr______.pfb. To save space on MSDOS type1 fonts are binary encoded
+(.pfb). On UNIX you can use this .pfb format too or the .pfa format
+(which occupies about double the space of a .pfb format).
+
+If your UNIX workstation supports DPS (Display PostScript) than
+you already may have a number of fully hinted type1 fonts. Look in
+places like /usr/lib/dps.
+
+ If you are satisfied with PK fonts derived from unhinted type1
+ fonts just for previewing then you can ftp (thanks to Karl Berry):
+ ftp.cs.umb.edu (file: pub/tex/psfonts.tar).
+
+ This set contains PK files for the standard 35 PostScript fonts in
+ various sizes, generated by `gsrenderfont' in the GNU font utilities
+ (on prep.ai.mit.edu et al.).
+
+Adobe has donated their Utopia font family to the X-consortium and IBM
+their Courier font. Both families are available on ftp.urc.tue.nl. The
+Courier font from IBM does have a rich set of accented characters not
+found in other Adobe fonts. Both fonts are fully hinted.
+
+Lee Hetherington has written a set of type1 conversion utilities. These
+allow to convert from binary (PFB) to ASCII (PFA) and back. Or to
+convert a type1 font into readable PostScript (disassemble) with the
+possibility to edit it and to convert it back (assemble) to some type1
+encoded form. They are now maintained by Eddie Kohler and available at
+http://www.lcdf.org/type (and as part of TeX Live).
+
+Type1 PostScript math fonts.
+----------------------------
+The PostScript type1 symbol fonts do not have the same rich set of math
+symbols as the TeX fonts. There are two exceptions: the Lucida fonts
+and the MathTime package. I have no experience with the Lucida fonts.
+The MathTime package from Michael Spivak has the disadvantage that it is
+too much MacIntosh/AMSTeX oriented. There are people who are working on
+LaTeX support based upon NFSS. Another disadvantage of MathTime is that
+it is built on top of TimesRoman-Italic (not delivered with the package)
+and lacks bold-italic symbols.
+
+Acknowledgements.
+-----------------
+Ps2pk uses the type1 rendering software IBM has donated to the
+X-consortium. This rendering package is used by ps2pk as pure as
+possible. But in order to support user specified encoding schemes, to
+generate extended and/or slanted font variations, to uncouple it from the
+X protocol and to fix some bugs I needed to change some of the sources.
+
+I also want to thank the `ps2pk discussion forum' who helped me to make
+ps2pk as it is now. Especially Tom Rokicki for enhancing his dvips/afm2tfm.
+
+I wish you a lot of fun with type1 fonts,
+
+--Piet
+
+Piet Tutelaers
+Computer Center Room RC 1.90
+Eindhoven University of Technology
+P.O. Box 513, 5600 MB Eindhoven, NL
+
+
+For those who have used earlier versions of ps2pk next differences may be
+of interest (only major differences are mentioned):
+
+Ps2pk 1.4 release (94-01)
+-------------------------
+1) Memory allocation made dynamically
+ 1.1 in computing runlengths (needed to build PK fonts)
+ 1.2 in scanning type1 fonts (to overcome `fixed' virtual memory)
+2) Problem with handling Lucida font (negative widths) solved
+3) Improved error handling in scanning AFM files
+4) Provided hooks to handle non 32-bit platforms
+5) Some cleanups
+6) Improved Makefiles.
+
+Ps2pk 1.3 release (92-09)
+-------------------------
+1) Official X11R5 patches included in type1 library.
+2) The -a<AFMfile> option added to ps2pk.
+3) Problem with rendering of Obique fonts solved.
+
+Ps2pk 1.2 release (92-06)
+-------------------------
+1) Ps2pk now computes the same checksum as afm2tfm (dvips5.487 or
+ higher). This means that you have to update your VF and TFM files
+ with the new dvips5487lib files.
+2) Bug fixes:
+ - the MSDOS version now correctly reads PFB font files
+ - a segmentation fault error removed (capri.pfa font)
+ - an out of memory problem fixed (davysrib.pfa font)
+3) Added Makefile for MSDOS/DJGPP (Delorie's GCC for 386 systems)
+
+Ps2pk 1.1 release (92-04)
+-------------------------
+1) Ps2pk uses now the same encoding scheme as introduced by afm2tfm 7.0
+ (dvips5485). But default (for all English/American writing TeX-friends)
+ the program uses the same encoding as is in the AFM-file belonging to
+ the type1 PostScript font (normally AdobeStandard). So the program does
+ not longer need re-encode to create a .cmi file containing the encoding
+ vector and the WX values. These are read directly from the AFM file.
+
+ Typical usage for standard encoding:
+ ps2pk -X329 Utopia-Regular rputr.329pk
+
+ or with EC.enc encoding:
+ ps2pk -eEC.enc -X329 Utopia-Regular rputr.329pk
+
+2) I have added a -E<expansion> and -S<slant> option to ps2pk thanks to
+ the patches I got from Lee Hetherington.
+
+3) I have added a MakeTeXPK script so that dvips and xdvi can use it.
+
+4) I have added manual pages and some documentation (README + INSTALLATION).
+
+5) Some inconveniences for MSDOS users are removed.
+
+Ps2pk 1.0 release (92-03)
+-------------------------
+
+======================================================================
+
+
+CTAN SOURCE TREE INFORMATION
+
+
+This CTAN source tree has been automatically extracted from the texk
+Subversion repository at svn://tug.org/texlive/trunk/Build/source/texk/.
+
+It is not possible to use the supplied configure script.
+In fact, if you call it; you will be told as such.
+
+This source can only be compiled in a texk build environment.
+You will need to download the whole environment, please refer to
+http://www.tug.org/texlive/svn/.
+
+It all boils down to a Subversion checkout of
+svn://tug.org/texlive/trunk/Build/source
+This will be the source tree that you can use for compilation. The
+CTAN directory is there for archival and informational purpose.
+
+For your convenience, the original configure script from the texk
+source tree is available in this directory as configure.texk.
+
+For the CTAN team,
+
+ Joachim Schrod <jschrod@acm.org>
diff --git a/fonts/utilities/ps2pk/README.14m b/fonts/utilities/ps2pk/README.14m
new file mode 100644
index 0000000000..6a70ab18ce
--- /dev/null
+++ b/fonts/utilities/ps2pk/README.14m
@@ -0,0 +1,35 @@
+Fri May 9 13:23:31 MET DST 1997
+ Rearranged all the files into one directory. New Makefile.in and
+ configure.in.
+
+ Thomas Esser
+
+March 1995
+Configuration files supplied. Makefile for the
+manual pages.
+
+January 1995
+
+Kpathsea path searching added. Set up for use with
+MakeTeXPK
+
+December 1994
+
+This modification of ps2pk version 1.4
+is an attempt to provide for PK files
+that will be compatible with the recommendations
+of the TUG Working Group on a TeX Directory Structure
+for platform-independent support files.
+
+The sources in the src directory have been modified
+to provide for PK specials at the end of each
+PK file so that there will be an internal
+identification available if the files have
+to be stored under truncated DOS 8+3 names
+as xxxx.pk for all resolutions. For details
+see src/CHANGES and the manual page ps2pk.1
+The original files are retained in this package
+with the suffix [ch]orig (which DOS will truncate to
+"COR" and "HOR"
+
+P. A. Mackay---mackay@cs.washington.edu
diff --git a/fonts/utilities/ps2pk/README.type1 b/fonts/utilities/ps2pk/README.type1
new file mode 100644
index 0000000000..4ce796d75c
--- /dev/null
+++ b/fonts/utilities/ps2pk/README.type1
@@ -0,0 +1,25 @@
+This directory contains a rasterizer for "Type 1" (PostScript) format
+outline fonts. It was donated by IBM for the R5 contrib tape and has
+been maintained since then by the MIT X Consortium. This version is
+compatible with X11R5 public patch 13.
+
+To be used, this rasterizer must be bound into the X server and the font
+server. It is most convenient to do this if this directory is moved
+into the 'mit' directory tree (i.e., mit/font/lib/font/Type1, a peer of
+the 'Speedo' directory). Of course, mit/font/lib/font/Imakefile must be
+made aware of its new subdirectory and the objects in it. In any case,
+you must ensure that the library mit/font/lib/font/libfont.a contains
+this code.
+
+In addition, the rasterizer must be "registered" with X. The source in
+mit/fonts/lib/font/fontfile/renderers.c, specifically the routine
+FontFileRegisterFontFileFunctions(), must be modified to add the line:
+
+ Type1RegisterFontFileFunctions();
+
+after the call to "SpeedoRegisterFontFileFunctions".
+
+Some Type 1 fonts have been donated; see, for example, the directory
+contrib/fonts/scaled/Type1. In order to use them, they must be in the
+font path, either by combining them in some existing font object
+directory, or adding a new font directory to the path.
diff --git a/fonts/utilities/ps2pk/Xstuff.h b/fonts/utilities/ps2pk/Xstuff.h
new file mode 100644
index 0000000000..523767da37
--- /dev/null
+++ b/fonts/utilities/ps2pk/Xstuff.h
@@ -0,0 +1,42 @@
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef XMD_H
+#define XMD_H 1
+
+#include "types.h"
+
+/*
+ * Bitfield suffixes for the protocol structure elements, if you
+ * need them. Note that bitfields are not guarranteed to be signed
+ * (or even unsigned) according to ANSI C.
+ */
+#ifdef WORD64
+#define B32 :32
+#define B16 :16
+#else
+#define B32
+#define B16
+#endif
+
+typedef struct {
+ SHORT leftSideBearing B16,
+ rightSideBearing B16,
+ characterWidth B16,
+ ascent B16,
+ descent B16;
+ USHORT attributes;
+} xCharInfo;
+#endif /* XMD_H */
+
+#ifndef _FS_PROTO_H_
+#define _FS_PROTO_H_
+
+typedef struct {
+ USHORT x_resolution B16;
+ USHORT y_resolution B16;
+ USHORT point_size B16;
+} fsResolution;
+
+#endif /* _FS_PROTO_H_ */
diff --git a/fonts/utilities/ps2pk/ac/withenable.ac b/fonts/utilities/ps2pk/ac/withenable.ac
new file mode 100644
index 0000000000..2fc8d86e84
--- /dev/null
+++ b/fonts/utilities/ps2pk/ac/withenable.ac
@@ -0,0 +1,7 @@
+## texk/ps2pk/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory texk/ps2pk/
+dnl
+dnl Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+dnl You may freely use, modify and/or distribute this file.
+dnl
+## configure options and TL libraries required for ps2pk
+KPSE_ENABLE_PROG([ps2pk], [kpathsea])
diff --git a/fonts/utilities/ps2pk/aclocal.m4 b/fonts/utilities/ps2pk/aclocal.m4
new file mode 100644
index 0000000000..36330023bf
--- /dev/null
+++ b/fonts/utilities/ps2pk/aclocal.m4
@@ -0,0 +1,1179 @@
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.16'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.16.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.16.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ AS_CASE([$CONFIG_FILES],
+ [*\'*], [eval set x "$CONFIG_FILES"],
+ [*], [set x $CONFIG_FILES])
+ shift
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
+ do
+ # Strip MF so we end up with the name of the file.
+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
+ am_filepart=`AS_BASENAME(["$am_mf"])`
+ AM_RUN_LOG([cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles]) || am_rc=$?
+ done
+ if test $am_rc -ne 0; then
+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).])
+ fi
+ AS_UNSET([am_dirpart])
+ AS_UNSET([am_filepart])
+ AS_UNSET([am_mf])
+ AS_UNSET([am_rc])
+ rm -f conftest-deps.mk
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
+am__doit:
+ @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+ ['0:this is the am__doit target'],
+ [AS_CASE([$s],
+ [BSD], [am__include='.include' am__quote='"'],
+ [am__include='include' am__quote=''])])
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([../../m4/kpse-common.m4])
+m4_include([../../m4/kpse-kpathsea-flags.m4])
+m4_include([../../m4/kpse-warnings.m4])
+m4_include([../../m4/libtool.m4])
+m4_include([../../m4/ltoptions.m4])
+m4_include([../../m4/ltsugar.m4])
+m4_include([../../m4/ltversion.m4])
+m4_include([../../m4/lt~obsolete.m4])
diff --git a/fonts/utilities/ps2pk/arith.c b/fonts/utilities/ps2pk/arith.c
new file mode 100644
index 0000000000..eba1b5dcde
--- /dev/null
+++ b/fonts/utilities/ps2pk/arith.c
@@ -0,0 +1,409 @@
+/* $XConsortium: arith.c,v 1.2 91/10/10 11:14:06 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+ /* ARITH CWEB V0006 ******** */
+/*
+:h1.ARITH Module - Portable Module for Multiple Precision Fixed Point Arithmetic
+
+This module provides division and multiplication of 64-bit fixed point
+numbers. (To be more precise, the module works on numbers that take
+two 'longs' to store. That is almost always equivalent to saying 64-bit
+numbers.)
+
+Note: it is frequently easy and desirable to recode these functions in
+assembly language for the particular processor being used, because
+assembly language, unlike C, will have 64-bit multiply products and
+64-bit dividends. This module is offered as a portable version.
+
+&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) and Sten F. Andler
+
+
+:h3.Include Files
+
+The included files are:
+*/
+
+#include "types.h"
+#include "objects.h"
+#include "spaces.h"
+#include "arith.h"
+
+/*
+:h3.
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+Reference for all algorithms: Donald E. Knuth, "The Art of Computer
+Programming, Volume 2, Semi-Numerical Algorithms," Addison-Wesley Co.,
+Massachusetts, 1969, pp. 229-279.
+
+Knuth talks about a 'digit' being an arbitrary sized unit and a number
+being a sequence of digits. We'll take a digit to be a 'short'.
+The following assumption must be valid for these algorithms to work:
+:ol.
+:li.A 'long' is two 'short's.
+:eol.
+The following code is INDEPENDENT of:
+:ol.
+:li.The actual size of a short.
+:li.Whether shorts and longs are stored most significant byte
+first or least significant byte first.
+:eol.
+
+SHORTSIZE is the number of bits in a short; INT32SIZE is the number of
+bits in an int32_t; MAXSHORT is the maximum unsigned short:
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+ASSEMBLE concatenates two shorts to form a long:
+*/
+#define ASSEMBLE(hi,lo) ((((uint32_t)hi)<<SHORTSIZE)+(lo))
+/*
+HIGHDIGIT extracts the most significant short from a long; LOWDIGIT
+extracts the least significant short from a long:
+*/
+#define HIGHDIGIT(u) ((u)>>SHORTSIZE)
+#define LOWDIGIT(u) ((u)&MAXSHORT)
+
+/*
+SIGNBITON tests the high order bit of a long 'w':
+*/
+#define SIGNBITON(w) (((int32_t)w)<0)
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h2.Double Long Arithmetic
+
+:h3.DLmult() - Multiply Two Longs to Yield a Double Long
+
+The two multiplicands must be positive.
+*/
+
+void DLmult(register doublelong *product, register uint32_t u, register uint32_t v)
+{
+ register uint32_t u1, u2; /* the digits of u */
+ register uint32_t v1, v2; /* the digits of v */
+ register unsigned int w1, w2, w3, w4; /* the digits of w */
+ register uint32_t t; /* temporary variable */
+/* printf("DLmult(? ?, %x, %x)\n", u, v); */
+ u1 = HIGHDIGIT(u);
+ u2 = LOWDIGIT(u);
+ v1 = HIGHDIGIT(v);
+ v2 = LOWDIGIT(v);
+
+ if (v2 == 0) w4 = w3 = w2 = 0;
+ else
+ {
+ t = u2 * v2;
+ w4 = LOWDIGIT(t);
+ t = u1 * v2 + HIGHDIGIT(t);
+ w3 = LOWDIGIT(t);
+ w2 = HIGHDIGIT(t);
+ }
+
+ if (v1 == 0) w1 = 0;
+ else
+ {
+ t = u2 * v1 + w3;
+ w3 = LOWDIGIT(t);
+ t = u1 * v1 + w2 + HIGHDIGIT(t);
+ w2 = LOWDIGIT(t);
+ w1 = HIGHDIGIT(t);
+ }
+
+ product->high = ASSEMBLE(w1, w2);
+ product->low = ASSEMBLE(w3, w4);
+}
+
+/*
+:h2.DLdiv() - Divide Two Longs by One Long, Yielding Two Longs
+
+Both the dividend and the divisor must be positive.
+*/
+
+void DLdiv(
+ doublelong *quotient, /* also where dividend is, originally */
+ uint32_t divisor)
+{
+ register uint32_t u1u2 = quotient->high;
+ register uint32_t u3u4 = quotient->low;
+ register int32_t u3; /* single digit of dividend */
+ register int v1,v2; /* divisor in registers */
+ register int32_t t; /* signed copy of u1u2 */
+ register int qhat; /* guess at the quotient digit */
+ register uint32_t q3q4; /* low two digits of quotient */
+ register int shift; /* holds the shift value for normalizing */
+ register int j; /* loop variable */
+
+/* printf("DLdiv(%x %x, %x)\n", quotient->high, quotient->low, divisor); */
+ /*
+ * Knuth's algorithm works if the dividend is smaller than the
+ * divisor. We can get to that state quickly:
+ */
+ if (u1u2 >= divisor) {
+ quotient->high = u1u2 / divisor;
+ u1u2 %= divisor;
+ }
+ else
+ quotient->high = 0;
+
+ if (divisor <= MAXSHORT) {
+
+ /*
+ * This is the case where the divisor is contained in one
+ * 'short'. It is worthwhile making this fast:
+ */
+ u1u2 = ASSEMBLE(u1u2, HIGHDIGIT(u3u4));
+ q3q4 = u1u2 / divisor;
+ u1u2 %= divisor;
+ u1u2 = ASSEMBLE(u1u2, LOWDIGIT(u3u4));
+ quotient->low = ASSEMBLE(q3q4, u1u2 / divisor);
+ return;
+ }
+
+
+ /*
+ * At this point the divisor is a true 'long' so we must use
+ * Knuth's algorithm.
+ *
+ * Step D1: Normalize divisor and dividend (this makes our 'qhat'
+ * guesses more accurate):
+ */
+ for (shift=0; !SIGNBITON(divisor); shift++, divisor <<= 1) { ; }
+ shift--;
+ divisor >>= 1;
+
+ if ((u1u2 >> (INT32SIZE - shift)) != 0 && shift != 0)
+ t1_abort("DLdiv: dividend too large");
+ u1u2 = (u1u2 << shift) + ((shift == 0) ? 0 : u3u4 >> (INT32SIZE - shift));
+ u3u4 <<= shift;
+
+ /*
+ * Step D2: Begin Loop through digits, dividing u1,u2,u3 by v1,v2,
+ * then shifting U left by 1 digit:
+ */
+ v1 = HIGHDIGIT(divisor);
+ v2 = LOWDIGIT(divisor);
+ q3q4 = 0;
+ u3 = HIGHDIGIT(u3u4);
+
+ for (j=0; j < 2; j++) {
+
+ /*
+ * Step D3: make a guess (qhat) at the next quotient denominator:
+ */
+ qhat = (HIGHDIGIT(u1u2) == v1) ? MAXSHORT : u1u2 / v1;
+ /*
+ * At this point Knuth would have us further refine our
+ * guess, since we know qhat is too big if
+ *
+ * v2 * qhat > ASSEMBLE(u1u2 % v, u3)
+ *
+ * That would make sense if u1u2 % v was easy to find, as it
+ * would be in assembly language. I ignore this step, and
+ * repeat step D6 if qhat is too big.
+ */
+
+ /*
+ * Step D4: Multiply v1,v2 times qhat and subtract it from
+ * u1,u2,u3:
+ */
+ u3 -= qhat * v2;
+ /*
+ * The high digit of u3 now contains the "borrow" for the
+ * rest of the substraction from u1,u2.
+ * Sometimes we can lose the sign bit with the above.
+ * If so, we have to force the high digit negative:
+ */
+ t = HIGHDIGIT(u3);
+ if (t > 0)
+ t |= -1 << SHORTSIZE;
+ t += u1u2 - qhat * v1;
+/* printf("..>divide step qhat=%x t=%x u3=%x u1u2=%x v1=%x v2=%x\n",
+ qhat, t, u3, u1u2, v1, v2); */
+ while (t < 0) { /* Test is Step D5. */
+
+ /*
+ * D6: Oops, qhat was too big. Add back in v1,v2 and
+ * decrease qhat by 1:
+ */
+ u3 = LOWDIGIT(u3) + v2;
+ t += HIGHDIGIT(u3) + v1;
+ qhat--;
+/* printf("..>>qhat correction t=%x u3=%x qhat=%x\n", t, u3, qhat); */
+ }
+ /*
+ * Step D7: shift U left one digit and loop:
+ */
+ u1u2 = t;
+ if (HIGHDIGIT(u1u2) != 0)
+ t1_abort("divide algorithm error");
+ u1u2 = ASSEMBLE(u1u2, LOWDIGIT(u3));
+ u3 = LOWDIGIT(u3u4);
+ q3q4 = ASSEMBLE(q3q4, qhat);
+ }
+ quotient->low = q3q4;
+/* printf("DLdiv returns %x %x\n", quotient->high, quotient->low); */
+ return;
+}
+
+/*
+:h3.DLadd() - Add Two Double Longs
+
+In this case, the doublelongs may be signed. The algorithm takes the
+piecewise sum of the high and low longs, with the possibility that the
+high should be incremented if there is a carry out of the low. How to
+tell if there is a carry? Alex Harbury suggested that if the sum of
+the lows is less than the max of the lows, there must have been a
+carry. Conversely, if there was a carry, the sum of the lows must be
+less than the max of the lows. So, the test is "if and only if".
+*/
+
+void DLadd(doublelong *u, doublelong *v) /* u = u + v */
+{
+ register uint32_t lowmax = MAX(u->low, v->low);
+
+/* printf("DLadd(%x %x, %x %x)\n", u->high, u->low, v->high, v->low); */
+ u->high += v->high;
+ u->low += v->low;
+ if (lowmax > u->low)
+ u->high++;
+}
+/*
+:h3.DLsub() - Subtract Two Double Longs
+
+Testing for a borrow is even easier. If the v.low is greater than
+u.low, there must be a borrow.
+*/
+
+void DLsub(doublelong *u, doublelong *v) /* u = u - v */
+{
+/* printf("DLsub(%x %x, %x %x)\n", u->high, u->low, v->high, v->low);*/
+ u->high -= v->high;
+ if (v->low > u->low)
+ u->high--;
+ u->low -= v->low;
+}
+/*
+:h3.DLrightshift() - Macro to Shift Double Long Right by N
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h2.Fractional Pel Arithmetic
+*/
+/*
+:h3.FPmult() - Multiply Two Fractional Pel Values
+
+This funtion first calculates w = u * v to "doublelong" precision.
+It then shifts w right by FRACTBITS bits, and checks that no
+overflow will occur when the resulting value is passed back as
+a fractpel.
+*/
+
+fractpel FPmult(register fractpel u, register fractpel v)
+{
+ doublelong w;
+ register int negative = FALSE; /* sign flag */
+
+ if ((u == 0) || (v == 0)) return (0);
+
+
+ if (u < 0) {u = -u; negative = TRUE;}
+ if (v < 0) {v = -v; negative = !negative;}
+
+ if (u == TOFRACTPEL(1)) return ((negative) ? -v : v);
+ if (v == TOFRACTPEL(1)) return ((negative) ? -u : u);
+
+ DLmult(&w, u, v);
+ DLrightshift(w, FRACTBITS);
+ if (w.high != 0 || SIGNBITON(w.low)) {
+ IfTrace2(TRUE,"FPmult: overflow, %dx%d\n", u, v);
+ w.low = TOFRACTPEL(MAXSHORT);
+ }
+
+ return ((negative) ? -w.low : w.low);
+}
+
+/*
+:h3.FPdiv() - Divide Two Fractional Pel Values
+
+These values may be signed. The function returns the quotient.
+*/
+
+fractpel FPdiv(register fractpel dividend, register fractpel divisor)
+{
+ doublelong w; /* result will be built here */
+ int negative = FALSE; /* flag for sign bit */
+
+ if (dividend < 0) {
+ dividend = -dividend;
+ negative = TRUE;
+ }
+ if (divisor < 0) {
+ divisor = -divisor;
+ negative = !negative;
+ }
+ w.low = dividend << FRACTBITS;
+ w.high = dividend >> (INT32SIZE - FRACTBITS);
+ DLdiv(&w, divisor);
+ if (w.high != 0 || SIGNBITON(w.low)) {
+ IfTrace2(TRUE,"FPdiv: overflow, %d/%d\n", dividend, divisor);
+ w.low = TOFRACTPEL(MAXSHORT);
+ }
+ return( (negative) ? -w.low : w.low);
+}
+
+/*
+:h3.FPstarslash() - Multiply then Divide
+
+Borrowing a chapter from the language Forth, it is useful to define
+an operator that first multiplies by one constant then divides by
+another, keeping the intermediate result in extended precision.
+*/
+
+fractpel FPstarslash(register fractpel a, register fractpel b,
+ register fractpel c) /* result = a * b / c */
+{
+ doublelong w; /* result will be built here */
+ int negative = FALSE;
+
+ if (a < 0) { a = -a; negative = TRUE; }
+ if (b < 0) { b = -b; negative = !negative; }
+ if (c < 0) { c = -c; negative = !negative; }
+
+ DLmult(&w, a, b);
+ DLdiv(&w, c);
+ if (w.high != 0 || SIGNBITON(w.low)) {
+ IfTrace3(TRUE,"FPstarslash: overflow, %d*%d/%d\n", a, b, c);
+ w.low = TOFRACTPEL(MAXSHORT);
+ }
+ return((negative) ? -w.low : w.low);
+}
diff --git a/fonts/utilities/ps2pk/arith.h b/fonts/utilities/ps2pk/arith.h
new file mode 100644
index 0000000000..fa3e1ecd2c
--- /dev/null
+++ b/fonts/utilities/ps2pk/arith.h
@@ -0,0 +1,70 @@
+/* $XConsortium: arith.h,v 1.2 91/10/10 11:17:49 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/*SHARED*/
+
+/* MAXSHORT may be defined by <limits.h> */
+#ifdef MAXSHORT
+#undef MAXSHORT
+#endif
+
+#define SHORTSIZE (sizeof(SHORT)*8)
+#define INT32SIZE (SHORTSIZE*2)
+#define MAXSHORT ((1<<SHORTSIZE)-1)
+
+/*END SHARED*/
+/*SHARED*/
+
+typedef struct {
+ int32_t high;
+ int32_t low;
+} doublelong;
+
+/*END SHARED*/
+/*SHARED*/
+
+#define DLrightshift(dl,N) { \
+ dl.low = (dl.low >> N) + (((uint32_t) dl.high) << (INT32SIZE - N)); \
+ dl.high >>= N; \
+}
+
+/*END SHARED*/
+/*SHARED*/
+
+#include "types.h"
+
+void DLmult(doublelong *, uint32_t, uint32_t),
+ DLdiv(doublelong *, uint32_t),
+ DLadd(doublelong *, doublelong *),
+ DLsub(doublelong *, doublelong *);
+
+fractpel FPmult(fractpel, fractpel);
+fractpel FPdiv(fractpel, fractpel);
+fractpel FPstarslash(fractpel, fractpel, fractpel);
+
+/*END SHARED*/
diff --git a/fonts/utilities/ps2pk/basename.c b/fonts/utilities/ps2pk/basename.c
new file mode 100644
index 0000000000..624b746778
--- /dev/null
+++ b/fonts/utilities/ps2pk/basename.c
@@ -0,0 +1,23 @@
+/*
+ * FILE: basename.c
+ * PURPOSE: a reimplementation of BSD's basename so that it can also be
+ * used as a function in other programs (see filenames.c and
+ * filenames.h)
+ * AUTHOR: Piet Tutelaers
+ * VERSION: 1.0 (Sept. 1995)
+ */
+#include <stdio.h> /* printf() */
+#include "basics.h" /* fatal() */
+#include "filenames.h" /* basename() */
+
+main(int argc, char **argv)
+{
+ if (argc < 2 || argc > 3)
+ fatal("Usage: basename string [suffix]\n");
+
+ if (argc == 2)
+ printf("%s\n", basename(argv[1], NULL));
+ else
+ printf("%s\n", basename(argv[1], argv[2]));
+ exit(0);
+}
diff --git a/fonts/utilities/ps2pk/basics.c b/fonts/utilities/ps2pk/basics.c
new file mode 100644
index 0000000000..6b1842d5ea
--- /dev/null
+++ b/fonts/utilities/ps2pk/basics.c
@@ -0,0 +1,27 @@
+/* FILE: basics.c
+ * PURPOSE: basic functions
+ * AUTHOR: Piet Tutelaers
+ * (see README for license)
+ */
+
+#include "basics.h"
+
+/* Give up ... */
+void fatal(const char *fmt, ...)
+{ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+ exit(1);
+}
+
+/* Give a message ... */
+void msg(const char *fmt, ...)
+{ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ fflush(stderr);
+ va_end(args);
+}
diff --git a/fonts/utilities/ps2pk/basics.h b/fonts/utilities/ps2pk/basics.h
new file mode 100644
index 0000000000..28c9c80831
--- /dev/null
+++ b/fonts/utilities/ps2pk/basics.h
@@ -0,0 +1,99 @@
+/* FILE: basics.h
+ * PURPOSE: basic definitions
+ * AUTHOR: Piet Tutelaers
+ * (see README for license)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "c-auto.h"
+#endif
+
+#ifndef NOBASICS
+
+#if defined(KPATHSEA)
+# include <kpathsea/config.h>
+# include <kpathsea/c-pathch.h>
+# include <kpathsea/c-fopen.h>
+# define PATHSEP ENV_SEP
+# define DIRSEP DIR_SEP
+# define RB FOPEN_RBIN_MODE
+# define WB FOPEN_WBIN_MODE
+# if defined(DOSISH)
+# define ESCAPECHAR '!'
+# define RECURSIVE "!!"
+# endif /* DOSISH */
+# define basename ps2pk_basename
+#elif defined(MSDOS) || defined(WIN32)
+# define PATHSEP ';'
+# define DIRSEP '\\'
+# define ESCAPECHAR '!'
+# define RECURSIVE "!!"
+# define PSRES_NAME "psres.dpr"
+# define RB "rb"
+# define WB "wb"
+#endif
+
+#ifndef PATHSEP
+#define PATHSEP ':'
+#endif
+
+#ifndef DIRSEP
+#define DIRSEP '/'
+#endif
+
+#ifndef ESCAPECHAR
+#define ESCAPECHAR '\\'
+#endif
+
+#ifndef RECURSIVE
+#define RECURSIVE "//"
+#endif
+
+/* TeX PS Resource database name */
+#ifndef PSRES_NAME
+#define PSRES_NAME "PSres.upr"
+#endif
+
+#ifndef RB
+#define RB "r"
+#endif
+
+#ifndef WB
+#define WB "w"
+#endif
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 256
+#endif
+
+#ifndef MAXSTRLEN
+#define MAXSTRLEN 256
+#endif
+
+#ifndef IS_DIR_SEP
+#define IS_DIR_SEP(c) ((c) == DIRSEP)
+#endif
+
+#define NOBASICS
+#endif
+
+#include <stdarg.h>
+
+#if defined __GNUC__ && __GNUC__ >=3
+__attribute__((__noreturn__))
+#elif defined _MSC_VER && 1200 <= _MSC_VER
+__declspec (noreturn)
+#endif
+void fatal(const char *fmt, ...);
+void msg(const char *fmt, ...);
+
+extern char *encfile, *afmfile;
+
+/* For debugging purposes it is handy to have a fopen() function that
+ * shows which files are opened.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h> /* struct stat */
+#include <sys/stat.h> /* stat() */
diff --git a/fonts/utilities/ps2pk/blues.h b/fonts/utilities/ps2pk/blues.h
new file mode 100644
index 0000000000..8d6a486e04
--- /dev/null
+++ b/fonts/utilities/ps2pk/blues.h
@@ -0,0 +1,93 @@
+/* $XConsortium: blues.h,v 1.2 91/10/10 11:17:52 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ * Portions Copyright (c) 1990 Adobe Systems Incorporated.
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark or Adobe
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission.
+ *
+ * IBM, LEXMARK, AND ADOBE PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY
+ * WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE
+ * ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING
+ * ANY DUTY TO SUPPORT OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY
+ * PORTION OF THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM,
+ * LEXMARK, OR ADOBE) ASSUMES THE ENTIRE COST OF ALL SERVICING, REPAIR AND
+ * CORRECTION. IN NO EVENT SHALL IBM, LEXMARK, OR ADOBE BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "types.h"
+
+#define TOPLEFT 1
+#define BOTTOMRIGHT 2
+
+#define NUMBLUEVALUES 14
+#define NUMOTHERBLUES 10
+#define NUMFAMILYBLUES 14
+#define NUMFAMILYOTHERBLUES 10
+#define NUMSTEMSNAPH 12
+#define NUMSTEMSNAPV 12
+#define NUMSTDHW 1
+#define NUMSTDVW 1
+
+#define DEFAULTBOLDSTEMWIDTH 2.0
+
+#define MAXALIGNMENTZONES ((NUMBLUEVALUES+NUMOTHERBLUES)/2)
+#define DEFAULTBLUESCALE 0.039625
+#define DEFAULTBLUESHIFT 7
+#define DEFAULTBLUEFUZZ 1
+#define DEFAULTSTDHW 0
+#define DEFAULTSTDVW 0
+#define DEFAULTFORCEBOLD FALSE
+#define DEFAULTLANGUAGEGROUP 0
+#define DEFAULTRNDSTEMUP FALSE
+#define DEFAULTLENIV 4
+#define DEFAULTEXPANSIONFACTOR 0.06
+
+/* see Type 1 Font Format book for explanations of these values */
+/* Note that we're currently doing nothing for minfeature and password. */
+struct blues_struct {
+ struct blues_struct *next; /* ptr to next Blues structure in list */
+ int numBlueValues; /* # of BlueValues in following array */
+ int BlueValues[NUMBLUEVALUES];
+ int numOtherBlues; /* # of OtherBlues values in following array */
+ int OtherBlues[NUMOTHERBLUES];
+ int numFamilyBlues; /* # of FamilyBlues values in following array */
+ int FamilyBlues[NUMFAMILYBLUES];
+ int numFamilyOtherBlues; /* # of FamilyOtherBlues values in */
+ int FamilyOtherBlues[NUMFAMILYOTHERBLUES]; /* this array */
+ DOUBLE BlueScale;
+ int BlueShift;
+ int BlueFuzz;
+ DOUBLE StdHW;
+ DOUBLE StdVW;
+ int numStemSnapH; /* # of StemSnapH values in following array */
+ DOUBLE StemSnapH[NUMSTEMSNAPH];
+ int numStemSnapV; /* # of StemSnapV values in following array */
+ DOUBLE StemSnapV[NUMSTEMSNAPV];
+ int ForceBold;
+ int LanguageGroup;
+ int RndStemUp;
+ int lenIV;
+ DOUBLE ExpansionFactor;
+};
+
+/* the alignment zone structure -- somewhat similar to the stem structure */
+/* see Adobe Type1 Font Format book about the terms used in this structure */
+struct alignmentzone {
+ int topzone; /* TRUE if a topzone, FALSE if a bottom zone */
+ DOUBLE bottomy, topy; /* interval of this alignment zone */
+};
diff --git a/fonts/utilities/ps2pk/bstring.c b/fonts/utilities/ps2pk/bstring.c
new file mode 100644
index 0000000000..250eece830
--- /dev/null
+++ b/fonts/utilities/ps2pk/bstring.c
@@ -0,0 +1,13 @@
+/*
+ * A simple memset() in case your ANSI C does not provide it
+ */
+
+#include "c-auto.h"
+
+#if !defined(HAVE_MEMSET) && !defined(memset)
+memset(void *s, int c, int length)
+{ char *p = s;
+
+ while (length--) *(p++) = c;
+}
+#endif
diff --git a/fonts/utilities/ps2pk/c-auto.in b/fonts/utilities/ps2pk/c-auto.in
new file mode 100644
index 0000000000..f6eb86702d
--- /dev/null
+++ b/fonts/utilities/ps2pk/c-auto.in
@@ -0,0 +1,196 @@
+/* c-auto.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if the `closedir' function returns void instead of `int'. */
+#undef CLOSEDIR_VOID
+
+/* Define to 1 if you have the <assert.h> header file. */
+#undef HAVE_ASSERT_H
+
+/* Define to 1 if you have the declaration of `isascii', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ISASCII
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#undef HAVE_FSEEKO
+
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
+/* Define to 1 if you have the `getwd' function. */
+#undef HAVE_GETWD
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#undef HAVE_INTPTR_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the `memcmp' function. */
+#undef HAVE_MEMCMP
+
+/* Define to 1 if you have the `memcpy' function. */
+#undef HAVE_MEMCPY
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* Define to 1 if you have the `mktemp' function. */
+#undef HAVE_MKTEMP
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the `putenv' function. */
+#undef HAVE_PUTENV
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if `st_mtim' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_MTIM
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#undef LT_OBJDIR
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT64_T
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int32_t
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int64_t
+
+/* Define to the type of a signed integer type wide enough to hold a pointer,
+ if such a type exists, and if the system does not define it. */
+#undef intptr_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint64_t
diff --git a/fonts/utilities/ps2pk/cluts.h b/fonts/utilities/ps2pk/cluts.h
new file mode 100644
index 0000000000..fe51e02f9a
--- /dev/null
+++ b/fonts/utilities/ps2pk/cluts.h
@@ -0,0 +1,35 @@
+/* $XConsortium: cluts.h,v 1.2 91/10/10 11:17:54 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* STUB */
+
+#define KillCLUT(T)
+#define CopyCLUT(T) T
+#define UniqueCLUT(T)
+
diff --git a/fonts/utilities/ps2pk/configure b/fonts/utilities/ps2pk/configure
new file mode 100755
index 0000000000..c071336652
--- /dev/null
+++ b/fonts/utilities/ps2pk/configure
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Pseudo configure for CTAN releases of DVI drivers from the texk
+# source tree.
+
+cat <<'_EOT_'
+
+Sorry, but this configure script won't be of much use for you.
+
+This source directory from CTAN can only be compiled in a texk build
+environment. You will need to download the whole environment, please
+refer to http://www.tug.org/texlive/svn/.
+
+It all boils down to a Subversion checkout of
+svn://tug.org/texlive/trunk/Build/source
+This will be the source tree that you can use for compilation. The
+CTAN tree is there for archival and informational purpose.
+
+For your convenience, the original configure script from the texk
+source tree is available in this directory as configure.texk.
+
+_EOT_
+
+exit 1
diff --git a/fonts/utilities/ps2pk/configure.ac b/fonts/utilities/ps2pk/configure.ac
new file mode 100644
index 0000000000..9d0f79dc68
--- /dev/null
+++ b/fonts/utilities/ps2pk/configure.ac
@@ -0,0 +1,42 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl Copyright 2009-2016 Peter Breitenlohner <tex-live@tug.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+AC_INIT([ps2pkm (TeX Live)], [1.8], [tex-k@tug.org])
+AC_PREREQ([2.65])
+AC_CONFIG_SRCDIR([arith.c])
+AC_CONFIG_AUX_DIR([../../build-aux])
+AC_CONFIG_MACRO_DIR([../../m4])
+
+dnl Common code for all programs using libkpathsea.
+KPSE_COMMON([ps2pkm], [no-define])
+
+AC_SEARCH_LIBS([pow], [m])
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([fcntl.h])
+
+dnl Checks for types.
+AC_TYPE_INT32_T
+AC_TYPE_INTPTR_T
+AC_TYPE_UINT32_T
+
+dnl Checks for library functions.
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([memset])
+
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in])
+
+dnl For tests
+AC_CHECK_PROGS([KPSEWHICH], [kpsewhich], [false])
+
+KPSE_KPATHSEA_FLAGS
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/fonts/utilities/ps2pk/configure.texk b/fonts/utilities/ps2pk/configure.texk
new file mode 100755
index 0000000000..475349d659
--- /dev/null
+++ b/fonts/utilities/ps2pk/configure.texk
@@ -0,0 +1,17537 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for ps2pkm (TeX Live) 1.8.
+#
+# Report bugs to <tex-k@tug.org>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and tex-k@tug.org
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='ps2pkm (TeX Live)'
+PACKAGE_TARNAME='ps2pkm--tex-live-'
+PACKAGE_VERSION='1.8'
+PACKAGE_STRING='ps2pkm (TeX Live) 1.8'
+PACKAGE_BUGREPORT='tex-k@tug.org'
+PACKAGE_URL=''
+
+ac_unique_file="arith.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+KPATHSEA_RULE
+KPATHSEA_DEPEND
+KPATHSEA_LIBS
+KPATHSEA_INCLUDES
+PKG_CONFIG
+KPSEWHICH
+CPP
+LT_SYS_LIBRARY_PATH
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+LIBTOOL
+OBJDUMP
+DLLTOOL
+AS
+WARNING_CFLAGS
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL
+am__quote'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_maintainer_mode
+enable_dependency_tracking
+enable_compiler_warnings
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_aix_soname
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+enable_largefile
+with_system_kpathsea
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+LT_SYS_LIBRARY_PATH
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures ps2pkm (TeX Live) 1.8 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root
+ [DATAROOTDIR/doc/ps2pkm--tex-live-]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of ps2pkm (TeX Live) 1.8:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-maintainer-mode
+ enable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --enable-compiler-warnings=[no|min|yes|max|all]
+ Turn on compiler warnings [default: yes if
+ maintainer-mode, min otherwise]
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-largefile omit support for large files
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-aix-soname=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX, [default=aix].
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
+ compiler's sysroot if not specified).
+ --with-system-kpathsea use installed kpathsea headers and library (requires
+ pkg-config)
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ LT_SYS_LIBRARY_PATH
+ User-defined run-time library search path.
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <tex-k@tug.org>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+ps2pkm (TeX Live) configure 1.8
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ---------------------------- ##
+## Report this to tex-k@tug.org ##
+## ---------------------------- ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_find_intX_t LINENO BITS VAR
+# -----------------------------------
+# Finds a signed integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_intX_t ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
+$as_echo_n "checking for int$2_t... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ # Order is important - never check a type that is potentially smaller
+ # than half of the expected target width.
+ for ac_type in int$2_t 'int' 'long int' \
+ 'long long int' 'short int' 'signed char'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+ < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ case $ac_type in #(
+ int$2_t) :
+ eval "$3=yes" ;; #(
+ *) :
+ eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+ break
+fi
+ done
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_intX_t
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ # Order is important - never check a type that is potentially smaller
+ # than half of the expected target width.
+ for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ case $ac_type in #(
+ uint$2_t) :
+ eval "$3=yes" ;; #(
+ *) :
+ eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+ break
+fi
+ done
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_uintX_t
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by ps2pkm (TeX Live) $as_me 1.8, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in ../../build-aux "$srcdir"/../../build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../build-aux \"$srcdir\"/../../build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+am__api_version='1.16'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
+am__doit:
+ @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ case $?:`cat confinc.out 2>/dev/null` in #(
+ '0:this is the am__doit target') :
+ case $s in #(
+ BSD) :
+ am__include='.include' am__quote='"' ;; #(
+ *) :
+ am__include='include' am__quote='' ;;
+esac ;; #(
+ *) :
+ ;;
+esac
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+# Check whether --enable-compiler-warnings was given.
+if test "${enable_compiler_warnings+set}" = set; then :
+ enableval=$enable_compiler_warnings;
+fi
+case $enable_compiler_warnings in #(
+ no | min | yes | max | all) :
+ ;; #(
+ *) :
+ if test "x$enable_maintainer_mode" = xyes; then :
+ enable_compiler_warnings=yes
+else
+ enable_compiler_warnings=min
+fi ;;
+esac
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.6'
+macro_revision='2.4.6'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case $ECHO in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test yes = "$GCC"; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return, which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD=$ac_prog
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test yes = "$with_gnu_ld"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD=$ac_dir/$ac_prog
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test no != "$with_gnu_ld" && break
+ ;;
+ *)
+ test yes != "$with_gnu_ld" && break
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+else
+ lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi
+fi
+
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM=$NM
+else
+ lt_nm_to_check=${ac_tool_prefix}nm
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/$lt_tmp_nm
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+ case $build_os in
+ mingw*) lt_bad_file=conftest.nm/nofile ;;
+ *) lt_bad_file=/dev/null ;;
+ esac
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ *$lt_bad_file* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break 2
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break 2
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols -headers"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring=ABCD
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test 17 != "$i" # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n "$lt_cv_sys_max_cmd_len"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test yes != "$GCC"; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test 0 -eq "$ac_status"; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test 0 -ne "$ac_status"; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test no = "$lt_cv_ar_at_file"; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ bitrig* | openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test ia64 = "$host_cpu"; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function,
+ # D for any global variable and I for any imported variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS=conftstm.$ac_objext
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test yes = "$pipe_works"; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+$as_echo_n "checking for a working dd... " >&6; }
+if ${ac_cv_path_lt_DD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+if test -z "$lt_DD"; then
+ ac_path_lt_DD_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in dd; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_lt_DD" || continue
+if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi
+ $ac_path_lt_DD_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_lt_DD"; then
+ :
+ fi
+else
+ ac_cv_path_lt_DD=$lt_DD
+fi
+
+rm -f conftest.i conftest2.i conftest.out
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+$as_echo "$ac_cv_path_lt_DD" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+$as_echo_n "checking how to truncate binary pipes... " >&6; }
+if ${lt_cv_truncate_bin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+$as_echo "$lt_cv_truncate_bin" >&6; }
+
+
+
+
+
+
+
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE=32
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE=64
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ emul=elf
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
+ ;;
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test yes != "$lt_cv_cc_needs_belf"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS=$SAVE_CFLAGS
+ fi
+ ;;
+*-*solaris*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*|x86_64-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD=${LD-ld}_sol2
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks=$enable_libtool_lock
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test yes != "$lt_cv_path_mainfest_tool"; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "$LT_MULTI_MODULE"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&5
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&5
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ 10.[012][,.]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test yes = "$lt_cv_apple_cc_single_mod"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test yes = "$lt_cv_ld_exported_symbols_list"; then
+ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+ fi
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x$2 in
+ x)
+ ;;
+ *:)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+ ;;
+ x:*)
+ eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+ ;;
+ *)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+##tldbg KPSE_COMMON: ps2pkm (no-define).
+##tldbg KPSE_BASIC: Remember ps2pkm (no-define) as Kpse_Package (for future messages).
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='ps2pkm--tex-live-'
+ VERSION='1.8'
+
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler accepts prototypes" >&5
+$as_echo_n "checking whether the compiler accepts prototypes... " >&6; }
+if ${kb_cv_c_prototypes+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+int
+main ()
+{
+extern void foo(int i,...);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ kb_cv_c_prototypes=yes
+else
+ kb_cv_c_prototypes=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kb_cv_c_prototypes" >&5
+$as_echo "$kb_cv_c_prototypes" >&6; }
+if test "x$kb_cv_c_prototypes" = xno; then
+ as_fn_error $? "Sorry, your compiler does not understand prototypes." "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what warning flags to pass to the C compiler" >&5
+$as_echo_n "checking what warning flags to pass to the C compiler... " >&6; }
+if ${kpse_cv_warning_cflags+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$GCC" = xyes; then
+ kpse_cv_warning_cflags=
+if test "x$enable_compiler_warnings" != xno; then
+ kpse_cv_warning_cflags="-Wimplicit -Wreturn-type"
+ case `$CC -dumpversion` in #(
+ 3.4.* | 4.* | 5.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wdeclaration-after-statement" ;; #(
+ *) :
+ ;;
+esac
+ case `$CC -dumpversion` in #(
+ 3.[234].* | 4.* | 5.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wno-unknown-pragmas" ;; #(
+ *) :
+ ;;
+esac
+ if test "x$enable_compiler_warnings" != xmin; then
+ kpse_cv_warning_cflags="-Wall -Wunused $kpse_cv_warning_cflags"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations"
+ if test "x$enable_compiler_warnings" != xyes; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wparentheses -Wswitch -Wtrigraphs -Wpointer-arith"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings"
+ case `$CC -dumpversion` in #(
+ 3.4.* | 4.* | 5.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wold-style-definition" ;; #(
+ *) :
+ ;;
+esac
+ if test "x$enable_compiler_warnings" != xmax; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wshadow"
+ fi
+ fi
+ fi
+fi
+elif test "x$enable_compiler_warnings" = xno; then
+ kpse_cv_warning_cflags=
+else
+ kpse_cv_warning_cflags= # FIXME: warning flags for non-GNU C compilers
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_warning_cflags" >&5
+$as_echo "$kpse_cv_warning_cflags" >&6; }
+WARNING_CFLAGS=$kpse_cv_warning_cflags
+
+
+
+
+
+
+
+
+
+
+
+
+# Set options
+enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AS"; then
+ ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AS="${ac_tool_prefix}as"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+$as_echo "$AS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+ ac_ct_AS=$AS
+ # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AS"; then
+ ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AS="as"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AS" = x; then
+ AS="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AS=$ac_ct_AS
+ fi
+else
+ AS="$ac_cv_prog_AS"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+ ;;
+esac
+
+test -z "$AS" && AS=as
+
+
+
+
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+ enable_dlopen=no
+
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ pic_mode=default
+fi
+
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+ shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+ withval=$with_aix_soname; case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname
+else
+ if ${lt_cv_with_aix_soname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_with_aix_soname=aix
+fi
+
+ with_aix_soname=$lt_cv_with_aix_soname
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+ if test aix != "$with_aix_soname"; then
+ # For the AIX way of multilib, we name the shared archive member
+ # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+ # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+ # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+ # the AIX toolchain works better with OBJECT_MODE set (default 32).
+ if test 64 = "${OBJECT_MODE-32}"; then
+ shared_archive_member_spec=shr_64
+ else
+ shared_archive_member_spec=shr
+ fi
+ fi
+ ;;
+*)
+ with_aix_soname=aix
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/${ac_tool_prefix}file"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
+ ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/file"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
+ ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC=$CC
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test yes = "$GCC"; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test yes = "$GCC"; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='$wl-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64, which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works"; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test no = "$hard_links"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ' (' and ')$', so one must not match beginning or
+ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+ # as well as any symbol that contains 'd'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test yes != "$GCC"; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd* | bitrig*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test yes = "$with_gnu_ld"; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test yes = "$lt_use_gnu_ld_interface"; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='$wl'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ export_dynamic_flag_spec='$wl--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test ia64 != "$host_cpu"; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='$wl--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ shrext_cmds=.dll
+ archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test linux-dietlibc = "$host_os"; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test no = "$tmp_diet"
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+ if test yes = "$supports_anon_versioning"; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ tcc*)
+ export_dynamic_flag_spec='-rdynamic'
+ ;;
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test no = "$ld_shlibs"; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test ia64 = "$host_cpu"; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # traditional, no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ ;;
+ esac
+
+ if test yes = "$GCC"; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`$CC -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
+ fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
+ else
+ shared_flag='$wl-bM:SRE'
+ fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
+ fi
+ fi
+
+ export_dynamic_flag_spec='$wl-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=/usr/lib:/lib
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=/usr/lib:/lib
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' $wl-bernotok'
+ allow_undefined_flag=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test yes = "$lt_cv_ld_force_load"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag=$_lt_dar_allow_undefined
+ case $cc_basename in
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test yes = "$_lt_dar_can_shared"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test yes = "$GCC"; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='$wl-E'
+ ;;
+
+ hpux10*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='$wl-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test yes = "$lt_cv_prog_compiler__b"; then
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='$wl-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ linux*)
+ case $cc_basename in
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ ld_shlibs=yes
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd* | bitrig*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
+ else
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ shrext_cmds=.dll
+ archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ osf3*)
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='$wl'
+ archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'. GCC discards it without '$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test yes = "$GCC"; then
+ whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test sequent = "$host_vendor"; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='$wl-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We CANNOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='$wl-z,text'
+ allow_undefined_flag='$wl-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='$wl-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='$wl-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test sni = "$host_vendor"; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='$wl-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test no = "$ld_shlibs" && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test yes,yes = "$GCC,$enable_shared"; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test yes = "$GCC"; then
+ case $host_os in
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary...
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+ elif test -n "$lt_multi_os_dir"; then
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+ lt_foo = "";
+ lt_count = 0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo = "/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 supports IA64
+ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line '#! .'. This would cause the generated library to
+ # depend on '.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # Using Import Files as archive members, it is possible to support
+ # filename-based versioning of shared library archives on AIX. While
+ # this would work for both with and without runtime linking, it will
+ # prevent static linking of such archives. So we do filename-based
+ # shared library versioning with .so extension only, which is used
+ # when both runtime linking and shared linking is enabled.
+ # Unfortunately, runtime linking may impact performance, so we do
+ # not want this to be the default eventually. Also, we use the
+ # versioned .so libs for executables only if there is the -brtl
+ # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # To allow for filename-based versioning support, we need to create
+ # libNAME.so.V as an archive file, containing:
+ # *) an Import File, referring to the versioned filename of the
+ # archive as well as the shared archive member, telling the
+ # bitwidth (32 or 64) of that shared object, and providing the
+ # list of exported symbols of that shared object, eventually
+ # decorated with the 'weak' keyword
+ # *) the shared object with the F_LOADONLY flag set, to really avoid
+ # it being seen by the linker.
+ # At run time we better use the real file rather than another symlink,
+ # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+ case $with_aix_soname,$aix_use_runtimelinking in
+ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ aix,yes) # traditional libtool
+ dynamic_linker='AIX unversionable lib.so'
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ aix,no) # traditional AIX only
+ dynamic_linker='AIX lib.a(lib.so.V)'
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ svr4,*) # full svr4 only
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,yes) # both, prefer svr4
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # unpreferred sharedlib libNAME.a needs extra handling
+ postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+ postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,no) # both, prefer aix
+ dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+ postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+ postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+ ;;
+ esac
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='$libname$shared_ext'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec=$LIB
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[23].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ if test 32 = "$HPUX_IA64_MODE"; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+ fi
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Ideally, we could use ldconfig to report *all* directores which are
+ # searched for libraries, however this is still not possible. Aside from not
+ # being certain /sbin/ldconfig is available, command
+ # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+ # even though it is searched at run-time. Try to do the best guess by
+ # appending ld.so.conf contents (and includes) to the search path.
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd* | bitrig*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec=/usr/lib
+ need_lib_prefix=no
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
+ else
+ need_version=yes
+ fi
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+os2*)
+ libname_spec='$name'
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+ # OS/2 can only load a DLL with a base name of 8 characters or less.
+ soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+ v=$($ECHO $release$versuffix | tr -d .-);
+ n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+ $ECHO $n$v`$shared_ext'
+ library_names_spec='${libname}_dll.$libext'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test yes = "$with_gnu_ld"; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=sco
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test yes = "$with_gnu_ld"; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test yes = "$hardcode_automatic"; then
+
+ # We can hardcode non-existent directories.
+ if test no != "$hardcode_direct" &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+ test no != "$hardcode_minus_L"; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test relink = "$hardcode_action" ||
+ test yes = "$inherit_rpath"; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test yes != "$enable_dlopen"; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen=load_add_on
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen=LoadLibrary
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+
+ lt_cv_dlopen=dyld
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen=shl_load
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test no = "$lt_cv_dlopen"; then
+ enable_dlopen=no
+ else
+ enable_dlopen=yes
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS=$LDFLAGS
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS=$LIBS
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test yes = "$cross_compiling"; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisibility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test yes = "$lt_cv_dlopen_self"; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test yes = "$cross_compiling"; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisibility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP"; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report what library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test no = "$can_build_shared" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test yes = "$enable_shared" || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_sys_largefile_source=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE_SOURCE 1
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_sys_largefile_source=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_cv_sys_largefile_source=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
+$as_echo "$ac_cv_sys_largefile_source" >&6; }
+case $ac_cv_sys_largefile_source in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
+_ACEOF
+;;
+esac
+rm -rf conftest*
+
+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
+# in glibc 2.1.3, but that breaks too many other things.
+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
+if test $ac_cv_sys_largefile_source != unknown; then
+
+$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
+
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if eval \${$as_ac_Header+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$as_ac_Header=yes"
+else
+ eval "$as_ac_Header=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_ac_Header
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dir; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5
+$as_echo_n "checking whether closedir returns void... " >&6; }
+if ${ac_cv_func_closedir_void+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_closedir_void=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header_dirent>
+#ifndef __cplusplus
+int closedir ();
+#endif
+
+int
+main ()
+{
+return closedir (opendir (".")) != 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_closedir_void=no
+else
+ ac_cv_func_closedir_void=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5
+$as_echo "$ac_cv_func_closedir_void" >&6; }
+if test $ac_cv_func_closedir_void = yes; then
+
+$as_echo "#define CLOSEDIR_VOID 1" >>confdefs.h
+
+fi
+
+for ac_header in assert.h float.h limits.h pwd.h stdlib.h sys/param.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in putenv
+do :
+ ac_fn_c_check_func "$LINENO" "putenv" "ac_cv_func_putenv"
+if test "x$ac_cv_func_putenv" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PUTENV 1
+_ACEOF
+
+fi
+done
+
+for ac_func in getcwd getwd memcmp memcpy mkstemp mktemp strchr strrchr
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this sort of thing. */
+ typedef int charset[2];
+ const charset cs = { 0, 0 };
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
+case $ac_cv_c_int64_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int64_t $ac_cv_c_int64_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT64_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+ esac
+
+case :$ac_cv_c_int64_t:$ac_cv_c_int64_t: in #(
+ *':no:'*) :
+ as_fn_error $? "Sorry, your compiler does not support 64-bit integer types." "$LINENO" 5 ;; #(
+ *) :
+ ;;
+esac
+ac_fn_c_check_decl "$LINENO" "isascii" "ac_cv_have_decl_isascii" "#include <ctype.h>
+"
+if test "x$ac_cv_have_decl_isascii" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISASCII $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_mtim" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_MTIM 1
+_ACEOF
+
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pow" >&5
+$as_echo_n "checking for library containing pow... " >&6; }
+if ${ac_cv_search_pow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_pow=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pow+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pow+:} false; then :
+
+else
+ ac_cv_search_pow=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pow" >&5
+$as_echo "$ac_cv_search_pow" >&6; }
+ac_res=$ac_cv_search_pow
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+for ac_header in fcntl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default"
+if test "x$ac_cv_header_fcntl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_FCNTL_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t"
+case $ac_cv_c_int32_t in #(
+ no|yes) ;; #(
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define int32_t $ac_cv_c_int32_t
+_ACEOF
+;;
+esac
+
+
+ ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_intptr_t" = xyes; then :
+
+$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
+
+else
+ for ac_type in 'int' 'long int' 'long long int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define intptr_t $ac_type
+_ACEOF
+
+ ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -z "$ac_type" && break
+ done
+fi
+
+
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT32_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+ esac
+
+
+for ac_func in vprintf
+do :
+ ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
+if test "x$ac_cv_func_vprintf" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VPRINTF 1
+_ACEOF
+
+ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
+if test "x$ac_cv_func__doprnt" = xyes; then :
+
+$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
+
+fi
+
+fi
+done
+
+
+for ac_func in memset
+do :
+ ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset"
+if test "x$ac_cv_func_memset" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MEMSET 1
+_ACEOF
+
+fi
+done
+
+
+ac_config_headers="$ac_config_headers c-auto.h:c-auto.in"
+
+
+for ac_prog in kpsewhich
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_KPSEWHICH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$KPSEWHICH"; then
+ ac_cv_prog_KPSEWHICH="$KPSEWHICH" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_KPSEWHICH="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+KPSEWHICH=$ac_cv_prog_KPSEWHICH
+if test -n "$KPSEWHICH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KPSEWHICH" >&5
+$as_echo "$KPSEWHICH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$KPSEWHICH" && break
+done
+test -n "$KPSEWHICH" || KPSEWHICH="false"
+
+
+kpse_save_CPPFLAGS=$CPPFLAGS
+kpse_save_LIBS=$LIBS
+
+##tldbg _KPSE_INIT: Initialize TL infrastructure.
+kpse_BLD=`(cd "./../../." && pwd)`
+kpse_SRC=`(cd "$srcdir/../../." && pwd)`
+
+##tldbg _KPSE_USE_LIBTOOL: Generate a libtool script for use in configure tests.
+: ${CONFIG_LT=./config.lt}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5
+$as_echo "$as_me: creating $CONFIG_LT" >&6;}
+as_write_fail=0
+cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## --------------------------------- ##
+## Main body of "$CONFIG_LT" script. ##
+## --------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x "$CONFIG_LT"
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+
+lt_cl_help="\
+'$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $0 [OPTIONS]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+ps2pkm (TeX Live) config.lt 1.8
+configured by $0, generated by GNU Autoconf 2.69.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test 0 != $#
+do
+ case $1 in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) as_fn_error $? "unrecognized option: $1
+Try '$0 --help' for more information." "$LINENO" 5 ;;
+
+ *) as_fn_error $? "unrecognized argument: $1
+Try '$0 --help' for more information." "$LINENO" 5 ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec 6>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in AS \
+DLLTOOL \
+OBJDUMP \
+SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
+nm_file_list_spec \
+lt_cv_truncate_bin \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5
+$as_echo "$as_me: creating $ofile" >&6;}
+
+
+ # See if we are running on zsh, and set the options that allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile=${ofile}T
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the same
+# distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=''
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Assembler program.
+AS=$lt_AS
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Object dumper program.
+OBJDUMP=$lt_OBJDUMP
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and where our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x$2 in
+ x)
+ ;;
+ *:)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+ ;;
+ x:*)
+ eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+ ;;
+ *)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+
+
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+
+as_fn_exit 0
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test yes = "$silent" &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec 5>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec 5>>config.log
+$lt_cl_success || as_fn_exit 1
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_link="./libtool --mode=link --tag=CC $ac_link"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PKG_CONFIG"; then
+ ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_PKG_CONFIG"; then
+ ac_ct_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_PKG_CONFIG"; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5
+$as_echo "$ac_ct_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_PKG_CONFIG" = x; then
+ PKG_CONFIG="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_ct_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_prog_PKG_CONFIG"
+fi
+
+##tldbg _KPSE_LIB_FLAGS: Setup kpathsea (-lkpathsea) flags.
+echo 'tldbg:_KPSE_LIB_FLAGS called: libdir=kpathsea, libname=kpathsea, options=lt, tlincl=-IBLD/texk -ISRC/texk, tllib=BLD/texk/kpathsea/libkpathsea.la, tlextra=, rebuildsrcdeps=${top_srcdir}/../kpathsea/*.[ch], rebuildblddeps=${top_builddir}/../kpathsea/paths.h.' >&5
+##tldbg _KPSE_LIB_FLAGS_TL: kpathsea (kpathsea) lt.
+
+# Check whether --with-system-kpathsea was given.
+if test "${with_system_kpathsea+set}" = set; then :
+ withval=$with_system_kpathsea;
+fi
+if test "x$with_system_kpathsea" = xyes; then
+ if $PKG_CONFIG kpathsea; then
+ KPATHSEA_INCLUDES=`$PKG_CONFIG kpathsea --cflags`
+ KPATHSEA_LIBS=`$PKG_CONFIG kpathsea --libs`
+elif test "x$need_kpathsea:$with_system_kpathsea" = xyes:yes; then
+ as_fn_error $? "did not find kpathsea" "$LINENO" 5
+fi
+else
+ KPATHSEA_INCLUDES="-I$kpse_BLD/texk -I$kpse_SRC/texk"
+ KPATHSEA_LIBS="$kpse_BLD/texk/kpathsea/libkpathsea.la"
+ KPATHSEA_DEPEND='${top_builddir}/../kpathsea/libkpathsea.la'
+ KPATHSEA_RULE='# Rebuild libkpathsea
+$(KPATHSEA_DEPEND): ${top_srcdir}/../kpathsea/*.[ch] ${top_builddir}/../kpathsea/paths.h
+ cd ${top_builddir}/../kpathsea && $(MAKE) $(AM_MAKEFLAGS) rebuild
+${top_builddir}/../kpathsea/paths.h:
+ cd ${top_builddir}/../kpathsea && $(MAKE) $(AM_MAKEFLAGS) rebuild'
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libkpathsea supports debugging" >&5
+$as_echo_n "checking if libkpathsea supports debugging... " >&6; }
+if ${kpse_cv_kpse_debug+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval CPPFLAGS=\"$KPATHSEA_INCLUDES \$CPPFLAGS\"
+eval LIBS=\"$KPATHSEA_LIBS \$LIBS\"
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <kpathsea/kpathsea.h>
+int
+main ()
+{
+FILE *f = fopen("f", "r")
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ kpse_cv_kpse_debug=yes
+else
+ kpse_cv_kpse_debug=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CPPFLAGS=$kpse_save_CPPFLAGS
+LIBS=$kpse_save_LIBS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_kpse_debug" >&5
+$as_echo "$kpse_cv_kpse_debug" >&6; }
+if test "x$kpse_cv_kpse_debug" != xyes; then :
+ KPATHSEA_INCLUDES="$KPATHSEA_INCLUDES -DNO_DEBUG"
+fi
+
+
+ac_config_files="$ac_config_files Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ps2pkm (TeX Live) $as_me 1.8, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <tex-k@tug.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+ps2pkm (TeX Live) config.status 1.8
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in AS \
+DLLTOOL \
+OBJDUMP \
+SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
+nm_file_list_spec \
+lt_cv_truncate_bin \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ RM='$RM'
+ ofile='$ofile'
+
+ac_aux_dir='$ac_aux_dir'
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "c-auto.h") CONFIG_HEADERS="$CONFIG_HEADERS c-auto.h:c-auto.in" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ case $CONFIG_FILES in #(
+ *\'*) :
+ eval set x "$CONFIG_FILES" ;; #(
+ *) :
+ set x $CONFIG_FILES ;; #(
+ *) :
+ ;;
+esac
+ shift
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
+ do
+ # Strip MF so we end up with the name of the file.
+ am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$am_mf" : 'X\(//\)[^/]' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles" >&5
+ (cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } || am_rc=$?
+ done
+ if test $am_rc -ne 0; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ { am_dirpart=; unset am_dirpart;}
+ { am_filepart=; unset am_filepart;}
+ { am_mf=; unset am_mf;}
+ { am_rc=; unset am_rc;}
+ rm -f conftest-deps.mk
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options that allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile=${ofile}T
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the same
+# distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=''
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Assembler program.
+AS=$lt_AS
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Object dumper program.
+OBJDUMP=$lt_OBJDUMP
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and where our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x$2 in
+ x)
+ ;;
+ *:)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+ ;;
+ x:*)
+ eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+ ;;
+ *)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+
+
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/fonts/utilities/ps2pk/curves.c b/fonts/utilities/ps2pk/curves.c
new file mode 100644
index 0000000000..08b7a866d1
--- /dev/null
+++ b/fonts/utilities/ps2pk/curves.c
@@ -0,0 +1,222 @@
+/* $XConsortium: curves.c,v 1.3 91/10/10 11:17:56 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991 */
+/* All Rights Reserved */
+
+/* License to use, copy, modify, and distribute this software */
+/* and its documentation for any purpose and without fee is */
+/* hereby granted, provided that licensee provides a license to */
+/* IBM, Corp. to use, copy, modify, and distribute derivative */
+/* works and their documentation for any purpose and without */
+/* fee, that the above copyright notice appear in all copies */
+/* and that both that copyright notice and this permission */
+/* notice appear in supporting documentation, and that the name */
+/* of IBM not be used in advertising or publicity pertaining to */
+/* distribution of the software without specific, written prior */
+/* permission. */
+
+/* IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES */
+/* OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT */
+/* LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, */
+/* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF */
+/* THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND */
+/* PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT */
+/* OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF */
+/* THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES */
+/* THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN */
+/* NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR */
+/* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING */
+/* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF */
+/* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT */
+/* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS */
+/* SOFTWARE. */
+/*
+:h1.CURVES Module - Stepping Beziers
+
+This module is responsible for "rasterizing"
+third order curves. That is, it changes the high level curve
+specification into a list of pels that that curve travels
+through.
+
+:h3.Include Files
+
+Include files needed:
+*/
+
+#include "types.h"
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "regions.h"
+#include "curves.h"
+#include "lines.h"
+#include "arith.h"
+
+
+/*
+:h3.Functions Provided to Other Modules
+
+External entry points:
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+Note that "stepping" and "flattening" are so similiar that they use the
+same routine. When the "region" parameter is NULL, that is a flag that
+we are flattening instead of stepping.
+*/
+/*
+:h2.Bezier Third Order Curves
+*/
+/*
+:h3.The "bezierinfo" Structure
+
+This structure is used to store information used when we subdivide
+Bezier curves.
+*/
+
+struct bezierinfo {
+ struct region *region; /* the region being built or NULL */
+ struct fractpoint last; /* not used yet; maybe could save some work */
+ struct fractpoint origin; /* the origin of the bezier */
+} ;
+
+/*
+ Checking for termination of the subdivision process:
+ This is the stupidest test in the world, just check if the coordinatewise
+ distance from an end control point to the next control point is less than
+ one half pel. If so, we must be done.
+ This returns 1 if the subdivision is terminated and 0 if you still need
+ to subdivide.
+*/
+
+static int BezierTerminationTest(fractpel xa, fractpel ya, fractpel xb, fractpel yb,
+ fractpel xc, fractpel yc, fractpel xd, fractpel yd)
+{
+ fractpel dmax;
+ dmax = ABS(xa - xb);
+ dmax = MAX(dmax,ABS(ya - yb));
+ dmax = MAX(dmax,ABS(xd - xc));
+ dmax = MAX(dmax,ABS(yd - yc));
+ if(dmax > FPHALF)
+ return(0); /* not done yet */
+ else
+ return(1); /* done */
+}
+
+/*
+:h3.StepBezierRecurse() - The Recursive Logic in StepBezier()
+
+The recursion involves dividing the control polygon into two smaller
+control polygons by finding the midpoints of the lines. This idea is
+described in any graphics text book and its simplicity is what caused
+Bezier to define his curves as he did. If the input region 'R' is NULL,
+the result is a path that is the 'flattened' curve; otherwise StepBezier
+returns nothing special.
+*/
+static struct segment *StepBezierRecurse(
+ struct bezierinfo *I, /* Region under construction or NULL */
+ fractpel xA, fractpel yA, /* A control point */
+ fractpel xB, fractpel yB, /* B control point */
+ fractpel xC, fractpel yC, /* C control point */
+ fractpel xD, fractpel yD) /* D control point */
+
+{
+ if (BezierTerminationTest(xA,yA,xB,yB,xC,yC,xD,yD))
+ {
+ if (I->region == NULL)
+ return(PathSegment(LINETYPE, xD - xA, yD - yA));
+ else
+ StepLine(I->region, I->origin.x + xA, I->origin.y + yA,
+ I->origin.x + xD, I->origin.y + yD);
+ }
+ else
+ {
+ fractpel xAB,yAB;
+ fractpel xBC,yBC;
+ fractpel xCD,yCD;
+ fractpel xABC,yABC;
+ fractpel xBCD,yBCD;
+ fractpel xABCD,yABCD;
+
+ xAB = xA + xB; yAB = yA + yB;
+ xBC = xB + xC; yBC = yB + yC;
+ xCD = xC + xD; yCD = yC + yD;
+
+ xABC = xAB + xBC; yABC = yAB + yBC;
+ xBCD = xBC + xCD; yBCD = yBC + yCD;
+
+ xABCD = xABC + xBCD; yABCD = yABC + yBCD;
+
+ xAB >>= 1; yAB >>= 1;
+ xBC >>= 1; yBC >>= 1;
+ xCD >>= 1; yCD >>= 1;
+ xABC >>= 2; yABC >>= 2;
+ xBCD >>= 2; yBCD >>= 2;
+ xABCD >>= 3; yABCD >>= 3;
+
+ if (I->region == NULL)
+ {
+ return( Join(
+ StepBezierRecurse(I, xA, yA, xAB, yAB, xABC, yABC, xABCD, yABCD),
+ StepBezierRecurse(I, xABCD, yABCD, xBCD, yBCD, xCD, yCD, xD, yD)
+ )
+ );
+ }
+ else
+ {
+ StepBezierRecurse(I, xA, yA, xAB, yAB, xABC, yABC, xABCD, yABCD);
+ StepBezierRecurse(I, xABCD, yABCD, xBCD, yBCD, xCD, yCD, xD, yD);
+ }
+ }
+ /*NOTREACHED*/
+ return NULL;
+}
+
+/*
+:h3.TOOBIG() - Macro to Test if a Coordinate is Too Big to Bezier SubDivide Normally
+
+Intermediate values in the Bezier subdivision are 8 times bigger than
+the starting values. If this overflows, a 'long', we are in trouble:
+*/
+
+#if defined(BITS)
+#undef BITS
+#endif
+#define BITS (sizeof(int32_t)*8)
+#define HIGHTEST(p) (((p)>>(BITS-4)) != 0) /* includes sign bit */
+#define TOOBIG(xy) ((xy < 0) ? HIGHTEST(-xy) : HIGHTEST(xy))
+
+/*
+:h3.StepBezier() - Produce Run Ends for a Bezier Curve
+
+This is the entry point called from outside the module.
+*/
+
+struct segment *StepBezier(
+ struct region *R, /* Region under construction or NULL */
+ fractpel xA, fractpel yA, /* A control point */
+ fractpel xB, fractpel yB, /* B control point */
+ fractpel xC, fractpel yC, /* C control point */
+ fractpel xD, fractpel yD) /* D control point */
+{
+ struct bezierinfo Info;
+
+ Info.region = R;
+ Info.origin.x = xA;
+ Info.origin.y = yA;
+
+ xB -= xA;
+ xC -= xA;
+ xD -= xA;
+ yB -= yA;
+ yC -= yA;
+ yD -= yA;
+
+ if ( TOOBIG(xB) || TOOBIG(yB) || TOOBIG(xC) || TOOBIG(yC)
+ || TOOBIG(xD) || TOOBIG(yD) )
+ t1_abort("Beziers this big not yet supported");
+
+ return(StepBezierRecurse(&Info,
+ (fractpel) 0, (fractpel) 0, xB, yB, xC, yC, xD, yD));
+}
+
diff --git a/fonts/utilities/ps2pk/curves.h b/fonts/utilities/ps2pk/curves.h
new file mode 100644
index 0000000000..cfa07b2bb7
--- /dev/null
+++ b/fonts/utilities/ps2pk/curves.h
@@ -0,0 +1,41 @@
+/* $XConsortium: curves.h,v 1.2 91/10/10 11:17:59 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/*SHARED*/
+
+#define StepConic(R,xA,yA,xB,yB,xC,yC,r) t1_StepConic(R,xA,yA,xB,yB,xC,yC,r)
+#define StepBezier(R,xA,yA,xB,yB,xC,yC,xD,yD) t1_StepBezier(R,xA,yA,xB,yB,xC,yC,xD,yD)
+
+#define FlattenConic(xM,yM,xC,yC,r) t1_StepConic(NULL,(fractpel)0,(fractpel)0,xM,yM,xC,yC,r)
+#define FlattenBezier(xB,yB,xC,yC,xD,yD) t1_StepBezier(NULL,(fractpel)0,(fractpel)0,xB,yB,xC,yC,xD,yD)
+
+struct segment *t1_StepConic();
+struct segment *t1_StepBezier(struct region *, fractpel, fractpel, fractpel,
+ fractpel, fractpel, fractpel, fractpel, fractpel);
+
+/*END SHARED*/
diff --git a/fonts/utilities/ps2pk/digit.h b/fonts/utilities/ps2pk/digit.h
new file mode 100644
index 0000000000..4ed89c765c
--- /dev/null
+++ b/fonts/utilities/ps2pk/digit.h
@@ -0,0 +1,64 @@
+/* $XConsortium: digit.h,v 1.2 91/10/10 11:18:01 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* -------------------------------------- */
+/* --- MACHINE GENERATED, DO NOT EDIT --- */
+/* -------------------------------------- */
+
+#ifndef DIGIT
+#define DIGIT 1
+
+/*
+ * Digit Value Table --
+ *
+ * The entries in the Digit Value Table map character
+ * codes in the set {0-9,a-z,A-Z} to their numeric
+ * values as part of numbers of radix 2-36.
+ *
+ */
+unsigned char digit_value[256] = {
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,
+ 0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,
+ 0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
+};
+
+#endif
diff --git a/fonts/utilities/ps2pk/encoding.c b/fonts/utilities/ps2pk/encoding.c
new file mode 100644
index 0000000000..e1d85fb029
--- /dev/null
+++ b/fonts/utilities/ps2pk/encoding.c
@@ -0,0 +1,353 @@
+/* MODULE encoding (encoding.c)
+ * interface: typedef char *encoding[256];
+ * void getenc(
+ * char **fontname, **encname,
+ * ( foundry name of font and name of this encoding )
+ * encoding ev, output encoding
+ * int width[256]); output widths
+ *
+ * depends on: MODULEs binary_table, strings
+ * <ctype.h>
+ * <stdio.h>
+ * <stdlib.h>
+ * <string.h>
+ *
+ * globals: void fatal();
+ *
+ * Author: Piet Tutelaers
+ * (see README for license)
+ */
+
+#include "types.h"
+#include "basics.h"
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static char *my_string(char *);
+static void remove_string(void);
+static void addcc(char *name, int charcode);
+static int getcc(char *name);
+
+/* return a pointer to first non space character after occurence of string t,
+ * the scan starts at pointer s
+ */
+static char *value_after(char *s, const char *t)
+{ int l;
+ l = strlen(t);
+ for (;;) {
+ while (*s != *t && *s != '\n') s++;
+ if (*s == '\n') return NULL;
+ if (strncmp(s, t, l) == 0) break;
+ s++;
+ }
+ s += l;
+ while (isspace((unsigned char)*s)) s++;
+ return s;
+}
+
+static int decimal(char *s)
+{ int sign = 1, d = 0;
+
+ while (isspace((unsigned char)*s)) s++;
+ if (*s == '-') { sign = -1; s++; }
+ while (isdigit((unsigned char)*s)) { d = d * 10 + (*s - '0'); s++; }
+ return sign*d;
+}
+
+/* Nextsymbol() reads lines from enc until a '[', '/' or a ']' is
+ * encountered. In that case pline points to the character following
+ * this symbol otherwise a fatal error is generated.
+ */
+
+FILE *enc;
+
+#define LINEBUF 1024
+char line[LINEBUF], *pline = NULL;
+
+static char nextsymbol(void)
+{
+ for (;;) {
+ if (pline == NULL) {
+ if (fgets(line, LINEBUF-1, enc) == NULL)
+ fatal("unexpected EOF while reading %s\n", encfile);
+ pline = line;
+ }
+ if (*pline == '[' || *pline == ']' || *pline == '/') break;
+ if (*pline == '%' || *pline == '\n' || *pline == '\0')
+ { pline = NULL;
+ continue;
+ }
+ pline++;
+ }
+ pline++; return *(pline-1);
+}
+
+static char *nextpsname(void)
+{ int i = 0;
+ char the_nextname[MAXSTRLEN], *name;
+
+ for (;;) {
+ if (pline == NULL) {
+ if (fgets(line, LINEBUF-1, enc) == NULL)
+ fatal("unexpected EOF while reading %s\n", encfile);
+ pline = line;
+ }
+ if (*pline == '%' || *pline == '\n' || *pline == '\0')
+ { pline = NULL;
+ continue;
+ }
+ if (isspace((unsigned char)*pline)) {
+ pline++;
+ continue;
+ }
+ if (!isalpha((unsigned char)*pline)) fatal("invalid name in %s\n", encfile);
+ /* pt981009: added '_' Staszek Wawrykiewicz <staw@gust.org.pl> */
+ while (isalnum((unsigned char)*pline) || *pline == '-' || *pline == '_') {
+ if (i > MAXSTRLEN-2)
+ fatal("name too long in %s (%s)\n", line, encfile);
+ the_nextname[i++] = *pline++;
+ }
+ the_nextname[i] = '\0';
+ name = malloc(i+1);
+ if (name == NULL) fatal("Out of memory\n");
+ strcpy(name, the_nextname);
+ break;
+ }
+ /* pt981009: removed pline++ Staszek Wawrykiewicz <staw@gust.org.pl> */
+ return name;
+}
+
+void getenc(char **fontname, char **encname, encoding ev, int width[256])
+{ int i, len, SCMseen, Ccnt, wx, cc;
+ FILE *afm;
+ char *name, ns;
+
+ for (i=0; i < 256; i++) { ev[i] = NULL; width[i] = -1000; }
+ if (encfile) {
+ enc = fopen(encfile, "r");
+ if (enc == NULL) fatal("Can't open %s\n", encfile);
+ if (nextsymbol() != '/') fatal("missing '/encoding' in %s\n", encfile);
+ *encname = nextpsname();
+ if (nextsymbol() != '[') fatal("missing '[' in %s\n", encfile);
+ i = 0;
+ while (i < 256 && (ns = nextsymbol()) == '/') {
+ name = my_string(pline);
+ if (strcmp(name, ".notdef") == 0) {
+ i++; remove_string();
+ continue;
+ }
+ addcc(name, i++);
+ }
+ if (i != 256) fatal("missing %d symbols in %s\n", 256-i, encfile);
+ if (nextsymbol() != ']') fatal("missing ']' in %s\n", encfile);
+ fclose(enc);
+ }
+ afm = fopen(afmfile, "r");
+ if (afm == NULL) fatal("Can't open %s\n", afmfile);
+ /*
+ * Scan header of AFM file and take the FontName and EncodingScheme
+ * (used for identification purposes in the PK postamble)
+ * Stop after reading `StartCharMetrics'.
+ */
+ SCMseen = 0; Ccnt = 0;
+ while (fgets(line, LINEBUF-1, afm)) {
+ if (strncmp(line, "FontName", 8) == 0) {
+ pline = value_after(line, "FontName");
+ len = strlen(pline);
+ if (*(pline+len-1) == '\n') {
+ *(pline+len-1) = '\0'; len--;
+ }
+ *fontname = malloc(len + 1);
+ if (*fontname == NULL) fatal("Out of memory\n");
+ strcpy(*fontname, pline);
+ }
+ else if (encname == NULL && strncmp(line, "EncodingScheme", 8) == 0) {
+ pline = value_after(line, "EncodingScheme");
+ len = strlen(pline);
+ if (*(pline+len-1) == '\n') {
+ *(pline+len-1) = '\0'; len--;
+ }
+ *encname = malloc(len + 1);
+ if (*encname == NULL) fatal("Out of memory\n");
+ strcpy(*encname, pline);
+ }
+ else if (strncmp(line, "StartCharMetrics", 16) == 0) {
+ SCMseen = 1; break;
+ }
+ }
+ if (SCMseen == 0) fatal("%s: no metrics info\n", afmfile);
+ while (fgets(line, LINEBUF-1, afm)) {
+ if (strncmp(line, "EndCharMetrics", 14) == 0) break;
+ if (strncmp(line, "C ", 2) != 0)
+ fatal("%s: unexpected line\n", afmfile);
+
+ /* Gracefully terminate when the AFM file is not valid. Every line */
+ /* in the AFM file should specify a "C"haracter, a "WX"idth, and */
+ /* a "N"ame. (ndw)
+ */
+ pline = value_after(line, "C");
+ if (pline == NULL)
+ fatal("\nBad char metric in %s (no char):\n\t %s\n", afmfile, line);
+ cc = decimal(pline);
+ pline = value_after(pline, "WX");
+ if (pline == NULL)
+ fatal("\nBad char metric in %s (no width):\n\t %s\n", afmfile, line);
+ wx = decimal(pline);
+ pline = value_after(pline, "N");
+ if (pline == NULL)
+ fatal("\nBad char metric in %s (no name):\n\t %s\n", afmfile, line);
+ name = my_string(pline);
+
+ if (encfile) {
+ if ((i = getcc(name)) == -1) {
+ remove_string();
+ continue;
+ }
+ do { /* allow more occurences per name */
+ ev[i] = name; width[i] = wx;
+ i = getcc(name);
+ }
+ while (i >= 0);
+ }
+ else if (cc >= 0 && cc <= 255) { /* ndw: 10/13/92 */
+ ev[cc] = name; width[cc] = wx;
+ }
+ else if (cc > 255)
+ msg("Char code %d ignored (out of range).\n", cc);
+ Ccnt++;
+ }
+ if (Ccnt == 0) fatal("%s: no characters selected\n", afmfile);
+}
+
+/* END MODULE encoding */
+
+/* MODULE binary_table
+ * depends on: MODULE string
+ * <stdlib.h>
+ * <string.h>
+ */
+
+/*
+ * TUG has accepted an extended font layout (EC.enc) where the hyphen
+ * occupies two positions ('055 and '177) to handle exeptional hyphenation
+ * situations (see TUGboat#11 1990 (no. 4) pp. 514).
+ * To handle this special case we allow two charcodes per symbol.
+ */
+
+/*
+ * Two functions for a binary search table. One to add a name and one
+ * to lookup a name. This table is used to store all encoding names and
+ * its corresponding charcode.
+ */
+
+struct Node
+{ char *name; /* pointer to a PostScript string */
+ short cc[2]; /* its charcode's (maximum of two) */
+ short left, right;
+} node[256];
+
+static int freenode = 0;
+static short root = -1;
+
+static void addcc(char *name, int charcode)
+{
+ short p = 0, q;
+ int r = 0;
+
+ q = root;
+ while (q != -1) {
+ p = q; r = strcmp(name, node[p].name);
+ if (r == 0) {
+ if (node[p].cc[1] == -1) {
+ node[p].cc[1] = charcode;
+ return;
+ }
+ else
+ fatal("%s: more than two codes for %s (%d,%d,%d)\n",
+ encfile, name, node[p].cc[0], node[p].cc[1], charcode);
+ }
+ else if (r < 0) q=node[p].left;
+ else q=node[p].right;
+ }
+ if (freenode == 256)
+ fatal("%s: too many PostScript names\n", encfile);
+ /* not found hence insert */
+ node[freenode].name = name;
+ node[freenode].cc[0] = charcode;
+ node[freenode].cc[1] = -1;
+ node[freenode].left = node[freenode].right = -1;
+ if (root == -1)
+ root = freenode;
+ else {
+ if (r < 0) node[p].left=freenode;
+ else node[p].right=freenode;
+ }
+ freenode++;
+}
+
+static int getcc(char *name)
+{ short r, p, q, cc;
+
+ q = root;
+ while (q != -1) {
+ p = q; r = strcmp(name, node[p].name);
+ if (r == 0) {
+ cc = node[p].cc[0];
+ node[p].cc[0] = node[p].cc[1];
+ node[p].cc[1] = -1;
+ return cc;
+ }
+ else if (r < 0) q = node[p].left;
+ else q = node[p].right;
+ }
+ return -1;
+}
+
+/* END MODULE binary_table */
+
+/* MODULE string:
+ * depends on: <ctype.h>
+ * <string.h>
+ */
+
+/* String() reads a string starting at a given character pointer.
+ * After removing leading whitespace the resulting string (with possible
+ * `.' and '_' characters) is stored in a stringpool after which a pointer
+ * to it is returned.
+ */
+
+#define POOLSIZE 10000
+static char stringpool[POOLSIZE];
+static int poolsize, /* occupied space annex free index */
+ lastpoolsize; /* previous poolsize */
+
+static char *my_string(char *s)
+{ int length; char *str;
+
+ while (isspace((unsigned char)*s)) s++;
+ str = s; length = 0;
+ while (isalnum((unsigned char)*s) || *s == '.' || *s == '_') { length++; s++; }
+ if (length == 0) return NULL;
+ else {
+ if (length + 1 > POOLSIZE - poolsize)
+ fatal("Out of memory %s\n", s);
+ strncpy(stringpool+poolsize, str, length);
+ str = stringpool + poolsize;
+ s = stringpool + poolsize + length;
+ *s = '\0';
+ lastpoolsize = poolsize;
+ poolsize += length+1;
+ return str;
+ }
+}
+
+/* remove last string from stringpool */
+static void remove_string(void)
+{
+ poolsize = lastpoolsize;
+}
+
+/* END MODULE string */
+
diff --git a/fonts/utilities/ps2pk/ffilest.h b/fonts/utilities/ps2pk/ffilest.h
new file mode 100644
index 0000000000..006e5fa042
--- /dev/null
+++ b/fonts/utilities/ps2pk/ffilest.h
@@ -0,0 +1,153 @@
+/*
+ * $XConsortium: fontfilest.h,v 1.3 91/07/16 20:15:16 keith Exp $
+ *
+ * Copyright 1991 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Keith Packard, MIT X Consortium
+ */
+
+#ifndef _FONTFILEST_H_
+#define _FONTFILEST_H_
+
+#ifdef XSERVER
+#include <X11/Xos.h>
+#else
+#include "types.h"
+#include "Xstuff.h"
+#endif
+
+#include "fontmisc.h"
+#include "fontstruct.h"
+#include "fontfile.h"
+#include "fontxlfd.h"
+
+typedef struct _FontName {
+ const char *name;
+ short length;
+ short ndashes;
+} FontNameRec;
+
+typedef struct _FontScaled {
+ FontScalableRec vals;
+ FontEntryPtr bitmap;
+ FontPtr pFont;
+} FontScaledRec;
+
+typedef struct _FontScalableExtra {
+ FontScalableRec defaults;
+ int numScaled;
+ int sizeScaled;
+ FontScaledPtr scaled;
+ pointer private;
+} FontScalableExtraRec;
+
+typedef struct _FontScalableEntry {
+ FontRendererPtr renderer;
+ char *fileName;
+ FontScalableExtraPtr extra;
+} FontScalableEntryRec;
+
+/*
+ * This "can't" work yet - the returned alias string must be permanent,
+ * but this layer would need to generate the appropriate name from the
+ * resolved scalable + the XLFD values passed in. XXX
+ */
+
+typedef struct _FontScaleAliasEntry {
+ char *resolved;
+} FontScaleAliasEntryRec;
+
+typedef struct _FontBitmapEntry {
+ FontRendererPtr renderer;
+ char *fileName;
+ FontPtr pFont;
+} FontBitmapEntryRec;
+
+typedef struct _FontAliasEntry {
+ char *resolved;
+} FontAliasEntryRec;
+
+typedef struct _FontBCEntry {
+ FontScalableRec vals;
+ FontEntryPtr entry;
+} FontBCEntryRec;
+
+typedef struct _FontEntry {
+ FontNameRec name;
+ int type;
+ union _FontEntryParts {
+ FontScalableEntryRec scalable;
+ FontBitmapEntryRec bitmap;
+ FontAliasEntryRec alias;
+ FontBCEntryRec bc;
+ } u;
+} FontEntryRec;
+
+typedef struct _FontTable {
+ int used;
+ int size;
+ FontEntryPtr entries;
+ Bool sorted;
+} FontTableRec;
+
+typedef struct _FontDirectory {
+ char *directory;
+ uint32_t dir_mtime;
+ uint32_t alias_mtime;
+ FontTableRec scalable;
+ FontTableRec nonScalable;
+} FontDirectoryRec;
+
+typedef struct _FontRenderer {
+ const char *fileSuffix;
+ int fileSuffixLen;
+ int (*OpenBitmap)(/* fpe, pFont, flags, entry, fileName, format, fmask */);
+ int (*OpenScalable)(/* fpe, pFont, flags, entry, fileName, vals, format, fmask */);
+ int (*GetInfoBitmap)(/* fpe, pFontInfo, entry, fileName */);
+ int (*GetInfoScalable)(/* fpe, pFontInfo, entry, fileName, vals */);
+ int number;
+} FontRendererRec;
+
+typedef struct _FontRenders {
+ int number;
+ FontRendererPtr *renderers;
+} FontRenderersRec, *FontRenderersPtr;
+
+typedef struct _BitmapInstance {
+ FontScalableRec vals;
+ FontBitmapEntryPtr bitmap;
+} BitmapInstanceRec, *BitmapInstancePtr;
+
+typedef struct _BitmapScalablePrivate {
+ int numInstances;
+ BitmapInstancePtr instances;
+} BitmapScalablePrivateRec, *BitmapScalablePrivatePtr;
+
+typedef struct _BitmapSources {
+ FontPathElementPtr *fpe;
+ int size;
+ int count;
+} BitmapSourcesRec, *BitmapSourcesPtr;
+
+extern BitmapSourcesRec FontFileBitmapSources;
+
+extern void Type1CloseFont(FontPtr);
+
+#endif /* _FONTFILEST_H_ */
diff --git a/fonts/utilities/ps2pk/filenames.c b/fonts/utilities/ps2pk/filenames.c
new file mode 100644
index 0000000000..8081233ef2
--- /dev/null
+++ b/fonts/utilities/ps2pk/filenames.c
@@ -0,0 +1,136 @@
+/* FILE: filenames.c
+ * PURPOSE: some handy functions for working with TeXfiles
+ * AUTHOR: Piet Tutelaers
+ * (see README for license)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "c-auto.h"
+#endif
+
+#ifdef KPATHSEA
+#include <kpathsea/kpathsea.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+
+#include "basics.h" /* basic definitions and fatal() */
+#include "filenames.h"
+
+/* comparing names (system dependant) */
+static int equal(const char *s, const char *t)
+{
+# ifndef UNIX
+ while (tolower(*s) == tolower(*t)) {
+ if (*s == '\0')
+ break;
+ s++; t++;
+ }
+# else
+ while (*s == *t) {
+ if (*s == '\0' || *t == '\0')
+ break;
+ s++; t++;
+ }
+# endif
+ if (*s == '\0' && *t == '\0')
+ return 1;
+ else
+ return 0;
+}
+
+/*
+ * Determine the extension
+ */
+char *extension(char *str) {
+ char *p, *base;
+ for (p = base = str; *p; ++p)
+ /* if (*p++ == DIRSEP) base = p; */
+ if (IS_DIR_SEP(*p))
+ base = p + 1;
+ for (p = base ; *p; p++)
+ if (*p == '.')
+ break;
+ return p;
+}
+
+/*
+ * Construct filename by replacing the current extension (if available)
+ * with supplied one.
+ */
+char *newname(char *name, const char *ext)
+{
+ char *e, *nn; int len1, len2;
+
+ e = extension(name);
+ if (equal(ext, e))
+ return name;
+ len1 = strlen(name) - strlen(e);
+ len2 = len1 + strlen(ext) + 1;
+ nn = (char *) malloc(len2);
+ if (nn == NULL)
+ fatal("Out of memory\n");
+ strncpy(nn, name, len1);
+ strcpy(nn+len1, ext);
+ return nn;
+}
+
+/*
+ * Derived from BSD basename
+ */
+char *basename(char *str, const char *suffix){
+ char *p; int len = 0;
+ const char *t;
+ char *base;
+
+ printf("basename of %s = ", str);
+#ifdef KPATHSEA
+ for (p = base = (NAME_BEGINS_WITH_DEVICE(str) ? str+2 : str);
+ *p; p++) {
+#else
+ for (p = base = str; *p; p++) {
+#endif
+ /* if (*p++ == DIRSEP) { base = p; len = 0; } */
+ if (IS_DIR_SEP(*p)) {
+ base = p+1;
+ len = 0;
+ } else len++;
+ }
+ printf("%s\n", base);
+ if (suffix != NULL) {
+ for (t = suffix; *t; ++t);
+ do {
+ len--; t--; p--;
+ if (*t != *p) break;
+ if (t == suffix) {
+ char *bn;
+ if (len == 0)
+ return NULL;
+ bn = malloc(len+1);
+ if (bn == NULL)
+ fatal("Out of memory\n");
+ strncpy(bn, base, len);
+ *(bn+len) = '\0'; /* RA */
+ return bn;
+ }
+ } while (p > base);
+ }
+ return base;
+}
+
+/*
+ * Return true if name can be the name of a PostScript resource
+ * (no extension and no absolute pathname).
+ */
+int ps_resource(const char *name) {
+ if (strchr(name, '.')) return 0 ;
+#ifdef KPATHSEA
+ if (kpse_absolute_p(name, true)) return 0;
+#else
+ if (strchr(name, DIRSEP)) return 0 ;
+#endif
+ return 1;
+}
diff --git a/fonts/utilities/ps2pk/filenames.h b/fonts/utilities/ps2pk/filenames.h
new file mode 100644
index 0000000000..3eda4744dd
--- /dev/null
+++ b/fonts/utilities/ps2pk/filenames.h
@@ -0,0 +1,27 @@
+/* FILE: filenames.h
+ * PURPOSE: functions for handling file names
+ */
+
+/*
+ * Determine extension of <str>.
+ */
+char *extension(char *str);
+
+/*
+ * Basename is the functional equivalent of BSD's basename utility.
+ * When the suffix is NULL no suffix removal is done. When needed
+ * a new string is allocated so that the original value of str is
+ * not changed.
+ */
+char *basename(char *str, const char *suffix);
+
+/*
+ * Newname builds a new filename by adding or replacing the extension
+ * of the given <name> with the new supplied <ext>.
+ */
+char *newname(char *name, const char *ext);
+
+/*
+ * ps_resource returns true if name can be treated as a PS resource
+ */
+int ps_resource(const char *name);
diff --git a/fonts/utilities/ps2pk/flisearch.c b/fonts/utilities/ps2pk/flisearch.c
new file mode 100644
index 0000000000..e196f6f1e2
--- /dev/null
+++ b/fonts/utilities/ps2pk/flisearch.c
@@ -0,0 +1,42 @@
+/*
+ * FILE: psearch.c
+ * PURPOSE: search files through possible recursive path
+ * VERSION: 1.0 (Oct. 1995)
+ * AUTHOR: Piet Tutelaers
+ */
+
+#include <stdio.h>
+#include <string.h> /* strcmp() */
+#include "basics.h" /* fatal(), msg() */
+#include "filenames.h" /* */
+#include "psearch.h" /* search_flipath() */
+
+char *fontname; int dpi, margin = 0;
+
+int main(int argc, char *argv[]) {
+ char *path, *file, *fn;
+ int matching(char *, int);
+
+ /* get path and file arguments */
+ if (argc != 4) fatal("Usage: psearch path fontname dpi\n");
+ path = argv[1]; fontname = argv[2]; dpi = atoi(argv[3]);
+
+ /* find <file> in <path> */
+ fn = search_flipath(path, matching);
+ if (fn == NULL) msg("%s at %d dpi not found\n", fontname, dpi);
+ else msg("%s: %s at %d dpi found\n", fn, fontname, dpi);
+ exit(0);
+}
+
+/*
+ * Function used to search for one single font in FLI path
+ */
+int matching(char *font, int size) {
+
+ if ((strcmp(font, fontname) == 0) && (size == dpi ||
+ (size >= dpi - margin && size <= dpi+margin)))
+ return 1;
+ else
+ return 0;
+}
+
diff --git a/fonts/utilities/ps2pk/font.h b/fonts/utilities/ps2pk/font.h
new file mode 100644
index 0000000000..8de6e908f3
--- /dev/null
+++ b/fonts/utilities/ps2pk/font.h
@@ -0,0 +1,107 @@
+/* $XConsortium: font.h,v 1.8 91/07/19 21:03:49 rws Exp $ */
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Digital or MIT not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* $NCDId: @(#)font.h,v 1.7 1991/06/24 17:00:23 lemke Exp $ */
+
+#ifndef FONT_H
+#define FONT_H
+
+#ifndef BitmapFormatByteOrderMask
+#include "fsmasks.h"
+#endif
+
+/* data structures */
+typedef struct _Font *FontPtr;
+typedef struct _FontInfo *FontInfoPtr;
+typedef struct _FontProp *FontPropPtr;
+typedef struct _ExtentInfo *ExtentInfoPtr;
+typedef struct _FontPathElement *FontPathElementPtr;
+typedef struct _CharInfo *CharInfoPtr;
+typedef struct _FontNames *FontNamesPtr;
+typedef struct _FontResolution *FontResolutionPtr;
+
+#define NullCharInfo ((CharInfoPtr) 0)
+#define NullFont ((FontPtr) 0)
+#define NullFontInfo ((FontInfoPtr) 0)
+
+ /* draw direction */
+#define LeftToRight 0
+#define RightToLeft 1
+#define BottomToTop 2
+#define TopToBottom 3
+typedef int DrawDirection;
+
+#define NO_SUCH_CHAR -1
+
+
+#define FontAliasType 0x1000
+
+#define AllocError 80
+#define StillWorking 81
+#define FontNameAlias 82
+#define BadFontName 83
+#define Suspended 84
+#define Successful 85
+#define BadFontPath 86
+#define BadCharRange 87
+#define BadFontFormat 88
+#define FPEResetFailed 89 /* for when an FPE reset won't work */
+
+/* OpenFont flags */
+#define FontLoadInfo 0x0001
+#define FontLoadProps 0x0002
+#define FontLoadMetrics 0x0004
+#define FontLoadBitmaps 0x0008
+#define FontLoadAll 0x000f
+#define FontOpenSync 0x0010
+
+/* Query flags */
+#define LoadAll 0x1
+#define FinishRamge 0x2
+#define EightBitFont 0x4
+#define SixteenBitFont 0x8
+
+typedef char *closure;
+
+extern int StartListFontsWithInfo( /* client, length, pattern, maxNames */ );
+extern int ListFonts( /* client, length, pattern, maxNames */ );
+
+extern FontNamesPtr MakeFontNamesRecord( /* size */ );
+extern void FreeFontNames();
+extern int AddFontNamesName();
+
+extern int FontToFSError();
+
+extern FontResolutionPtr GetClientResolution();
+
+typedef struct _FontPatternCache *FontPatternCachePtr;
+
+extern FontPatternCachePtr MakeFontPatternCache ();
+extern void FreeFontPatternCache ();
+extern void EmtpyFontPatternCache ();
+extern void CacheFontPattern ();
+extern FontPtr FindCachedFontPattern ();
+extern void RemoveCachedFontPattern ();
+
+#endif /* FONT_H */
diff --git a/fonts/utilities/ps2pk/fontfcn.c b/fonts/utilities/ps2pk/fontfcn.c
new file mode 100644
index 0000000000..dfaeb8ff57
--- /dev/null
+++ b/fonts/utilities/ps2pk/fontfcn.c
@@ -0,0 +1,300 @@
+/* $XConsortium: fontfcn.c,v 1.8 92/03/27 18:15:45 eswu Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* Author: Katherine A. Hitchcock IBM Almaden Research Laboratory */
+
+#ifdef HAVE_CONFIG_H
+#include "c-auto.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "regions.h"
+#include "util.h"
+#include "fontmisc.h"
+#include "ffilest.h"
+#include "fontfcn.h"
+
+#define FF_PARSE_ERROR 5
+#define FF_PATH 1
+
+/***================================================================***/
+/* GLOBALS */
+/***================================================================***/
+char CurFontName[120];
+char *CurFontEnv;
+char *vm_base = NULL;
+psfont *FontP = NULL;
+psfont TheCurrentFont;
+
+
+/***================================================================***/
+/* SearchDict - look for name */
+/* - compare for match on len and string */
+/* return 0 - not found. */
+/* return n - nth element in dictionary. */
+/***================================================================***/
+int SearchDictName(psdict *dictP, psobj *keyP)
+{
+ int i,n;
+
+
+ n = dictP[0].key.len;
+ for (i=1;i<=n;i++) { /* scan the intire dictionary */
+ if (
+ (dictP[i].key.len == keyP->len )
+ &&
+ (strncmp(dictP[i].key.data.valueP,
+ keyP->data.valueP,
+ keyP->len) == 0
+ )
+ ) return(i);
+ }
+ return(0);
+}
+/***================================================================***/
+static boolean initFont(void)
+{
+
+ if (!(vm_init())) return(FALSE);
+ vm_base = vm_next_byte();
+ if (!(Init_BuiltInEncoding())) return(FALSE);
+ strcpy(CurFontName, ""); /* iniitialize to none */
+ FontP = &TheCurrentFont;
+ FontP->vm_start = vm_next_byte();
+ FontP->FontFileName.len = 0;
+ FontP->FontFileName.data.valueP = CurFontName;
+ return(TRUE);
+}
+/***================================================================***/
+static void resetFont(char *env)
+{
+
+ vm_next = FontP->vm_start;
+ vm_free = vm_size - ( vm_next - vm_base);
+ FontP->Subrs.len = 0;
+ FontP->Subrs.data.stringP = NULL;
+ FontP->CharStringsP = NULL;
+ FontP->Private = NULL;
+ FontP->fontInfoP = NULL;
+ FontP->BluesP = NULL;
+ /* This will load the font into the FontP */
+ strcpy(CurFontName,env);
+ FontP->FontFileName.len = strlen(CurFontName);
+ FontP->FontFileName.data.valueP = CurFontName;
+
+}
+/***================================================================***/
+/* Read font used to attempt to load the font and, upon failure,
+ try a second time with twice as much memory. Unfortunately, if
+ it's a really complex font, simply using 2*vm_size may be insufficient.
+ I've modified it so that the program will try progressively larger
+ amounts of memory until it really runs out or the font loads
+ successfully. (ndw)
+*/
+static int readFont(char *env)
+{
+ int rcode;
+
+ /* restore the virtual memory and eliminate old font */
+ resetFont(env);
+ /* This will load the font into the FontP */
+ rcode = scan_font(FontP);
+ return(rcode);
+}
+/***================================================================***/
+struct region *fontfcnB(struct XYspace *S, unsigned char *code, int *lenP, int *mode)
+{
+ psobj *charnameP; /* points to psobj that is name of character*/
+ int N;
+ psdict *CharStringsDictP; /* dictionary with char strings */
+ psobj CodeName; /* used to store the translation of the name*/
+ psobj *SubrsArrayP;
+ psobj *theStringP;
+
+ struct region *charpath; /* the path for this character */
+
+ charnameP = &CodeName;
+ charnameP->len = *lenP;
+ charnameP->data.stringP = code;
+
+ CharStringsDictP = FontP->CharStringsP;
+
+ /* search the chars string for this charname as key */
+ N = SearchDictName(CharStringsDictP,charnameP);
+ if (N<=0) {
+ *mode = FF_PARSE_ERROR;
+ return(NULL);
+ }
+ /* ok, the nth item is the psobj that is the string for this char */
+ theStringP = &(CharStringsDictP[N].value);
+
+ /* get the dictionary pointers to the Subrs */
+
+ SubrsArrayP = &(FontP->Subrs);
+ /* scale the Adobe fonts to 1 unit high */
+ S = (struct XYspace *)Permanent(Scale((struct xobject *)S, 1.0 , 1.0));
+ /* call the type 1 routine to rasterize the character */
+ charpath = (struct region *)Type1Char(FontP,S,theStringP,SubrsArrayP,NULL,
+ FontP->BluesP, mode);
+ Destroy(S);
+ /* if Type1Char reported an error, then return */
+ if ( *mode == FF_PARSE_ERROR) return(NULL);
+ /* fill with winding rule unless path was requested */
+ if (*mode != FF_PATH) {
+ charpath = Interior((struct segment *)charpath,WINDINGRULE+CONTINUITY);
+ }
+ return(charpath);
+}
+/***================================================================***/
+/* fontfcnA(env, mode) */
+/* */
+/* env is a pointer to a string that contains the fontname. */
+/* */
+/* 1) initialize the font - global indicates it has been done */
+/* 2) load the font */
+/***================================================================***/
+Bool fontfcnA(char *env, int *mode)
+{
+ int rc;
+
+ /* Has the FontP initialized? If not, then */
+ /* Initialize */
+ if (FontP == NULL) {
+ InitImager();
+ if (!(initFont())) {
+ /* we are really out of memory */
+ *mode = SCAN_OUT_OF_MEMORY;
+ return(FALSE);
+ }
+ }
+
+ /* if the env is null, then use font already loaded */
+
+ /* if the not same font name */
+ if ( (env) && (strcmp(env,CurFontName) != 0 ) ) {
+ /* restore the virtual memory and eliminate old font, read new one */
+ rc = readFont(env);
+ if (rc != 0 ) {
+ strcpy(CurFontName, ""); /* no font loaded */
+ *mode = rc;
+ return(FALSE);
+ }
+ }
+ return(TRUE);
+
+}
+/***================================================================***/
+/* QueryFontLib(env, infoName,infoValue,rcodeP) */
+/* */
+/* env is a pointer to a string that contains the fontname. */
+/* */
+/* 1) initialize the font - global indicates it has been done */
+/* 2) load the font */
+/* 3) use the font to call getInfo for that value. */
+/***================================================================***/
+
+void QueryFontLib(
+ char *env, const char *infoName,
+ void *infoValue, /* parameter returned here */
+ int *rcodeP)
+{
+ int rc,N,i;
+ psdict *dictP;
+ psobj nameObj;
+ psobj *valueP;
+
+ /* Has the FontP initialized? If not, then */
+ /* Initialize */
+ if (FontP == NULL) {
+ InitImager();
+ if (!(initFont())) {
+ *rcodeP = 1;
+ return;
+ }
+ }
+ /* if the env is null, then use font already loaded */
+ /* if the not same font name, reset and load next font */
+ if ( (env) && (strcmp(env,CurFontName) != 0 ) ) {
+ /* restore the virtual memory and eliminate old font */
+ rc = readFont(env);
+ if (rc != 0 ) {
+ strcpy(CurFontName, ""); /* no font loaded */
+ *rcodeP = 1;
+ return;
+ }
+ }
+ dictP = FontP->fontInfoP;
+ objFormatName(&nameObj,strlen(infoName),infoName);
+ N = SearchDictName(dictP,&nameObj);
+ /* if found */
+ if ( N > 0 ) {
+ *rcodeP = 0;
+ switch (dictP[N].value.type) {
+ case OBJ_ARRAY:
+ valueP = dictP[N].value.data.arrayP;
+ if (strcmp(infoName,"FontMatrix") == 0) {
+ /* 6 elments, return them as floats */
+ for (i=0;i<6;i++) {
+ if (valueP->type == OBJ_INTEGER )
+ ((float *)infoValue)[i] = valueP->data.integer;
+ else
+ ((float *)infoValue)[i] = valueP->data.real;
+ valueP++;
+ }
+ }
+ if (strcmp(infoName,"FontBBox") == 0) {
+ /* 4 elments for Bounding Box. all integers */
+ for (i=0;i<4;i++) {
+ ((int *)infoValue)[i] = valueP->data.integer;
+ valueP++;
+ }
+ break;
+ case OBJ_INTEGER:
+ case OBJ_BOOLEAN:
+ *((int *)infoValue) = dictP[N].value.data.integer;
+ break;
+ case OBJ_REAL:
+ *((float *)infoValue) = dictP[N].value.data.real;
+ break;
+ case OBJ_NAME:
+ case OBJ_STRING:
+ *((char **)infoValue) = dictP[N].value.data.valueP;
+ break;
+ default:
+ *rcodeP = 1;
+ break;
+ }
+ }
+ }
+ else *rcodeP = 1;
+}
diff --git a/fonts/utilities/ps2pk/fontfcn.h b/fonts/utilities/ps2pk/fontfcn.h
new file mode 100644
index 0000000000..fdabdd89cf
--- /dev/null
+++ b/fonts/utilities/ps2pk/fontfcn.h
@@ -0,0 +1,121 @@
+/* $XConsortium: fontfcn.h,v 1.3 92/03/26 16:42:23 eswu Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* Definition of a PostScript FONT */
+typedef struct ps_font {
+ char *vm_start;
+ psobj FontFileName;
+ psobj Subrs;
+ psdict *CharStringsP;
+ psdict *Private;
+ psdict *fontInfoP;
+struct blues_struct *BluesP;
+} psfont;
+/***================================================================***/
+/* Globals */
+/***================================================================***/
+
+extern int currentchar; /* for error reporting */
+/***================================================================***/
+/* Routines in scan_font */
+/***================================================================***/
+
+extern boolean Init_BuiltInEncoding(void);
+extern int SearchDictName(psdict *, psobj *);
+extern int scan_font(psfont *);
+extern struct xobject *Type1Char(psfont *, struct XYspace *, psobj *, psobj *,
+ psobj *, struct blues_struct *, int *);
+extern void objFormatName(psobj *, int, const char *);
+extern Bool fontfcnA(char *env,int *mode);
+extern struct region *fontfcnB(struct XYspace *S, unsigned char *code,
+ int *lenP, int *mode);
+/***================================================================***/
+/* Entry point for Type1Char to get entry from CharStrings */
+/***================================================================***/
+extern psobj *GetType1CharString(psfont *, unsigned char);
+
+extern int Type1OpenScalable(encoding, FontPtr *, int, FontEntryPtr, char *,
+ FontScalablePtr, fsBitmapFormat,
+ fsBitmapFormatMask, DOUBLE, DOUBLE);
+extern void Type1RegisterFontFileFunctions(void);
+extern void Type1CloseFont();
+extern int CheckFSFormat(int format,int fmask,int *bit,int *byte,int *scan,int *glyph,int *image);
+
+/***================================================================***/
+/* Return codes from scan_font */
+/***================================================================***/
+#define SCAN_OK 0
+#define SCAN_FILE_EOF -1
+#define SCAN_ERROR -2
+#define SCAN_OUT_OF_MEMORY -3
+#define SCAN_FILE_OPEN_ERROR -4
+#define SCAN_TRUE -5
+#define SCAN_FALSE -6
+#define SCAN_END -7
+
+/***================================================================***/
+/* Name of FontInfo fields */
+/***================================================================***/
+
+#define FONTNAME 1
+#define PAINTTYPE 2
+#define FONTTYPENUM 3
+#define FONTMATRIX 4
+#define FONTBBOX 5
+#define UNIQUEID 6
+#define STROKEWIDTH 7
+#define VERSION 8
+#define NOTICE 9
+#define FULLNAME 10
+#define FAMILYNAME 11
+#define WEIGHT 12
+#define ITALICANGLE 13
+#define ISFIXEDPITCH 14
+#define UNDERLINEPOSITION 15
+#define UNDERLINETHICKNESS 16
+#define ENCODING 17
+/***================================================================***/
+/* Name of Private values */
+/***================================================================***/
+#define BLUEVALUES 1
+#define OTHERBLUES 2
+#define FAMILYBLUES 3
+#define FAMILYOTHERBLUES 4
+#define BLUESCALE 5
+#define BLUESHIFT 6
+#define BLUEFUZZ 7
+#define STDHW 8
+#define STDVW 9
+#define STEMSNAPH 10
+#define STEMSNAPV 11
+#define FORCEBOLD 12
+#define LANGUAGEGROUP 13
+#define LENIV 14
+#define RNDSTEMUP 15
+#define EXPANSIONFACTOR 16
diff --git a/fonts/utilities/ps2pk/fontfile.h b/fonts/utilities/ps2pk/fontfile.h
new file mode 100644
index 0000000000..166aac3a01
--- /dev/null
+++ b/fonts/utilities/ps2pk/fontfile.h
@@ -0,0 +1,72 @@
+/*
+ * $XConsortium: fontfile.h,v 1.1 91/05/11 09:11:58 rws Exp $
+ *
+ * Copyright 1991 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Keith Packard, MIT X Consortium
+ */
+
+#ifndef _FONTFILE_H_
+#define _FONTFILE_H_
+typedef struct _FontEntry *FontEntryPtr;
+typedef struct _FontTable *FontTablePtr;
+typedef struct _FontName *FontNamePtr;
+typedef struct _FontScaled *FontScaledPtr;
+typedef struct _FontScalableExtra *FontScalableExtraPtr;
+typedef struct _FontScalableEntry *FontScalableEntryPtr;
+typedef struct _FontScaleAliasEntry *FontScaleAliasEntryPtr;
+typedef struct _FontBitmapEntry *FontBitmapEntryPtr;
+typedef struct _FontAliasEntry *FontAliasEntryPtr;
+typedef struct _FontBCEntry *FontBCEntryPtr;
+typedef struct _FontDirectory *FontDirectoryPtr;
+typedef struct _FontRenderer *FontRendererPtr;
+
+#define NullFontEntry ((FontEntryPtr) 0)
+#define NullFontTable ((FontTablePtr) 0)
+#define NullFontName ((FontNamePtr) 0)
+#define NullFontScaled ((FontScaled) 0)
+#define NullFontScalableExtra ((FontScalableExtra) 0)
+#define NullFontscalableEntry ((FontScalableEntry) 0)
+#define NullFontScaleAliasEntry ((FontScaleAliasEntry) 0)
+#define NullFontBitmapEntry ((FontBitmapEntry) 0)
+#define NullFontAliasEntry ((FontAliasEntry) 0)
+#define NullFontBCEntry ((FontBCEntry) 0)
+#define NullFontDirectory ((FontDirectoryPtr) 0)
+#define NullFontRenderer ((FontRendererPtr) 0)
+
+#define FONT_ENTRY_SCALABLE 0
+#define FONT_ENTRY_SCALE_ALIAS 1
+#define FONT_ENTRY_BITMAP 2
+#define FONT_ENTRY_ALIAS 3
+#define FONT_ENTRY_BC 4
+
+#define MAXFONTNAMELEN 1024
+#define MAXFONTFILENAMELEN 1024
+
+#define FontDirFile "fonts.dir"
+#define FontAliasFile "fonts.alias"
+#define FontScalableFile "fonts.scale"
+
+extern FontEntryPtr FontFileFindNameInDir ();
+extern FontDirectoryPtr FontFileMakeDir ();
+extern FontRendererPtr FontFileMatchRenderer ();
+extern char *SaveString ();
+extern FontScaledPtr FontFileFindScaledInstance ();
+#endif /* _FONTFILE_H_ */
diff --git a/fonts/utilities/ps2pk/fontmisc.h b/fonts/utilities/ps2pk/fontmisc.h
new file mode 100644
index 0000000000..ffde14ff31
--- /dev/null
+++ b/fonts/utilities/ps2pk/fontmisc.h
@@ -0,0 +1,63 @@
+/*
+ * $XConsortium: fontmisc.h,v 1.5 91/05/12 16:15:48 rws Exp $
+ *
+ * Copyright 1991 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Keith Packard, MIT X Consortium
+ */
+
+#ifndef _FONTMISC_H_
+#define _FONTMISC_H_
+
+#ifdef XSERVER
+#include "Xfuncs.h"
+#endif
+
+typedef unsigned char *pointer;
+typedef int Bool;
+#ifndef X_PROTOCOL
+typedef unsigned long Atom;
+typedef unsigned long XID;
+#endif
+#ifndef LSBFirst
+#define LSBFirst 0
+#define MSBFirst 1
+#endif
+
+#ifndef None
+#define None 0l
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#define FALSE 0
+#endif
+
+extern char *NameForAtom ();
+
+#define lowbit(x) ((x) & (~(x) + 1))
+
+#if defined(assert)
+#undef assert
+#endif
+
+#define assert(x)
+
+#endif /* _FONTMISC_H_ */
diff --git a/fonts/utilities/ps2pk/fonts.h b/fonts/utilities/ps2pk/fonts.h
new file mode 100644
index 0000000000..497206bf2d
--- /dev/null
+++ b/fonts/utilities/ps2pk/fonts.h
@@ -0,0 +1,47 @@
+/* $XConsortium: fonts.h,v 1.2 91/10/10 11:18:09 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/* STUB */
+
+#define CopyFont(f) f
+#define UniqueFont(f) f
+#define KillFont(f)
+#define KillText(t)
+#define CopyText(t) t
+#define I_DumpText(t)
+#define CoerceText(t) t
+#define TextDelta(t,pt)
+#define XformText(p,s)
+#define GimeSpace() FALSE
+
+#define LibInit()
+#define InitFonts()
+#define InitFiles()
+#define TraceClose()
diff --git a/fonts/utilities/ps2pk/fontstruct.h b/fonts/utilities/ps2pk/fontstruct.h
new file mode 100644
index 0000000000..7b9212f1e3
--- /dev/null
+++ b/fonts/utilities/ps2pk/fontstruct.h
@@ -0,0 +1,224 @@
+/* $Header: fontstruct.h,v 1.10 91/07/22 15:37:41 keith Exp $ */
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Digital or MIT not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+ @(#)fontstruct.h 3.2 91/04/15
+
+******************************************************************/
+
+#ifndef FONTSTR_H
+#define FONTSTR_H
+
+#ifdef XSERVER
+#include <X11/Xproto.h>
+#else
+#include "Xstuff.h"
+#endif
+
+#include "font.h"
+
+/*
+ * This version of the server font data strucutre is only for describing
+ * the in memory data structure. The file structure is not necessarily a
+ * copy of this. That is up to the compiler and the OS layer font loading
+ * machinery.
+ */
+
+#define GLYPHPADOPTIONS 4 /* 1, 2, 4, or 8 */
+
+typedef enum {
+ Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit
+} FontEncoding;
+
+typedef struct _FontProp {
+ long name;
+ intptr_t value; /* large enough to hole an 'int' or 'void *' */
+} FontPropRec;
+
+typedef struct _FontResolution {
+ unsigned short x_resolution;
+ unsigned short y_resolution;
+ unsigned short point_size;
+} FontResolutionRec;
+
+typedef struct _ExtentInfo {
+ DrawDirection drawDirection;
+ int fontAscent;
+ int fontDescent;
+ int overallAscent;
+ int overallDescent;
+ int overallWidth;
+ int overallLeft;
+ int overallRight;
+} ExtentInfoRec;
+
+typedef struct _CharInfo {
+ xCharInfo metrics; /* info preformatted for Queries */
+ char *bits; /* pointer to glyph image */
+} CharInfoRec;
+
+/*
+ * Font is created at font load time. It is specific to a single encoding.
+ * e.g. not all of the glyphs in a font may be part of a single encoding.
+ */
+
+typedef struct _FontInfo {
+ unsigned short firstCol;
+ unsigned short lastCol;
+ unsigned short firstRow;
+ unsigned short lastRow;
+ unsigned short defaultCh;
+ unsigned int noOverlap:1;
+ unsigned int terminalFont:1;
+ unsigned int constantMetrics:1;
+ unsigned int constantWidth:1;
+ unsigned int inkInside:1;
+ unsigned int inkMetrics:1;
+ unsigned int allExist:1;
+ unsigned int drawDirection:2;
+ unsigned int cachable:1;
+ unsigned int anamorphic:1;
+ short maxOverlap;
+ short pad;
+ xCharInfo maxbounds;
+ xCharInfo minbounds;
+ xCharInfo ink_maxbounds;
+ xCharInfo ink_minbounds;
+ short fontAscent;
+ short fontDescent;
+ int nprops;
+ FontPropPtr props;
+ char *isStringProp;
+} FontInfoRec;
+
+typedef struct _Font {
+ int refcnt;
+ FontInfoRec info;
+ char bit;
+ char byte;
+ char glyph;
+ char scan;
+ fsBitmapFormat format;
+ int (*get_glyphs) ( /* font, count, chars, encoding, count, glyphs */ );
+ int (*get_metrics) ( /* font, count, chars, encoding, count, glyphs */ );
+ int (*get_bitmaps) (/* client, font, flags, ranges, nranges,
+ nextents, extents */ );
+ int (*get_extents) (/* client, font, format, flags, ranges,
+ nranges, nglyphs, offsets, glyphs */ );
+ void (*unload_font) ( /* font */ );
+ FontPathElementPtr fpe;
+ pointer svrPrivate;
+ pointer fontPrivate;
+ pointer fpePrivate;
+ int maxPrivate;
+ pointer *devPrivates;
+} FontRec;
+
+extern Bool _FontSetNewPrivate (/* pFont, n, ptr */);
+extern int AllocateFontPrivateIndex ();
+
+#define FontGetPrivate(pFont,n) ((n) > (pFont)->maxPrivate ? (pointer) 0 : \
+ (pFont)->devPrivates[n])
+
+#define FontSetPrivate(pFont,n,ptr) ((n) > (pFont)->maxPrivate ? \
+ _FontSetNewPrivate (pFont, n, ptr) : \
+ ((((pFont)->devPrivates[n] = (ptr)) != 0) || TRUE))
+
+typedef struct _FontNames {
+ int nnames;
+ int size;
+ int *length;
+ char **names;
+} FontNamesRec;
+
+/* External view of font paths */
+typedef struct _FontPathElement {
+ int name_length;
+ char *name;
+ int type;
+ int refcount;
+ pointer private;
+} FontPathElementRec;
+
+typedef struct _FPEFunctions {
+ int (*name_check) ( /* name */ );
+ int (*init_fpe) ( /* fpe */ );
+ int (*reset_fpe) ( /* fpe */ );
+ int (*free_fpe) ( /* fpe */ );
+ int (*open_font) ( /* client, fpe, flags, name, namelen, format,
+ fid, ppfont, alias */ );
+ int (*close_font) ( /* pfont */ );
+ int (*list_fonts) ( /* client, fpe, pattern, patlen, maxnames,
+ paths */ );
+ int (*start_list_fonts_with_info) ( /* client, fpe, name, namelen,
+ maxnames, data */ );
+ int (*list_next_font_with_info) ( /* client, fpe, name, namelen,
+ info, num, data */ );
+ int (*wakeup_fpe) ( /* fpe, mask */ );
+ int (*client_died) ( /* client, fpe */ );
+} FPEFunctionsRec, FPEFunctions;
+
+extern int InitFPETypes();
+
+/*
+ * Various macros for computing values based on contents of
+ * the above structures
+ */
+
+#define GLYPHWIDTHPIXELS(pci) \
+ ((pci)->metrics.rightSideBearing - (pci)->metrics.leftSideBearing)
+
+#define GLYPHHEIGHTPIXELS(pci) \
+ ((pci)->metrics.ascent + (pci)->metrics.descent)
+
+#define GLYPHWIDTHBYTES(pci) (((GLYPHWIDTHPIXELS(pci))+7) >> 3)
+
+#define GLYPHWIDTHPADDED(bc) (((bc)+7) & ~0x7)
+
+#define BYTES_PER_ROW(bits, nbytes) \
+ ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \
+ :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \
+ :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \
+ :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \
+ : 0)
+
+#define BYTES_FOR_GLYPH(ci,pad) (GLYPHHEIGHTPIXELS(ci) * \
+ BYTES_PER_ROW(GLYPHWIDTHPIXELS(ci),pad))
+/*
+ * Macros for computing different bounding boxes for fonts; from
+ * the font protocol
+ */
+
+#define FONT_MAX_ASCENT(pi) ((pi)->fontAscent > (pi)->ink_maxbounds.ascent ? \
+ (pi)->fontAscent : (pi)->ink_maxbounds.ascent)
+#define FONT_MAX_DESCENT(pi) ((pi)->fontDescent > (pi)->ink_maxbounds.descent ? \
+ (pi)->fontDescent : (pi)->ink_maxbounds.descent)
+#define FONT_MAX_HEIGHT(pi) (FONT_MAX_ASCENT(pi) + FONT_MAX_DESCENT(pi))
+#define FONT_MIN_LEFT(pi) ((pi)->ink_minbounds.leftSideBearing < 0 ? \
+ (pi)->ink_minbounds.leftSideBearing : 0)
+#define FONT_MAX_RIGHT(pi) ((pi)->ink_maxbounds.rightSideBearing > \
+ (pi)->ink_maxbounds.characterWidth ? \
+ (pi)->ink_maxbounds.rightSideBearing : \
+ (pi)->ink_maxbounds.characterWidth)
+#define FONT_MAX_WIDTH(pi) (FONT_MAX_RIGHT(pi) - FONT_MIN_LEFT(pi))
+
+#endif /* FONTSTR_H */
diff --git a/fonts/utilities/ps2pk/fontxlfd.h b/fonts/utilities/ps2pk/fontxlfd.h
new file mode 100644
index 0000000000..9ea8090c30
--- /dev/null
+++ b/fonts/utilities/ps2pk/fontxlfd.h
@@ -0,0 +1,43 @@
+/*
+ * $XConsortium: fontxlfd.h,v 1.1 91/05/11 09:12:07 rws Exp $
+ *
+ * Copyright 1990 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Keith Packard, MIT X Consortium
+ */
+
+#ifndef _FONTXLFD_H_
+#define _FONTXLFD_H_
+
+
+typedef struct _FontScalable {
+ int pixel,
+ point,
+ x,
+ y,
+ width;
+} FontScalableRec, *FontScalablePtr;
+
+#define FONT_XLFD_REPLACE_NONE 0
+#define FONT_XLFD_REPLACE_STAR 1
+#define FONT_XLFD_REPLACE_ZERO 2
+#define FONT_XLFD_REPLACE_VALUE 3
+
+#endif /* _FONTXLFD_H_ */
diff --git a/fonts/utilities/ps2pk/fsmasks.h b/fonts/utilities/ps2pk/fsmasks.h
new file mode 100644
index 0000000000..dba6e8ec61
--- /dev/null
+++ b/fonts/utilities/ps2pk/fsmasks.h
@@ -0,0 +1,72 @@
+/* $XConsortium: fsmasks.h,v 1.2 91/05/13 16:46:16 gildea Exp $ */
+/*
+ * Copyright 1990, 1991 Network Computing Devices;
+ * Portions Copyright 1987 by Digital Equipment Corporation and the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this protoype software
+ * and its documentation to Members and Affiliates of the MIT X Consortium
+ * any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Network Computing Devices, Digital or
+ * MIT not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission.
+ *
+ * NETWORK COMPUTING DEVICES, DIGITAL AND MIT DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, DIGITAL OR MIT BE
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * @(#)fsmasks.h 4.1 91/05/02
+ *
+ */
+
+/*
+ * masks & values used by the font lib and the font server
+ */
+
+#ifndef _FSMASKS_H_
+#define _FSMASKS_H_
+
+#include "types.h"
+
+/* font format macros */
+#define BitmapFormatByteOrderMask (1L << 0)
+#define BitmapFormatBitOrderMask (1L << 1)
+#define BitmapFormatImageRectMask (3L << 2)
+#define BitmapFormatScanlinePadMask (3L << 8)
+#define BitmapFormatScanlineUnitMask (3L << 12)
+
+#define BitmapFormatByteOrderLSB (0)
+#define BitmapFormatByteOrderMSB (1L << 0)
+#define BitmapFormatBitOrderLSB (0)
+#define BitmapFormatBitOrderMSB (1L << 1)
+
+#define BitmapFormatImageRectMin (0L << 2)
+#define BitmapFormatImageRectMaxWidth (1L << 2)
+#define BitmapFormatImageRectMax (2L << 2)
+
+#define BitmapFormatScanlinePad8 (0L << 8)
+#define BitmapFormatScanlinePad16 (1L << 8)
+#define BitmapFormatScanlinePad32 (2L << 8)
+#define BitmapFormatScanlinePad64 (3L << 8)
+
+#define BitmapFormatScanlineUnit8 (0L << 12)
+#define BitmapFormatScanlineUnit16 (1L << 12)
+#define BitmapFormatScanlineUnit32 (2L << 12)
+#define BitmapFormatScanlineUnit64 (3L << 12)
+
+#define BitmapFormatMaskByte (1L << 0)
+#define BitmapFormatMaskBit (1L << 1)
+#define BitmapFormatMaskImageRectangle (1L << 2)
+#define BitmapFormatMaskScanLinePad (1L << 3)
+#define BitmapFormatMaskScanLineUnit (1L << 4)
+
+typedef uint32_t fsBitmapFormat;
+typedef uint32_t fsBitmapFormatMask;
+
+#endif /* _FSMASKS_H_ */
diff --git a/fonts/utilities/ps2pk/hdigit.h b/fonts/utilities/ps2pk/hdigit.h
new file mode 100644
index 0000000000..adee64dd00
--- /dev/null
+++ b/fonts/utilities/ps2pk/hdigit.h
@@ -0,0 +1,94 @@
+/* $XConsortium: hdigit.h,v 1.2 91/10/10 11:18:11 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* -------------------------------------- */
+/* --- MACHINE GENERATED, DO NOT EDIT --- */
+/* -------------------------------------- */
+
+#ifndef HDIGIT
+#define HDIGIT 1
+
+/*
+ * Hex Digit Value Table --
+ *
+ * The entries in the Digit Value Table map character codes in the set
+ * {0-9,a-f,A-F} to their numeric values for readhexstring
+ * (00 10...F0 for the high hex digit and 00 01...0F for the low).
+ * The white-space and hex string termination characters are.
+ * mapped to codes > 0xf0 to enable usage by several modules.
+ * 2 tables are build HighHex and LowHex.
+ *
+ */
+
+/* Indicators for special characters in these tables */
+#define HERROR (0xfe)
+#define HWHITE_SPACE (0xfd)
+#define HRIGHT_ANGLE (0xfc)
+#define LAST_HDIGIT (0xf0)
+
+#define HighHexP (HighHex+1)
+unsigned char HighHex[257] = { 0xFF,
+ 0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFD,0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xFE,0xFE,0xFE,0xFE,0xFC,0xFE,
+ 0xFE,0xA0,0xB0,0xC0,0xD0,0xE0,0xF0,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xA0,0xB0,0xC0,0xD0,0xE0,0xF0,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE
+};
+#define LowHexP (LowHex+1)
+unsigned char LowHex[257] = { 0xFF,
+ 0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFD,0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0xFE,0xFE,0xFE,0xFE,0xFC,0xFE,
+ 0xFE,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
+ 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE
+};
+
+#endif
diff --git a/fonts/utilities/ps2pk/hints.c b/fonts/utilities/ps2pk/hints.c
new file mode 100644
index 0000000000..5cd52aab7e
--- /dev/null
+++ b/fonts/utilities/ps2pk/hints.c
@@ -0,0 +1,916 @@
+/* $XConsortium: hints.c,v 1.4 91/10/10 11:18:13 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+ /* HINTS CWEB V0006 ******** */
+/*
+:h1.HINTS Module - Processing Rasterization Hints
+
+&author. Sten F. Andler; continuity by Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) and Duaine
+W. Pryor, Jr.
+
+
+:h3.Include Files
+
+The included files are:
+*/
+
+#include "types.h"
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "regions.h"
+#include "hints.h"
+
+/*
+:h3.Functions Provided to the TYPE1IMAGER User
+
+None.
+*/
+
+/*
+:h3.Functions Provided to Other Modules
+
+This module provides the following entry point to other modules:
+*/
+
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h3.Macros Provided to Other Modules
+
+None.
+*/
+
+/*
+:h2.InitHints() - Initialize hint data structure
+*/
+
+#define MAXLABEL 20
+static struct {
+ int inuse;
+ int computed;
+ struct fractpoint hint;
+} oldHint[MAXLABEL];
+
+#define ODD(x) (((int)(x)) & 01)
+#define FPFLOOR(fp) TOFRACTPEL((fp) >> FRACTBITS)
+#define FPROUND(fp) FPFLOOR((fp) + FPHALF)
+
+void InitHints(void)
+{
+ int i;
+
+ for (i = 0; i < MAXLABEL; i++)
+ {
+ oldHint[i].inuse = FALSE;
+ oldHint[i].computed = FALSE;
+ }
+}
+
+/*
+:h3.CloseHints(hintP) - Reverse hints that are still open
+*/
+
+void CloseHints(struct fractpoint *hintP)
+{
+ int i;
+
+ for (i = 0; i < MAXLABEL; i++)
+ {
+ if (oldHint[i].inuse)
+ {
+ hintP->x -= oldHint[i].hint.x;
+ hintP->y -= oldHint[i].hint.y;
+
+ oldHint[i].inuse = FALSE;
+
+ IfTrace3((HintDebug > 1)," Hint %d was open, hint=(%dl,%dl)\n",
+ i, hintP->x, hintP->y);
+ }
+ }
+}
+
+/*
+:h3.ComputeHint(hP, currX, currY, hintP) - Compute the value of a hint
+*/
+
+static void ComputeHint(struct hintsegment *hP, fractpel currX, fractpel currY,
+ struct fractpoint *hintP)
+{
+ fractpel currRef = 0, currWidth = 0;
+ int idealWidth;
+ fractpel hintValue = 0;
+ char orientation;
+
+/*
+By construction, width is never zero. Therefore we can use the
+width value to determine if the hint has been rotated by a
+multiple of 90 degrees.
+*/
+
+ if (hP->width.y == 0)
+ {
+ orientation = 'v'; /* vertical */
+ IfTrace0((HintDebug > 0)," vertical hint\n");
+ }
+ else if (hP->width.x == 0)
+ {
+ orientation = 'h'; /* horizontal */
+ IfTrace0((HintDebug > 0)," horizontal hint\n");
+ }
+ else
+ {
+ IfTrace0((HintDebug > 0)," hint not vertical or horizontal\n");
+ hintP->x = hintP->y = 0;
+ return;
+ }
+
+ /* Compute currRef and currWidth with a unit of 1 pel */
+ if (orientation == 'v') /* vertical */
+ {
+ currRef = hP->ref.x + currX;
+ currWidth = ABS(hP->width.x);
+ }
+ else if (orientation == 'h') /* horizontal */
+ {
+ currRef = hP->ref.y + currY;
+ currWidth = ABS(hP->width.y);
+ }
+ else /* error */
+ {
+ t1_abort("ComputeHint: invalid orientation");
+ }
+
+ IfTrace4((HintDebug > 1),
+ " currX=%dl, currY=%dl, currRef=%dl, currWidth=%dl\n",
+ currX, currY,
+ currRef, currWidth);
+
+ if ((hP->hinttype == 'b') /* Bar or stem */
+ || (hP->hinttype == 's')) /* Serif */
+ {
+ idealWidth = NEARESTPEL(currWidth);
+ if (idealWidth == 0) idealWidth = 1;
+ if (ODD(idealWidth)) /* Is ideal width odd? */
+ {
+ /* center "ref" over pel */
+ hintValue = FPFLOOR(currRef) + FPHALF - currRef;
+ }
+ else
+ {
+ /* align "ref" on pel boundary */
+ hintValue = FPROUND(currRef) - currRef;
+ }
+ if (HintDebug > 2) {
+ IfTrace1(TRUE," idealWidth=%d, ", idealWidth);
+ }
+ }
+ else if (hP->hinttype == 'c') /* Curve extrema */
+ {
+ /* align "ref" on pel boundary */
+ hintValue = FPROUND(currRef) - currRef;
+ }
+ else /* error */
+ {
+ t1_abort("ComputeHint: invalid hinttype");
+ }
+
+ IfTrace1((HintDebug > 1)," hintValue=%dl", hintValue);
+
+ if (orientation == 'v') /* vertical */
+ {
+ hintP->x = hintValue;
+ hintP->y = 0;
+ }
+ else if (orientation == 'h') /* horizontal */
+ {
+ hintP->x = 0;
+ hintP->y = hintValue;
+ }
+ else /* error */
+ {
+ t1_abort("ComputeHint: invalid orientation");
+ }
+}
+
+/*
+:h3.ProcessHint(hP, currX, currY, hintP) - Process a rasterization hint
+*/
+
+void ProcessHint(struct hintsegment *hP, fractpel currX, fractpel currY,
+ struct fractpoint *hintP)
+{
+ struct fractpoint thisHint = { 0, 0 };
+
+ IfTrace4((HintDebug > 1)," ref=(%dl,%dl), width=(%dl,%dl)",
+ hP->ref.x, hP->ref.y,
+ hP->width.x, hP->width.y);
+ IfTrace4((HintDebug > 1),", %c %c %c %c",
+ hP->orientation, hP->hinttype,
+ hP->adjusttype, hP->direction);
+ IfTrace1((HintDebug > 1),", label=%d\n", hP->label);
+
+ if ((hP->adjusttype == 'm') /* Move */
+ || (hP->adjusttype == 'a')) /* Adjust */
+ {
+ /* Look up hint in oldHint table */
+ if ((hP->label >= 0) && (hP->label < MAXLABEL))
+ {
+ if (oldHint[hP->label].computed)
+ /* Use old hint value if already computed */
+ {
+ thisHint.x = oldHint[hP->label].hint.x;
+ thisHint.y = oldHint[hP->label].hint.y;
+ oldHint[hP->label].inuse = TRUE;
+ }
+ else
+ /* Compute new value for hint and store it for future use */
+ {
+ ComputeHint(hP, currX, currY, &thisHint);
+
+ oldHint[hP->label].hint.x = thisHint.x;
+ oldHint[hP->label].hint.y = thisHint.y;
+ oldHint[hP->label].inuse = TRUE;
+ oldHint[hP->label].computed = TRUE;
+ }
+ }
+ else /* error */
+ {
+ t1_abort("ProcessHint: invalid label");
+ }
+ }
+ else if (hP->adjusttype == 'r') /* Reverse */
+ {
+ /* Use the inverse of the existing hint value to reverse hint */
+ if ((hP->label >= 0) && (hP->label < MAXLABEL))
+ {
+ if (oldHint[hP->label].inuse)
+ {
+ thisHint.x = -oldHint[hP->label].hint.x;
+ thisHint.y = -oldHint[hP->label].hint.y;
+ oldHint[hP->label].inuse = FALSE;
+ }
+ else /* error */
+ {
+ t1_abort("ProcessHint: label is not in use");
+ }
+ }
+ else /* error */
+ {
+ t1_abort("ProcessHint: invalid label");
+ }
+
+ }
+ else /* error */
+ {
+ t1_abort("ProcessHint: invalid adjusttype");
+ }
+ IfTrace3((HintDebug > 1)," label=%d, thisHint=(%dl,%dl)\n",
+ hP->label, thisHint.x, thisHint.y);
+
+ hintP->x += thisHint.x;
+ hintP->y += thisHint.y;
+
+ IfTrace2((HintDebug > 1)," hint=(%dl,%dl)\n",
+ hintP->x, hintP->y);
+}
+
+/*
+:h2 id=subpath.Navigation Through Edge Lists
+
+For continuity checking purposes, we need to navigate through edge
+lists by the "subpath" chains and answer questions about edges. The
+subpath chain links together edges that were part of the same subpath
+(no intervening move segments) when the interior of the path was
+calculated. Here we use the term "edge" to mean every edge list
+that was created in between changes of direction.
+
+The subpath chains are singly-linked circular chains. For the convenience
+of building them, they direction of the list (from edge to edge) is the
+reverse of the order in which they were built. Within any single edge,
+the subpath chain goes from top-to-bottom. (There might be a violation
+of this because of the way the user started the first chain; see
+:hdref refid=fixsubp..).
+
+:h3.ISTOP() and ISBOTTOM() - Flag Bits for Edge Lists at the Top and
+Bottom of Their SubPaths
+*/
+
+#define ISTOP(flag) ((flag)&0x20)
+#define ISBOTTOM(flag) ((flag)&0x10)
+/*
+:h3.ISLEFT() - Flag Bit for Left Edges
+*/
+
+#define ISLEFT(flag) ((flag)&0x08)
+
+/*
+:h3.XofY() - Macro to Find X Value at Given Y
+
+This macro can only be used if it is known that the Y is within the
+given edgelist's ymin and ymax.
+*/
+
+#define XofY(edge, y) edge->xvalues[y - edge->ymin]
+
+/*
+:h3.findXofY() - Like XofY(), Except not Restricted
+
+If the Y is out of bounds of the given edgelist, this macro will
+call SearchXofY to search the edge's subpath chain for the correct
+Y range. If the Y value is off the edge, MINPEL is returned.
+*/
+#define findXofY(edge, y) ((y < edge->ymin || y >= edge->ymax) ? SearchXofY(edge, y) : XofY(edge, y))
+
+/*
+:h4.SearchXofY() - Routine Called by FindXofY() for Difficult Cases
+
+The concept of this routine is to follow the subpath chain to find the
+edge just below (i.e., next in chain) or just above (i.e., immediately
+before in chain. It is assumed that the Y value is no more than one
+off of the edge's range; XofY() could be replace by FindXofY() to
+call ourselves recursively if this were not true.
+*/
+
+static pel SearchXofY(
+ register struct edgelist *edge, /* represents edge */
+ register pel y) /* 'y' value to find edge for */
+{
+ register struct edgelist *e; /* loop variable */
+
+ if (y < edge->ymin) {
+ if (ISTOP(edge->flag))
+ return(MINPEL);
+ for (e = edge->subpath; e->subpath != edge; e = e->subpath) { ; }
+ if (e->ymax == edge->ymin)
+ return(XofY(e, y));
+ }
+ else if (y >= edge->ymax) {
+ if (ISBOTTOM(edge->flag))
+ return(MINPEL);
+ e = edge->subpath;
+ if (e->ymin == edge->ymax)
+ return(XofY(e, y));
+ }
+ else
+ return(XofY(edge, y));
+
+ t1_abort("bad subpath chain");
+
+ /*NOTREACHED*/
+ return MINPEL;
+}
+/*
+:h3.ISBREAK() Macro - Tests if an Edge List is at a "Break"
+
+The subpath chains are organized top to bottom. When the bottom of
+a given edge is reached, the subpath chain points to the top of the
+next edge. We call this a "break" in the chain. The following macro
+is the simple test for the break condition:
+*/
+
+#define ISBREAK(top,bot) (top->ymax != bot->ymin)
+
+
+/*
+:h3.ImpliedHorizontalLine() - Tests for Horizontal Connectivity
+
+This function returns true if two edges are connected horizontally.
+They are connected horizontally if they are consecutive in the subpath,
+and either we are at the bottom and the first edge is going down or we
+are at the top and the first edge is going up.
+*/
+
+#define BLACKABOVE -1
+#define BLACKBELOW +1
+#define NONE 0
+
+static int ImpliedHorizontalLine(
+ register struct edgelist *e1, /* two edges ... */
+ register struct edgelist *e2, /* ... to check */
+ register int y) /* y where they might be connected */
+{
+ register struct edgelist *e3,*e4;
+
+ if (ISDOWN(e1->flag) == ISDOWN(e2->flag))
+ return(NONE); /* can't be consecutive unless different directions */
+/*
+Now we check for consecutiveness: Can we get from 'e1' to 'e2' with
+only one intervening break? Can we get from 'e2' to 'e1' with only one
+intervening break? 'e3' will be as far as we can get after 'e1'; 'e4'
+will be has far as we can get after 'e2':
+*/
+ for (e3 = e1; !ISBREAK(e3, e3->subpath); e3 = e3->subpath) { ; }
+ for (e3 = e3->subpath; e3 != e2; e3 = e3->subpath)
+ if (ISBREAK(e3, e3->subpath))
+ break;
+
+ for (e4 = e2; !ISBREAK(e4, e4->subpath); e4 = e4->subpath) { ; }
+ for (e4 = e4->subpath; e4 != e1; e4 = e4->subpath)
+ if (ISBREAK(e4, e4->subpath))
+ break;
+/*
+If the edges are mutually consecutive, we must have horizontal lines
+both top and bottom:
+*/
+ if (e3 == e2 && e4 == e1)
+ return(TRUE);
+/*
+If the edges are not consecutive either way, no horizontal lines are
+possible:
+*/
+ if (e3 != e2 && e4 != e1)
+ return(NONE);
+/*
+Now let's swap 'e1' and 'e2' if necessary to enforce the rule that 'e2'
+follows 'e1'. Remember that subpath chains go in the opposite direction
+from the way the subpaths were built; this led to the simplest way
+do build them.
+*/
+ if (e4 != e1) {
+ e2 = e1;
+ e1 = e3; /* remember e3 == e2, this just swaps 'e1' and 'e2' */
+ }
+/*
+Now we have everything to return the answer:
+*/
+ if (ISTOP(e1->flag) && y == e1->ymin)
+ return(ISDOWN(e2->flag));
+ else if (ISBOTTOM(e1->flag) && y == e1->ymax)
+ return(!ISDOWN(e2->flag));
+ else
+ t1_abort("ImpliedHorizontalLine: why ask?");
+ /*NOTREACHED*/
+ return 0;
+}
+
+/*
+:h3 id=fixsubp.FixSubPaths() - Must be Called to Organize Subpath Chains
+
+The region-building code in Interior(), in particular splitedge(),
+maintains the rule that sub-paths are linked top-to-bottom except
+at breaks. However, it is possible that there may be a "false break"
+because the user started the subpath in the middle of an edge (and
+went in the "wrong" direction from there, up instead of down). This
+routine finds and fixes false breaks.
+
+Also, this routine sets the ISTOP and ISBOTTOM flags in the edge lists.
+*/
+
+static void FixSubPaths(
+ register struct region *R) /* anchor of region */
+{
+ register struct edgelist *e; /* fast loop variable */
+ register struct edgelist *edge; /* current edge in region */
+ register struct edgelist *next; /* next in subpath after 'edge' */
+ register struct edgelist *break1; /* first break after 'next' */
+ register struct edgelist *break2 = NULL; /* last break before 'edge' */
+ register struct edgelist *prev; /* previous edge for fixing links */
+ int left = TRUE;
+
+ for (edge = R->anchor; edge != NULL; edge = edge->link) {
+
+ if (left)
+ edge->flag |= ISLEFT(ON);
+ left = !left;
+
+ next = edge->subpath;
+
+ if (!ISBREAK(edge, next))
+ continue;
+ if (edge->ymax < next->ymin)
+ t1_abort("disjoint subpath?");
+/*
+'edge' now contains an edgelist at the bottom of an edge, and 'next'
+contains the next subsequent edgelist in the subpath, which must be at
+the top. We refer to this a "break" in the subpath.
+*/
+ next->flag |= ISTOP(ON);
+ edge->flag |= ISBOTTOM(ON);
+
+ if (ISDOWN(edge->flag) != ISDOWN(next->flag))
+ continue;
+/*
+We are now in the unusual case; both edges are going in the same
+direction so this must be a "false break" due to the way that the user
+created the path. We'll have to fix it.
+*/
+ for (break1 = next; !ISBREAK(break1, break1->subpath); break1 = break1->subpath) { ; }
+
+ for (e = break1->subpath; e != edge; e = e->subpath)
+ if (ISBREAK(e, e->subpath))
+ break2 = e;
+/*
+Now we've set up 'break1' and 'break2'. I've found the following
+diagram invaluable. 'break1' is the first break after 'next'. 'break2'
+is the LAST break before 'edge'.
+&drawing.
+ next
+ +------+ +---->+------+
+ +--->| >-----+ | | >-----+
+ | | | | | | | |
+ | +-------------+ | +-------------+
+ | | |break1| | | | |
+ | +->| >-------+ +->| >-----+
+ | | | | | |
+ | | | +-------------+
+ | +------+ | | |
+ | +----------------+ | | |
+ | | +------+ | +->| >-----+
+ | +->| >-----+ | | | |
+ | | | | | +-------------+
+ | +-------------+ | | | |
+ | | |edge | | | |break2|
+ | +->| >-----+ | +->| >-----+
+ | | | | | | | |
+ | | | | | | | |
+ | | | | | | | |
+ | +------+ | | +------+ |
+ | | | |
+ +---------------+ +---------------+
+
+&edrawing.
+We want to fix this situation by having 'edge' point to where 'break1'
+now points, and having 'break1' point to where 'break2' now points.
+Finally, 'break2' should point to 'next'. Also, we observe that
+'break1' can't be a bottom, and is also not a top unless it is the same
+as 'next':
+*/
+ edge->subpath = break1->subpath;
+
+ break1->subpath = break2->subpath;
+ if (ISBREAK(break1, break1->subpath))
+ t1_abort("unable to fix subpath break?");
+
+ break2->subpath = next;
+
+ break1->flag &= ~ISBOTTOM(ON);
+ if (break1 != next)
+ break1->flag &= ~ISTOP(ON);
+ }
+/*
+This region might contain "ambiguous" edges; edges exactly equal to
+edge->link. Due to the random dynamics of where they get sorted into
+the list, they can yield false crossings, where the edges appear
+to cross. This confuses our continuity logic no end. Since we can
+swap them without changing the region, we do.
+*/
+ for (edge = R->anchor, prev = NULL; VALIDEDGE(edge); prev = edge, edge = prev->link) {
+
+ if (! ISAMBIGUOUS(edge->flag))
+ continue;
+
+ next = edge->subpath;
+
+ while (ISAMBIGUOUS(next->flag) && next != edge)
+ next = next->subpath;
+/*
+We've finally found a non-ambiguous edge; we make sure it is left/right
+compatible with 'edge':
+*/
+ if ( (ISLEFT(edge->flag) == ISLEFT(next->flag) && ISDOWN(edge->flag) == ISDOWN(next->flag) )
+ || (ISLEFT(edge->flag) != ISLEFT(next->flag) && ISDOWN(edge->flag) != ISDOWN(next->flag) ) )
+ continue;
+
+/*
+Incompatible, we will swap 'edge' and the following edge in the list.
+You may think that there must be a next edge in this swath. So did I.
+No! If there is a totally ambiguous inner loop, for example, we could
+get all the way to the outside without resolving ambiguity.
+*/
+ next = edge->link; /* note new meaning of 'next' */
+ if (next == NULL || edge->ymin != next->ymin)
+ continue;
+ if (prev == NULL)
+ R->anchor = next;
+ else
+ prev->link = next;
+ edge->link = next->link;
+ next->link = edge;
+ edge->flag ^= ISLEFT(ON);
+ edge->flag &= ~ISAMBIGUOUS(ON);
+ next->flag ^= ISLEFT(ON);
+ next->flag &= ~ISAMBIGUOUS(ON);
+ edge = next;
+ }
+}
+/*
+:h3.DumpSubPaths()
+
+A debug tool.
+*/
+
+static struct edgelist *before(struct edgelist *); /* subroutine of DumpSubPaths */
+
+static void DumpSubPaths(struct edgelist *anchor)
+{
+
+ register struct edgelist *edge,*e,*e2;
+ pel y;
+
+ for (edge = anchor; VALIDEDGE(edge); edge = edge->link) {
+ if (ISPERMANENT(edge->flag))
+ continue;
+ IfTrace0(TRUE, "BEGIN Subpath\n");
+ for (e2 = edge; !ISPERMANENT(e2->flag);) {
+ if (ISDOWN(e2->flag)) {
+ IfTrace1(TRUE, ". Downgoing edge's top at %p\n", e2);
+ for (e = e2;; e = e->subpath) {
+ IfTrace4(TRUE, ". . [%5d] %5d @ %p[%x]\n",
+ e->ymin, *e->xvalues, e, e->flag);
+ for (y=e->ymin+1; y < e->ymax; y++)
+ IfTrace2(TRUE, ". . [%5d] %5d \"\n", y, e->xvalues[y-e->ymin]);
+ e->flag |= ISPERMANENT(ON);
+ if (ISBREAK(e, e->subpath))
+ break;
+ }
+ }
+ else {
+ IfTrace1(TRUE, ". Upgoing edge's top at %p\n", e2);
+ for (e = e2; !ISBREAK(e, e->subpath); e = e->subpath) { ; }
+ for (;; e=before(e)) {
+ IfTrace4(TRUE, ". . [%5d] %5d @ %p[%x]\n",
+ e->ymax-1, e->xvalues[e->ymax-1-e->ymin], e, e->flag);
+ for (y=e->ymax-2; y >= e->ymin; y--)
+ IfTrace2(TRUE, ". . [%5d] %5d \"\n", y, e->xvalues[y-e->ymin]);
+ e->flag |= ISPERMANENT(ON);
+ if (e == e2)
+ break;
+ }
+ }
+ do {
+ e2 = before(e2);
+ } while (!ISBREAK(before(e2), e2));
+ }
+ }
+}
+
+static struct edgelist *before(struct edgelist *e)
+{
+ struct edgelist *r;
+ for (r = e->subpath; r->subpath != e; r = r->subpath) { ; }
+ return(r);
+}
+
+/*
+:h2.Fixing Region Continuity Problems
+
+Small regions may become disconnected when their connecting segments are
+less than a pel wide. This may be correct in some applications, but in
+many (especially small font characters), it is more pleasing to keep
+connectivity. ApplyContinuity() (invoked by +CONTINUITY on the
+Interior() fill rule) fixes connection breaks. The resulting region
+is geometrically less accurate, but may be more pleasing to the eye.
+*/
+/*
+Here are some macros which we will need:
+*/
+
+#define IsValidPel(j) (j!=MINPEL)
+
+/*
+:h3.writeXofY() - Stuffs an X Value Into an "edgelist"
+
+writeXofY writes an x value into an edge at position 'y'. It must
+update the edge's xmin and xmax. If there is a possibility that this
+new x might exceed the region's bounds, updating those are the
+responsibility of the caller.
+*/
+
+static void writeXofY(
+ struct edgelist *e, /* relevant edgelist */
+ int y, /* y value */
+ int x) /* new x value */
+{
+ if (e->xmin > x) e->xmin = x;
+ if (e->xmax < x) e->xmax = x;
+ e->xvalues[y - e->ymin] = x;
+}
+
+/*-------------------------------------------------------------------------*/
+/* the following three macros tell us whether we are at a birth point, a */
+/* death point, or simply in the middle of the character */
+/*-------------------------------------------------------------------------*/
+#define WeAreAtTop(e,i) (ISTOP(e->flag) && e->ymin == i)
+#define WeAreAtBottom(e,i) (ISBOTTOM(e->flag) && e->ymax-1 == i)
+#define WeAreInMiddle(e,i) \
+ ((!ISTOP(e->flag) && !ISBOTTOM(e->flag))||(i < e->ymax-1 && i > e->ymin))
+/*
+The following macro tests if two "edgelist" structures are in the same
+swath:
+*/
+#define SAMESWATH(e1,e2) (e1->ymin == e2->ymin)
+
+/*
+:h3.CollapseWhiteRun() - Subroutine of ApplyContinuity()
+
+When we have a white run with an implied horizontal line above or
+below it, we better have black on the other side of this line. This
+function both tests to see if black is there, and adjusts the end
+points (collapses) the white run as necessary if it is not. The
+goal is to collapse the white run as little as possible.
+*/
+
+static void CollapseWhiteRun(
+ struct edgelist *anchor, /* anchor of edge list */
+ pel yblack, /* y of (hopefully) black run above or below */
+ struct edgelist *left, /* edgelist at left of WHITE run */
+ struct edgelist *right, /* edgelist at right of WHITE run */
+ pel ywhite) /* y location of white run */
+{
+ struct edgelist *edge;
+ struct edgelist *swathstart = anchor;
+ register pel x;
+
+ if (XofY(left, ywhite) >= XofY(right, ywhite))
+ return;
+/*
+Find the swath with 'yblack'. If we don't find it, completely collapse
+the white run and return:
+*/
+ while (VALIDEDGE(swathstart)) {
+ if (yblack < swathstart->ymin) {
+ writeXofY(left, ywhite, XofY(right, ywhite));
+ return;
+ }
+ if (yblack < swathstart->ymax) break;
+ swathstart = swathstart->link->link;
+ }
+ if(!VALIDEDGE(swathstart)) {
+ writeXofY(left, ywhite, XofY(right, ywhite));
+ return;
+ }
+/*
+Now we are in the swath that contains 'y', the reference line above
+or below that we are trying to maintain continuity with. If black
+in this line begins in the middle of our white run, we must collapse
+the white run from the left to that point. If black ends in the
+middle of our white run, we must collapse the white run from the right
+to that point.
+*/
+ for (edge = swathstart; VALIDEDGE(edge); edge = edge->link) {
+
+ if (!SAMESWATH(swathstart,edge))
+ break;
+ if( XofY(edge, yblack) > XofY(left, ywhite)) {
+ if (ISLEFT(edge->flag)) {
+ x = XofY(edge, yblack);
+ if (XofY(right, ywhite) < x)
+ x = XofY(right, ywhite);
+ writeXofY(left, ywhite, x);
+ }
+ else {
+ x = XofY(edge, yblack);
+ while (edge->link != NULL && SAMESWATH(edge, edge->link)
+ && x >= XofY(edge->link, yblack) ) {
+ edge = edge->link->link;
+ x = XofY(edge, yblack);
+ }
+ if (x < XofY(right, ywhite))
+ writeXofY(right, ywhite, x);
+ return;
+ }
+ }
+ }
+ writeXofY(left, ywhite, XofY(right, ywhite));
+}
+
+/*
+:h3.ApplyContinuity() - Fix False Breaks in a Region
+
+This is the externally visible routine called from the REGIONS module
+when the +CONTINUITY flag is on the Interior() fill rule.
+*/
+
+void ApplyContinuity(struct region *R)
+{
+ struct edgelist *left;
+ struct edgelist *right;
+ struct edgelist *edge,*e2;
+ pel rightXabove,rightXbelow,leftXabove,leftXbelow;
+ pel leftX,rightX;
+ int i;
+ int32_t newcenter,abovecenter,belowcenter;
+
+ FixSubPaths(R);
+ if (RegionDebug >= 3)
+ DumpSubPaths(R->anchor);
+ left = R->anchor;
+/* loop through and do all of the easy checking. ( no tops or bottoms) */
+ while(VALIDEDGE(left))
+ {
+ right = left->link;
+ for(i=left->ymin;i<left->ymax;++i)
+ {
+ leftX = findXofY(left,i);
+ rightX = findXofY(right,i);
+ leftXbelow = findXofY(left,i+1);
+ rightXbelow = findXofY(right,i+1);
+ if(rightX <= leftX)
+ {
+/* then, we have a break in a near vertical line */
+ leftXabove = findXofY(left,i-1);
+ rightXabove = findXofY(right,i-1);
+ if( IsValidPel(leftXabove) && IsValidPel(rightXabove) )
+ {
+ abovecenter = leftXabove + rightXabove;
+ }
+ else
+ {
+ abovecenter = leftX + rightX;
+ }
+ if( IsValidPel(leftXbelow) && IsValidPel(rightXbelow) )
+ {
+ belowcenter = leftXbelow + rightXbelow;
+ }
+ else
+ {
+ belowcenter = leftX + rightX;
+ }
+ newcenter = abovecenter + belowcenter;
+ if( newcenter > 4*leftX )
+ {
+ rightX = rightX + 1;
+ }
+ else if( newcenter < 4*leftX)
+ {
+ leftX = leftX - 1;
+ }
+ else
+ {
+ rightX = rightX + 1;
+ }
+ writeXofY(right,i,rightX);
+ writeXofY(left,i,leftX);
+ if(rightX > R->xmax) {R->xmax = rightX;}
+ if(leftX < R->xmin) {R->xmin = leftX;}
+ }
+ if( !WeAreAtBottom(left,i) && (leftXbelow>=rightX))
+ {
+/* then we have a break in a near horizontal line in the middle */
+ writeXofY(right,i,leftXbelow);
+ }
+ if( !WeAreAtBottom(right,i) && (leftX >=rightXbelow))
+ {
+/* then we have a break in a near horizontal line in the middle */
+ writeXofY(left,i,rightXbelow);
+ }
+ }
+ left = right->link;
+ }
+/*
+There may be "implied horizontal lines" between edges that have
+implications for continuity. This loop looks for white runs that
+have implied horizontal lines on the top or bottom, and calls
+CollapseWhiteRuns to check and fix any continuity problems from
+them.
+*/
+ for (edge = R->anchor; VALIDEDGE(edge); edge = edge->link) {
+ if ((!ISTOP(edge->flag) && !ISBOTTOM(edge->flag)) || ISLEFT(edge->flag))
+ continue; /* at some future date we may want left edge logic here too */
+ for (e2 = edge->link; VALIDEDGE(e2) && SAMESWATH(edge,e2); e2 = e2->link) {
+ if (ISTOP(e2->flag) && ISTOP(edge->flag)
+ && NONE != ImpliedHorizontalLine(edge,e2,edge->ymin)) {
+ if (ISLEFT(e2->flag))
+ CollapseWhiteRun(R->anchor, edge->ymin-1,
+ edge, e2, edge->ymin);
+ }
+ if (ISBOTTOM(e2->flag) && ISBOTTOM(edge->flag)
+ && NONE != ImpliedHorizontalLine(edge,e2, edge->ymax)) {
+ if (ISLEFT(e2->flag))
+ CollapseWhiteRun(R->anchor, edge->ymax,
+ edge, e2, edge->ymax-1);
+ }
+ }
+ }
+}
+
+
+
+
diff --git a/fonts/utilities/ps2pk/hints.h b/fonts/utilities/ps2pk/hints.h
new file mode 100644
index 0000000000..a3f91675cb
--- /dev/null
+++ b/fonts/utilities/ps2pk/hints.h
@@ -0,0 +1,43 @@
+/* $XConsortium: hints.h,v 1.2 91/10/10 11:18:19 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/*SHARED*/
+
+#define InitHints t1_InitHints
+void t1_InitHints(void); /* Initialize hint data structure */
+
+#define CloseHints(hintP) t1_CloseHints(hintP)
+void t1_CloseHints(struct fractpoint *); /* Reverse hints that are still open */
+
+#define ProcessHint(hP, currX, currY, hintP) t1_ProcessHint(hP, currX, currY, hintP)
+void t1_ProcessHint(struct hintsegment *, fractpel, fractpel,
+ struct fractpoint *); /* Process a rasterization hint */
+
+#define ApplyContinuity(R) t1_ApplyContinuity(R)
+void t1_ApplyContinuity(struct region *); /* fix false connection breaks in a region */
+/*END SHARED*/
diff --git a/fonts/utilities/ps2pk/lines.c b/fonts/utilities/ps2pk/lines.c
new file mode 100644
index 0000000000..41a1d5beb2
--- /dev/null
+++ b/fonts/utilities/ps2pk/lines.c
@@ -0,0 +1,194 @@
+/* $XConsortium: lines.c,v 1.2 91/10/10 11:18:21 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+ /* LINES CWEB V0003 ******** */
+/*
+:h1.LINES Module - Rasterizing Lines
+
+&author. Duaine W. Pryor, Jr. and Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com)
+
+
+:h3.Include Files
+
+The included files are:
+*/
+
+#include "types.h"
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "regions.h"
+#include "lines.h"
+
+/*
+:h3.Functions Provided to the TYPE1IMAGER User
+
+None.
+*/
+
+/*
+:h3.Functions Provided to Other Modules
+
+This module provides the following entry point to other modules:
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h3.Macros Provided to Other Modules
+
+None.
+*/
+
+/*
+:h2.StepLine() - Produces Run Ends for a Line After Checks
+
+The main work is done by Bresenham(); here we just perform checks and
+get the line so that its Y direction is always increasing:
+*/
+
+static void Bresenham(pel *, fractpel, fractpel, fractpel, fractpel);
+
+void StepLine(
+ register struct region *R, /* region being built */
+ register fractpel x1, /* starting ... */
+ register fractpel y1, /* ... point */
+ register fractpel x2, /* ending ... */
+ register fractpel y2) /* ... point */
+{
+ register fractpel dy;
+
+ IfTrace4((LineDebug > 0), ".....StepLine: (%dl,%dl) to (%dl,%dl)\n",
+ x1, y1, x2, y2);
+
+ dy = y2 - y1;
+
+/*
+We execute the "GOING_TO" macro to call back the REGIONS module, if
+necessary (like if the Y direction of the edge has changed):
+*/
+ GOING_TO(R, x1, y1, x2, y2, dy);
+
+ if (dy == 0)
+ return;
+
+ if (dy < 0)
+ Bresenham(R->edge, x2, y2, x1, y1);
+ else
+ Bresenham(R->edge, x1, y1, x2, y2);
+ return;
+}
+/*
+:h3.Bresenham() - Actually Produces Run Ends
+
+This routine runs a Bresenham line-stepping
+algorithm. See, for example, Newman and Sproul, :hp1/Principles
+of Interactive Computer Graphics/, pp. 25-27.
+When we enter this, we
+are guaranteed that dy is positive.
+We'd like to work in 8 bit precision, so we'll define some macros and
+constants to let us do that:
+*/
+
+#define PREC 8 /* we'll keep fraction pels in 8 bit precision */
+/*
+RoundFP() rounds down by 'b' bits:
+*/
+#define RoundFP(xy,b) (((xy)+(1<<((b)-1)))>>(b))
+
+/*
+TruncFP() truncates down by 'b' bits:
+*/
+#define TruncFP(xy,b) ((xy)>>(b))
+
+
+static void Bresenham(
+ register pel *edgeP, /* pointer to top of list (y == 0) */
+ register fractpel x1, /* starting point ... */
+ register fractpel y1, /* ... on line */
+ register fractpel x2, /* ending point ... */
+ register fractpel y2) /* ... on the line (down) */
+{
+ register int32_t dx,dy; /* change in x and y, in my own precision */
+ register int32_t x,y; /* integer pel starting point */
+ register int count; /* integer pel delta y */
+ register int32_t d; /* the Bresenham algorithm error term */
+
+ x1 = TruncFP(x1, FRACTBITS-PREC);
+ y1 = TruncFP(y1, FRACTBITS-PREC);
+ x2 = TruncFP(x2, FRACTBITS-PREC);
+ y2 = TruncFP(y2, FRACTBITS-PREC);
+
+ dx = x2 - x1;
+ dy = y2 - y1;
+/*
+Find the starting x and y integer pel coordinates:
+*/
+
+ x = RoundFP(x1,PREC);
+ y = RoundFP(y1,PREC);
+ edgeP += y;
+ count = RoundFP(y2,PREC) - y;
+/*------------------------------------------------------------------*/
+/* Force dx to be positive so that dfy will be negative */
+/* this means that vertical moves will decrease d */
+/*------------------------------------------------------------------*/
+ if (dx<0)
+ {
+ dx = -dx;
+#define P PREC
+ d=(dy*(x1-(x<<P)+(1<<(P-1)))-dx*((y<<P)-y1+(1<<(P-1))))>>P;
+#undef P
+ while(--count >= 0 )
+ {
+ while(d<0)
+ {
+ --x;
+ d += dy;
+ }
+ *(edgeP++) = x;
+ d -= dx;
+ }
+ }
+ else /* positive dx */
+ {
+#define P PREC
+ d = (dy*((x<<P)-x1+(1<<(P-1)))-dx*((y<<P)-y1+(1<<(P-1))))>>P;
+#undef P
+ while(--count >= 0 )
+ {
+ while(d<0)
+ {
+ ++x;
+ d += dy;
+ }
+ *(edgeP++) = x;
+ d -= dx;
+ }
+ }
+}
diff --git a/fonts/utilities/ps2pk/lines.h b/fonts/utilities/ps2pk/lines.h
new file mode 100644
index 0000000000..011955c299
--- /dev/null
+++ b/fonts/utilities/ps2pk/lines.h
@@ -0,0 +1,36 @@
+/* $XConsortium: lines.h,v 1.2 91/10/10 11:18:23 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/*SHARED*/
+
+#define StepLine(R,x1,y1,x2,y2) t1_StepLine(R,x1,y1,x2,y2)
+
+void t1_StepLine(struct region *, fractpel, fractpel, fractpel,
+ fractpel); /* check for special conditions, call Bresenham */
+
+/*END SHARED*/
diff --git a/fonts/utilities/ps2pk/mag.1 b/fonts/utilities/ps2pk/mag.1
new file mode 100644
index 0000000000..bf1c97ce7a
--- /dev/null
+++ b/fonts/utilities/ps2pk/mag.1
@@ -0,0 +1,68 @@
+.\" e
+.TH MAG 1 "1 Feb 2016"
+.de EX
+.sp
+.in +5
+.nf
+.ft CW
+..
+.de EE
+.in -5
+.ft R
+.sp
+.fi
+..
+.SH NAME
+mag \- computes TeX fontsizes and magsteps
+.SH SYNOPSIS
+.B
+mag
+[-\fBR\fIdpi\fP\fP] magstep . . .
+
+.B
+mag
+[-\fBr\fP] [-\fBR\fP\fIdpi\fP] fontsize . . .
+
+.SH DESCRIPTION
+.EQ
+delim $$
+.EN
+This tool calculates fontsizes given magsteps. TeXfonts are provided as
+true sized fonts or as magnifications. The fontsize of a true sized
+font equals the resolution of the printer (ex. 300). The fontsize
+of a font magnified $n$ \fImagsteps\fP equals:
+.EQ
+1.2 sup{n} times 300
+delim off
+.EN
+rounded to its nearest integer value. Fontnames for TeX fonts normally
+consists of the name (\fIcmr\fP), pointsize (\fI10\fP), type (\fIpk\fP)
+and fontsize (\fI360\fP), for example: \fIcmr10.360pk\fP.
+
+.SH EXAMPLES
+The result of \fImag -R240 -2 0 0.5 1\fP will be:
+.EX
+167 240 263 288
+.EE
+
+The inverse function is computed with the \fI-r\fP option. The result of
+\fImag -r -R240 167 240 263 288\fP
+will be the fontsteps:
+.EX
+-2 0 0.5 1
+.EE
+
+The UNIX shells allow command substitution. One can write:
+.EX
+mag -r -R240 `mag -R240 -2 0 0.5 1`
+.EE
+
+.SH DATE
+18 December, 1989
+
+.SH AUTHOR
+.nf
+Piet Tutelaers
+University of Technology Eindhoven
+Maintained in TeX Live; please send bug reports or other correspondence
+to tex-k@tug.org (http://lists.tug.org/tex-k).
diff --git a/fonts/utilities/ps2pk/mag.c b/fonts/utilities/ps2pk/mag.c
new file mode 100644
index 0000000000..3f5c6b61d5
--- /dev/null
+++ b/fonts/utilities/ps2pk/mag.c
@@ -0,0 +1,156 @@
+/*
+ * .\" e
+ * .TH MAG 1 UMFT
+ * .SH NAME
+ * mag \- computes fontsizes and magsteps
+ *
+ * .de Ex
+ * .sp
+ * .RS
+ * .nf
+ * .ft C
+ * ..
+ * .de Xe
+ * .RE
+ * .sp
+ * .fi
+ * ..
+ * .SH SYNOPSIS
+ * .B
+ * mag
+ * [-\fBR\fIdpi\fP\fP] magstep . . .
+ *
+ * .B
+ * mag
+ * [-\fBr\fP] [-\fBR\fP\fIdpi\fP] fontsize . . .
+ *
+ * .SH DESCRIPTION
+ * .EQ
+ * delim $$
+ * .EN
+ * This tool calculates fontsizes given magsteps. TeXfonts are provided as
+ * true sized fonts or as magnifications. The fontsize of a true sized
+ * font equals the resolution of the printer (ex. 300). The fontsize
+ * of a font magnified $n$ \fImagsteps\fP equals:
+ * .EQ
+ * 1.2 sup{n} times 300
+ * delim off
+ * .EN
+ * rounded to its nearest integer value. Fontnames for TeX fonts normally
+ * consists of the name (\fIcmr\fP), pointsize (\fI10\fP), type (\fIpk\fP)
+ * and fontsize (\fI360\fP), for example: \fIcmr10.360pk\fP.
+ *
+ * .SH EXAMPLES
+ * The result of \fImag -R240 -2 0 0.5 1\fP will be:
+ * .Ex
+ * 167 240 263 288
+ * .Xe
+ *
+ * The inverse function is computed with the \fI-r\fP option. The result of
+ * \fImag -r -R240 167 240 263 288\fP
+ * will be the fontsteps:
+ * .Ex
+ * -2 0 0.5 1
+ * .Xe
+ *
+ * The UNIX shells allow command substitution. One can write:
+ * .Ex
+ * mag -r -R240 `mag -R240 -2 0 0.5 1`
+ * .Xe
+ *
+ * .SH DATE
+ * August, 1992
+ *
+ * .SH AUTHOR
+ * .nf
+ * Piet Tutelaers
+ * University of Technology Eindhoven
+ */
+
+#include "basics.h" /* fatal() */
+
+#include <ctype.h>
+#include <math.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef WIN32
+#include <fcntl.h>
+#endif
+
+int invert = 0;
+float DPI = 300.0;
+
+/* Prototypes */
+static int fontsize(double);
+static double stepsize(double);
+
+int main(int argc, char *argv[]) {
+ float sz, arg; int c;
+ const char *myname = "mag";
+ short done;
+
+ while (--argc > 0 && (*++argv)[0] == '-') {
+ if (isdigit((int)(*argv)[1])) { /* allow negative numbers as arguments */
+ break;
+ }
+ done=0;
+ while ((!done) && (c = *++argv[0])) /* allow -bcK like options */
+ switch (c) {
+ case 'r':
+ invert = 1; break;
+ case 'R':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ DPI = atof(argv[0]);
+ done = 1;
+ break;
+invalid:
+ default:
+ fatal("%s: %c invalid option\n", myname, c);
+ }
+ }
+
+ if (argc < 1) {
+ msg ("mag (ps2pk) version " PACKAGE_VERSION "\n");
+ fatal("Usage: %s [-r] [-Rdpi] size . . .\n", myname);
+ }
+
+#ifdef WIN32
+ setmode(fileno(stdout), _O_BINARY);
+#endif
+
+ for ( ; argc; argc--, argv++) {
+ arg=atof(argv[0]);
+ switch (invert) {
+ case 0:
+ printf("%d%c", fontsize(arg), argc > 1 ? ' ' : '\n');
+ break;
+ case 1:
+ sz=stepsize(arg);
+ if (((int)(10*sz))%10==0)
+ printf("%d%c", (int)sz, argc > 1 ? ' ' : '\n');
+ else
+ printf("%f%c", sz, argc > 1 ? ' ' : '\n');
+ }
+ }
+ return 0;
+}
+
+static int
+fontsize(double x)
+{
+ return(DPI*pow(1.2, x) + 0.5);
+}
+
+static double
+stepsize(double x)
+{
+ double s;
+ s=(log(x)-log(DPI))/log(1.2);
+ if (s>=0) return floor(10*s+0.5)/10;
+ return -floor(10*(-s)+0.5)/10;
+}
diff --git a/fonts/utilities/ps2pk/objects.c b/fonts/utilities/ps2pk/objects.c
new file mode 100644
index 0000000000..ba18c9ca7f
--- /dev/null
+++ b/fonts/utilities/ps2pk/objects.c
@@ -0,0 +1,1156 @@
+/* $XConsortium: objects.c,v 1.5 92/03/20 15:56:06 eswu Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+ /* OBJECTS CWEB V0025 ******** */
+/*
+:h1.OBJECTS Module - TYPE1IMAGER Objects Common Routines
+
+This module defines and implements the C structures that represent
+objects in the TYPE1IMAGER. All common routines for manipulating these
+objects are defined in this module. Specific routines for
+specific objects are defined in the modules that deal with that
+object type.
+
+
+&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com)
+
+
+:h3.Include Files
+
+The included files are:
+*/
+#define GLOBALS 1 /* see :hdref refid=debugvar. */
+/*
+The following two includes are C standards; we include them because we
+use 'toupper' and the 'str'-type functions in this module. Potentially
+these may be defined as macros; if these ".h" files do not exist on your
+system it is a pretty safe bet that these are external entry points and
+you do do not need to include these header files.
+*/
+
+#include "types.h"
+#include <string.h>
+#include <ctype.h>
+#include "util.h"
+
+/*
+override incorrect system functions; for example you might define
+a macro for "strcpy" that diverts it to "my_strcpy".
+*/
+
+ /* moved these includes from above the */
+ /* was included first (it contains com- */
+ /* piler defines). dsr 081291 */
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "regions.h"
+#include "fonts.h"
+#include "pictures.h"
+#include "strokes.h"
+#include "cluts.h"
+static const char *TypeFmt(int);
+static int ObjectPostMortem(struct xobject *obj);
+
+/*
+:h3.The "pointer" Macro - Define a Generic Pointer
+
+Sadly, many compilers will give a warning message when a pointer to
+one structure is assigned to a pointer to another. We've even seen
+some that give severe errors (when the wrong pointer type is used as
+an initializer or returned from a function). TYPE1IMAGER has routines
+like Dup and Allocate that are perfectly willing to duplicate or
+allocate any of a number of different types of structures. How to
+declare them in a truely portable way?
+
+Well, there is no single good answer that I've found. You can always
+beg the question and "cast" everything. I find this distracting and the
+resulting code ugly. On the other hand, we have found at least one
+compiler that will accept "void *" as a generic pointer that can
+assigned to any other pointer type without error or warning (apparently
+this is also the ANSI standard). So, we define "void *" to be a generic
+pointer. (You might have to change this for your compiler; the "ifndef"
+allows the change to be made on the command line if you want.)
+:i1/portability assumptions/
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.Functions Provided to the TYPE1IMAGER User
+
+This module provides the following TYPE1IMAGER entry points:
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+Note that entry points that are intended for use external to TYPE1IMAGER
+begin with the characters :q/xi/. Macros are used to make the names
+more mnemonic.
+*/
+
+/*
+:h3.Functions Provided to Other Modules
+
+This module provides the following functions for other modules:
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+Note that entry points that intended for use within TYPE1IMAGER, but
+which must be global because they are used across module boundaries,
+begin with the characters :q/I_/. Macros are used to make the names
+more mnemonic.
+
+Entry points totally within a module use mnemonic names and are
+declared :hp2/static/. One of the compilers I used had a bug when
+static functions were passed as addresses. Thus, some functions
+which are logically "static" are not so declared.
+
+Note also the trick of declaring routines, like Consume(), with a
+variable number of arguments. To avoid the restrictions on variable
+numbers of arguments in the macro processor, we just replace the
+text 'Consume' with 'I_Consume'.
+*/
+/*
+:h3.Macros Provided to Other Modules
+
+This is the module where we define all the useful constants like
+TRUE, FALSE, and NULL, and simple expressions like MIN(), MAX(), and ABS().
+We might as well get to it right here:
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+Notice that upper case is used for constant values and macro
+definitions. I generally follow that convention.
+
+Many more global macros are defined later in this module.
+*/
+/*
+:h2.Basic TYPE1IMAGER Object Structure
+
+All TYPE1IMAGER objects which are available to the user have a common
+header. This header is defined below:
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+The following define is an attempt to centralize the definition of the
+common xobject data shared by structures that are derived from the
+generic xobject structure. For example, the structure font, defined in
+fonts.shr :
+&code.
+ struct font {
+ char type;
+ char flag;
+ int references;
+ ... other data types & structs ...
+ }
+&ecode.
+would now be defined as:
+&code.
+ struct font {
+ XOBJ_COMMON
+ ... other data types & structs ...
+ }
+&ecode.
+Thus we have a better-structured inheritance mechanism. 3-26-91 PNM
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.Object Type Definitions
+
+These constants define the values which go in the 'type' field of
+an TYPE1IMAGER object structure:
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.Flag Byte Definitions
+
+Many programmers define flag bits as a mask (for example, 0x04), and
+test, set, and reset them as follows:
+
+&code.
+ if ((flag & PERMANENT) != 0)
+
+ flag |= PERMANENT;
+ flag &= &inv.PERMANENT;
+:exmp.
+
+I favor a style where the 'if' statement can ask a question:
+
+&code.
+ if (ISPERMANENT(flag))
+
+ flag |= ISPERMANENT(ON);
+ flag &= &inv.ISPERMANENT(ON);
+
+:exmp.
+This said, we now define two bit settings of the flag byte of the
+object. "ISPERMANENT" will be set by the user, when he calls
+Permanent(). "ISIMMORTAL" will be used for compiled-in objects
+that we don't want the user to ever destroy.
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+Flag bit definitions that apply to all objects are assigned
+starting with the least significant (0x01) bit. Flag bit definitions
+specific to a certain object type are assigned starting with the
+most significant (0x80) bit. We hope they never meet.
+*/
+/*
+:h3 id=preserve.PRESERVE() Macro
+
+Occasionally an TYPE1IMAGER operator is implemented by calling other
+TYPE1IMAGER operators. For example, Arc2() calls Conic(). When we
+call more than one operator as a subroutine, we have to be careful
+of temporary objects. A temporary object will be consumed by the
+subroutine operator and then is no longer available for the caller.
+This can be prevented simply by bumping a temporary object's reference
+count.
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h3.RefRoll() Macro to Detect References Count Rollover
+
+The following macro is designed to check for reference count rollover.
+A return value of TRUE means rollover has not occurred; a return value
+of FALSE means we cannot increment the reference count. Note also that
+those functions that use this macro must decrement the reference count
+afterwards. 3-26-91 PNM
+*/
+
+#define RefRoll(obj) (++(obj)->references > 0)
+
+/*
+:h2.TYPE1IMAGER Object Functions
+
+:h3.INT32COPY() - Macro to Copy "long" Aligned Data
+
+Copying arbitrary bytes in C is a bit of a problem. "strcpy" can't be
+used, because 0 bytes are special-cased. Most environments have a
+routine "memcopy" or "bcopy" or "bytecopy" that copies memory containing
+zero bytes. Sadly, there is no standard on the name of such a routine,
+which makes it impossible to write truely portable code to use it.
+
+It turns out that TYPE1IMAGER, when it wants to copy data, frequently
+knows that both the source and destination are aligned on "long"
+boundaries. This allows us to copy by using "long *" pointers. This
+is usually very efficient on almost all processors. Frequently, it
+is more efficient than using general-purpose assembly language routines.
+So, we define a macro to do this in a portable way. "dest" and "source"
+must be long-aligned, and "bytes" must be a multiple of "sizeof(long)":
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.Allocate() - Allocating a Memory Block
+
+Allocate returns a pointer to memory object that is a copy of
+the template passed (if any). In addition, extra bytes may be
+allocated contiguously with the object. (This may be useful for
+variable size objects such as edge lists. See :hdref refid=regions..)
+
+Allocate() always returns a non-immortal object, even if the template is
+immortal. Therefore a non-NULL template must have a "flag" byte.
+
+If the template is NULL, then 'size' bytes are cleared to all NULLs.
+
+If the template is non-NULL, a new object is allocated in memory.
+It therefore seems logical that its reference count field should be
+set to 1. So, a nun-NULL template must also have a "references" field.
+PNM 3-26-91
+*/
+
+struct xobject *t1_Allocate(
+ register int size, /* number of bytes to allocate & initialize */
+ void *p, /* example structure to allocate */
+ register int extra) /* any extra uninitialized bytes needed contiguously */
+{
+/* the actual argument p is one of
+ struct XYspace *
+ struct edgelist *
+ struct hintsegment *
+ struct region *
+ struct segment *
+ struct xobject *
+*/
+ register struct xobject *template = p;
+ register struct xobject *r;
+
+ /*
+ * round up 'size' and 'extra' to be an integer number of 'long's:
+ */
+ size = (size + sizeof(int32_t) - 1) & -sizeof(int32_t);
+ extra = (extra + sizeof(int32_t) - 1) & -sizeof(int32_t);
+ if (size + extra <= 0)
+ t1_abort("Non-positive allocate?");
+ r = (struct xobject *) Xalloc(size + extra);
+
+ while (r == NULL) {
+ if (!GimeSpace()) {
+ IfTrace1(TRUE, "malloc attempted %d bytes.\n",
+ size + extra);
+ t1_abort("We have REALLY run out of memory");
+ }
+ r = (struct xobject *) Xalloc(size + extra);
+ }
+
+ /*
+ * copy the template into the new memory:
+ */
+ if (template != NULL) {
+ /* Added references count decrement if template is not permanent.
+ This is for the case where Allocate is called by a Dupxxxx
+ function, which was in turn called by Unique(). (PNM) */
+ if (!ISPERMANENT(template->flag))
+ --template->references;
+ INT32COPY(r, template, size);
+ r->flag &= ~(ISPERMANENT(ON) | ISIMMORTAL(ON));
+ /* added reference field 3-2-6-91 PNM */
+ r->references = 1;
+ }
+ else {
+ register char **p1;
+
+ for (p1=(char **)r; size > 0; size -= sizeof(char *))
+ *p1++ = NULL;
+ }
+
+ if (MemoryDebug > 1) {
+ register int *L;
+ L = (int *) r;
+ IfTrace4(TRUE, "Allocating at %p: %x %x %x\n",
+ L, L[-1], L[0], L[1]);
+ }
+ return(r);
+}
+
+/*
+:h3.Free() - Frees an Allocated Object
+
+This routine makes a sanity check to make sure the "type" field of the
+standard object structure has not been cleared. If the object is
+not a standard structure, then the macro "NonObjectFree" is available
+that does not perform this check.
+
+In either case, the object must not be the NULL pointer. This preserves
+portability, as the C system Xfree() will not always accept NULL.
+*/
+
+void Free(void *p) /* structure to free */
+{
+/* the actual argument p is one of
+ struct XYspace *
+ struct edgelist *
+ struct region *
+ struct segment *
+ struct xobject *
+*/
+ register struct xobject *obj = p;
+
+ if (obj->type == INVALIDTYPE)
+ t1_abort("Free of already freed object?");
+ obj->type = INVALIDTYPE;
+
+ if (MemoryDebug > 1) {
+ register int *L;
+ L = (int *) obj;
+ IfTrace4(TRUE,"Freeing at %p: %x %x %x\n", L, L[-1], L[0], L[1]);
+ }
+
+ Xfree(obj);
+}
+
+/*
+:h3.Permanent() - Makes an Object Permanent
+
+Real simple--just set a flag. Every routine that consumes its objects
+(which is almost every user entry) must check this flag, and not consume
+the object if it is set.
+
+If a temporary object is made permanent, and there is more than one
+reference to it, we must first Copy() it, then set the ISPERMANENT
+flag. Note also that the reference count must be incremented when an
+object is changed from temporary to permanent (see the ISUNIQUE macro).
+
+Note that the purpose of this function is to convert an object into a
+permanent object:
+ If it was permanent to begin with, we do nothing;
+ If it was temporary and unique, we set the PERMANENT flag and increment
+the reference count;
+ If it was temporary and nonunique, we must make a unique Copy(), set
+the PERMANENT flag, and set the reference count to 2. We must also
+decrement the original object's reference count, because what we have
+done is to change one of the old temporary handles to a permanent one.
+3-26-91 PNM
+*/
+
+struct xobject *t1_Permanent(void *p) /* object to be made permanent */
+{
+/* the actual argument p is one of
+ struct segment *
+ struct xobject *
+*/
+ register struct xobject *obj = p;
+
+ IfTrace1((MustTraceCalls),"Permanent(%p)\n", obj);
+
+ if ( (obj != NULL) && ( !(ISPERMANENT(obj->flag)) ) )
+ {
+ /* there is a non-NULL, temporary object to be made permanent.
+ If there are multiple references to this object, first get
+ a new COPY().
+ Note also that we have to decrement the reference count if
+ we do a Copy() here, because we are consuming the temporary
+ argument passed, and returning a unique, permanent one.
+ */
+ if ( obj->references > 1)
+ {
+ obj = Copy(obj);
+ }
+ /* now set the permanent flag, and increment the reference
+ count, since a temporary object has now become permanent. */
+ obj->references++;
+ obj->flag |= ISPERMANENT(ON);
+ }
+ return(obj);
+}
+
+#if 0
+/*
+:h3.Temporary() - Undoes the Effect of "Permanent()"
+
+This simply resets the "ISPERMANENT" flag.
+
+If a permanent object is made temporary, and there is more than one reference
+to it, we must first Copy() it, then reset the ISPERMANENT flag. However,
+if the permanent object has obly one reference, we need only decrement the
+reference count ( and reset the flag).
+
+Note that this function, in the case of a PERMANENT argument, basically
+converts the PERMANENT handle to a TEMPORARY one. Thus, in the case of
+a nonunique, permanent argument passed, we not only make a Copy(),
+we also decrement the reference count, to reflect the fact that we have
+lost a permanent handle and gained a temporary one.
+PNM 3-2-6-91
+*/
+
+struct xobject *xiTemporary(
+ register struct xobject *obj) /* object to be made not permanent */
+{
+ IfTrace1((MustTraceCalls),"Temporary(%p)\n", obj);
+
+ if (obj != NULL) {
+ /* if it's already temporary, there's nothing to do. */
+ if ISPERMANENT(obj->flag)
+ {
+ /* if there are multiple references to this object, get a
+ Copy we can safely alter. Recall that the reference count
+ is incremented for permanent objects.
+ Recall further that Copy returns an object with the
+ same flag state and a reference count of 2 (for PERMANENT
+ objects).
+ Thus, regardless of whether or not we need to copy a
+ permanent object, we still decrement its reference
+ count and reset the flag.
+ */
+ if (obj->references != 2 || ISIMMORTAL(obj->flag))
+ {
+ /* not unique; consume handle, get a temporary Copy! */
+ obj = Copy(obj);
+ }
+ /* else decrement the reference count (since it's going from
+ permanent to temporary) and clear the flag. */
+ else {
+ obj->references--;
+ obj->flag &= ~ISPERMANENT(ON);
+ }
+ }
+ }
+ return(obj);
+}
+#endif
+
+/*
+:h3.Dup() - Duplicate an Object
+
+Dup will increment the reference count of an object, only making a
+Copy() if needed.
+Note that Dup() retains the state of the permanent flag.
+3-26-91 PNM
+*/
+
+
+struct xobject *t1_Dup(
+ register struct xobject *obj) /* object to be duplicated */
+{
+ register char oldflag; /* copy of original object's flag byte */
+
+ IfTrace1((MustTraceCalls),"Dup(%p)\n", obj);
+
+ if (obj == NULL)
+ return(NULL);
+ /* An immortal object must be Copy'ed, so that we get a mortal
+ copy of it, since we try not to destroy immortal objects. */
+ if (ISIMMORTAL(obj->flag))
+ return(Copy(obj));
+
+ /* if incrementing the reference count doesn't cause the count
+ to wrap, simply return the object with the count bumped. Note
+ that the RefRoll macro increments the count to perform the
+ rollover check, so we must decrement the count. */
+ if (RefRoll(obj))
+ return(obj);
+
+ /* that didn't work out, so put the count back and call Copy(). */
+ --obj->references;
+ oldflag = obj->flag;
+ obj = Copy(obj);
+ if (ISPERMANENT(oldflag))
+ obj = Permanent(obj);
+ return(obj);
+}
+
+/*
+:h3.Copy() - Make a New Copy of an Object
+
+This is the generic Copy() where the object type is unknown. There
+are specific Copyxxx functions for known object types.
+
+Copy will create a NEW temporary object, and WILL NOT simply bump the
+reference count.
+
+Sometimes duplicating an object is just as simple as Allocating with it
+as a template. But other objects are complicated linked lists. So, we
+let each module provide us a routine (or macro) that duplicates the
+objects it knows about.
+*/
+
+struct xobject *t1_Copy(
+ register struct xobject *obj) /* object to be Copy'ed */
+{
+ if (obj == NULL)
+ return(NULL);
+
+ if (ISPATHTYPE(obj->type))
+ obj = (struct xobject *) CopyPath((struct segment *)obj);
+ else
+ switch (obj->type) {
+ case SPACETYPE:
+ obj = (struct xobject *) CopySpace((struct XYspace *)obj); break;
+ case FONTTYPE:
+ obj = (struct xobject *) CopyFont(obj); break;
+ case REGIONTYPE:
+ obj = (struct xobject *) CopyRegion((struct region *)obj); break;
+ case PICTURETYPE:
+ obj = (struct xobject *) CopyPicture(obj); break;
+ case LINESTYLETYPE:
+ obj = (struct xobject *) CopyLineStyle(obj); break;
+ case STROKEPATHTYPE:
+ obj = (struct xobject *) CopyStrokePath(obj); break;
+ case CLUTTYPE:
+ obj = (struct xobject *) CopyCLUT(obj); break;
+ default:
+ return(ArgErr("Copy: invalid object", obj, NULL));
+ }
+
+ return(obj);
+}
+
+/*
+:h3.Destroy() - Destroys an Object
+
+This can get complicated. Just like with Copy(), we let the experts
+handle it.
+*/
+struct xobject *Destroy(void *p) /* object to be destroyed */
+{
+/* the actual argument p is one of
+ struct region *
+ struct segment *
+ struct xobject *
+*/
+ register struct xobject *obj = p;
+
+ IfTrace1((MustTraceCalls),"Destroy(%p)\n", obj);
+
+ if (obj == NULL)
+ return(NULL);
+ if (ISIMMORTAL(obj->flag)) {
+ IfTrace1(TRUE,"Destroy of immortal object %p ignored\n", obj);
+ return(NULL);
+ }
+ if (ISPATHTYPE(obj->type))
+ KillPath((struct segment *)obj);
+ else {
+ switch (obj->type) {
+ case REGIONTYPE:
+ KillRegion((struct region *)obj);
+ break;
+ case SPACETYPE:
+ KillSpace(obj);
+ break;
+ case LINESTYLETYPE:
+ KillLineStyle(obj);
+ break;
+ case FONTTYPE:
+ KillFont(obj);
+ break;
+ case PICTURETYPE:
+ KillPicture(obj);
+ break;
+ case STROKEPATHTYPE:
+ KillStrokePath(obj);
+ break;
+ case CLUTTYPE:
+ KillCLUT(obj);
+ break;
+ default:
+ return(ArgErr("Destroy: invalid object", obj, NULL));
+ }
+ }
+ return(NULL);
+}
+/*
+:h2.Generally Useful Macros
+
+:h3.FOLLOWING() - Macro to Point to the Data Following a Structure
+
+There are several places in TYPE1IMAGER where we will allocate variable
+data that belongs to a structure immediately after that structure.
+This is a performance technique, because it reduces the number of
+trips we have to take through Xalloc() and Xfree(). It turns out C has
+a very convenient way to point past a structure--if 'p' is a pointer
+to a structure, 'p+1' is a pointer to the data after it. This
+behavior of C is somewhat startling and somewhat hard to follow, if
+you are not used to it, so we define a macro to point to the data
+following a structure:
+*/
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.TYPECHECK() - Verify the Type of an Argument
+
+This macro tests the type of an argument. If the test fails, it consumes
+any other arguments as necessary and causes the imbedding routine to
+return the value 'whenBAD'.
+
+Note that the consumeables list should be an argument list itself, for
+example (0) or (2,A,B). See :hdref refid=consume. below.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.ARGCHECK() - Perform an Arbitrary Check on an Argument
+
+This macro is a generalization of TYPECHECK to take an arbitrary
+predicate. If the error occurs (i.e., the predicate is true), the
+arbitrary message 'msg' is returned.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.TYPENULLCHECK() - Extension of TYPECHECK() for NULL arguments
+
+Many routines allow NULLs to be passed as arguments. 'whenBAD' will
+be returned in this case, too.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.MAKECONSUME() - Create a "Consume"-type Macro
+
+Consuming an object means destroying it if it is not permanent. This
+logic is so common to all the routines, that it is immortalized in this
+macro. For example, ConsumePath(p) can be simply defined as
+MAKECONSUME(p,KillPath(p)). In effect, this macro operates on a
+meta-level.
+:i1/consuming objects/
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h3.MAKEUNIQUE() - Create a "Unique"-type Macro
+
+Many routines are written to modify their arguments in place. Thus,
+they want to insure that they duplicate an object if it is permanent.
+This is called making an object "unique". For example, UniquePath(p)
+can be simply defined as MAKEUNIQUE(p,DupPath(p)).
+:i1/unique objects/
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+An object is unique (and directly alterable) if there is only one
+reference to it, and it is not permanent (in which case we increment
+the reference count, so we don't have to check the permanent bit).
+3-26-91 PNM
+
+Note the rules for making a unique object:
+&drawing.
+ IF (obj->references = 1) return(obj);
+ ELSE (references > 1)
+ IF (ISPERMANENT(obj->flag)) return(Dupxxx(obj));
+ ELSE (nonunique, temporary object!)
+ obj->references--; return(Dupxxx(obj));
+&edrawing.
+If we must make a Copy of a nonunique, temporary object, we decrement
+reference count of the original object!
+*/
+
+/*
+:h3.Unique() - Make a Unique Object
+
+Here is a generic 'Unique' function if the object type is not known.
+Why didn't we build it with the MAKEUNIQUE macro, you ask? Well, we
+used to, but there is at least one damn compiler in the world that
+raises errors if the types of an "(a) ? b : c" expression do not match.
+Also, when we changed Dup() to retain the permanent/temporary flag, we
+wanted to make sure "Unique" always returned a temporary object.
+
+Note that we cannot use Dup() to create a copy of the object in question,
+because Dup() may simply bump the reference count, and not return a
+unique copy to us. That is why we use t1_Copy().
+
+The purpose of this function is to make sure we have a copy of an object
+that we can safely alter:
+:ol.
+:li.If we have a unique, temporary object, we simply return the argument.
+:li.If we have a nonunique, temporary object, we have to make a new copy
+of it, and decrement the reference count of the original object, to reflect
+the fact that we traded temporary handles.
+:li.If we have a permanent object, we make a temporary copy of it, but
+we do not decrement the reference count of the original permanent object,
+because permanent objects, by definition, are persistent. 3-2-6-91 PNM
+:eol.
+*/
+
+struct xobject *t1_Unique(struct xobject *obj)
+{
+ /* if the original object is not already unique, make a unique
+ copy...Note also that if the object was not permanent, we must
+ consume the old handle! 3-26-91 PNM
+ NOTE : consumption of the old handle moved to Allocate. 4-18-91 */
+ if (!obj || obj->references == 1)
+ return(obj);
+
+ obj = Copy(obj);
+ /* and make sure we return a temporary object ! */
+ if (ISPERMANENT(obj->flag))
+ {
+ obj->flag &= ~ISPERMANENT(ON);
+ obj->references--;
+ }
+ return(obj);
+}
+
+
+/*
+:h2.Initialization, Error, and Debug Routines
+
+:h3 id=debugvar.Declarations for Debug Purposes
+
+We declare all the debug flags here. Some link editors make the not
+unreasonable restriction that only one module may declare and
+initialize global variables; all the rest must declare the variable
+'extern'. This is logical, but is somewhat awkward to implement with
+C include files. We solve the problem by temporarily making the name
+'extern' a null name if GLOBALS is defined. (GLOBALS is only defined
+in this OBJECTS module.) Since 'externs' can't be initialized, we
+have to handle that with #defines too.
+:i1/GLOBALS (&#define.)/
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+static const char *ErrorMessage = NULL;
+
+/*
+:h3.Pragmatics() - Set/Reset Debug Flags
+
+We provide a controlled way for the TYPE1IMAGER user to set and reset
+our debugging and tracing:
+*/
+static void Pragmatics(
+ const char *username, /* name of the flag */
+ int value) /* value to set it to */
+{
+ register char *p; /* temporary loop variable */
+#define NAMESIZE 40
+ char name[NAMESIZE]; /* buffer to store my copy of 'username' */
+
+ if (strlen(username) >= NAMESIZE)
+ t1_abort("Pragmatics name too large");
+ strcpy(name, username);
+ for (p = name; *p != '\0'; p++)
+ *p = toupper((unsigned char)*p);
+
+ if (!strcmp(name, "ALL"))
+ MustTraceCalls = InternalTrace = /* MustCrash = */
+ LineIOTrace = value;
+
+ else if (!strcmp(name, "LINEIOTRACE"))
+ LineIOTrace = value;
+
+ else if (!strcmp(name, "TRACECALLS"))
+ MustTraceCalls = value;
+
+ else if (!strcmp(name, "CHECKARGS"))
+ MustCheckArgs = value;
+
+ else if (!strcmp(name, "PROCESSHINTS"))
+ ProcessHints = value;
+
+ else if (!strcmp(name, "SAVEFONTPATHS"))
+ SaveFontPaths = value;
+
+ else if (!strcmp(name, "CRASTERCOMPRESSIONTYPE"))
+ CRASTERCompressionType = value;
+
+ else if (!strcmp(name, "CRASHONUSERERROR"))
+ MustCrash = value;
+
+ else if (!strcmp(name, "DEBUG"))
+ StrokeDebug = SpaceDebug = PathDebug = ConicDebug = LineDebug =
+ RegionDebug = MemoryDebug = FontDebug =
+ HintDebug = ImageDebug = OffPageDebug = value;
+
+ else if (!strcmp(name, "CONICDEBUG"))
+ ConicDebug = value;
+
+ else if (!strcmp(name, "LINEDEBUG"))
+ LineDebug = value;
+
+ else if (!strcmp(name, "REGIONDEBUG"))
+ RegionDebug = value;
+
+ else if (!strcmp(name, "PATHDEBUG"))
+ PathDebug = value;
+
+ else if (!strcmp(name, "SPACEDEBUG"))
+ SpaceDebug = value;
+
+ else if (!strcmp(name, "STROKEDEBUG"))
+ StrokeDebug = value;
+
+ else if (!strcmp(name, "MEMORYDEBUG"))
+ MemoryDebug = value;
+
+ else if (!strcmp(name, "FONTDEBUG"))
+ FontDebug = value;
+
+ else if (!strcmp(name, "HINTDEBUG"))
+ HintDebug = value;
+
+ else if (!strcmp(name, "IMAGEDEBUG"))
+ ImageDebug = value;
+
+ else if (!strcmp(name, "OFFPAGEDEBUG"))
+ OffPageDebug = value;
+
+#ifdef MC68000
+/*
+The following pragmatics flag turns on or off instruction histograming
+for performance analysis. It is only defined in the Delta card
+environment.
+*/
+ else if (!strcmp(name, "PROFILE")) {
+ if (value)
+ StartProfile();
+ else
+ StopProfile();
+ }
+#endif
+ else if (!strcmp(name, "FLUSHCACHE")) {
+ while (GimeSpace()) { ; }
+ }
+
+ else if (!strcmp(name, "CACHEDCHARS"))
+ CachedChars = (value <= 0) ? 1 : value;
+
+ else if (!strcmp(name, "CACHEDFONTS"))
+ CachedFonts = (value <= 0) ? 1 : value;
+
+ else if (!strcmp(name, "CACHEBLIMIT"))
+ CacheBLimit = value;
+
+ else if (!strcmp(name, "CONTINUITY"))
+ Continuity = value;
+
+
+ else {
+ printf("Pragmatics flag = '%s'\n", name);
+ ArgErr("Pragmatics: flag not known", NULL, NULL);
+ }
+ return;
+}
+
+/*
+:h3.Consume() - Consume a List of Arguments
+
+This general purpose routine is provided in the case where the object
+type(s) to be consumed are unknown or not yet verified, and/or it is
+not known whether the object is permanent.
+
+If the type of the argument is known, it is faster to directly consume
+that type, for example, ConsumeRegion() or ConsumePath(). Furthermore,
+if it is already known that the object is temporary, it is faster to
+just kill it rather than consume it, for example, KillSpace().
+*/
+
+void
+Consume(int n, ...)
+{
+ struct xobject *arg;
+ int i;
+ va_list ap;
+
+ va_start (ap, n);
+ for(i = 0; i < n; i++) {
+ arg = va_arg(ap, struct xobject *);
+ if (arg != NULL && !ISPERMANENT(arg->flag))
+ Destroy(arg);
+ }
+ va_end(ap);
+ return;
+}
+
+/*
+:h3.TypeErr() - Handles "Invalid Object Type" Errors
+*/
+
+struct xobject *TypeErr(
+ const char *name, /* Name of routine (for error message) */
+ void *p, /* Object in error */
+ int expect, /* type expected */
+ void *q) /* object to return to caller */
+{
+/* the actual arguments p and q are one of
+ struct XYspace *
+ struct segment *
+ struct xobject *
+*/
+ struct xobject *obj = p;
+ struct xobject *ret = q;
+
+ static char typemsg[80];
+
+ if (MustCrash)
+ LineIOTrace = TRUE;
+
+ sprintf(typemsg, "Wrong object type in %s; expected %s seen %s\n",
+ name, TypeFmt(expect), TypeFmt(obj->type));
+ IfTrace0(TRUE,typemsg);
+
+ ObjectPostMortem(obj);
+
+ if (MustCrash)
+ t1_abort("Terminating because of CrashOnUserError...");
+ else
+ ErrorMessage = typemsg;
+
+/* changed ISPERMANENT to ret->references > 1 3-26-91 PNM */
+ if (ret != NULL && (ret->references > 1))
+ ret = Dup(ret);
+ return(ret);
+}
+
+/*
+:h4.TypeFmt() - Returns Pointer to English Name of Object Type
+
+This is a subroutine of TypeErr().
+*/
+
+static const char *TypeFmt(
+ int type) /* type field */
+{
+ const char *r;
+
+ if (ISPATHTYPE(type))
+ if (type == TEXTTYPE)
+ r = "path or region (from TextPath)";
+ else
+ r = "path";
+ else {
+ switch (type) {
+ case INVALIDTYPE:
+ r = "INVALID (previously consumed?)";
+ break;
+ case REGIONTYPE:
+ r = "region";
+ break;
+ case SPACETYPE:
+ r = "XYspace";
+ break;
+ case LINESTYLETYPE:
+ r = "linestyle";
+ break;
+ case FONTTYPE:
+ r = "font";
+ break;
+ case PICTURETYPE:
+ r = "picture";
+ break;
+ case STROKEPATHTYPE:
+ r = "path (from StrokePath)";
+ break;
+ default:
+ r = "UNKNOWN";
+ break;
+ }
+ }
+ return(r);
+}
+/*
+:h4.ObjectPostMortem() - Prints as Much as We Can About a Bad Object
+
+This is a subroutine of TypeErr() and ArgErr().
+*/
+
+static int ObjectPostMortem(register struct xobject *obj)
+{
+ Pragmatics("Debug", 10);
+ IfTrace2(TRUE,"Bad object is of %s type %p\n", TypeFmt(obj->type), obj);
+
+ IfTrace0((obj == (struct xobject *) USER),
+ "Suspect that InitImager() was omitted.\n");
+ Pragmatics("Debug", 0);
+
+ /* NOTREACHED? */
+ return 0;
+}
+
+/*
+:h3.ArgErr() - Invalid Argument Passed to a Routine
+
+A common routine to report argument errors. It is usually called
+is returned to the caller in case MustCrash is FALSE and ArgErr
+returns to its caller.
+*/
+
+struct xobject *ArgErr(
+ const char *str, /* description of error */
+ void *p, /* object, if any, that was in error */
+ void *q) /* object returned to caller or NULL */
+{
+/* the actual argument p is one of
+ struct XYspace *
+ struct segment *
+ struct xobject *
+*/
+ struct xobject *obj = p;
+ struct xobject *ret = q;
+
+ if (MustCrash)
+ LineIOTrace = TRUE;
+ IfTrace1(TRUE,"ARGUMENT ERROR-- %s.\n", str);
+ if (obj != NULL)
+ ObjectPostMortem(obj);
+ if (MustCrash)
+ t1_abort("Terminating because of CrashOnUserError...");
+ else
+ ErrorMessage = str;
+ return(ret);
+}
+
+/*
+:h3.t1_abort() - Crash Due to Error
+
+We divide by zero, and if that doesn't work, call exit(), the results of
+which is system dependent (and thus is part of the Hourglass required
+environment).
+*/
+static int test = 0;
+
+/*ARGSUSED*/
+void t1_abort(const char *str)
+{
+ LineIOTrace = TRUE;
+ IfTrace1(TRUE,"\nABORT: reason='%s'\n", str);
+ TraceClose();
+ test = 1/test;
+ exit(99);
+}
+
+/*
+:h3.REAL Miscellaneous Stuff
+
+:h4.ErrorMsg() - Return the User an Error Message
+*/
+
+const char *ErrorMsg(void)
+{
+ register const char *r;
+
+ r = ErrorMessage;
+ ErrorMessage = NULL;
+ return(r);
+}
+
+/*
+:h4.InitImager() - Initialize TYPE1IMAGER
+
+We check that a short is 16 bits and a long 32 bits; we have made
+those assumptions elsewhere in the code. (This is almost a C standard,
+anyway.) Note that TYPE1IMAGER makes no assumptions about the size of an
+'int'!
+:i1/portability assumptions/
+*/
+void InitImager(void)
+{
+
+/* Check to see if we have been using our own malloc. If so,*/
+/* Undef malloc so that we can get to the system call. */
+/* All other calls to malloc are defined to Xalloc. */
+
+ if (sizeof(SHORT) != 2 || sizeof(int32_t) != 4)
+ t1_abort("Fundamental TYPE1IMAGER assumptions invalid in this port");
+ InitSpaces();
+ InitFonts();
+ InitFiles();
+/*
+In some environments, constants and/or exception handling need to be
+*/
+ LibInit();
+}
+/*
+:h4.TermImager() - Terminate TYPE1IMAGER
+
+This only makes sense in a server environment; true TYPE1IMAGER needs do
+nothing.
+*/
+void TermImager(void)
+{
+ return;
+}
+#if 0
+/*
+:h4.reportusage() - A Stub to Get a Clean Link with Portable PMP
+*/
+void reportusage(void)
+{
+ return;
+}
+#endif
diff --git a/fonts/utilities/ps2pk/objects.h b/fonts/utilities/ps2pk/objects.h
new file mode 100644
index 0000000000..790bed9865
--- /dev/null
+++ b/fonts/utilities/ps2pk/objects.h
@@ -0,0 +1,298 @@
+/* $XConsortium: objects.h,v 1.6 92/03/20 14:35:56 keith Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/*SHARED*/
+
+/*END SHARED*/
+/*SHARED*/
+
+#ifdef WIN32
+#include <stdio.h>
+#include <stdlib.h>
+#include <kpathsea/kpathsea.h>
+#endif
+
+#include "types.h"
+
+#define Permanent(obj) t1_Permanent(obj)
+#define Destroy(obj) t1_Destroy(obj)
+#define Dup(obj) t1_Dup(obj)
+#define InitImager t1_InitImager
+#define TermImager t1_TermImager
+#define ErrorMsg t1_ErrorMsg
+
+struct xobject *t1_Permanent(void *); /* make an object permanent */
+struct xobject *t1_Destroy(void *); /* destroy an object */
+struct xobject *t1_Dup(struct xobject *); /* duplicate an object */
+void t1_InitImager(void); /* initialize TYPE1IMAGER */
+void t1_TermImager(void); /* terminate TYPE1IMAGER */
+const char *t1_ErrorMsg(void); /* return last TYPE1IMAGER error message */
+
+/*END SHARED*/
+/*SHARED*/
+
+#define Allocate(n,t,s) t1_Allocate(n,t,s)
+#define Free(obj) t1_Free(obj)
+#define NonObjectFree(a) Xfree(a)
+#define Consume t1_Consume
+#define ArgErr(s,o,r) t1_ArgErr(s,o,r)
+#define TypeErr(n,o,e,r) t1_TypeErr(n,o,e,r)
+#define Copy(obj) t1_Copy(obj)
+#define Unique(obj) t1_Unique(obj)
+
+void t1_abort(const char *); /* crash; software logic error */
+struct xobject *t1_Allocate(int, void *, int); /* allocate memory */
+void t1_Free(void *); /* free memory */
+struct xobject *t1_Unique(struct xobject *);
+ /* make a unique temporary copy of an object */
+struct xobject *t1_ArgErr(const char *, void *, void *);
+ /* handle argument errors */
+struct xobject *t1_TypeErr(const char *, void *, int, void *);
+ /* handle 'bad type' argument errors */
+void t1_Consume(int, ...); /* consume a variable number of arguments */
+struct xobject *t1_Copy(struct xobject *);
+ /* make a new copy, not reference bump PNM */
+
+/*END SHARED*/
+/*SHARED*/
+
+#define ON (~0) /* all bits on */
+#ifndef FALSE
+#define FALSE 0 /* handy zero value */
+#endif
+#ifndef TRUE
+#define TRUE 1 /* handy non-zero value */
+#endif
+
+#ifndef NULL
+#define NULL 0
+/*
+The NULL pointer is system specific. (Most systems, however, use 0.)
+TYPE1IMAGER could have its own NULL, independent of the rest of the system,
+were it not for malloc(). The system call malloc() returns NULL when
+out of memory.
+:i1/portibility assumptions/
+*/
+#endif
+
+#ifdef MAX
+#undef MAX
+#endif
+
+#ifdef MIN
+#undef MIN
+#endif
+
+#ifdef ABS
+#undef ABS
+#endif
+
+#define MIN(a,b) (((a)<(b)) ? a : b)
+#define MAX(a,b) (((a)>(b)) ? a : b)
+#define ABS(a) (((a)>=0)?(a):-(a))
+
+/*END SHARED*/
+/*SHARED*/
+
+struct xobject {
+ char type; /* encoded type of object */
+ unsigned char flag; /* flag byte for temporary object characteristics */
+ short references; /* count of pointers to this object
+ (plus 1 for permanent objects) PNM */
+} ;
+
+/*END SHARED*/
+/*SHARED*/
+
+#define XOBJ_COMMON char type; unsigned char flag; short references;
+
+/*END SHARED*/
+/*SHARED*/
+
+
+#define INVALIDTYPE 0
+#define FONTTYPE 1
+#define REGIONTYPE 3
+#define PICTURETYPE 4
+#define SPACETYPE 5
+#define LINESTYLETYPE 6
+#define EDGETYPE 7
+#define STROKEPATHTYPE 8
+#define CLUTTYPE 9
+
+#define ISPATHTYPE(type) ((type)&0x10) /* all path segments have this bit on */
+#define LINETYPE (0+ISPATHTYPE(ON))
+#define CONICTYPE (1+ISPATHTYPE(ON))
+#define BEZIERTYPE (2+ISPATHTYPE(ON))
+#define HINTTYPE (3+ISPATHTYPE(ON))
+
+#define MOVETYPE (5+ISPATHTYPE(ON))
+#define TEXTTYPE (6+ISPATHTYPE(ON))
+
+/*END SHARED*/
+/*SHARED*/
+
+#define ISPERMANENT(flag) ((flag)&0x01)
+#define ISIMMORTAL(flag) ((flag)&0x02)
+
+/*END SHARED*/
+/*SHARED*/
+
+#define PRESERVE(obj) if (!ISPERMANENT((obj)->flag)) \
+ (obj)->references++;
+
+/*END SHARED*/
+/*SHARED*/
+
+#define INT32COPY(dest,source,bytes) { \
+ register int32_t *p1 = (int32_t *)dest; register int32_t *p2 = (int32_t *)source; \
+ register int count = (bytes) / sizeof(int32_t); \
+ while (--count >= 0) *p1++ = *p2++; }
+
+
+/*END SHARED*/
+/*SHARED*/
+
+#define FOLLOWING(p) ((p)+1)
+
+/*END SHARED*/
+/*SHARED*/
+
+#define TYPECHECK(name, obj, expect, whenBAD, consumables, rettype) { \
+ if (obj->type != expect) { \
+ (Consume)consumables; \
+ return((rettype)TypeErr(name, obj, expect, whenBAD)); \
+ } \
+}
+
+/*END SHARED*/
+/*SHARED*/
+
+#define ARGCHECK(test,msg,obj,whenBAD,consumables,rettype) { \
+ if (test) { \
+ (Consume)consumables; \
+ return((rettype)ArgErr(msg, obj, whenBAD)); \
+ } \
+}
+
+/*END SHARED*/
+/*SHARED*/
+
+/* Changed use of Dup() below to Temporary(Copy()) because Dup() does not
+ necessarily return a Unique Copy anymore! 3-26-91 */
+#define TYPENULLCHECK(name, obj, expect, whenBAD, consumables,rettype) \
+ if (obj == NULL) { \
+ (Consume)consumables; \
+ if (whenBAD != NULL && ISPERMANENT(whenBAD->flag)) \
+ return((rettype)Temporary(Copy(whenBAD))); \
+ else return((rettype)whenBAD); \
+ } else { \
+ if (obj->type != expect) { \
+ (Consume)consumables; \
+ return((rettype)TypeErr(name, obj, expect, whenBAD)); \
+ } \
+ }
+/*END SHARED*/
+/*SHARED*/
+
+#define MAKECONSUME(obj,stmt) { if (!ISPERMANENT(obj->flag)) stmt; }
+
+/*END SHARED*/
+/*SHARED*/
+
+#define MAKEUNIQUE(obj,stmt) ( ( (obj)->references > 1 ) ? stmt : obj )
+
+/*END SHARED*/
+/*SHARED*/
+/* NDW: personally, I want to see status and error messages! */
+#define IfTrace0(condition,model) \
+ {if (condition) printf("%s",model);}
+#define IfTrace1(condition,model,arg0) \
+ {if (condition) printf(model,arg0);}
+#define IfTrace2(condition,model,arg0,arg1) \
+ {if (condition) printf(model,arg0,arg1);}
+#define IfTrace3(condition,model,arg0,arg1,arg2) \
+ {if (condition) printf(model,arg0,arg1,arg2);}
+#define IfTrace4(condition,model,arg0,arg1,arg2,arg3) \
+ {if (condition) printf(model,arg0,arg1,arg2,arg3);}
+#define IfTrace5(condition,model,arg0,arg1,arg2,arg3,arg4) \
+ {if (condition) printf(model,arg0,arg1,arg2,arg3,arg4);}
+#define IfTrace6(condition,model,arg0,arg1,arg2,arg3,arg4,arg5) \
+ {if (condition) printf(model,arg0,arg1,arg2,arg3,arg4,arg5);}
+/* NDW: patch ends */
+
+void Trace0();
+char *Trace1(),*Trace2(),*Trace3(),*Trace4(),*Trace5(),*Trace6();
+
+#ifdef GLOBALS
+
+#define extern
+#define INITIALIZED(value) = value
+
+#else
+
+#define INITIALIZED(value)
+
+#endif
+
+extern char MustCheckArgs INITIALIZED(TRUE);
+extern char MustTraceCalls INITIALIZED(FALSE);
+extern char MustCrash INITIALIZED(TRUE);
+extern char InternalTrace INITIALIZED(TRUE);
+extern char LineIOTrace INITIALIZED(TRUE);
+
+extern char ProcessHints INITIALIZED(TRUE);
+
+extern char SaveFontPaths INITIALIZED(TRUE);
+
+extern short CRASTERCompressionType INITIALIZED(1);
+
+extern char ConicDebug INITIALIZED(0);
+extern char LineDebug INITIALIZED(0);
+extern char RegionDebug INITIALIZED(0);
+extern char PathDebug INITIALIZED(0);
+extern char FontDebug INITIALIZED(0);
+extern char SpaceDebug INITIALIZED(0);
+extern char StrokeDebug INITIALIZED(0);
+extern char MemoryDebug INITIALIZED(0);
+extern char HintDebug INITIALIZED(0);
+extern char ImageDebug INITIALIZED(0);
+extern char OffPageDebug INITIALIZED(0);
+
+extern short CachedChars INITIALIZED(0x7FFF);
+extern short CachedFonts INITIALIZED(0x7FFF);
+extern int CacheBLimit INITIALIZED(12500);
+extern char Continuity INITIALIZED(2);
+
+#ifdef extern
+#undef extern
+#endif
+
+extern void Xfree(void*);
+
+/*END SHARED*/
diff --git a/fonts/utilities/ps2pk/paths.c b/fonts/utilities/ps2pk/paths.c
new file mode 100644
index 0000000000..fc7cb511cb
--- /dev/null
+++ b/fonts/utilities/ps2pk/paths.c
@@ -0,0 +1,1395 @@
+/* $XConsortium: paths.c,v 1.4 91/10/10 11:18:40 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+ /* PATHS CWEB V0021 ******** */
+/*
+:h1 id=paths.PATHS Module - Path Operator Handler
+
+This is the module that is responsible for building and transforming
+path lists.
+
+&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com)
+
+
+:h3.Include Files
+
+The included files are:
+*/
+
+ /* after the system includes (dsr) */
+#include "types.h"
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "regions.h" /* understands about Union */
+#include "fonts.h" /* understands about TEXTTYPEs */
+#include "pictures.h" /* understands about handles */
+#include "strokes.h" /* understands how to coerce stroke paths */
+
+static void UnClose(struct segment *);
+
+/*
+:h3.Routines Available to the TYPE1IMAGER User
+
+The PATHS routines that are made available to the outside user are:
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.Functions Provided to Other Modules
+
+The path routines that are made available to other TYPE1IMAGER modules
+are defined here:
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+NOTE: because of the casts put in the macros for Loc, ArcCA, Conic,
+RoundConic, PathSegment, and JoinSegment, we cannot use the macro names
+when the functions are actually defined. We have to use the unique
+names with their unique first two characters. Thus, if anyone in the
+future ever decided to change the first two characters, it would not be
+enough just to change the macro (as it would for most other functions).
+He would have to also change the function definition.
+*/
+/*
+:h3.Macros Provided to Other Modules
+
+The CONCAT macro is defined here and used in the STROKES module. See
+:hdref refid=pathmac..
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h2.Path Segment Structures
+
+A path is represented as a linked list of the following structure:
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+When 'link' is NULL, we are at the last segment in the path (surprise!).
+
+'last' is only non-NULL on the first segment of a path,
+for all the other segments 'last' == NULL. We test for a non-NULL
+'last' (ISPATHANCHOR predicate) when we are given an alleged path
+to make sure the user is not trying to pull a fast one on us.
+
+A path may be a collection of disjoint paths. Every break in the
+disjoint path is represented by a MOVETYPE segment.
+
+Closed paths are discussed in :hdref refid=close..
+
+:h3.CopyPath() - Physically Duplicating a Path
+
+This simple function illustrates moving through the path linked list.
+Duplicating a segment just involves making a copy of it, except for
+text, which has some auxilliary things involved. We don't feel
+competent to duplicate text in this module, so we call someone who
+knows how (in the FONTS module).
+*/
+struct segment *CopyPath(
+ register struct segment *p0) /* path to duplicate */
+{
+ register struct segment *p,*n,*last,*anchor;
+
+ for (p = p0, anchor = NULL; p != NULL; p = p->link) {
+
+ ARGCHECK((!ISPATHTYPE(p->type) || (p != p0 && p->last != NULL)),
+ "CopyPath: invalid segment", p, NULL, (0), struct segment *);
+
+ if (p->type == TEXTTYPE)
+ n = (struct segment *) CopyText(p);
+ else
+ n = (struct segment *)Allocate(p->size, p, 0);
+ n->last = NULL;
+ if (anchor == NULL)
+ anchor = n;
+ else
+ last->link = n;
+ last = n;
+ }
+/*
+At this point we have a chain of newly allocated segments hanging off
+'anchor'. We need to make sure the first segment points to the last:
+*/
+ if (anchor != NULL) {
+ n->link = NULL;
+ anchor->last = n;
+ }
+
+ return(anchor);
+}
+/*
+:h3.KillPath() - Destroying a Path
+
+Destroying a path is simply a matter of freeing each segment in the
+linked list. Again, we let the experts handle text.
+*/
+void KillPath(
+ register struct segment *p) /* path to destroy */
+{
+ register struct segment *linkp; /* temp register holding next segment*/
+
+ /* return conditional based on reference count 3-26-91 PNM */
+ if ( (--(p->references) > 1) ||
+ ( (p->references == 1) && !ISPERMANENT(p->flag) ) )
+ return;
+
+ while (p != NULL) {
+ if (!ISPATHTYPE(p->type)) {
+ ArgErr("KillPath: bad segment", p, NULL);
+ return;
+ }
+ linkp = p->link;
+ if (p->type == TEXTTYPE)
+ KillText(p);
+ else
+ Free(p);
+ p = linkp;
+ }
+}
+
+/*
+:h2 id=location."location" Objects
+
+The TYPE1IMAGER user creates and destroys objects of type "location". These
+objects locate points for the primitive path operators. We play a trick
+here and store these objects in the same "segment" structure used for
+paths, with a type field == MOVETYPE.
+
+This allows the Line() operator, for example, to be very trivial:
+It merely stamps its input structure as a LINETYPE and returns it to the
+caller--assuming, of course, the input structure was not permanent (as
+it usually isn't).
+
+:h3.The "movesegment" Template Structure
+
+This template is used as a generic segment structure for Allocate:
+*/
+
+/* added reference field 1 to temporary template below 3-26-91 PNM */
+static struct segment movetemplate = { MOVETYPE, 0, 1, sizeof(struct segment), 0,
+ NULL, NULL, { 0, 0 } };
+/*
+:h3.Loc() - Create an "Invisible Line" Between (0,0) and a Point
+
+*/
+
+struct segment *t1_Loc(
+ register struct XYspace *S, /* coordinate space to interpret X,Y */
+ DOUBLE x, DOUBLE y) /* destination point */
+{
+ register struct segment *r;
+
+
+ IfTrace3((MustTraceCalls),"..Loc(S=%p, x=%f, y=%f)\n", S, x, y);
+
+ r = (struct segment *)Allocate(sizeof(struct segment), &movetemplate, 0);
+ TYPECHECK("Loc", S, SPACETYPE, r, (0), struct segment *);
+
+ r->last = r;
+ r->context = S->context;
+ (*S->convert)(&r->dest, S, x, y);
+ ConsumeSpace(S);
+ return(r);
+}
+/*
+:h3.ILoc() - Loc() With Integer Arguments
+
+*/
+struct segment *ILoc(
+ register struct XYspace *S, /* coordinate space to interpret X,Y */
+ register int x, register int y) /* destination point */
+{
+ register struct segment *r;
+
+ IfTrace3((MustTraceCalls),"..ILoc(S=%p, x=%d, y=%d)\n",
+ S, (int32_t) x, (int32_t) y);
+ r = (struct segment *)Allocate(sizeof(struct segment), &movetemplate, 0);
+ TYPECHECK("Loc", S, SPACETYPE, r, (0), struct segment *);
+
+ r->last = r;
+ r->context = S->context;
+ (*S->iconvert)(&r->dest, S, (int32_t) x, (int32_t) y);
+ ConsumeSpace(S);
+ return(r);
+}
+
+/*
+:h2.Straight Line Segments
+
+:h3.PathSegment() - Create a Generic Path Segment
+
+Many routines need a LINETYPE or MOVETYPE path segment, but do not
+want to go through the external user's interface, because, for example,
+they already know the "fractpel" destination of the segment and the
+conversion is unnecessary. PathSegment() is an internal routine
+provided to the rest of TYPE1IMAGER for handling these cases.
+*/
+
+struct segment *t1_PathSegment(
+ int type, /* LINETYPE or MOVETYPE */
+ fractpel x, fractpel y) /* where to go to, if known */
+{
+ register struct segment *r; /* newly created segment */
+
+ r = (struct segment *)Allocate(sizeof(struct segment), &movetemplate, 0);
+ r->type = type;
+ r->last = r; /* last points to itself for singleton */
+ r->dest.x = x;
+ r->dest.y = y;
+ return(r);
+}
+/*
+:h3.Line() - Create a Line Segment Between (0,0) and a Point P
+
+This involves just creating and filling out a segment structure:
+*/
+struct segment *Line(
+ register struct segment *P) /* relevant coordinate space */
+{
+
+ IfTrace1((MustTraceCalls),"..Line(%p)\n", P);
+ ARGCHECK(!ISLOCATION(P), "Line: arg not a location", P, NULL, (0), struct segment *);
+
+ P = UniquePath(P);
+ P->type = LINETYPE;
+ return(P);
+}
+/*
+:h2.Curved Path Segments
+
+We need more points to describe curves. So, the structures for curved
+path segments are slightly different. The first part is identical;
+the curved structures are larger with the extra points on the end.
+
+:h3.Bezier Segment Structure
+
+We support third order Bezier curves. They are specified with four
+control points A, B, C, and D. The curve starts at A with slope AB
+and ends at D with slope CD. The curvature at the point A is inversely
+related to the length |AB|, and the curvature at the point D is
+inversely related to the length |CD|. Point A is always point (0,0).
+
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.Bezier() - Generate a Bezier Segment
+
+This is just a simple matter of filling out a 'beziersegment' structure:
+*/
+
+struct beziersegment *Bezier(
+ register struct segment *B, /* second control point */
+ register struct segment *C, /* third control point */
+ register struct segment *D) /* fourth control point (ending point) */
+{
+/* added reference field of 1 to temporary template below 3-26-91 PNM */
+ static struct beziersegment template =
+ { BEZIERTYPE, 0, 1, sizeof(struct beziersegment), 0,
+ NULL, NULL, { 0, 0 }, { 0, 0 }, { 0, 0 } };
+
+ register struct beziersegment *r; /* output segment */
+
+ IfTrace3((MustTraceCalls),"..Bezier(%p, %p, %p)\n", B, C, D);
+ ARGCHECK(!ISLOCATION(B), "Bezier: bad B", B, NULL, (2,C,D), struct beziersegment *);
+ ARGCHECK(!ISLOCATION(C), "Bezier: bad C", C, NULL, (2,B,D), struct beziersegment *);
+ ARGCHECK(!ISLOCATION(D), "Bezier: bad D", D, NULL, (2,B,C), struct beziersegment *);
+
+ r = (struct beziersegment *)Allocate(sizeof(struct beziersegment), &template, 0);
+ r->last = (struct segment *) r;
+ r->dest.x = D->dest.x;
+ r->dest.y = D->dest.y;
+ r->B.x = B->dest.x;
+ r->B.y = B->dest.y;
+ r->C.x = C->dest.x;
+ r->C.y = C->dest.y;
+
+ ConsumePath(B);
+ ConsumePath(C);
+ ConsumePath(D);
+ return(r);
+}
+
+/*
+:h2.Font "Hint" Segments
+
+:h3.Hint() - A Font 'Hint' Segment
+
+This is temporary code while we experiment with hints.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+struct hintsegment *Hint(
+ struct XYspace *S,
+ float ref,
+ float width,
+ char orientation,
+ char hinttype,
+ char adjusttype,
+ char direction,
+ int label)
+{
+/* added reference field of 1 to hintsegment template below 3-26-91 PNM */
+ static struct hintsegment template = { HINTTYPE, 0, 1, sizeof(struct hintsegment), 0,
+ NULL, NULL, { 0, 0 }, { 0, 0 }, { 0, 0 },
+ ' ', ' ', ' ', ' ', 0};
+
+ register struct hintsegment *r;
+
+ r = (struct hintsegment *)Allocate(sizeof(struct hintsegment), &template, 0);
+
+ r->orientation = orientation;
+ if (width == 0.0) width = 1.0;
+
+ if (orientation == 'h') {
+ (*S->convert)(&r->ref, S, 0.0, ref);
+ (*S->convert)(&r->width, S, 0.0, width);
+ }
+ else if (orientation == 'v') {
+ (*S->convert)(&r->ref, S, ref, 0.0);
+ (*S->convert)(&r->width, S, width, 0.0);
+ }
+ else
+ return((struct hintsegment *)ArgErr("Hint: orient not 'h' or 'v'", NULL, NULL));
+ if (r->width.x < 0) r->width.x = - r->width.x;
+ if (r->width.y < 0) r->width.y = - r->width.y;
+ r->hinttype = hinttype;
+ r->adjusttype = adjusttype;
+ r->direction = direction;
+ r->label = label;
+ r->last = (struct segment *) r;
+ ConsumeSpace(S);
+ return(r);
+}
+
+/*
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+POP removes the first segment in a path 'p' and Frees it. 'p' is left
+pointing to the end of the path:
+*/
+#define POP(p) \
+ { register struct segment *linkp; \
+ linkp = p->link; \
+ if (linkp != NULL) \
+ linkp->last = p->last; \
+ Free(p); \
+ p = linkp; }
+/*
+INSERT inserts a single segment in the middle of a chain. 'b' is
+the segment before, 'p' the segment to be inserted, and 'a' the
+segment after.
+*/
+#define INSERT(b,p,a) b->link=p; p->link=a; p->last=NULL
+
+/*
+:h3.Join() - Join Two Objects Together
+
+If these are paths, this operator simply invokes the CONCAT macro.
+Why so much code then, you ask? Well we have to check for object
+types other than paths, and also check for certain path consistency
+rules.
+*/
+
+struct segment *Join(
+ register struct segment *p1, register struct segment *p2)
+{
+ IfTrace2((MustTraceCalls),"..Join(%p, %p)\n", p1, p2);
+/*
+We start with a whole bunch of very straightforward argument tests:
+*/
+ if (p2 != NULL) {
+ if (!ISPATHTYPE(p2->type)) {
+
+ if (p1 == NULL)
+ return((struct segment *)Unique((struct xobject *)p2));
+
+ switch (p1->type) {
+
+ case REGIONTYPE:
+
+ case STROKEPATHTYPE:
+ p1 = CoercePath(p1);
+ break;
+
+ default:
+ return((struct segment *)BegHandle(p1, p2));
+ }
+ }
+
+ ARGCHECK((p2->last == NULL), "Join: right arg not anchor", p2, NULL, (1,p1), struct segment *);
+ p2 = UniquePath(p2);
+
+/*
+In certain circumstances, we don't have to duplicate a permanent
+location. (We would just end up destroying it anyway). These cases
+are when 'p2' begins with a move-type segment:
+*/
+ if (p2->type == TEXTTYPE || p2->type == MOVETYPE) {
+ if (p1 == NULL)
+ return(p2);
+ if (ISLOCATION(p1)) {
+ p2->dest.x += p1->dest.x;
+ p2->dest.y += p1->dest.y;
+ ConsumePath(p1);
+ return(p2);
+ }
+ }
+ }
+ else
+ return((struct segment *)Unique((struct xobject *)p1));
+
+ if (p1 != NULL) {
+ if (!ISPATHTYPE(p1->type))
+
+ switch (p2->type) {
+
+ case REGIONTYPE:
+
+ case STROKEPATHTYPE:
+ p2 = CoercePath(p2);
+ break;
+
+ default:
+ return((struct segment *)EndHandle(p1, p2));
+ }
+
+ ARGCHECK((p1->last == NULL), "Join: left arg not anchor", p1, NULL, (1,p2), struct segment *);
+ p1 = UniquePath(p1);
+ }
+ else
+ return(p2);
+
+/*
+At this point all the checking is done. We have two temporary non-null
+path types in 'p1' and 'p2'. If p1 ends with a MOVE, and p2 begins with
+a MOVE, we collapse the two MOVEs into one. We enforce the rule that
+there may not be two MOVEs in a row:
+*/
+
+ if (p1->last->type == MOVETYPE && p2->type == MOVETYPE) {
+ p1->last->flag |= p2->flag;
+ p1->last->dest.x += p2->dest.x;
+ p1->last->dest.y += p2->dest.y;
+ POP(p2);
+ if (p2 == NULL)
+ return(p1);
+ }
+/*
+Now we check for another silly rule. If a path has any TEXTTYPEs,
+then it must have only TEXTTYPEs and MOVETYPEs, and furthermore,
+it must begin with a TEXTTYPE. This rule makes it easy to check
+for the special case of text. If necessary, we will coerce
+TEXTTYPEs into paths so we don't mix TEXTTYPEs with normal paths.
+*/
+ if (p1->type == TEXTTYPE) {
+ if (p2->type != TEXTTYPE && !ISLOCATION(p2))
+ p1 = CoerceText(p1);
+ }
+ else {
+ if (p2->type == TEXTTYPE) {
+ if (ISLOCATION(p1)) {
+ p2->dest.x += p1->dest.x;
+ p2->dest.y += p1->dest.y;
+ Free(p1);
+ return(p2);
+ }
+ else
+ p2 = CoerceText(p2);
+ }
+ }
+/*
+Thank God! Finally! It's hard to believe, but we are now able to
+actually do the join. This is just invoking the CONCAT macro:
+*/
+ CONCAT(p1, p2);
+
+ return(p1);
+}
+
+/*
+:h3.JoinSegment() - Create a Path Segment and Join It to a Known Path
+
+This internal function is quicker than a full-fledged join because
+it can do much less checking.
+*/
+
+struct segment *t1_JoinSegment(
+ register struct segment *before, /* path to join before new segment */
+ int type, /* type of new segment (MOVETYPE or LINETYPE) */
+ fractpel x, fractpel y, /* x,y of new segment */
+ register struct segment *after) /* path to join after new segment */
+{
+ register struct segment *r; /* returned path built here */
+
+ r = PathSegment(type, x, y);
+ if (before != NULL) {
+ CONCAT(before, r);
+ r = before;
+ }
+ else
+ r->context = after->context;
+ if (after != NULL)
+ CONCAT(r, after);
+ return(r);
+}
+
+/*
+:h2.Other Path Functions
+
+*/
+
+
+struct segment *t1_ClosePath(
+ register struct segment *p0, /* path to close */
+ register int lastonly) /* flag deciding to close all subpaths or... */
+{
+ register struct segment *p,*last,*start; /* used in looping through path */
+ register fractpel x,y; /* current position in path */
+ register fractpel firstx,firsty; /* start position of sub path */
+ register struct segment *lastnonhint; /* last non-hint segment in path */
+
+ IfTrace1((MustTraceCalls),"ClosePath(%p)\n", p0);
+ if (p0 != NULL && p0->type == TEXTTYPE)
+ return(UniquePath(p0));
+ if (p0->type == STROKEPATHTYPE)
+ return((struct segment *)Unique((struct xobject *)p0));
+ /*
+ * NOTE: a null closed path is different from a null open path
+ * and is denoted by a closed (0,0) move segment. We make
+ * sure this path begins and ends with a MOVETYPE:
+ */
+ if (p0 == NULL || p0->type != MOVETYPE)
+ p0 = JoinSegment(NULL, MOVETYPE, 0, 0, p0);
+ TYPECHECK("ClosePath", p0, MOVETYPE, NULL, (0), struct segment *);
+ if (p0->last->type != MOVETYPE)
+ p0 = JoinSegment(p0, MOVETYPE, 0, 0, NULL);
+
+ p0 = UniquePath(p0);
+
+ lastnonhint = NULL;
+/*
+We now begin a loop through the path,
+incrementing current 'x' and 'y'. We are searching
+for MOVETYPE segments (breaks in the path) that are not already closed.
+At each break, we insert a close segment.
+*/
+ for (p = p0, x = y = 0, start = NULL;
+ p != NULL;
+ x += p->dest.x, y += p->dest.y, last = p, p = p->link) {
+
+ if (p->type == MOVETYPE) {
+ if (start != NULL && (lastonly?p->link==NULL:TRUE) &&
+ !(ISCLOSED(start->flag) && LASTCLOSED(last->flag))) {
+ register struct segment *r; /* newly created */
+
+ start->flag |= ISCLOSED(ON);
+ r = PathSegment(LINETYPE, firstx - x,
+ firsty - y);
+ INSERT(last, r, p);
+ r->flag |= LASTCLOSED(ON);
+ /*< adjust 'last' if possible for a 0,0 close >*/
+
+#define CLOSEFUDGE 3 /* if we are this close, let's change last segment */
+ if (r->dest.x != 0 || r->dest.y != 0) {
+ if (r->dest.x <= CLOSEFUDGE && r->dest.x >= -CLOSEFUDGE
+ && r->dest.y <= CLOSEFUDGE && r->dest.y >= -CLOSEFUDGE) {
+ IfTrace2((PathDebug),
+ "ClosePath forced closed by (%d,%d)\n",
+ r->dest.x, r->dest.y);
+ if (lastnonhint == NULL)
+ t1_abort("unexpected NULL pointer in ClosePath");
+ lastnonhint->dest.x += r->dest.x;
+ lastnonhint->dest.y += r->dest.y;
+ r->dest.x = r->dest.y = 0;
+ }
+ }
+ if (p->link != NULL) {
+ p->dest.x += x - firstx;
+ p->dest.y += y - firsty;
+ x = firstx;
+ y = firsty;
+ }
+ }
+ start = p;
+ firstx = x + p->dest.x;
+ firsty = y + p->dest.y;
+ }
+ else if (p->type != HINTTYPE)
+ lastnonhint = p;
+ }
+ return(p0);
+}
+/*
+*/
+/*
+:h2.Reversing the Direction of a Path
+
+This turned out to be more difficult than I thought at first. The
+trickiness was due to the fact that closed paths must remain closed,
+etc.
+
+We need three subroutines:
+*/
+
+static struct segment *SplitPath(struct segment *, struct segment *); /* break a path at any point */
+static struct segment *DropSubPath(struct segment *); /* breaks a path after first sub-path */
+static struct segment *ReverseSubPath(struct segment *); /* reverses a single sub-path */
+
+/*
+:h3.Reverse() - User Operator to Reverse a Path
+
+This operator reverses the entire path.
+*/
+
+struct segment *Reverse(
+ register struct segment *p) /* full path to reverse */
+{
+ register struct segment *r; /* output path built here */
+ register struct segment *nextp; /* contains next sub-path */
+
+ IfTrace1((MustTraceCalls),"Reverse(%p)\n", p);
+
+ if (p == NULL)
+ return(NULL);
+
+ ARGCHECK(!ISPATHANCHOR(p), "Reverse: invalid path", p, NULL, (0), struct segment *);
+
+ if (p->type == TEXTTYPE)
+ p = CoerceText(p);
+ p = UniquePath(p);
+
+ r = NULL;
+
+ do {
+ nextp = DropSubPath(p);
+ p = ReverseSubPath(p);
+ r = Join(p, r);
+ p = nextp;
+
+ } while (p != NULL);
+
+ return(r);
+}
+
+/*
+:h4.ReverseSubPath() - Subroutine to Reverse a Single Sub-Path
+*/
+
+static struct segment *ReverseSubPath(
+ register struct segment *p) /* input path */
+{
+ register struct segment *r; /* reversed path will be created here */
+ register struct segment *nextp; /* temporary variable used in loop */
+ register int wasclosed; /* flag, path was closed */
+
+ if (p == NULL)
+ return(NULL);
+
+ wasclosed = ISCLOSED(p->flag);
+ r = NULL;
+
+ do {
+/*
+First we reverse the direction of this segment and clean up its flags:
+*/
+ p->dest.x = - p->dest.x; p->dest.y = - p->dest.y;
+ p->flag &= ~(ISCLOSED(ON) | LASTCLOSED(ON));
+
+ switch (p->type) {
+
+ case LINETYPE:
+ case MOVETYPE:
+ break;
+
+ case CONICTYPE:
+ {
+/*
+The logic of this is that the new M point (stored relative to the new
+beginning) is (M - C). However, C ("dest") has already been reversed
+So, we add "dest" instead of subtracting it:
+*/
+ register struct conicsegment *cp = (struct conicsegment *) p;
+
+ cp->M.x += cp->dest.x; cp->M.y += cp->dest.y;
+ }
+ break;
+
+ case BEZIERTYPE:
+ {
+ register struct beziersegment *bp = (struct beziersegment *) p;
+
+ bp->B.x += bp->dest.x; bp->B.y += bp->dest.y;
+ bp->C.x += bp->dest.x; bp->C.y += bp->dest.y;
+ }
+ break;
+
+ case HINTTYPE:
+ {
+ register struct hintsegment *hp = (struct hintsegment *) p;
+
+ hp->ref.x = -hp->ref.x; hp->ref.y = -hp->ref.y;
+ }
+ break;
+
+ default:
+ t1_abort("Reverse: bad path segment");
+ }
+/*
+We need to reverse the order of segments too, so we break this segment
+off of the input path, and tack it on the front of the growing path
+in 'r':
+*/
+ nextp = p->link;
+ p->link = NULL;
+ p->last = p;
+ if (r != NULL)
+ CONCAT(p,r); /* leaves result in 'p'... not what we want */
+ r = p;
+ p = nextp; /* advance to next segment in input path */
+
+ } while (p != NULL);
+
+ if (wasclosed)
+ r = ClosePath(r);
+
+ return(r);
+}
+
+/*
+:h4.DropSubPath() - Drops the First Sub-Path Off a Path
+
+This subroutine returns the remaining sub-path(s). While doing so, it
+breaks the input path after the first sub-path so that a pointer to
+the original path now contains the first sub-path only.
+*/
+
+static struct segment *DropSubPath(
+ register struct segment *p0) /* original path */
+{
+ register struct segment *p; /* returned remainder here */
+
+ for (p = p0; p->link != NULL; p = p->link) {
+ if (p->link->type == MOVETYPE)
+ break;
+ }
+
+ return(SplitPath(p0, p));
+}
+
+static struct segment *SplitPath(
+ register struct segment *anchor,
+ register struct segment *before)
+{
+ register struct segment *r;
+
+ if (before == anchor->last)
+ return(NULL);
+
+ r = before->link;
+ r->last = anchor->last;
+ anchor->last = before;
+ before->link = NULL;
+
+ return(r);
+}
+
+
+/*
+:h3.ReverseSubPaths() - Reverse the Direction of Sub-paths Within a Path
+
+This user operator reverses the sub-paths in a path, but leaves the
+'move' segments unchanged. It builds on top of the subroutines
+already established.
+*/
+
+struct segment *ReverseSubPaths(
+ register struct segment *p) /* input path */
+{
+ register struct segment *r; /* reversed path will be created here */
+ register struct segment *nextp; /* temporary variable used in loop */
+ int wasclosed; /* flag; subpath was closed */
+ register struct segment *nomove; /* the part of sub-path without move segment */
+ struct fractpoint delta;
+
+ IfTrace1((MustTraceCalls),"ReverseSubPaths(%p)\n", p);
+
+ if (p == NULL)
+ return(NULL);
+
+ ARGCHECK(!ISPATHANCHOR(p), "ReverseSubPaths: invalid path", p, NULL, (0), struct segment *);
+
+ if (p->type == TEXTTYPE)
+ p = CoerceText(p);
+ if (p->type != MOVETYPE)
+ p = JoinSegment(NULL, MOVETYPE, 0, 0, p);
+
+ p = UniquePath(p);
+
+ r = NULL;
+
+ for (; p != NULL;) {
+ nextp = DropSubPath(p);
+ wasclosed = ISCLOSED(p->flag);
+ if (wasclosed)
+ UnClose(p);
+
+ nomove = SplitPath(p, p);
+ r = Join(r, p);
+
+ PathDelta(nomove, &delta);
+
+ nomove = ReverseSubPath(nomove);
+ p->dest.x += delta.x;
+ p->dest.y += delta.y;
+ if (nextp != NULL) {
+ nextp->dest.x += delta.x;
+ nextp->dest.y += delta.y;
+ }
+ if (wasclosed) {
+ nomove = ClosePath(nomove);
+ nextp->dest.x -= delta.x;
+ nextp->dest.y -= delta.y;
+ }
+ r = Join(r, nomove);
+ p = nextp;
+
+ }
+
+ return(r);
+}
+
+static void UnClose(register struct segment *p0)
+{
+ register struct segment *p;
+
+ for (p=p0; p->link->link != NULL; p=p->link) { ; }
+
+ if (!LASTCLOSED(p->link->flag))
+ t1_abort("UnClose: no LASTCLOSED");
+
+ Free(SplitPath(p0, p));
+ p0->flag &= ~ISCLOSED(ON);
+}
+
+/*
+:h2.Transforming and Putting Handles on Paths
+
+:h3.PathTransform() - Transform a Path
+
+Transforming a path involves transforming all the points. In order
+that closed paths do not become "unclosed" when their relative
+positions are slightly changed due to loss of arithmetic precision,
+all point transformations are in absolute coordinates.
+
+(It might be better to reset the "absolute" coordinates every time a
+move segment is encountered. This would mean that we could accumulate
+error from subpath to subpath, but we would be less likely to make
+the "big error" where our fixed point arithmetic "wraps". However, I
+think I'll keep it this way until something happens to convince me
+otherwise.)
+
+The transform is described as a "space", that way we can use our
+old friend the "iconvert" function, which should be very efficient.
+*/
+
+struct segment *PathTransform(
+ register struct segment *p0, /* path to transform */
+ register struct XYspace *S) /* pseudo space to transform in */
+{
+ register struct segment *p; /* to loop through path with */
+ register fractpel newx,newy; /* current transformed position in path */
+ register fractpel oldx,oldy; /* current untransformed position in path */
+ register fractpel savex,savey; /* save path delta x,y */
+
+ p0 = UniquePath(p0);
+
+ newx = newy = oldx = oldy = 0;
+
+ for (p=p0; p != NULL; p=p->link) {
+
+ savex = p->dest.x; savey = p->dest.y;
+
+ (*S->iconvert)(&p->dest, S, p->dest.x + oldx, p->dest.y + oldy);
+ p->dest.x -= newx;
+ p->dest.y -= newy;
+
+ switch (p->type) {
+
+ case LINETYPE:
+ case MOVETYPE:
+ break;
+
+ case CONICTYPE:
+ {
+ register struct conicsegment *cp = (struct conicsegment *) p;
+
+ (*S->iconvert)(&cp->M, S, cp->M.x + oldx, cp->M.y + oldy);
+ cp->M.x -= newx;
+ cp->M.y -= newy;
+ /*
+ * Note roundness doesn't change... linear transform
+ */
+ break;
+ }
+
+
+ case BEZIERTYPE:
+ {
+ register struct beziersegment *bp = (struct beziersegment *) p;
+
+ (*S->iconvert)(&bp->B, S, bp->B.x + oldx, bp->B.y + oldy);
+ bp->B.x -= newx;
+ bp->B.y -= newy;
+ (*S->iconvert)(&bp->C, S, bp->C.x + oldx, bp->C.y + oldy);
+ bp->C.x -= newx;
+ bp->C.y -= newy;
+ break;
+ }
+
+ case HINTTYPE:
+ {
+ register struct hintsegment *hp = (struct hintsegment *) p;
+
+ (*S->iconvert)(&hp->ref, S, hp->ref.x + oldx, hp->ref.y + oldy);
+ hp->ref.x -= newx;
+ hp->ref.y -= newy;
+ (*S->iconvert)(&hp->width, S, hp->width.x, hp->width.y);
+ /* Note: width is not relative to origin */
+ break;
+ }
+
+ case TEXTTYPE:
+ {
+ XformText(p,S);
+ break;
+ }
+
+ default:
+ IfTrace1(TRUE,"path = %p\n", p);
+ t1_abort("PathTransform: invalid segment");
+ }
+ oldx += savex;
+ oldy += savey;
+ newx += p->dest.x;
+ newy += p->dest.y;
+ }
+ return(p0);
+}
+
+/*
+:h3.PathDelta() - Return a Path's Ending Point
+*/
+
+void PathDelta(
+ register struct segment *p, /* input path */
+ register struct fractpoint *pt) /* pointer to x,y to set */
+{
+ register fractpel x,y; /* working variables for path current point */
+
+ for (x=y=0; p != NULL; p=p->link) {
+ x += p->dest.x;
+ y += p->dest.y;
+#if 0 /* fonts.h defines TextDelta as empty, thus mypoint is not initialized */
+ if (p->type == TEXTTYPE) {
+ struct fractpoint mypoint;
+
+ TextDelta(p, &mypoint);
+ x += mypoint.x;
+ y += mypoint.y;
+ }
+#endif
+ }
+
+ pt->x = x;
+ pt->y = y;
+}
+
+/*
+:h3.BoundingBox() - Produce a Bounding Box Path
+
+This function is called by image code, when we know the size of the
+image in pels, and need to get a bounding box path that surrounds it.
+The starting/ending handle is in the lower right hand corner.
+*/
+struct segment *BoundingBox(
+ register pel h, register pel w) /* size of box */
+{
+ register struct segment *path;
+
+ path = PathSegment(LINETYPE, -TOFRACTPEL(w), 0);
+ path = JoinSegment(NULL, LINETYPE, 0, -TOFRACTPEL(h), path);
+ path = JoinSegment(NULL, LINETYPE, TOFRACTPEL(w), 0, path);
+ path = ClosePath(path);
+
+ return(path);
+}
+
+/*
+:h2.Querying Locations and Paths
+
+:h3.QueryLoc() - Return the X,Y of a Locition
+*/
+
+void QueryLoc(
+ register struct segment *P, /* location to query, not consumed */
+ register struct XYspace *S, /* XY space to return coordinates in */
+ register DOUBLE *xP, /* coordinates ... */
+ register DOUBLE *yP) /* ... returned here */
+{
+ IfTrace4((MustTraceCalls),"QueryLoc(P=%p, S=%p, (%p, %p))\n",
+ P, S, xP, yP);
+ if (!ISLOCATION(P)) {
+ ArgErr("QueryLoc: first arg not a location", P, NULL);
+ return;
+ }
+ if (S->type != SPACETYPE) {
+ ArgErr("QueryLoc: second arg not a space", S, NULL);
+ return;
+ }
+ UnConvert(S, &P->dest, xP, yP);
+}
+/*
+:h3.QueryPath() - Find Out the Type of Segment at the Head of a Path
+
+This is a very simple routine that looks at the first segment of a
+path and tells the caller what it is, as well as returning the control
+point(s) of the path segment. Different path segments have different
+number of control points. If the caller knows that the segment is
+a move segment, for example, he only needs to pass pointers to return
+one control point.
+*/
+
+void QueryPath(
+ register struct segment *path, /* path to check */
+ register int *typeP, /* return the type of path here */
+ register struct segment **Bp, /* return location of first point */
+ register struct segment **Cp, /* return location of second point */
+ register struct segment **Dp, /* return location of third point */
+ register DOUBLE *fP) /* return Conic sharpness */
+{
+ register int coerced = FALSE; /* did I coerce a text path? */
+
+ IfTrace3((MustTraceCalls), "QueryPath(%p, %p, %p, ...)\n",
+ path, typeP, Bp);
+ if (path == NULL) {
+ *typeP = -1;
+ return;
+ }
+ if (!ISPATHANCHOR(path)) {
+ ArgErr("QueryPath: arg not a valid path", path, NULL);
+ }
+ if (path->type == TEXTTYPE) {
+ path = CoerceText(path);
+ coerced = TRUE;
+ }
+
+ switch (path->type) {
+
+ case MOVETYPE:
+ *typeP = 0;
+ *Bp = PathSegment(MOVETYPE, path->dest.x, path->dest.y);
+ break;
+
+ case LINETYPE:
+ *typeP = (LASTCLOSED(path->flag)) ? 4 : 1;
+ *Bp = PathSegment(MOVETYPE, path->dest.x, path->dest.y);
+ break;
+
+ case CONICTYPE:
+ {
+ register struct conicsegment *cp = (struct conicsegment *) path;
+
+ *typeP = 2;
+ *Bp = PathSegment(MOVETYPE, cp->M.x, cp->M.y);
+ *Cp = PathSegment(MOVETYPE, cp->dest.x, cp->dest.y);
+ *fP = cp->roundness;
+ }
+ break;
+
+ case BEZIERTYPE:
+ {
+ register struct beziersegment *bp = (struct beziersegment *) path;
+
+ *typeP = 3;
+ *Bp = PathSegment(MOVETYPE, bp->B.x, bp->B.y);
+ *Cp = PathSegment(MOVETYPE, bp->C.x, bp->C.y);
+ *Dp = PathSegment(MOVETYPE, bp->dest.x, bp->dest.y);
+ }
+ break;
+
+ case HINTTYPE:
+ *typeP = 5;
+ break;
+
+ default:
+ t1_abort("QueryPath: unknown segment");
+ }
+ if (coerced)
+ KillPath(path);
+}
+/*
+:h3.QueryBounds() - Return the Bounding Box of a Path
+
+Returns the bounding box by setting the user's variables.
+*/
+
+void QueryBounds(
+ register struct segment *p0, /* object to check for bound */
+ struct XYspace *S, /* coordinate space of returned values */
+ DOUBLE *xminP, DOUBLE *yminP,
+ /* lower left hand corner (set by routine) */
+ DOUBLE *xmaxP, DOUBLE *ymaxP)
+ /* upper right hand corner (set by routine) */
+{
+ register struct segment *path; /* loop variable for path segments */
+ register fractpel lastx,lasty; /* loop variables: previous endingpoint */
+ register fractpel x,y; /* loop variables: current ending point */
+ struct fractpoint min; /* registers to keep lower left hand corner */
+ struct fractpoint max; /* registers to keep upper right hand corner */
+ int coerced = FALSE; /* we have coerced the path from another object */
+ DOUBLE x1,y1,x2,y2,x3,y3,x4,y4; /* corners of rectangle in space X */
+
+ IfTrace2((MustTraceCalls), "QueryBounds(%p, %p,", p0, S);
+ IfTrace4((MustTraceCalls), " %p, %p, %p, %p)\n",
+ xminP, yminP, xmaxP, ymaxP);
+ if (S->type != SPACETYPE) {
+ ArgErr("QueryBounds: bad XYspace", S, NULL);
+ return;
+ }
+
+ min.x = min.y = max.x = max.y = 0;
+ if (p0 != NULL) {
+ if (!ISPATHANCHOR(p0)) {
+ switch(p0->type) {
+ case STROKEPATHTYPE:
+ /* replaced DupStrokePath() with Dup() 3-26-91 PNM */
+ p0 = (struct segment *) DoStroke(Dup((struct xobject *)p0));
+ /* no break here, we have a region in p0 */
+ case REGIONTYPE:
+ p0 = RegionBounds((struct region *)p0);
+ break;
+
+ case PICTURETYPE:
+ p0 = PictureBounds(p0);
+ break;
+
+ default:
+ ArgErr("QueryBounds: bad object", p0, NULL);
+ return;
+ }
+ coerced = TRUE;
+ }
+ if (p0->type == TEXTTYPE) {
+ /* replaced CopyPath() with Dup() 3-26-91 PNM */
+ p0 = (struct segment *)CoerceText(Dup((struct xobject *)p0)); /* there are faster ways */
+ coerced = TRUE;
+ }
+ if (p0->type == MOVETYPE) {
+ min.x = max.x = p0->dest.x;
+ min.y = max.y = p0->dest.y;
+ }
+ }
+ lastx = lasty = 0;
+
+ for (path = p0; path != NULL; path = path->link) {
+
+ x = lastx + path->dest.x;
+ y = lasty + path->dest.y;
+
+ switch (path->type) {
+
+ case LINETYPE:
+ break;
+
+ case CONICTYPE:
+ {
+ register struct conicsegment *cp = (struct conicsegment *) path;
+ register fractpel Mx = lastx + cp->M.x;
+ register fractpel My = lasty + cp->M.y;
+ register fractpel deltax = 0.5 * cp->roundness * cp->dest.x;
+ register fractpel deltay = 0.5 * cp->roundness * cp->dest.y;
+ register fractpel Px = Mx - deltax;
+ register fractpel Py = My - deltay;
+ register fractpel Qx = Mx + deltax;
+ register fractpel Qy = My + deltay;
+
+
+ if (Mx < min.x) min.x = Mx;
+ else if (Mx > max.x) max.x = Mx;
+ if (My < min.y) min.y = My;
+ else if (My > max.y) max.y = My;
+
+ if (Px < min.x) min.x = Px;
+ else if (Px > max.x) max.x = Px;
+ if (Py < min.y) min.y = Py;
+ else if (Py > max.y) max.y = Py;
+
+ if (Qx < min.x) min.x = Qx;
+ else if (Qx > max.x) max.x = Qx;
+ if (Qy < min.y) min.y = Qy;
+ else if (Qy > max.y) max.y = Qy;
+ }
+ break;
+
+
+ case MOVETYPE:
+ /*
+ * We can't risk adding trailing Moves to the
+ * bounding box:
+ */
+ if (path->link == NULL)
+ goto done; /* God forgive me */
+ break;
+
+ case BEZIERTYPE:
+ {
+ register struct beziersegment *bp = (struct beziersegment *) path;
+ register fractpel Bx = lastx + bp->B.x;
+ register fractpel By = lasty + bp->B.y;
+ register fractpel Cx = lastx + bp->C.x;
+ register fractpel Cy = lasty + bp->C.y;
+
+ if (Bx < min.x) min.x = Bx;
+ else if (Bx > max.x) max.x = Bx;
+ if (By < min.y) min.y = By;
+ else if (By > max.y) max.y = By;
+
+ if (Cx < min.x) min.x = Cx;
+ else if (Cx > max.x) max.x = Cx;
+ if (Cy < min.y) min.y = Cy;
+ else if (Cy > max.y) max.y = Cy;
+ }
+ break;
+
+ case HINTTYPE:
+ break;
+ default:
+ t1_abort("QueryBounds: unknown type");
+ }
+
+ if (x < min.x) min.x = x;
+ else if (x > max.x) max.x = x;
+ if (y < min.y) min.y = y;
+ else if (y > max.y) max.y = y;
+
+ lastx = x; lasty = y;
+ }
+done:
+ UnConvert(S, &min, &x1, &y1);
+ UnConvert(S, &max, &x4, &y4);
+ x = min.x; min.x = max.x; max.x = x;
+ UnConvert(S, &min, &x2, &y2);
+ UnConvert(S, &max, &x3, &y3);
+
+ *xminP = *xmaxP = x1;
+ if (x2 < *xminP) *xminP = x2;
+ else if (x2 > *xmaxP) *xmaxP = x2;
+ if (x3 < *xminP) *xminP = x3;
+ else if (x3 > *xmaxP) *xmaxP = x3;
+ if (x4 < *xminP) *xminP = x4;
+ else if (x4 > *xmaxP) *xmaxP = x4;
+
+ *yminP = *ymaxP = y1;
+ if (y2 < *yminP) *yminP = y2;
+ else if (y2 > *ymaxP) *ymaxP = y2;
+ if (y3 < *yminP) *yminP = y3;
+ else if (y3 > *ymaxP) *ymaxP = y3;
+ if (y4 < *yminP) *yminP = y4;
+ else if (y4 > *ymaxP) *ymaxP = y4;
+
+ if (coerced)
+ Destroy(p0);
+}
+/*
+:h3.BoxPath()
+*/
+struct segment *BoxPath(struct XYspace *S, int h, int w)
+{
+ struct segment *path;
+
+ path = Join( Line(ILoc(S, w, 0)), Line(ILoc(S, 0, h)) );
+ path = JoinSegment(path, LINETYPE, -path->dest.x, -path->dest.y, NULL);
+ return(ClosePath(path));
+}
+
+/*
+:h3.DropSegment() - Drop the First Segment in a Path
+
+This routine takes the path and returns a new path that is one segment
+shorter. It can be used in conjunction with QueryPath(), for example,
+to ask about an entire path.
+*/
+
+struct segment *DropSegment(register struct segment *path)
+{
+ IfTrace1((MustTraceCalls),"DropSegment(%p)\n", path);
+ if (path != NULL && path->type == STROKEPATHTYPE)
+ path = CoercePath(path);
+ ARGCHECK((path == NULL || !ISPATHANCHOR(path)),
+ "DropSegment: arg not a non-null path", path, path, (0), struct segment *);
+ if (path->type == TEXTTYPE)
+ path = CoerceText(path);
+ path = UniquePath(path);
+
+ POP(path);
+ return(path);
+}
+/*
+:h3.HeadSegment() - Return the First Segment in a Path
+
+This routine takes the path and returns a new path consists of the
+first segment only.
+*/
+
+struct segment *HeadSegment(
+ register struct segment *path) /* input path */
+{
+ IfTrace1((MustTraceCalls),"HeadSegment(%p)\n", path);
+ if (path == NULL)
+ return(NULL);
+ if (path->type == STROKEPATHTYPE)
+ path = CoercePath(path);
+ ARGCHECK(!ISPATHANCHOR(path), "HeadSegment: arg not a path", path, path, (0), struct segment *);
+ if (path->type == TEXTTYPE)
+ path = CoerceText(path);
+ path = UniquePath(path);
+
+ if (path->link != NULL)
+ KillPath(path->link);
+ path->link = NULL;
+ path->last = path;
+ return(path);
+}
diff --git a/fonts/utilities/ps2pk/paths.h b/fonts/utilities/ps2pk/paths.h
new file mode 100644
index 0000000000..f16fd55136
--- /dev/null
+++ b/fonts/utilities/ps2pk/paths.h
@@ -0,0 +1,220 @@
+/* $XConsortium: paths.h,v 1.2 91/10/10 11:18:50 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/*SHARED*/
+
+#include "types.h"
+
+#define Loc(S,x,y) t1_Loc(S,(DOUBLE)x,(DOUBLE)y)
+#define ILoc(S,x,y) t1_ILoc(S,x,y)
+#define Line(P) t1_Line(P)
+#define Join(p1,p2) t1_Join(p1,p2)
+#define ClosePath(p) t1_ClosePath(p,0)
+#define CloseLastSubPath(p) t1_ClosePath(p,1)
+#define Conic(B,C,s) t1_Conic(B,C,(DOUBLE)s)
+#define RoundConic(M,C,r) t1_RoundConic(M,C,(DOUBLE)r)
+#define ArcP3(S,P2,P3) t1_ArcP3(S,P2,P3)
+#define ArcCA(S,C,d) t1_ArcCA(S,C,(DOUBLE)d)
+#define Bezier(B,C,D) t1_Bezier(B,C,D)
+#define Hint(S,r,w,o,h,a,d,l) t1_Hint(S,r,w,o,h,a,d,l)
+#define Reverse(p) t1_Reverse(p)
+#define ReverseSubPaths(p) t1_ReverseSubPaths(p)
+#define AddLoc(p1,p2) t1_Join(p1,p2)
+#if 0
+#define SubLoc(p1,p2) t1_SubLoc(p1,p2)
+#endif
+#define DropSegment(p) t1_DropSegment(p)
+#define HeadSegment(p) t1_HeadSegment(p)
+#define QueryLoc(P,S,x,y) t1_QueryLoc(P,S,x,y)
+#define QueryPath(p,t,B,C,D,r) t1_QueryPath(p,t,B,C,D,r)
+#define QueryBounds(p,S,x1,y1,x2,y2) t1_QueryBounds(p,S,x1,y1,x2,y2)
+
+
+struct segment *t1_Loc(struct XYspace *, DOUBLE, DOUBLE);
+ /* create a location object (or "move" segment) */
+struct segment *t1_ILoc(struct XYspace *, int, int);
+ /* integer argument version of same */
+struct segment *t1_Line(struct segment *); /* straight line path segment */
+struct segment *t1_Join(struct segment *, struct segment *);
+ /* join two paths or regions together */
+struct segment *t1_ClosePath(struct segment *, int);
+ /* close a path or path set */
+struct conicsegment *t1_Conic(); /* conic curve path segment */
+struct conicsegment *t1_RoundConic(); /* ditto, specified another way */
+struct conicsegment *t1_ArcP3(); /* circular path segment with three points */
+struct conicsegment *t1_ArcCA(); /* ditto, with center point and angle */
+struct beziersegment *t1_Bezier(struct segment *, struct segment *,
+ struct segment *); /* Bezier third order curve path segment */
+struct hintsegment *t1_Hint(struct XYspace *, float, float, char,
+ char, char, char, int); /* produce a font 'hint' path segment */
+struct segment *t1_Reverse(struct segment *);
+ /* reverse the complete order of paths */
+struct segment *t1_ReverseSubPaths(struct segment *);
+ /* reverse only sub-paths; moves unchanged */
+struct segment *t1_DropSegment(struct segment *);
+ /* Drop the first segment in a path */
+struct segment *t1_HeadSegment(struct segment *);
+ /* return the first segment in a path */
+void t1_QueryLoc(struct segment *, struct XYspace *, DOUBLE *, DOUBLE *);
+ /* Query location; return its (x,y) */
+void t1_QueryPath(struct segment *, int *typeP, struct segment **,
+ struct segment **, struct segment **, DOUBLE *);
+ /* Query segment at head of a path */
+void t1_QueryBounds(struct segment *, struct XYspace *, DOUBLE *, DOUBLE *,
+ DOUBLE *, DOUBLE *); /* Query the bounding box of a path */
+
+/*END SHARED*/
+/*SHARED*/
+
+#define CopyPath(p) t1_CopyPath(p)
+#define KillPath(p) t1_KillPath(p)
+#define PathTransform(p,m) t1_PathXform(p,m)
+#define PathDelta(p,pt) t1_PathDelta(p,pt)
+#define BoundingBox(h,w) t1_BoundingBox(h,w)
+#define PathSegment(t,x,y) t1_PathSegment(t,(fractpel)x,(fractpel)y)
+#define JoinSegment(b,t,x,y,a) t1_JoinSegment(b,t,(fractpel)x,(fractpel)y,a)
+#define Hypoteneuse(dx,dy) t1_Hypoteneuse(dx,dy)
+#define BoxPath(S,h,w) t1_BoxPath(S,h,w)
+
+struct segment *t1_CopyPath(struct segment *); /* duplicate a path */
+void t1_KillPath(struct segment *); /* destroy a path */
+struct segment *t1_PathXform(struct segment *, struct XYspace *);
+ /* transform a path arbitrarily */
+void t1_PathDelta(struct segment *, struct fractpoint *);
+ /* calculate the ending point of a path */
+struct segment *t1_BoundingBox(pel, pel); /* produce a Bounding Box Path */
+struct segment *t1_PathSegment(int, fractpel, fractpel);
+ /* produce a MOVE or LINE segment */
+struct segment *t1_JoinSegment(struct segment *, int, fractpel, fractpel,
+ struct segment *); /* join a MOVE or LINE segment to a path */
+DOUBLE t1_Hypoteneuse(); /* returns the length of a line */
+struct segment *t1_BoxPath(struct XYspace *, int, int);
+ /* returns a rectangular path */
+
+/*END SHARED*/
+/*SHARED*/
+
+#define ConsumePath(p) MAKECONSUME(p,KillPath(p))
+#define UniquePath(p) MAKEUNIQUE(p,CopyPath(p))
+
+/*END SHARED*/
+/*SHARED*/
+
+struct segment {
+ XOBJ_COMMON /* xobject common data define 3-26-91 PNM */
+ unsigned char size; /* size of the structure */
+ unsigned char context; /* index to device context */
+ struct segment *link; /* pointer to next structure in linked list */
+ struct segment *last; /* pointer to last structure in list */
+ struct fractpoint dest; /* relative ending location of path segment */
+} ;
+
+#define ISCLOSED(flag) ((flag)&0x80) /* subpath is closed */
+#define LASTCLOSED(flag) ((flag)&0x40) /* last segment in closed subpath */
+
+/*
+NOTE: The ISCLOSED flag is set on the MOVETYPE segment before the
+subpath proper; the LASTCLOSED flag is set on the last segment (LINETYPE)
+in the subpath
+
+We define the ISPATHANCHOR predicate to test that a path handle
+passed by the user is valid:
+*/
+
+#define ISPATHANCHOR(p) (ISPATHTYPE(p->type)&&p->last!=NULL)
+
+/*
+For performance reasons, a user's "location" object is identical to
+a path whose only segment is a move segment. We define a predicate
+to test for this case. See also :hdref refid=location..
+*/
+
+#define ISLOCATION(p) ((p)->type == MOVETYPE && (p)->link == NULL)
+
+/*END SHARED*/
+/*SHARED*/
+
+struct conicsegment {
+ XOBJ_COMMON /* xobject common data define 3-26-91 PNM */
+ /* type = CONICTYPE */
+ unsigned char size; /* as with any 'segment' type */
+ unsigned char context; /* as with any 'segment' type */
+ struct segment *link; /* as with any 'segment' type */
+ struct segment *last; /* as with any 'segment' type */
+ struct fractpoint dest; /* Ending point (C point) */
+ struct fractpoint M; /* "midpoint" of conic explained above */
+ float roundness; /* explained above */
+} ;
+/*END SHARED*/
+/*SHARED*/
+
+struct beziersegment {
+ XOBJ_COMMON /* xobject common data define 3-26-91 PNM */
+ /* type = BEZIERTYPE */
+ unsigned char size; /* as with any 'segment' type */
+ unsigned char context; /* as with any 'segment' type */
+ struct segment *link; /* as with any 'segment' type */
+ struct segment *last; /* as with any 'segment' type */
+ struct fractpoint dest; /* ending point (D) */
+ struct fractpoint B; /* control point B */
+ struct fractpoint C; /* control point C */
+} ;
+
+/*END SHARED*/
+/*SHARED*/
+
+struct hintsegment {
+ XOBJ_COMMON /* xobject common data define 3-26-91 PNM */
+ /* type = HINTTYPE */
+ unsigned char size; /* size of the structure */
+ unsigned char context; /* device context */
+ struct segment *link; /* pointer to next structure in linked list */
+ struct segment *last; /* pointer to last structure in list */
+ struct fractpoint dest; /* ALWAYS 0,0 */
+ struct fractpoint ref;
+ struct fractpoint width;
+ char orientation;
+ char hinttype;
+ char adjusttype;
+ char direction;
+ int label;
+} ;
+
+/*END SHARED*/
+/*SHARED*/
+
+/*
+CONCAT links the 'p2' path chain on the end of the 'p1' chain. (This macro
+is also used by the STROKES module.)
+*/
+#define CONCAT(p1, p2) { \
+ p1->last->link = p2; /* link p2 on end of p1 */ \
+ p1->last = p2->last; /* last of new is last of p2 */ \
+ p2->last = NULL; } /* only first segment has non-NULL "last" */
+
+/*END SHARED*/
diff --git a/fonts/utilities/ps2pk/pfb2pfa.1 b/fonts/utilities/ps2pk/pfb2pfa.1
new file mode 100644
index 0000000000..b533d8f7ae
--- /dev/null
+++ b/fonts/utilities/ps2pk/pfb2pfa.1
@@ -0,0 +1,21 @@
+.TH PFB2PFA 1 "1 Feb 2016"
+.SH NAME
+pfb2pfa \- convert a type1 pfb file (binary MSDOS) into a pfa (ASCII)
+.SH SYNOPSIS
+pfb2pfa [-v] pfbfile [pfafile]
+.SH DESCRIPTION
+Program converts a binary MSDOS representation for a type1 PostScript
+font into a readable ASCII version. The MSDOS newline (\\r) is converted
+into the UNIX newline (\\n). The output is written in a file whose name
+is the name that is provided on the command line or the basename of the
+input file plus extension ".pfa".
+.PP
+With the -v option you get some information about what the
+program is doing.
+.SH AUTHOR
+.nf
+Piet Tutelaers
+Maintained in TeX Live; please send bug reports or other correspondence
+to tex-k@tug.org (http://lists.tug.org/tex-k).
+
+
diff --git a/fonts/utilities/ps2pk/pfb2pfa.c b/fonts/utilities/ps2pk/pfb2pfa.c
new file mode 100644
index 0000000000..368d0a9b57
--- /dev/null
+++ b/fonts/utilities/ps2pk/pfb2pfa.c
@@ -0,0 +1,106 @@
+/*
+ * NAME
+ * pfb2pfa - convert a type1 pfb file (binary) into a pfa (ASCII)
+ * SYNOPSIS
+ * pfb2pfa [-v] pfbfile [pfafile]
+ * DESCRIPTION
+ * Program converts a binary MSDOS representation for a type1
+ * PostScript font into a readable ASCII version. The MSDOS
+ * newline (\r) is converted into the UNIX newline (\n).
+ * The output is written in a file whose name is the name that
+ * is provided on the command line or the basename of the input
+ * file plus extension ".pfa".
+ *
+ * With the -v option you get some information about what the
+ * program is doing.
+ * AUTHOR
+ * Piet Tutelaers
+ */
+
+#include "basics.h" /* basic definitions and fatal() */
+#include <stdarg.h>
+#include <stdio.h>
+#include "filenames.h" /* newname() */
+
+#if defined(MSDOS) || defined(DOSISH)
+#define NEWLINE '\012'
+#else
+#define NEWLINE '\n'
+#endif
+
+#define HEX_PER_LINE 30
+
+int main (int argc, char *argv[])
+{ unsigned int t, l, i;
+ unsigned int l1, l2, l3, l4;
+ short c, done, verbose = 0;
+ FILE *pfb, *pfa;
+ char *pfbname, *pfaname = NULL;
+ const char *myname = "pfb2pfa";
+
+ while (--argc > 0 && (*++argv)[0] == '-') {
+ done=0;
+ while ((!done) && (c = *++argv[0])) /* allow -bcK like options */
+ switch (c) {
+ case 'v':
+ verbose = 1; break;
+ default:
+ fatal("%s: %c invalid option\n", myname, c);
+ }
+ }
+
+ if (argc < 1) {
+ msg ("pfb2pfa (ps2pk) version " PACKAGE_VERSION "\n");
+ fatal("Usage: %s [-v] pfbfile [pfafile]\n", myname);
+ }
+
+ pfbname = argv[0]; argc--; argv++;
+ if (argc < 1) pfaname = newname(pfbname, ".pfa");
+ else if (argc == 1) pfaname = argv[0];
+ else fatal("Usage: %s [-v] pfbfile [pfafile]\n", myname);
+
+ pfb = fopen(pfbname, RB);
+ if (pfb == NULL) fatal("Can't open %s\n", pfbname);
+
+ pfa = fopen(pfaname, WB);
+ if (pfa == NULL) fatal("Can't open %s\n", pfaname);
+
+ while(!feof(pfb)) {
+ if (getc(pfb) != 128)
+ fatal("%s: not a pfb file.\n", pfbname);
+ t = getc(pfb);
+ if (verbose) printf("Type: %d, ", t);
+ switch (t) {
+ case 1:
+ l1 = getc(pfb); l2 = getc(pfb); l3 = getc(pfb); l4 = getc(pfb);
+ l = l1 | l2 << 8 | l3 << 16 | l4 << 24;
+ /* printf("%2x %2x %2x %2x -> %x\n", l1, l2, l3, l4, l); */
+ if (verbose) printf(" plain text, length %d\n", l);
+ for (i=0; i < l ; i++) {
+ c = getc(pfb);
+ if (c == '\r') putc(NEWLINE, pfa);
+ else putc(c, pfa);
+ }
+ break;
+ case 2:
+ l1 = getc(pfb); l2 = getc(pfb); l3 = getc(pfb); l4 = getc(pfb);
+ l = l1 | l2 << 8 | l3 << 16 | l4 << 24;
+ /* printf("%2x %2x %2x %2x -> %x\n", l1, l2, l3, l4, l); */
+ if (verbose) printf(" binary data, length %d\n", l);
+ for(i = 0; i < l ;i++) {
+ fprintf(pfa, "%02x", getc(pfb));
+ if ((i+1) % HEX_PER_LINE == 0) putc(NEWLINE, pfa);
+ }
+ putc(NEWLINE, pfa);
+ break;
+ case 3:
+ if (verbose) printf("End of file\n");
+ exit(0);
+ break;
+ default:
+ fatal("Unknown field type: %d\n", t);
+ }
+ }
+ fclose(pfa); fclose(pfb);
+ return 0;
+}
diff --git a/fonts/utilities/ps2pk/pictures.h b/fonts/utilities/ps2pk/pictures.h
new file mode 100644
index 0000000000..cd9aab1e09
--- /dev/null
+++ b/fonts/utilities/ps2pk/pictures.h
@@ -0,0 +1,48 @@
+/* $XConsortium: pictures.h,v 1.2 91/10/10 11:18:53 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* STUB */
+
+#define CopyPicture(p) p
+#define UniquePicture(p) p
+#define KillPicture(p)
+#define BegHandle(o,m) o
+#define EndHandle(o,m) o
+#define PictureBounds(P) P
+
+struct picture {
+ struct fractpoint origin;
+ struct fractpoint ending;
+};
+
+#define Phantom(o) t1_Phantom(o)
+#define Snap(o) t1_Snap(o)
+
+struct segment *t1_Phantom(struct segment *);
+struct segment *t1_Snap(struct segment *);
diff --git a/fonts/utilities/ps2pk/pk2bm.1 b/fonts/utilities/ps2pk/pk2bm.1
new file mode 100644
index 0000000000..12155d08ef
--- /dev/null
+++ b/fonts/utilities/ps2pk/pk2bm.1
@@ -0,0 +1,40 @@
+.TH PK2BM 1 "1 Feb 2016"
+.SH NAME
+pk2bm \- create a bitmap from a TeX pkfont
+.SH SYNOPSIS:
+pk2bm [-bh] [-W\fIwidth\fP] [-H\fIheight\fP] -c\fIchar\fP pkfont
+
+pk2bm [-bh] [-W\fIwidth\fP] [-H\fIheight\fP] -o\fIoctchar\fP pkfont
+.SH DESCRIPTION
+This program generates a bitmap (ASCII file) which can be used
+to create X11 applications. The bitmap file consists of all pixels
+of the specified character (via the -c or -o option) from
+the given pkfont. The format is described in bitmap(X11).
+.PP
+The pkfont is a packed fontfile generated by gftopk(TeX) from a
+gffont. A gffont is the output of METAFONT a program to design fonts
+in a device independant way.
+.PP
+With the -b flag a bitmap is generated in which all black pixels are
+drawn as a `*' and all white bits as a `.'. With the -h flag a
+hexadecimal bitmap dump is generated.
+.PP
+The -W and/or -H options can be used to create a bitmap of
+respectivally `width' and `height' pixels. The pk-bitmap will in
+this case be centered according to these new dimensions.
+.PP
+The output is written to the standard output.
+.SH SEE ALSO
+.nf
+`METAFONT', Donald Knuth.
+`The PKtype processor', belonging to the METAFONTware.
+bitmap(X11),
+gftopk(TeX),
+pktype(TeX),
+ps2pk(1)
+
+.SH AUTHOR
+.nf
+Piet Tutelaers
+Maintained in TeX Live; please send bug reports or other correspondence
+to tex-k@tug.org (http://lists.tug.org/tex-k).
diff --git a/fonts/utilities/ps2pk/pk2bm.c b/fonts/utilities/ps2pk/pk2bm.c
new file mode 100644
index 0000000000..5445bf7409
--- /dev/null
+++ b/fonts/utilities/ps2pk/pk2bm.c
@@ -0,0 +1,231 @@
+/*
+ * NAME
+ * pk2bm - create a bitmap from a TeX pkfont
+ * SYNOPSIS:
+ * pk2bm [-bh] [-W width] [-H height] {-c char|-o octchar} pkfont
+ * DESCRIPTION
+ * This program generates a bitmap (ASCII file) which can be used
+ * to create X11 applications. The bitmap file consists of all
+ * pixels of the specified character (via the -c or -o option) from
+ * the given pkfont. The format is described in bitmap(X11).
+ *
+ * The pkfont is a packed fontfile generated by gftopk(TeX) from a
+ * gffont. A gffont is the output of METAFONT a program to design fonts
+ * in a device independant way.
+ *
+ * With the -b flag a bitmap is generated in which all black pixels are
+ * drawn as a `*' and all white bits as a `.'. With the -h flag a
+ * hexadecimal bitmap dump is generated.
+ *
+ * The -W and/or -H options can be used to create a bitmap of
+ * respectivally `width' and `height' pixels. The pk-bitmap will in
+ * this case be centered according to these new dimensions.
+ *
+ * The output is written to the standard output.
+ * SEE ALSO
+ * ``METAFONT'', Donald Knuth.
+ * ``The PKtype processor'', belonging to the METAFONTware.
+ * bitmap(X11), gftopk(TeX), pktype(TeX), ps2pk(1)
+ * AUTHOR
+ * Piet Tutelaers
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "c-auto.h"
+#endif
+
+#include <stdio.h>
+#include "pkin.h"
+#include "basics.h"
+
+#ifdef WIN32
+#include <fcntl.h>
+#include <io.h>
+#endif
+
+static quarterword lsbf(quarterword u);
+static void dots(quarterword u, int n);
+static int atoo(char *oct);
+
+int main(int argc, char *argv[])
+{
+ int done, C = 0, c, h = 0, w = 0, row, col;
+ unsigned int bitmap = 0, hexmap = 0;
+ halfword *word;
+ chardesc cd;
+ const char *myname = "pk2bm";
+ char *pkname;
+
+ while (--argc > 0 && (*++argv)[0] == '-') {
+ done=0;
+ while ((!done) && (c = *++argv[0])) /* allow -bcK as an option */
+ switch (c) {
+ case 'c':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ C = *argv[0];
+ done = 1; break;
+ case 'o':
+ if (*++argv[0] == '\0') {
+ argc--; ++argv;
+ }
+ if (argv[0] == '\0') goto invalid;
+ C = atoo(argv[0]);
+ done = 1; break;
+ case 'H':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ h = atoi(argv[0]);
+ done=1;
+ break;
+ case 'W':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ w = atoi(argv[0]);
+ done=1;
+ break;
+ case 'b':
+ bitmap = 1;
+ break;
+ case 'h':
+ hexmap = 1;
+ break;
+invalid:
+ default:
+ printf("%s: %c invalid option\n", myname, c);
+ exit(1);
+ }
+ }
+
+ if (argc == 0) {
+ msg ("pk2bm (ps2pk) version " PACKAGE_VERSION "\n");
+ printf("Usage: %s [-bh] {-c char|-o octchar} [-W width -H height] pkfile\n", myname);
+ exit(1);
+ }
+
+#ifdef WIN32
+ _setmode(fileno(stdout), _O_BINARY);
+#endif
+
+ pkname = argv[0];
+
+ if (readchar(pkname, (integer)C, &cd)) {
+ int H, dh, W, dw, bitsleft;
+ halfword nextword; quarterword nextbyte;
+
+ H=cd.cheight; if (h==0) h=H; dh=(h-H)/2;
+ W=cd.cwidth; if (w==0) w=W; dw=(w-W)/2;
+
+ if (bitmap || hexmap) {
+ printf("character : %d (%c)\n", (int) cd.charcode,
+ (char)cd.charcode);
+ printf(" height : %d\n", (int) cd.cheight);
+ printf(" width : %d\n", (int) cd.cwidth);
+ printf(" xoff : %d\n", (int) cd.xoff);
+ printf(" yoff : %d\n", (int) cd.yoff);
+ }
+ else {
+ printf("#define %s_%c_width \t %d\n",
+ pkname, (char)cd.charcode, (int) w);
+ printf("#define %s_%c_height \t %d\n",
+ pkname, (char)cd.charcode, (int) h);
+ printf("#define %s_%c_xoff \t %d\n",
+ pkname, (char)cd.charcode, (int) dw);
+ printf("#define %s_%c_yoff \t %d\n",
+ pkname, (char)cd.charcode, (int) dh);
+ printf("static char %s_%c_bits[] = {",
+ pkname, (char)cd.charcode);
+ }
+ for (row=0; row<h-H-dh; row++) {
+ printf("\n ");
+ for (col=0; col<w; col+=8)
+ if (bitmap) dots(0, w-col>7? 8: w-col);
+ else if (hexmap) printf("%02x", 0x00);
+ else printf(" 0x%02x, ", 0x00);
+ }
+ word = cd.raster;
+ for (row=h-H-dh; row<h-dh; row++) {
+ bitsleft = dw; nextword = 0;
+ printf("\n ");
+ for (col=0; col<w; col+=8) {
+ if (bitsleft>=8) {
+ nextbyte = nextword >> (bitsleft-8) & 0xff;
+ bitsleft-=8;
+
+ if (bitmap) dots(nextbyte, w-col>7? 8: w-col);
+ else if (hexmap) printf("%02x", nextbyte);
+ else printf(" 0x%02x, ", lsbf(nextbyte));
+ }
+ else {
+ nextbyte = nextword << (8-bitsleft) & 0xff;
+ if (col-dw<W)
+ nextword=(*word++);
+ else nextword=0;
+ nextbyte = nextbyte | (nextword >> (16-(8-bitsleft))
+ & 0xff);
+ bitsleft = 16 - (8-bitsleft);
+
+ if (bitmap) dots(nextbyte, w-col>7? 8: w-col);
+ else if (hexmap) printf("%02x", nextbyte);
+ else printf(" 0x%02x, ", lsbf(nextbyte));
+ }
+ }
+ }
+ for (row=h-dh; row<h; row++) {
+ printf("\n ");
+ for (col=0; col<w; col+=8)
+ if (bitmap) dots(0, w-col>7? 8: w-col);
+ else if (hexmap) printf("%02x", 0x00);
+ else printf(" 0x%02x, ", 0x00);
+ }
+ if ((!bitmap) && (!hexmap)) printf("};\n");
+ else putchar('\n');
+ }
+ return 0;
+}
+
+/*
+ * lsbf() transforms a byte (least significant bit first).
+ */
+static quarterword
+lsbf(quarterword u)
+{
+ int i; quarterword bit, result = 0;
+
+ for (i=0; i<8; i++) {
+ bit = u & 001;
+ result = (result<<1) | bit;
+ u = u >> 1;
+ }
+ return result;
+}
+
+/*
+ * dots() print byte: `*' for a black and `.' for a white pixel
+ */
+static void
+dots(quarterword u, int n)
+{
+ unsigned int bit;
+
+ bit=1<<7;
+ for ( ;n>0 ;n--) {
+ if (u & bit) putchar('*');
+ else putchar('.');
+ bit>>=1;
+ }
+}
+
+static int
+atoo(char *oct)
+{
+ int octal = 0;
+ while (*oct != '\0') octal = 8*octal + (*oct++) - '0';
+ return octal;
+}
diff --git a/fonts/utilities/ps2pk/pkin.c b/fonts/utilities/ps2pk/pkin.c
new file mode 100644
index 0000000000..be295a00b4
--- /dev/null
+++ b/fonts/utilities/ps2pk/pkin.c
@@ -0,0 +1,435 @@
+/*
+ * NAME
+ * pkin.c - implementation of readchar()
+ * DESCRIPTION
+ * This implementation of readchar() uses parts of the program dvips
+ * written by Tomas Rokicki--the inventor of the pkformat--(loadfont.c,
+ * download.c and unpack.c). Dvips in turn is derived from pktype.
+ * Pktype(TeX) is described in debt in ``The PKtype processor'',
+ * which is available as pktype.weave as part of the METAFONTware.
+ * What was needed to implement readchar() is rearranged in pkfile.c to
+ * get more modularity in the style of MODULA2.
+ * REDESIGN
+ * Piet Tutelaers
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "c-auto.h"
+#endif
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+#include <stdlib.h> /* malloc() */
+#include "basics.h" /* basic definitions */
+#include "pkin.h"
+
+/*
+ * Now we have some routines to get stuff from the pk file. pkbyte returns
+ * the next byte from the pk file.
+ */
+
+static FILE *pkfile ;
+
+static shalfword
+pkbyte(void)
+{
+ register shalfword i ;
+
+ if ((i=getc(pkfile))==EOF)
+ fatal("unexpected eof in pk file\n") ;
+ return(i) ;
+}
+
+static shalfword
+pksbyte(void)
+{
+ register shalfword i ;
+
+ i = pkbyte() ;
+ return i > 127 ? i -256 : i ;
+}
+
+static integer
+pkquad(void)
+{
+ register integer i ;
+
+ i = pksbyte() ;
+ i = i * 256 + pkbyte() ;
+ i = i * 256 + pkbyte() ;
+ i = i * 256 + pkbyte() ;
+ return(i) ;
+}
+
+static integer
+pktrio(void)
+{
+ register integer i ;
+
+ i = pkbyte() ;
+ i = i * 256 + pkbyte() ;
+ i = i * 256 + pkbyte() ;
+ return(i) ;
+}
+
+static integer
+pkpair(void)
+{
+ register integer i ;
+
+ i = pkbyte() ;
+ i = i * 256 + pkbyte() ;
+ return (i);
+}
+
+static integer
+pkspair(void)
+{
+ register integer i ;
+
+ i = pksbyte() ;
+ i = i * 256 + pkbyte();
+ return (i);
+}
+
+/*
+ * pkopen opens the pk file. This is system dependent.
+ */
+
+static Boolean
+pkopen(const char *name)
+{
+ if ((pkfile=fopen(name, RB))==NULL) {
+ fatal("Could not open %s\n", name) ;
+ } else
+ return(1) ;
+}
+
+/*
+ * The next part is devoted to unpacking the character data.
+ */
+
+/*
+ * We need procedures to get a nybble, bit, and packed word from the
+ * packed data structure.
+ */
+
+static halfword inputbyte, flagbyte ;
+static halfword bitweight ;
+static halfword dynf ;
+static halfword repeatcount ;
+
+static shalfword
+getnyb (void)
+{ halfword temp;
+ if ( bitweight == 0 )
+ { bitweight = 16 ;
+ inputbyte = pkbyte();
+ temp = inputbyte >> 4 ;
+ } else {
+ bitweight = 0 ;
+ temp = inputbyte & 15 ;
+ }
+ return(temp);
+}
+
+static Boolean
+getbit (void)
+{
+ bitweight >>= 1 ;
+ if ( bitweight == 0 )
+ { inputbyte = pkbyte();
+ bitweight = 128 ;
+ }
+ return(inputbyte & bitweight) ;
+}
+
+static halfword (*realfunc)() ;
+long PKremainder ;
+static halfword handlehuge(halfword i, halfword k) ;
+
+static halfword
+pkpackednum (void)
+{
+register halfword i, j ;
+ i = getnyb () ;
+ if ( i == 0 )
+ { do { j = getnyb () ;
+ i++ ;
+ } while ( ! ( j != 0 ) ) ;
+ if ( i > 3 ) {
+/*
+ * Damn, we got a huge count! We *fake* it by giving an artificially
+ * large repeat count.
+ */
+ return( handlehuge ( i , j ) ) ;
+ } else {
+ while ( i > 0 )
+ { j = j * 16 + getnyb () ;
+ i-- ;
+ }
+ return ( j - 15 + ( 13 - dynf ) * 16 + dynf ) ;
+ }
+ }
+ else if ( i <= dynf ) return ( i ) ;
+ else if ( i < 14 ) return ( ( i - dynf - 1 ) * 16 + getnyb () + dynf + 1
+ ) ;
+ else
+ { if ( i == 14 ) repeatcount = pkpackednum () ;
+ else repeatcount = 1 ;
+#ifdef DEBUG
+ printf("[%d]", repeatcount);
+#endif
+ return ( (*realfunc)() ) ;
+ }
+ }
+
+static halfword rest (void)
+{
+ halfword i ;
+
+ if (PKremainder < 0) {
+ PKremainder = - PKremainder ;
+ return ( 0 ) ;
+ } else if (PKremainder > 0) {
+ if (PKremainder > 4000) {
+ PKremainder = 4000 - PKremainder ;
+ return ( 4000 ) ;
+ } else {
+ i = PKremainder ;
+ PKremainder = 0 ;
+ realfunc = pkpackednum ;
+ return ( i ) ;
+ }
+ } else {
+ fatal("shouldn't happen\n") ;
+ }
+
+ /*NOTREACHED*/
+ return 0;
+}
+
+static halfword
+handlehuge (halfword i, halfword k)
+{
+ register long j = k ;
+
+ while (i) {
+ j = (j << 4L) + getnyb() ;
+ i-- ;
+ }
+ PKremainder = j - 15 + ( 13 - dynf ) * 16 + dynf ;
+ realfunc = rest ;
+ return ( rest() ) ;
+}
+
+/*
+ * And now we have our unpacking routine.
+ */
+
+static halfword gpower[17] = { 0 , 1 , 3 , 7 , 15 , 31 , 63 , 127 ,
+ 255 , 511 , 1023 , 2047 , 4095 , 8191 , 16383 , 32767 , 65535 } ;
+
+static void
+unpack(chardesc *cd)
+{
+ register integer i, j ;
+ register halfword word, wordweight ;
+ halfword *raster;
+ shalfword rowsleft ;
+ Boolean turnon ;
+ shalfword hbit ;
+ halfword count ;
+ shalfword wordwidth ;
+
+ wordwidth = (cd->cwidth + 15) / 16 ;
+ i = 2 * cd->cheight * (long)wordwidth ;
+ if (i <= 0)
+ i = 2 ;
+ cd->raster = (halfword *)malloc((unsigned)i) ;
+ if (cd->raster == NULL)
+ fatal("out of memory during allocation\n") ;
+ raster = cd->raster;
+ realfunc = pkpackednum ;
+ dynf = flagbyte / 16 ;
+ turnon = flagbyte & 8 ;
+ if ( dynf == 14 )
+ { bitweight = 0 ;
+ for ( i = 1 ; i <= cd->cheight ; i ++ )
+ { word = 0 ;
+ wordweight = 32768 ;
+ for ( j = 1 ; j <= cd->cwidth ; j ++ )
+ { if ( getbit () ) word += wordweight ;
+ wordweight >>= 1 ;
+ if ( wordweight == 0 )
+ { *raster++ = word ;
+ word = 0 ;
+ wordweight = 32768 ;
+ }
+ }
+ if ( wordweight != 32768 )
+ *raster++ = word ;
+ }
+ } else {
+ rowsleft = cd->cheight ;
+ hbit = cd->cwidth ;
+ repeatcount = 0 ;
+ wordweight = 16 ;
+ word = 0 ;
+ bitweight = 0 ;
+ while ( rowsleft > 0 )
+ { count = (*realfunc)() ;
+#ifdef DEBUG
+ if (turnon) printf("(%d) ",count);
+ else printf("%d ",count);
+#endif
+ while ( count != 0 )
+ { if ( ( count < wordweight ) && ( count < hbit ) )
+ { if ( turnon ) word += gpower [ wordweight ] - gpower
+ [ wordweight - count ] ;
+ hbit -= count ;
+ wordweight -= count ;
+ count = 0 ;
+ }
+ else if ( ( count >= hbit ) && ( hbit <= wordweight ) )
+ { if ( turnon )
+ word += gpower [ wordweight ] - gpower
+ [ wordweight - hbit ] ;
+ *raster++ = word ;
+ for ( i = 1 ; i <= repeatcount ; i ++ ) {
+ for ( j = 1 ; j <= wordwidth ; j ++ ) {
+ *raster = *(raster - wordwidth) ;
+ raster++ ;
+ }
+ }
+ rowsleft -= repeatcount + 1 ;
+ repeatcount = 0 ;
+ word = 0 ;
+ wordweight = 16 ;
+ count -= hbit ;
+ hbit = cd->cwidth ;
+ }
+ else
+ { if ( turnon ) word += gpower [ wordweight ] ;
+ *raster++ = word ;
+ word = 0 ;
+ count -= wordweight ;
+ hbit -= wordweight ;
+ wordweight = 16 ;
+ }
+ }
+ turnon = ! turnon ;
+ }
+ putchar('\n') ;
+ if ( ( rowsleft != 0 ) || ( hbit != cd->cwidth ) )
+ fatal( "error while unpacking; more bits than required\n" ) ;
+ }
+}
+
+/*
+ * readchar(): the main routine
+ * Reads the character definition of character `c' into `cd' if available,
+ * return FALSE (0) otherwise.
+ */
+int
+readchar(char *name, integer c, chardesc *cd)
+{
+ register shalfword i ;
+ register integer k ;
+ register integer length = 0;
+
+ if (!pkopen(name)) return(0);
+/*
+ * Check the preamble of the pkfile
+ */
+ if (pkbyte()!=247)
+ fatal("bad pk file, expected pre\n") ;
+ if (pkbyte()!=89)
+ fatal("bad version of pk file\n") ;
+ for(i=pkbyte(); i>0; i--) /* creator of pkfile */
+ (void)pkbyte() ;
+ (void) pkquad() ; /* design size */
+ (void) pkquad() ; /* checksum */
+ (void) pkquad() ; /* hppp */
+ (void) pkquad() ; /* vppp */
+/*
+ * Now we skip to the desired character definition
+ */
+ while ((flagbyte=pkbyte())!=245) {
+ if (flagbyte < 240) {
+ switch (flagbyte & 7) {
+case 0: case 1: case 2: case 3:
+ length = (flagbyte & 7) * 256 + pkbyte() - 4 ;
+ cd->charcode = pkbyte() ;
+ (void) pktrio() ; /* TFMwidth */
+ (void) pkbyte() ; /* pixel width */
+ break ;
+case 4: case 5: case 6:
+ length = (flagbyte & 3) * 65536 + pkpair() * 256 - 5 ;
+ cd->charcode = pkbyte() ;
+ (void) pktrio() ; /* TFMwidth */
+ (void) pkpair() ; /* pixelwidth */
+ break ;
+case 7:
+ length = pkquad() - 12 ;
+ cd->charcode = pkquad() ;
+ (void) pkquad() ; /* TFMwidth */
+ (void) pkquad(); /* pixelwidth */
+ (void) pkquad(); /* pixelheight */
+ }
+ if (length <= 0)
+ fatal("packet length (%d) too small\n", length) ;
+ if (cd->charcode == c) {
+ if (flagbyte & 4) {
+ if ((flagbyte & 7) == 7) { /* long format */
+ cd->cwidth = pkquad() ;
+ cd->cheight = pkquad() ;
+ cd->xoff = pkquad() ;
+ cd->yoff = pkquad() ;
+ } else { /* extended format */
+ cd->cwidth = pkpair(); ;
+ cd->cheight = pkpair() ;
+ cd->xoff = pkspair() ;
+ cd->yoff = pkspair() ;
+ }
+ } else { /* short format */
+ cd->cwidth = pkbyte() ;
+ cd->cheight = pkbyte() ;
+ cd->xoff = pksbyte() ;
+ cd->yoff = pksbyte() ;
+ }
+ unpack(cd);
+ (void)fclose(pkfile) ;
+ return(1);
+ }
+ for (; length>0; length--) /* skip this character */
+ (void) pkbyte() ;
+ } else {
+ k = 0 ;
+ switch (flagbyte) {
+case 243:
+ k = pksbyte() ;
+case 242:
+ k = k * 256 + pkbyte() ;
+case 241:
+ k = k * 256 + pkbyte() ;
+case 240:
+ k = k * 256 + pkbyte() ;
+ while (k-- > 0)
+ i = pkbyte() ;
+ break ;
+case 244:
+ k = pkquad() ;
+ break ;
+case 246:
+ break ;
+default:
+ fatal("unexpected command (%d)\n", flagbyte) ;
+ }
+ }
+ }
+ (void)fclose(pkfile) ;
+ return(0); /* character not found */
+}
diff --git a/fonts/utilities/ps2pk/pkin.h b/fonts/utilities/ps2pk/pkin.h
new file mode 100644
index 0000000000..8ffae55e2d
--- /dev/null
+++ b/fonts/utilities/ps2pk/pkin.h
@@ -0,0 +1,60 @@
+/*
+ * NAME
+ * pkin.h - header file for readchar()
+ * SYNOPSIS
+ * #include "pkfile.h"
+ *
+ * int readchar(name, c, cd)
+ * char name[]; shalfword c; chardesc *cd;
+ * DESCRIPTION
+ * Readchar() opens the pkfile `name', checks if it's a legal pkfile,
+ * and reads the character description of `c' into `cd'. Readchar()
+ * returns TRUE (1) upon success, FALSE (0) if the character `c' is
+ * not found in the pkfile.
+ *
+ * Parameter `cd' is a pointer to a the following structure:
+ * typedef struct {
+ * integer charcode,
+ * cwidth, cheight,
+ * xoff, yoff;
+ * halfword *raster ;
+ * } chardesc ;
+ *
+ * Charcode is the code of the character returned, cwidth and cheight
+ * respectively the width and height of the character in pixels,
+ * xoff and yoff are the offsets of first pixel to the reference point
+ * of the character box.
+ * Raster is a pointer to the bitmap describing the character. This
+ * raster consists of cheight rows of (cwidth + 15) /16 words of
+ * 16 bits each. Each row contains from left to right all cwidth
+ * pixels of that row.
+ * WARNING
+ * If the machine has a default integer size of 16 bits, and 32-bit
+ * integers must be manipulated with %ld, be carefull!
+ * AUTHORS
+ * Piet Tutelaers
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+/*
+ * Type declarations. integer must be a 32-bit signed; shalfword must
+ * be a sixteen-bit signed; halfword must be a sixteen-bit unsigned;
+ * quarterword must be an eight-bit unsigned.
+ */
+typedef long integer;
+typedef short shalfword ;
+typedef unsigned short halfword ;
+typedef unsigned char quarterword ;
+typedef short Boolean ;
+/*
+ * A chardesc describes an individual character.
+ */
+typedef struct {
+ integer charcode,
+ cwidth, cheight,
+ xoff, yoff;
+ halfword *raster ;
+} chardesc ;
+
+int readchar(char *name, integer c, chardesc *cd);
diff --git a/fonts/utilities/ps2pk/pkout.c b/fonts/utilities/ps2pk/pkout.c
new file mode 100644
index 0000000000..4d50fbe7be
--- /dev/null
+++ b/fonts/utilities/ps2pk/pkout.c
@@ -0,0 +1,578 @@
+/* FILE: pkout.c
+ * PURPOSE: implementation of PK output functions
+ * COMMENT: functions are derived from `The GFtoPK processor' but
+ * presented in a modular fashion so they can be used in other
+ * programs.
+ * (Porting `top-down' WEB code into modular readable C-code is
+ * not a trivial exercise.)
+ *
+ * AUTHOR: Piet Tutelaers
+ * (see README for license)
+ */
+
+/* Some constants */
+#define PK_ID 89
+#define PK_SPC1 240 /* All we need, max length always < 255 */
+#define PK_NUMSPC 244
+#define PK_NOOP 246
+#define PK_PRE 247
+#define PK_POST 245
+
+#define DPI 72.27
+#define MIN(a,b) ( (a<b)? (a): (b))
+
+#include "basics.h" /* definitions and fatal() */
+#include <stdio.h>
+#include <stdarg.h> /* va_start(), va_end() */
+#include <stdlib.h> /* malloc() */
+#include "pkout.h"
+
+#undef DEBUG
+static int pk_len = 0;
+static FILE *pkfile;
+
+void pk_open(char *pkname)
+{
+ pkfile = fopen(pkname, WB);
+ if (pkfile == NULL) fatal("Can not open %s\n", pkname);
+}
+
+void pk_close(void)
+{
+ fclose(pkfile);
+}
+
+/* Portable Big Endian output functions */
+
+/* Nybble buffer */
+static int pk_output_byte, bitweight;
+static void pk1(int);
+
+static void pk_nybble(int x)
+{
+ if (bitweight == 16) {
+ bitweight = 1; pk_output_byte = x*16;
+ }
+ else {
+ bitweight = 16; pk1(pk_output_byte + x);
+ }
+}
+
+static void pk1(int x)
+{
+ if (x < 0) x += 256;
+ putc(x & 0x00ff, pkfile);
+ pk_len++;
+}
+
+static void pk2(int x)
+{
+ if (x < 0) x += 65536;
+ pk1((x & 0x00ff00) >> 8);
+ pk1(x & 0x0000ff);
+}
+
+static void pk3(int32_t x)
+{
+ pk1((x & 0x00ff0000) >> 16);
+ pk1((x & 0x0000ff00) >> 8);
+ pk1(x & 0x000000ff);
+}
+
+static void pk4(int32_t x)
+{
+ if (x < 0) { /* next two lines from mackay@cs.washington.edu */
+ x += 2<<29; x += 2<<29;
+ pk1(((x & 0x7f000000) >> 24) + 128);
+ }
+ else pk1((x & 0x7f000000) >> 24);
+ pk1((x & 0x00ff0000) >> 16);
+ pk1((x & 0x0000ff00) >> 8);
+ pk1(x & 0x000000ff);
+}
+
+static int MAX_COUNTS; /* length of array to hold runlengths */
+
+void pk_preamble(char *comment, /* source of the font */
+ float pointsize, /* pointsize in points */
+ int32_t checksum, /* should equal to tfm-value */
+ unsigned int h_res, /* horizontal resolution (dpi) */
+ unsigned int v_res) /* vertical resolution (dpi) */
+{
+ int i, len;
+
+ /* compute MAX_COUNTS based upon pointsize, h_res and v_res */
+ MAX_COUNTS = pointsize / DPI * h_res * (pointsize / DPI * v_res + 1);
+
+ pk1(PK_PRE);
+ pk1(PK_ID);
+ len = strlen(comment);
+ len = len>255? 255: len;
+ pk1(len);
+ for (i=0; i<len; i++) pk1(*comment++);
+
+ pk4((int32_t)(pointsize * (1<<20) + 0.5));
+ pk4(checksum);
+ pk4((int32_t)(h_res / DPI * (1<<16))); pk4((int32_t)(v_res / DPI * (1<<16)));
+}
+
+/* From `The GFtoPK processor', pp. 231 */
+
+static int optimal_size(int W, int H, int cnt, int count[], int *dyn_f)
+{ int comp_size = 0, b_comp_size, deriv[14], i, j, k;
+
+ i = (count[0] == 0? 1: 0); /* skip first empty runlength */
+ /* compute comp_size and deriv[1..13] */
+ for (j=1; j<14; j++) deriv[j] = 0;
+ while (i<cnt) {
+ j = count[i++];
+ if (j == -1) { comp_size++; continue; }
+ if (j < 0) { j = -j; comp_size++; }
+ if (j < 209) comp_size += 2;
+ else {
+ k = j - 193;
+ while (k >= 16) { k=k/16; comp_size += 2; }
+ comp_size++;
+ }
+ if (j < 14) deriv[j]--;
+ else {
+ if (j < 209) deriv[(223 - j) / 15]++;
+ else {
+ k = 16;
+ while (k*16 < j+3) k *= 16;
+ if (j-k <= 192) deriv[(207-j+k)/15] += 2;
+ }
+ }
+ }
+ /* find minimal value */
+ b_comp_size = comp_size; *dyn_f = 0;
+ for (i=1; i<14; i++) {
+ comp_size += deriv[i];
+ if (comp_size <= b_comp_size) {
+ b_comp_size = comp_size; *dyn_f = i;
+ }
+ }
+ comp_size = (b_comp_size + 1) / 2;
+ if (H*W == 0 || (comp_size > (H*W + 7) / 8)) {
+ comp_size = (H*W + 7) / 8; *dyn_f = 14;
+ }
+ return comp_size;
+}
+
+/* Next array contains the runlengths */
+static int *count = NULL;
+
+/* Global variables (interface between pk_runlengths() and pk_char() */
+static int dyn_f, comp_size, cnt;
+
+static void pk_runlengths(int W, int H, int (*next_pixel)())
+{ int current_value, pixel, i, j, max_counts, first_count;
+ int total_pixels, rc, row, col, runlength;
+ int color2, total_pixels2, /* counting equal rows variables */
+ i1, i2, newrow;
+
+ first_count = H; max_counts = first_count + H * W;
+ if (count == NULL) {
+ count = malloc(MAX_COUNTS * sizeof(int));
+ if (count == NULL) fatal("Out of memory\n");
+ }
+
+ if (max_counts > MAX_COUNTS) {
+ free(count);
+ count = malloc(max_counts * sizeof(int));
+ if (count == NULL) fatal("Out of memory\n");
+ MAX_COUNTS = max_counts;
+ }
+
+ /* 1: compute transitions BLACK<->WHITE */
+
+ cnt = first_count;
+ runlength = 0; current_value = BLACK;
+ for (row=0; row < H; row++) {
+ for (col=0; col<W; col++) {
+ pixel = (*next_pixel)();
+ if (pixel == current_value) runlength++;
+ else if (pixel == OTHER(current_value)) {
+ count[cnt++] = runlength;
+ current_value = OTHER(current_value);
+ runlength = 1;
+ }
+ }
+ }
+ if (runlength>0)
+ count[cnt++] = runlength;
+
+ /* for an empty glyph */
+ if (cnt == first_count) count[cnt++] = 0;
+
+#ifdef DEBUG
+ current_value = BLACK;
+ for (i=first_count; i<cnt; i++)
+ if (count[i] < 0) printf("[%d]", -count[i]);
+ else {
+ if (current_value == BLACK) printf("%d", count[i]);
+ else printf("(%d)", count[i]);
+ current_value = OTHER(current_value);
+ }
+ putchar('\n');
+#endif
+
+ /* 2: Now remove equal lines and add a repeat count at the first
+ transition of a row */
+
+ i = first_count; j = 0;
+ total_pixels = 0; row = -1;
+ current_value = BLACK;
+ if (count[i] == 0) {
+ count[j++] = count[i++];
+ current_value = WHITE;
+ }
+ while (i < cnt) {
+ if (j >= i) fatal("Program error: report to author!\n");
+ count[j++] = count[i];
+ total_pixels += count[i++];
+ current_value = OTHER(current_value);
+ newrow = total_pixels / W; col = total_pixels % W;
+ /* if transition starts in column zero or in a previous row
+ then continue */
+ if (newrow == row || row == H-1 || col == 0) continue;
+ row = newrow;
+
+ /* count equal rows */
+
+ /* 1: goto first transition of next row */
+ color2 = current_value;
+ total_pixels2 = total_pixels; i2 = i;
+ while (i2 < cnt && total_pixels2 / W == row) {
+ total_pixels2 += count[i2++];
+ color2 = OTHER(color2);
+ }
+
+ /* 2: do we need to compute a repeat count? */
+ if (color2 != current_value
+ || total_pixels2 - total_pixels != W) continue;
+
+ /* 3: count them */
+ rc = 0; i1 = i;
+ while (i2 < cnt && count[i1] == count[i2]) {
+#ifdef DEBUG
+ printf("%d (%d)", count[i1], count[i2]);
+#endif
+ total_pixels2 += count[i2++]; i1++;
+ }
+ rc = total_pixels2 / W - row; /* enclosed rows */
+ if (MIN(count[i1], count[i2]) + total_pixels2 % W < W)
+ rc--;
+#ifdef DEBUG
+ printf(" row %d: rc = %d\n", row, rc);
+#endif
+
+ /* 3: now remove the equal rows and finish last row */
+ if (rc > 0) {
+ /* insert a repeat count */
+ if (j >= i) fatal("Program error: report to author\n");
+ count[j++] = -rc;
+
+ /* finish runlengths of current row */
+ while (total_pixels + count[i] < row*W+W) {
+ if (j >= i) fatal("Program error: increase FIRST_COUNT!\n");
+ count[j++] = count[i];
+ total_pixels += count[i++];
+ current_value = OTHER(current_value);
+ }
+
+ /* skip runlengths of equal rows */
+ while (total_pixels + count[i] < (row+rc+1)*W) {
+ total_pixels += count[i++];
+ current_value = OTHER(current_value);
+ }
+ row += rc;
+ }
+ }
+ cnt = j; /* that is what we have now */
+
+ /* 3: compute optimal packing size */
+
+ comp_size = optimal_size(H, W, cnt, count, &dyn_f);
+#ifdef DEBUG
+ current_value = BLACK;
+ for (i=0; i<cnt; i++)
+ if (count[i] < 0) printf("[%d]", -count[i]);
+ else {
+ if (current_value == BLACK) printf("%d", count[i]);
+ else printf("(%d)", count[i]);
+ current_value = OTHER(current_value);
+ }
+ printf("\nOptimal packing with dyn_f = %d total size %d\n",
+ dyn_f, comp_size);
+#endif
+}
+
+#define MAX_TWOBYTE_NYBBLE (208 - 15*dyn_f)
+
+static void pk_number(int x)
+{ int k;
+
+ if (x < 0) { /* repeat count */
+ if (x == -1) pk_nybble(0xF);
+ else { pk_nybble(0xE);
+ pk_number(-x);
+ }
+ }
+ else if (x <= dyn_f) pk_nybble(x);
+ else if (x <= MAX_TWOBYTE_NYBBLE) { /* two nybble values */
+ x-= dyn_f+1;
+ pk_nybble(dyn_f + 1 + x / 16);
+ pk_nybble(x % 16);
+ }
+ else { /* huge counts */
+ x = x - MAX_TWOBYTE_NYBBLE + 15; k = 16;
+ while (k <= x) { k *= 16; pk_nybble(0x0); }
+ while (k > 1) { k = k / 16; pk_nybble(x / k); x = x % k; }
+ }
+}
+
+/* in case runlength encoding is not optimal we send a compressed
+ bitmap in stead of the packed runlengths
+ See GFtoPK processor, pp. 235 */
+static void pk_bitmap(int width, int cnt, int runlength[])
+{ int count, /* number of bits in the current state to send */
+ buff, /* byte buffer */
+ h_bit, /* horizontal bit count for each runlength */
+ p_bit, /* what bit are we about to send out? */
+ r_on, s_on, /* state saving variables */
+ r_count, s_count,/* dito */
+ r_i, s_i, /* dito */
+ rc, /* repeat count */
+ state, /* state variable (what state?) */
+ on, /* starting with black? */
+ i; /* points to next runlength */
+ static int power[9] = {1, 2, 4, 8, 16, 32, 64, 128, 256};
+
+ buff = 0; p_bit = 8; h_bit = width;
+ state = 0; rc = 0;
+ r_on = s_on = r_count = s_count = r_i = s_i = 0; /* avoid warnings */
+ on = 1; count = runlength[0]; i = 1;
+ while (i < cnt || state || count>0) {
+ if (state) {
+ count = r_count; i = r_i; on = r_on; rc--;
+ }
+ else {
+ r_count = count; r_i = i; r_on = on;
+ }
+
+ /* send one row of width bits */
+ do {
+ if (count == 0) {
+ if (runlength[i] < 0) {
+ if (!state) rc = - runlength[i];
+ i++;
+ }
+ count = runlength[i]; i++; on = !on;
+ }
+ if (count >= p_bit && p_bit < h_bit) {
+ /* we end a byte, we don't end a runlength */
+ if (on) buff += power[p_bit] - 1;
+ pk1(buff);
+ buff = 0; h_bit -= p_bit;
+ count -= p_bit; p_bit = 8;
+ }
+ else {
+ if (count < p_bit && count < h_bit) {
+ /* we neither end the row nor the byte */
+ if (on) buff += power[p_bit] - power[p_bit-count];
+ p_bit -= count; h_bit -= count; count = 0;
+ }
+ else { /* we end a row and maybe a byte */
+ if (on) buff += power[p_bit] - power[p_bit-h_bit];
+ count -= h_bit; p_bit -= h_bit; h_bit = width;
+ if (p_bit == 0) {
+ pk1(buff); buff = 0; p_bit = 8;
+ }
+ }
+ }
+ } while (h_bit != width);
+
+ if (state && rc == 0) {
+ count = s_count; i = s_i; on = s_on; state = 0;
+ }
+ else if (!state && rc >0) {
+ s_count = count; s_i = i; s_on = on; state = 1;
+ }
+ }
+ if (p_bit != 8) pk1(buff);
+}
+
+/* For packing a character */
+void pk_char(int char_code, /* character code 0..255 */
+ int32_t tfm_width, /* TFM width of character */
+ int h_escapement, /* horizontal escapement in pixels */
+ unsigned int width, /* width of bounding box */
+ unsigned int height, /* height of bounding box */
+ int h_offset, /* horizontal offset to reference point */
+ int v_offset, /* vertical offset to reference point */
+ int (*next_pixel)()) /* user's next pixel generator */
+{ int i;
+ unsigned short flag_byte;
+
+ pk_runlengths(width, height, next_pixel);
+
+ /* write a character preamble */
+
+ flag_byte = dyn_f * 16;
+ if (count[0] > 0) flag_byte += 8; /* starting in BLACK */
+ if (tfm_width > 0XFFFFFF || width > 65535 || height > 65535
+ || h_offset > 32767 || v_offset > 32767
+ || h_offset < -32768 || v_offset < -32768
+ || comp_size > 196594)
+ { /* write long format */
+ fatal("Can't handle long format yet!\n");
+ }
+ else if (h_escapement > 255 || width > 255 || height > 255
+ || h_offset > 127 || v_offset > 127
+ || h_offset < -128 || v_offset < -128
+ || comp_size > 1015)
+ { /* write two-byte short character preamble */
+ comp_size += 13; flag_byte += comp_size / 65535 + 4;
+ pk1(flag_byte);
+ pk2(comp_size % 65535);
+ pk1(char_code);
+ pk3(tfm_width);
+ pk2(h_escapement); /* pixels ! */
+ pk2(width);
+ pk2(height);
+ pk2(h_offset);
+ pk2(v_offset);
+ }
+ else { /* write one-byte short character preamble */
+ comp_size += 8; flag_byte += comp_size / 256;
+ pk1(flag_byte);
+ pk1(comp_size % 256);
+ pk1(char_code);
+ pk3(tfm_width);
+ pk1(h_escapement); /* pixels ! */
+ pk1(width);
+ pk1(height);
+ pk1(h_offset);
+ pk1(v_offset);
+ }
+
+ /* and now the character itself */
+ if (dyn_f != 14) { /* send compressed format */
+ if (count[0] == 0) i = 1; else i = 0;
+ bitweight = 16;
+ for (i=i; i<cnt; i++) pk_number(count[i]);
+ if (bitweight != 16) pk1(pk_output_byte);
+ }
+ else /* send bitmap */
+ if (height > 0) pk_bitmap(width, cnt, count);
+
+}
+
+/*
+ * Output small string special (<255 chars)
+ */
+static void pkstring(const char *fmt, ...) {
+ char buf[256]; int i, len;
+ va_list args;
+
+ va_start(args, fmt);
+#ifdef CHARSPRINTF
+ (void) vsprintf(buf, fmt, args);
+ len = strlen(buf);
+#else
+ len = vsprintf(buf, fmt, args);
+#endif
+ if (len > 255 || len < 0) fatal("PK string exceeds 255 characters\n");
+ va_end(args);
+
+ pk1(PK_SPC1);
+ pk1(len); i = 0;
+ for (i = 0; i < len; i++) pk1(buf[i]);
+}
+
+/*
+ * Compute METAFONT magnification string for <dpi>
+ */
+
+static int PSPKINT(float x) {
+ return (int) x;
+}
+
+static char mag_str[64];
+
+static char *magnification (int dpi, int BDPI) {
+ double size, magstep;
+
+ if (dpi == BDPI) {
+ sprintf(mag_str, "magstep(0)");
+ return mag_str;
+ }
+ size = BDPI; magstep = 0;
+ while (dpi < size) {
+ size = size / 1.095445115;
+ magstep -= 0.5;
+ if (dpi == PSPKINT(size + 0.5)) {
+ sprintf(mag_str, "magstep(%.1f)", magstep);
+ return mag_str;
+ }
+ if (dpi > size) {
+ sprintf(mag_str, "%d+%d/%d", PSPKINT(dpi/BDPI), dpi%BDPI, BDPI);
+ return mag_str;
+ }
+ }
+ while (dpi > size) {
+ size = size * 1.095445115;
+ magstep += 0.5;
+ if (dpi == PSPKINT(size + 0.5)) {
+ sprintf(mag_str, "magstep(%.1f)", magstep);
+ return mag_str;
+ }
+ if (dpi < size) {
+ sprintf(mag_str, "%d+%d/%d", PSPKINT(dpi/BDPI), dpi%BDPI, BDPI);
+ return mag_str;
+ }
+ }
+ fatal("PK could not determine magnification\n");
+}
+
+/*
+ * Barebone postample
+ */
+void pk_postamble(void)
+{
+ pk1(PK_POST);
+ while (pk_len % 4 != 0) pk1(PK_NOOP);
+}
+
+/*
+ * Write special PK strings in the postamble for identification
+ * purposes as proposed by mackay@cs.washington.edu.
+ */
+void ps2pk_postamble(char *fontname, /* The real FontName from the afm */
+ char *encname, /* The actual name, not the filename */
+ int base_res, /* basic resolution */
+ int h_res, /* Match against base_res for mag */
+ int v_res, /* Match against h_res for aspect_ratio */
+ float pointsize, /* Used for fontfacebyte calculation */
+ char *args) /* Essential ps2pk args */
+{
+ int i;
+
+ pkstring("ps2pk options: %s", args);
+ pkstring("fontid=%s", fontname);
+ if (encname) pkstring("codingscheme=%s", encname);
+ pkstring("fontfacebyte");
+ pk1(PK_NUMSPC);
+ i = (pointsize < 127.0) ?
+ ((254 - (int)((2 * pointsize)+0.5)) * (1 << 16)) : 0;
+ pk4(i);
+ pkstring("pixels_per_inch=%d", base_res);
+ pkstring("mag=%s", magnification(h_res, base_res));
+ if (v_res != h_res)
+ pkstring("aspect ratio=%d / %d",
+ (int)((1.0 * v_res / h_res * base_res) + 0.5), base_res);
+
+ pk1(PK_POST);
+ while (pk_len % 4 != 0) pk1(PK_NOOP);
+}
diff --git a/fonts/utilities/ps2pk/pkout.h b/fonts/utilities/ps2pk/pkout.h
new file mode 100644
index 0000000000..a22d9f9015
--- /dev/null
+++ b/fonts/utilities/ps2pk/pkout.h
@@ -0,0 +1,45 @@
+/* FILE: pkout.h
+ * PURPOSE: interface to te PK output functions (pkfile.c)
+ * COMMENT: See the pktest.c example program how to use the PK functions.
+ * (see README for license)
+ */
+
+/* A function for opening a pk file */
+void pk_open(char *name);
+
+/* A function for closing a pk file */
+void pk_close(void);
+
+/* A function for writing the preamble */
+void pk_preamble(char *comment, /* comment string: source of font */
+ float pointsize, /* design size in points */
+ int32_t checksum, /* checksum */
+ unsigned int h_res, /* horizontal resolution (dpi) */
+ unsigned int v_res); /* vertical resolution (dpi) */
+
+/* For packing a character */
+void pk_char(int char_code, /* character code 0..255 */
+ int32_t tfm_width, /* TFM width of character */
+ int h_escapement, /* horizontal escapement in pixels */
+ unsigned int width, /* width of bounding box */
+ unsigned int height, /* height of bounding box */
+ int h_offset, /* horizontal offset to reference point */
+ int v_offset, /* vertical offset to reference point */
+ int (*next_pixel)()); /* user's pixel generator */
+
+/* Barebone postample */
+void pk_postamble(void);
+
+/* PS2PK postamble */
+void ps2pk_postamble(char *fontname, /* The real FontName from the afm */
+ char *encname, /* The actual name, not the filename */
+ int base_res, /* basic resolution */
+ int h_res, /* Match against base_res for mag */
+ int v_res, /* Match against h_res for aspect_ratio */
+ float pointsize, /* Used for fontfacebyte calculation */
+ char *args); /* Essential ps2pk args */
+
+/* Here are some definitions to play with pixels */
+#define BLACK 1
+#define WHITE 0
+#define OTHER(pixel) (pixel==BLACK? WHITE: BLACK)
diff --git a/fonts/utilities/ps2pk/pktest.c b/fonts/utilities/ps2pk/pktest.c
new file mode 100644
index 0000000000..2cc97f1c7c
--- /dev/null
+++ b/fonts/utilities/ps2pk/pktest.c
@@ -0,0 +1,110 @@
+/* FILE: pktest.c
+ * PURPOSE: This program demonstrates how a PK file can be created from
+ * a single character bitmap.
+ * USAGE: pktest -c<char_code> -W<with> -H<Height> pkname < test.bm
+ * (test.bm contains the character from `The GFtoPK processor')
+ * AUTHOR: Piet Tutelaers
+ * (see README for license)
+ */
+
+int testing = 1;
+#include <stdio.h>
+#include "basics.h" /* fatal() */
+#include "pkout.h"
+
+static int next_pixel(void);
+
+int main(int argc, char *argv[])
+{
+ int done, C = 0, W = 0, H = 0, c;
+ const char *myname;
+ char *pkname, comment[256];
+
+ myname = argv[0];
+ while (--argc > 0 && (*++argv)[0] == '-') {
+ done=0;
+ while ((!done) && (c = *++argv[0])) /* allow multiletter options */
+ switch (c) {
+ case 'c':
+ C = *++argv[0];
+ if (C == '\0') {
+ argc--; C = *++argv[0];
+ }
+ break;
+ case 'H':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ H = atoi(*argv); done = 1;
+ break;
+ case 'W':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ W = atoi(*argv); done = 1;
+ break;
+ default:
+ fatal("%s: %c invalid option\n", myname, c);
+ }
+ }
+
+ if (argc == 0 || C == 0 || W*H == 0) {
+ msg ("pktest (ps2pk) version " PACKAGE_VERSION "\n");
+ fatal("Usage: %s -c<char> -W<width> -H<height> pkfile\n", myname);
+ }
+
+ pkname = argv[0];
+ pk_open(pkname);
+
+ sprintf(comment, "Testfont %s designed at 10 points", pkname);
+ pk_preamble(comment, 10.0, 1473505522, 120, 120);
+ printf("character %c Width %d Height %d\n", C, W, H);
+ pk_char(C, 640796, 25, W, H, -2, 28, next_pixel);
+ pk_postamble();
+ pk_close();
+ return 0;
+}
+
+/* This function delivers the pixels from the character's bounding box
+ * from left to right and from top to bottom.
+ */
+static int next_pixel(void)
+{ int c;
+ do { c = getchar();
+ if (c==EOF) fatal("reading past end of file!\n");
+ if (c == '*' || c == 'X') return BLACK;
+ if (c == '.') return WHITE;
+ } while (1);
+}
+
+/* The character example from GFtoPK:
+ ********************
+ ********************
+ ********************
+ ********************
+ **................**
+ **................**
+ **................**
+ ....................
+ ....................
+ ..**............**..
+ ..**............**..
+ ..**............**..
+ ..****************..
+ ..****************..
+ ..****************..
+ ..****************..
+ ..**............**..
+ ..**............**..
+ ..**............**..
+ ....................
+ ....................
+ ....................
+ **................**
+ **................**
+ **................**
+ ********************
+ ********************
+ ********************
+ ********************
+*/
diff --git a/fonts/utilities/ps2pk/protos.h b/fonts/utilities/ps2pk/protos.h
new file mode 100644
index 0000000000..eb8e62c32f
--- /dev/null
+++ b/fonts/utilities/ps2pk/protos.h
@@ -0,0 +1,402 @@
+arith.c
+/* void DLmult(struct *product,unsigned long u,unsigned long v); */
+/* void DLdiv(struct *quotient,unsigned long divisor); */
+/* void DLadd(struct *u,struct *v); */
+/* void DLsub(struct *u,struct *v); */
+extern long FPmult(long u,long v);
+extern long FPdiv(long dividend,long divisor);
+extern long FPstarslash(long a,long b,long c);
+basename.c
+extern int main(int argc,char **argv );
+basics.c
+extern void fatal(char *fmt,...);
+extern void msg(char *fmt,...);
+bstring.c
+extern int memset(void *s,int c,int length);
+curves.c
+extern int BezierTerminationTest(long xa,long ya,long xb,long yb,long xc,long yc,long xd,long yd);
+static struct segment *StepBezierRecurse(struct bezierinfo *I,long xA,long yA,long xB,long yB,long xC,long yC,long xD,long yD);
+extern struct segment *t1_StepBezier(struct region *R,long xA,long yA,long xB,long yB,long xC,long yC,long xD,long yD);
+emxrun.c
+extern int main(int argc,char **argv );
+extern int emx_system(char *cmd);
+encoding.c
+static char *value_after(char *s,char *t);
+extern int decimal(char *s);
+extern char nextsymbol(void);
+extern char *nextpsname(void);
+extern void getenc(char **fontname ,char **encname ,char **ev ,int *width);
+extern void addcc(char *name,int charcode);
+extern int getcc(char *name);
+extern char *string(char *s);
+extern void remove_string(void);
+filenames.c
+static char *charptr(char *name,char c);
+extern int equal(char *s,char *t);
+extern char *extension(char *str);
+extern char *newname(char *name,char *ext);
+extern char *ps2pk_basename(char *str,char *suffix);
+extern int ps_resource(char *name);
+flisearch.c
+extern int main(int argc,char **argv );
+extern int matching(char *font,int size);
+fontfcn.c
+extern int SearchDictName(struct ps_dict *dictP,struct ps_obj *keyP);
+extern int initFont(void);
+extern void resetFont(char *env);
+extern int readFont(char *env);
+extern unsigned char *fontfcnB(unsigned char *S,unsigned char *code,int *lenP,int *mode);
+extern int fontfcnA(char *env,int *mode);
+extern void QueryFontLib(char *env,char *infoName,unsigned char *infoValue,int *rcodeP);
+hints.c
+extern void t1_InitHints(void);
+extern void t1_CloseHints(struct fractpoint *hintP);
+static void ComputeHint(struct hintsegment *hP,long currX,long currY,struct fractpoint *hintP);
+extern void t1_ProcessHint(struct hintsegment *hP,long currX,long currY,struct fractpoint *hintP);
+static short SearchXofY(struct edgelist *edge,short y);
+static int ImpliedHorizontalLine(struct edgelist *e1,struct edgelist *e2,int y);
+static void FixSubPaths(struct region *R);
+static void DumpSubPaths(struct edgelist *anchor);
+static struct edgelist *before(struct edgelist *e);
+static void writeXofY(struct edgelist *e,int y,int x);
+static void CollapseWhiteRun(struct edgelist *anchor,short yblack,struct edgelist *left,struct edgelist *right,short ywhite);
+extern void t1_ApplyContinuity(struct region *R);
+lines.c
+extern void t1_StepLine(struct region *R,long x1,long y1,long x2,long y2);
+extern void t1_Bresenham(short *edgeP,long x1,long y1,long x2,long y2);
+lspsres.c
+mag.c
+extern int main(int argc,char **argv );
+extern int fontsize(double x);
+extern double stepsize(double x);
+objects.c
+extern struct xobject *t1_Allocate(int size,struct xobject *template,int extra);
+extern void t1_Free(struct xobject *obj);
+extern struct xobject *t1_Permanent(struct xobject *obj);
+extern struct xobject *xiTemporary(struct xobject *obj);
+extern struct xobject *t1_Dup(struct xobject *obj);
+extern struct xobject *t1_Copy(struct xobject *obj);
+extern struct xobject *t1_Destroy(struct xobject *obj);
+extern struct xobject *t1_Unique(struct xobject *obj);
+extern void t1_Pragmatics(char *username,int value);
+extern void t1_Consume(int n,...);
+extern struct xobject *t1_TypeErr(char *name,struct xobject *obj,int expect,struct xobject *ret);
+static char *TypeFmt(int type);
+static int ObjectPostMortem(struct xobject *obj);
+extern struct xobject *t1_ArgErr(char *str,struct xobject *obj,struct xobject *ret);
+extern void t1_abort(char *str);
+extern char *t1_ErrorMsg(void);
+extern void t1_InitImager(void);
+extern void t1_TermImager(void);
+extern void reportusage(void);
+paths.c
+extern struct segment *t1_CopyPath(struct segment *p0);
+extern void t1_KillPath(struct segment *p);
+extern struct segment *t1_Loc(struct XYspace *S,double x,double y);
+extern struct segment *t1_ILoc(struct XYspace *S,int x,int y);
+extern struct segment *t1_SubLoc(struct segment *p1,struct segment *p2);
+extern struct segment *t1_PathSegment(int type,long x,long y);
+extern struct segment *t1_Line(struct segment *P);
+extern struct beziersegment *t1_Bezier(struct segment *B,struct segment *C,struct segment *D);
+extern struct hintsegment *t1_Hint(struct XYspace *S,double ref,double width,char orientation,char hinttype,char adjusttype,char direction,int label);
+extern struct segment *t1_Join(struct segment *p1,struct segment *p2);
+extern struct segment *t1_JoinSegment(struct segment *before,int type,long x,long y,struct segment *after);
+extern struct segment *t1_ClosePath(struct segment *p0,int lastonly);
+extern struct segment *t1_Reverse(struct segment *p);
+static struct segment *ReverseSubPath(struct segment *p);
+static struct segment *DropSubPath(struct segment *p0);
+static struct segment *SplitPath(struct segment *anchor,struct segment *before);
+extern struct segment *t1_ReverseSubPaths(struct segment *p);
+static int UnClose(struct segment *p0);
+extern struct segment *t1_PathXform(struct segment *p0,struct XYspace *S);
+extern void t1_PathDelta(struct segment *p,struct fractpoint *pt);
+extern struct segment *t1_BoundingBox(short h,short w);
+extern void t1_QueryLoc(struct segment *P,struct XYspace *S,double *xP,double *yP);
+extern void t1_QueryPath(struct segment *path,int *typeP,struct segment **Bp ,struct segment **Cp ,struct segment **Dp ,double *fP);
+extern void t1_QueryBounds(struct segment *p0,struct XYspace *S,double *xminP,double *yminP,double *xmaxP,double *ymaxP);
+extern struct segment *t1_BoxPath(struct XYspace *S,int h,int w);
+extern struct segment *t1_DropSegment(struct segment *path);
+extern struct segment *t1_HeadSegment(struct segment *path);
+extern void t1_DumpPath(struct segment *p);
+pfb2pfa.c
+extern int main(int argc,char **argv );
+pk2bm.c
+extern int main(int argc,char **argv );
+extern unsigned char lsbf(unsigned char u);
+extern void dots(unsigned char u,int n);
+extern int atoo(char *oct);
+pkin.c
+static short pkbyte(void);
+static long pkquad(void);
+static long pktrio(void);
+static long pklong(void);
+static short pkopen(char *name);
+static short getnyb(void);
+static short getbit(void);
+static unsigned short pkpackednum(void);
+static unsigned short rest(void);
+static unsigned short handlehuge(unsigned short i,unsigned short k);
+/* void unpack(struct *cd); */
+/* int readchar(char *name,short c,struct *cd); */
+static void error(char *s);
+pkout.c
+extern void pk_open(char *pkname);
+extern void pk_close(void);
+static void pk_nybble(int x);
+static void pk1(int x);
+static void pk2(int x);
+static void pk3(int x);
+static void pk4(int x);
+extern void pk_preamble(char *comment,float pointsize,int checksum,unsigned int h_res,unsigned int v_res);
+extern int optimal_size(int W,int H,int cnt,int *count,int *dyn_f);
+static void pk_runlengths(int W,int H,int (*next_pixel)(void));
+static void pk_number(int x);
+static void pk_bitmap(int width,int cnt,int *runlength);
+extern void pk_char(int char_code,int tfm_width,int h_escapement,unsigned int width,unsigned int height,int h_offset,int v_offset,int (*next_pixel)(void));
+static void pkstring(char *fmt,...);
+extern int INT(float x);
+extern char *magnification(int dpi,int BDPI);
+extern void pk_postamble(void);
+extern void ps2pk_postamble(char *fontname,char *encname,int base_res,int h_res,int v_res,float pointsize,char *args);
+pktest.c
+extern int main(int argc,char **argv );
+extern int next_pixel(void);
+ps2pk.c
+psargs.c
+psearch.c
+regions.c
+extern void t1_KillRegion(struct region *area);
+extern struct region *t1_CopyRegion(struct region *area);
+static struct edgelist *NewEdge(short xmin,short xmax,short ymin,short ymax,short *xvalues,int isdown);
+extern struct region *t1_Interior(struct segment *p,int fillrule);
+static int Unwind(struct edgelist *area);
+extern void t1_ChangeDirection(int type,struct region *R,long x,long y,long dy);
+static void newfilledge(struct region *R,long xmin,long xmax,long ymin,long ymax,int isdown);
+extern struct edgelist *t1_SortSwath(struct edgelist *anchor,struct edgelist *edge,struct edgelist *(*swathfcn)(void));
+static struct edgelist *splitedge(struct edgelist *list,short y);
+static void vertjoin(struct edgelist *top,struct edgelist *bottom);
+extern struct edgelist *swathxsort(struct edgelist *before0,struct edgelist *edge);
+extern struct edgelist *t1_SwathUnion(struct edgelist *before0,struct edgelist *edge);
+extern struct edgelist *swathrightmost(struct edgelist *before,struct edgelist *edge);
+static int touches(int h,short *left,short *right);
+static int crosses(int h,short *left,short *right);
+static void cedgemin(int, pel *, pel);
+static void cedgemax(int, pel *, pel);
+static void edgemin(int, pel *, pel *);
+static void edgemax(int, pel *, pel *);
+static void discard(struct edgelist *left,struct edgelist *right);
+extern void t1_MoveEdges(struct region *R,long dx,long dy);
+extern void t1_UnJumble(struct region *region);
+static int OptimizeRegion(struct region *R);
+extern void t1_MoreWorkArea(struct region *R,long x1,long y1,long x2,long y2);
+extern struct region *t1_BoxClip(struct region *R,short xmin,short ymin,short xmax,short ymax);
+extern struct segment *t1_RegionBounds(struct region *R);
+extern void t1_DumpArea(struct region *area);
+extern void t1_DumpEdges(struct edgelist *edges);
+static int edgecheck(struct edgelist *edge,int oldmin,int oldmax);
+scanfont.c
+/* struct ps_obj *MakeEncodingArrayP(struct *encodingTable); */
+extern int Init_BuiltInEncoding(void);
+static int getNextValue(int valueType);
+static int getInt(void);
+static int getEncoding(struct ps_obj *arrayP);
+static int getArray(struct ps_obj *arrayP);
+static int getName(char *nameP);
+static int getNbytes(int N);
+static int getLiteralName(struct ps_obj *nameObjP);
+static int BuildSubrs(struct ps_font *FontP);
+static int BuildCharStrings(struct ps_font *FontP);
+static int BuildFontInfo(struct ps_font *fontP);
+static int BuildPrivate(struct ps_font *fontP);
+static int GetType1Blues(struct ps_font *fontP);
+extern struct ps_obj *GetType1CharString(struct ps_font *fontP,unsigned char code);
+static int FindDictValue(struct ps_dict *dictP);
+extern int scan_font(struct ps_font *FontP);
+sexpr.c
+extern int main(int argc,char **argv );
+spaces.c
+extern struct XYspace *t1_CopySpace(struct XYspace *S);
+static void ConsiderContext(struct xobject *obj,double (*M)[2]);
+extern void FXYConvert(struct fractpoint *pt,struct XYspace *S,double x,double y);
+extern void IXYConvert(struct fractpoint *pt,struct XYspace *S,long x,long y);
+extern void ForceFloat(struct fractpoint *pt,struct XYspace *S,long x,long y);
+extern long FXYboth(double cx,double cy,double x,double y);
+extern long FXonly(double cx,double cy,double x,double y);
+extern long FYonly(double cx,double cy,double x,double y);
+extern long IXYboth(long cx,long cy,long x,long y);
+extern long IXonly(long cx,long cy,long x,long y);
+extern long IYonly(long cx,long cy,long x,long y);
+extern long FPXYboth(long cx,long cy,long x,long y);
+extern long FPXonly(long cx,long cy,long x,long y);
+extern long FPYonly(long cx,long cy,long x,long y);
+static void FillOutFcns(struct XYspace *S);
+static void FindFfcn(double cx,double cy,long (**fcnP )(void));
+static void FindIfcn(double cx,double cy,long *icxP,long *icyP,long (**fcnP )(void));
+extern void t1_UnConvert(struct XYspace *S,struct fractpoint *pt,double *xp,double *yp);
+extern struct xobject *t1_Xform(struct xobject *obj,double (*M)[2]);
+extern struct xobject *t1_Transform(struct xobject *obj,double cxx,double cyx,double cxy,double cyy);
+extern struct xobject *t1_Scale(struct xobject *obj,double sx,double sy);
+extern void t1_PseudoSpace(struct XYspace *S,double (*M)[2]);
+extern void t1_MMultiply(double (*A)[2],double (*B)[2],double (*C)[2]);
+extern void t1_MInvert(double (*M)[2],double (*Mprime)[2]);
+extern void t1_InitSpaces(void);
+extern void t1_QuerySpace(struct XYspace *S,double *cxxP,double *cyxP,double *cxyP,double *cyyP);
+extern void t1_FormatFP(char *str,long fpel);
+extern void t1_DumpSpace(struct XYspace *S);
+strexpr.c
+extern struct val *make_int(int i);
+extern struct val *make_str(char *s);
+extern void free_value(struct val *vp);
+extern int is_integer(struct val *vp,int *r);
+extern int to_integer(struct val *vp);
+extern void to_string(struct val *vp);
+extern void nexttoken(void);
+extern struct val *eval6(void);
+extern struct val *eval4(void);
+extern struct val *eval3(void);
+extern int strexpr(int *result,char *expression);
+t1funcs.c
+extern int Type1OpenScalable(char **ev ,struct _Font **ppFont ,int flags,struct _FontEntry *entry,char *fileName,struct _FontScalable *vals,unsigned long format,unsigned long fmask,double efactor,double slant);
+static int Type1GetGlyphs(struct _Font *pFont,unsigned long count,unsigned char *chars,int charEncoding,unsigned long *glyphCount,struct _CharInfo **glyphs );
+/* int Type1GetMetrics(struct _Font *pFont,unsigned long count,unsigned char *chars,int charEncoding,unsigned long *glyphCount,struct **glyphs ); */
+extern void Type1CloseFont(struct _Font *pFont);
+static void fill(char *dest,int h,int w,struct region *area,int byte,int bit,int wordsize);
+static void fillrun(char *p,short x0,short x1,int bit);
+extern int Type1RegisterFontFileFunctions(void);
+t1info.c
+static void FillHeader(struct _FontInfo *pInfo,struct _FontScalable *Vals);
+/* void adjust_min_max(struct *minc,struct *maxc,struct *tmp); */
+static void ComputeBounds(struct _FontInfo *pInfo,struct _CharInfo *pChars,struct _FontScalable *Vals);
+static void ComputeProps(struct _FontInfo *pInfo,struct _FontScalable *Vals,char *Filename);
+static void ComputeStdProps(struct _FontInfo *pInfo,struct _FontScalable *Vals,char *Filename,char *Fontname);
+extern int Type1GetInfoScalable(struct _FontPathElement *fpe,struct _FontInfo *pInfo,struct _FontEntry *entry,struct _FontName *fontName,char *fileName,struct _FontScalable *Vals);
+extern void T1FillFontInfo(struct _Font *pFont,struct _FontScalable *Vals,char *Filename,char *Fontname);
+extern void T1InitStdProps(void);
+t1io.c
+extern struct F_FILE *T1Open(char *fn,char *mode);
+extern int T1Getc(struct F_FILE *f);
+extern int T1Ungetc(int c,struct F_FILE *f);
+extern int T1Read(char *buffP,int size,int n,struct F_FILE *f);
+extern int T1Close(struct F_FILE *f);
+extern struct F_FILE *T1eexec(struct F_FILE *f);
+static int T1Decrypt(unsigned char *p,int len);
+static int T1Fill(struct F_FILE *f);
+t1snap.c
+extern unsigned __int64 __stdcall Int64ShllMod32(unsigned __int64 Value,unsigned long ShiftCount);
+extern __int64 __stdcall Int64ShraMod32(__int64 Value,unsigned long ShiftCount);
+extern unsigned __int64 __stdcall Int64ShrlMod32(unsigned __int64 Value,unsigned long ShiftCount);
+extern void *GetFiberData(void );
+extern void *GetCurrentFiber(void );
+extern struct segment *t1_Phantom(struct xobject *obj);
+extern struct xobject *t1_Snap(struct segment *p);
+t1stub.c
+extern int xiStub(void);
+extern void t1_DumpText(struct segment *foo);
+t1test.c
+extern int main(int argc,char **argv );
+extern void Display(struct _CharInfo *glyph);
+extern int T1FillVals(struct _FontScalable *vals);
+extern int CheckFSFormat(int format,int fmask,int *bit,int *byte,int *scan,int *glyph,int *image);
+extern char *MakeAtom(char *p);
+extern int GetClientResolutions(int *resP);
+extern char *Xalloc(int size);
+extern void Xfree(void);
+extern int FontDefaultFormat(void);
+extern int FontFileRegisterRenderer(void);
+extern int GenericGetBitmaps(void);
+extern int GenericGetExtents(void);
+extern int FontParseXLFDName(void);
+extern int FontComputeInfoAccelerators(void);
+texfiles.c
+extern unsigned long num(struct _iobuf *fp,int size);
+extern int snum(struct _iobuf *fp,int size);
+token.c
+static double P10(long exponent);
+static int next_char(int ch);
+static int add_char(int ch);
+static int skip_space(int ch);
+static int skip_comment(int ch);
+static int add_sign(int ch);
+static int add_1st_digits(int ch);
+static int add_digits(int ch);
+static int add_1st_decpt(int ch);
+static int add_decpt(int ch);
+static int add_fraction(int ch);
+static int add_e_sign(int ch);
+static int add_exponent(int ch);
+static int add_radix(int ch);
+static int add_r_digits(int ch);
+static int RADIX_NUMBER(int ch);
+static int INTEGER(int ch);
+static int REAL(int ch);
+static int HEX_STRING(int ch);
+static void save_digraph(int ch);
+static int STRING(int ch);
+static int AAH_NAME(int ch);
+static int NAME(int ch);
+static int LITERAL_NAME(int ch);
+static int IMMED_NAME(int ch);
+static int OOPS_NAME(int ch);
+static int RIGHT_ANGLE(int ch);
+static int RIGHT_PAREN(int ch);
+static int LEFT_BRACE(int ch);
+static int RIGHT_BRACE(int ch);
+static int LEFT_BRACKET(int ch);
+static int RIGHT_BRACKET(int ch);
+static int BREAK_SIGNAL(int ch);
+static int NO_TOKEN(int ch);
+extern void scan_token(struct ps_obj *inputP);
+type1.c
+static int ComputeAlignmentZones(void);
+static int InitStems(void);
+static int FinitStems(void);
+static void ComputeStem(int stemno);
+static struct segment *Applyhint(struct segment *p,int stemnumber,int half);
+static struct segment *Applyrevhint(struct segment *p,int stemnumber,int half);
+static struct segment *FindStems(double x,double y,double dx,double dy);
+static void ClearStack(void);
+static void Push(double Num);
+static void ClearCallStack(void);
+static void PushCall(struct ps_obj *CurrStrP,int CurrIndex,unsigned short CurrKey);
+static void PopCall(struct ps_obj **CurrStrPP ,int *CurrIndexP,unsigned short *CurrKeyP);
+static void ClearPSFakeStack(void);
+static void PSFakePush(double Num);
+static double PSFakePop(void);
+static struct segment *CenterStem(double edge1,double edge2);
+static unsigned char Decrypt(unsigned char cipher);
+static int DoRead(int *CodeP);
+static void StartDecrypt(void);
+static void Decode(int Code);
+static void DoCommand(int Code);
+static void Type1Escape(int Code);
+static void HStem(double y,double dy);
+static void VStem(double x,double dx);
+static void RLineTo(double dx,double dy);
+static void RRCurveTo(double dx1,double dy1,double dx2,double dy2,double dx3,double dy3);
+static void DoClosePath(void);
+static void CallSubr(int subrno);
+static void Return(void);
+static void EndChar(void);
+static void RMoveTo(double dx,double dy);
+static void DotSection(void);
+static void Seac(double asb,double adx,double ady,unsigned char bchar,unsigned char achar);
+static void Sbw(double sbx,double sby,double wx,double wy);
+static double Div(double num1,double num2);
+static void FlxProc(double c1x2,double c1y2,double c3x0,double c3y0,double c3x1,double c3y1,double c3x2,double c3y2,double c4x0,double c4y0,double c4x1,double c4y1,double c4x2,double c4y2,double epY,double epX,int idmin);
+static void FlxProc1(void);
+static void FlxProc2(void);
+static void HintReplace(void);
+static void CallOtherSubr(int othersubrno);
+static void SetCurrentPoint(double x,double y);
+extern struct xobject *Type1Char(char *env,struct XYspace *S,struct ps_obj *charstrP,struct ps_obj *subrsP,struct ps_obj *osubrsP,struct blues_struct *bluesP,int *modeP);
+util.c
+extern int vm_init(void);
+extern char *vm_alloc(unsigned int bytes);
+extern void objFormatInteger(struct ps_obj *objP,int value);
+extern void objFormatReal(struct ps_obj *objP,double value);
+extern void objFormatBoolean(struct ps_obj *objP,int value);
+extern void objFormatEncoding(struct ps_obj *objP,int length,struct ps_obj *valueP);
+extern void objFormatArray(struct ps_obj *objP,int length,struct ps_obj *valueP);
+extern void objFormatString(struct ps_obj *objP,int length,char *valueP);
+extern void objFormatName(struct ps_obj *objP,int length,char *valueP);
+extern void objFormatFile(struct ps_obj *objP,struct _iobuf *valueP);
diff --git a/fonts/utilities/ps2pk/ps2pk.1 b/fonts/utilities/ps2pk/ps2pk.1
new file mode 100644
index 0000000000..47cf209269
--- /dev/null
+++ b/fonts/utilities/ps2pk/ps2pk.1
@@ -0,0 +1,159 @@
+.TH PS2PK 1 "1 Feb 2016"
+.SH NAME
+ps2pk \- creates a TeX pkfont from a type1 PostScript font
+.SH SYNOPSIS
+ps2pk
+[ -v ]
+[ -e\fIenc\fP ]
+[ -X\fIxres\fP ]
+[ -E\fIexpansion\fP ]
+[ -S\fIslant\fP ]
+[ -P\fIpointsize\fP ]
+[ -R\fIbaseres\fP ]
+[ -r\fIaspectratio\fP ]
+[ -Y\fIyres\fP ]
+[ -a\fIAFMfile\fP ]
+[ -m\fImodename\fP ]
+type1 [pkfont]
+.SH DESCRIPTION
+This program renders a given type1 PostScript font at a given pointsize
+(default 10.0 points) and resolution (default 300dpi) into a TeX pkfont.
+.PP
+To generate the pkfont ps2pk needs a valid type1 font file (for
+example Utopia-Regular, Utopia-Regula.pfb or Utopia-Regula.pfa) and
+its corresponding AFM-file (Utopia-Regular.afm) with the font metrics.
+The program accepts both the binary type1 format (Utopia-Regula.pfb)
+and its ASCII equivalent (Utopia-Regular or Utopia-Regula.pfa). To
+locate the files, ps2pk uses the kpathsea library (see the info page
+on kpathsea). Additionally, pfb and pfa files are searched for in the
+directory specified in the environment variable T1INPUTS, and afm
+files are searched in AFMFONTS, if they are set (the -v flag will
+report which filenames are looked for).
+.PP
+The program will make a pkfont in which the character codes are derived
+from their AFM (Adobe Font Metrics) defined values. This can be
+overruled by specifying an explicit encoding file via the -e option.
+The encoding file \fIenc\fP
+should contain a valid PostScript encoding containing PostScript names
+like /hyphen. Here is an incomplete example (see afm2tfm for complete
+syntax):
+
+.RS
+.nf
+% This is the EC encoding.
+/ECEncoding [ % now 256 chars follow
+% 0x00
+ /grave /acute /circumflex /tilde /dieresis /hungarumlaut
+ /ring /caron /breve /macron /dotaccent /cedilla
+ /ogonek /quotesinglbase /guilsinglleft /guilsinglright
+
+ (Rest of lines omitted.)
+
+% 0xF0
+ /eth /ntilde /ograve /oacute /ocircumflex /otilde
+ /odieresis /oe /oslash /ugrave /uacute /ucircumflex
+ /udieresis /yacute /thorn /germandbls ] def
+.fi
+.RE
+.PP
+Options and arguments:
+.IP -a\fIAFMfile\fP 12
+Overrules the name that is used to locate the AFM file.
+
+.IP -e\fIenc\fP 12
+Name of a file containing an encoding scheme
+(default \- the encoding named in the AFM-file is used).
+The actual PostScript name of the encoding scheme is written
+as a "special" at the end of the pkfont.
+
+.IP -E\fIextension\fP 12
+The extension factor (real value, default 1.0).
+
+.IP -m\fImodename\fP 12
+A modename such as would be used by METAFONT (default "Unknown mode").
+
+.IP -P\fIpointsize\fP 12
+The desired pointsize (real value, default 10.0 points).
+
+.IP -R\fIbaseres\fP 12
+The desired base resolution (integer value, default 300 dpi).
+If this differs from the value of \fIxres\fP, the appropriate
+magnification will be shown in the "specials" at the end
+of the pkfont. If possible, this will be expressed as a
+magstep, otherwise as a real number. For example, a pkfont with an \fIxres\fP
+of 329, using the default base resolution of 300,
+will include the "special" text "mag=magstep(0.5)" at the
+end of the font.
+
+.IP -r\fIaspectratio\fP 12
+The desired aspect ratio (expression, integerY/integerX, default 300/300).
+This will be shown in the "specials" at the end
+of the pkfont. Setting the aspect ratio creates a value for
+\fIyres\fP but an explicit \fIyres\fP value will take precedence.
+Argument must be in "" if spaces are left around `/'.
+
+.IP -S\fIslant\fP 12
+The slant (real value, default 0.0).
+
+.IP -X\fIxres\fP 12
+The resolution in the X direction (integer value, default 300 dpi).
+
+.IP -Y\fIyres\fP 12
+The resolution in the Y direction (integer value, default the value
+of \fIxres\fP). If \fIyres\fP differs from \fIxres\fP, a "special"
+text giving the aspect ratio will be written at the end of the
+pkfont.
+
+.IP -v 12
+Verbose flag. (Tells what the program is doing.)
+
+.IP type1 12
+The name of the PostScript type1 font. The name of the AFM-file will be
+constructed from this name by removing the extension (if suplied) and
+adding ".afm". The PostScript "FontName" is extracted from the
+AFM-file and written into a "special" at the end of the pkfont.
+
+.IP [pkfont] 12
+The name of the resulting pkfont can be overruled with this name. The
+default name of pkfont is derived from the basename of the type1
+font, the pointsize and \fIxres\fP. For example
+`ps2pk -P17.28 Utopia-Regular' will result in `Utopia-Regular17.300pk'.
+An explicit value for the name of the pkfont is necessary when
+the type1 font name already shows the point size, otherwise
+the \fIpointsize\fP value is catenated on to the pkfont basename
+which is usually not what is wanted.
+
+.PP
+The following PK "specials" provide an internal check on the
+characteristics of the pkfont, in accordance with the recommendations
+of the TeX Working Group on the TeX Directory Standard (TWG-TDS):
+.br
+"fontid=\fIFontName\fP", "codingscheme=\fIEncoding\fP", "fontfacebyte", "mag",
+"mode=(ps2pk)\fImodename\fP", "pixels-per-inch", and "aspect-ratio" if it
+is other than unity.
+
+.SH ACKNOWLEDGEMENT
+This program uses the Type1 hinting and rendering software IBM
+has donated to the X Consortium.
+
+.SH SEE ALSO
+.nf
+`METAFONT: The Program', Donald Knuth.
+`The GFtoPK processor', belonging to the METAFONTware.
+`Adobe Font Metric Files', Version 3.0, PostScript Developer
+Support Group.
+afm2tfm(1)
+pk2bm(1)
+kpsewhich(1)
+info kpathsea
+
+.SH VERSION
+1.4 (January 1994)
+
+.SH AUTHOR
+Piet Tutelaers,
+modified for ps2pkm by Pierre A. Mackay.
+This manpage was adapted to teTeX by Frank Kuester.
+.PP
+Maintained in TeX Live; please send bug reports or other correspondence
+to tex-k@tug.org (http://lists.tug.org/tex-k).
diff --git a/fonts/utilities/ps2pk/ps2pk.c b/fonts/utilities/ps2pk/ps2pk.c
new file mode 100644
index 0000000000..c59d9a7f82
--- /dev/null
+++ b/fonts/utilities/ps2pk/ps2pk.c
@@ -0,0 +1,708 @@
+/*
+ * NAME
+ * ps2pk - creates a PK font from a type1 PostScript font
+ * SYNOPSIS:
+ * ps2pk [options] type1 [pkname]
+ * DESCRIPTION
+ * This program renders a given type1 PostScript font at a given
+ * pointsize (default 10.0 points) and resolution (default 300dpi)
+ * into a TeX PK font.
+ *
+ * To generate the PK font ps2pk needs a valid type1 fontname (for
+ * example Utopia-Regular.pfa) and its corresponding AFMfile
+ * (Utopia-Regular.afm). The program accepts both the MSDOS binary
+ * type1 format (Utopia-Regula.pfb) and its UNIX ASCII equivalent
+ * (Utopia-Regula.pfa). The resulting PK font does contain all
+ * characters for which the C-code is non negative. This can be
+ * overruled by specifying an explicit <encoding> via the -e<encoding>
+ * option. Character codes in AFM files are specified as integer values
+ * after the C, for example Utopia-Regular.afm provides:
+ * C 251 ; WX 601 ; N germandbls ; B 22 -12 573 742 ;
+ * C -1 ; WX 380 ; N onesuperior ; B 81 272 307 680 ;
+ *
+ * The `germandbls' has code 251 and `onesuperior' -1 which means
+ * that this character is not part of the default AdobeStandard-
+ * Encoding scheme. To get this `onesuperior' you have to add it to
+ * an encoding vector as described in the PostScript manuals. But of
+ * course it is better to use standard encodings, like the one provided
+ * with the new psfonts. This `TeXBase1Encoding' encoding does contain
+ * all names of characters as defined in the 256 character TeX fonts.
+ *
+ * The location of files for ps2pk, since version 1.5, has been
+ * improved using PostScript resource databases. These databases
+ * can be created using Adobe's mkpsres(1) utility. On UNIX the
+ * default name is PSres.upr and can be found in directories like
+ * /usr/lib/DPS depending on the machine you are using. The
+ * following example of an UPR file contains three resources
+ * PS-Resources-1.0
+ * Encoding
+ * FontAFM
+ * FontOutline
+ * .
+ * //usr/local/tex/fonts/type1faces
+ * Encoding
+ * ECEncoding=EC.enc
+ * .
+ * FontAFM
+ * Courier=ResidentFonts/Courier.pfa
+ * .
+ * FontOutline
+ * Courier=ResidentFonts/Courier.afm
+ * .
+ *
+ * When this UPR is in the PSRESOURCEPATH ps2pk can make an EC encoded
+ * PK font for Courier with:
+ *
+ * ps2pk -eECEncoding Courier
+ *
+ * It is also possible without the UPR file but then you have to
+ * set T1INPUTS to the directories containing the files you need,
+ * for example:
+ *
+ * setenv T1INPUTS /usr/local/tex/fonts/type1faces//
+ *
+ * and to run ps2pk by providing the proper filenames:
+ *
+ * ps2pk -eEC.enc Courier.pfa
+ *
+ * In both cases the result will be the PK font Courier10.300pk.
+ *
+ * PostScript resource databases eliminate the need for recursive
+ * directory search, this is done by mkpsres(1) instead. And all
+ * resources can be stored in one directory per computer keeping
+ * maintenance easy. Another advantage is the mapping of internal
+ * PostScript names, which are case sensitive and not restricted to
+ * MSDOS limitations, to external platform dependant filenames in
+ * a very natural way. On a MSDOS computer psres.dpr (the equivalent
+ * of PSres.upr) could be:
+ * PS-Resources-1.0
+ * Encoding
+ * FontAFM
+ * FontOutline
+ * .
+ * Encoding
+ * TeXBase1Encoding=c:\emtex\dvips\8r.enc
+ * .
+ * FontAFM
+ * Courier=c:\psfonts\com_____.pfb
+ * .
+ * FontOutline
+ * Courier=c:\psfonts\afm\com_____.afm
+ * .
+ *
+ * Given this psres.dpr resource database
+ *
+ * ps2pk -eTeXBase1Encoding Courier
+ *
+ * will create Courier10.300pk. Unfortunately MSDOS will abbreviate
+ * this name to COURIER1.300. Mkpsres(1) is an improved version
+ * of Adobe's makepsres(1) that runs on UNIX and MSDOS. This program
+ * will treat PFB fonts and PFM fonts correctly and recognize
+ * filenames ending with ".enc" as encoding vectors.
+ *
+ * If the name of <type1font> does not contain an explicit extension
+ * or directory separator it is considered as the name of a resource.
+ * Otherwise as a filename. You can not mix up resource names and file-
+ * names. Filenames must have an extension!
+ *
+ * OPTIONS AND ARGUMENTS
+ * -a<AFM> The name of the AFM resource or file can be
+ * overruled with this option.
+ * -e<encoding> The encoding scheme (default the encoding from the
+ * AFM file is used).
+ * -E<extension> The extension factor (real value, default 1.0).
+ * -O Create old checksums (for compatibility)
+ * -P<pointsize> The desired pointsize (real value, default 10.0
+ * points). PK fonts created with a value different
+ * to 10.0 will cause dvips warnings `dvips: Design
+ * size mismatch in font ...'.
+ * -R<baseres> The base resolution (integer value, default 300
+ * dpi). Only used for creating METAFONT compatible
+ * identification strings in PK postamble.
+ * -S<slant> The slant (real value, default 0.0).
+ * -X<xres> The resolution (integer value) in the X direction
+ * (default 300 dpi).
+ * -Y<yres> The resolution (integer value) in the Y direction
+ * (defaults to the value of <xres>).
+ * -d Debug stat() calls during recursive path searching
+ * -v Verbose flag. (Tells what the program is doing.)
+ *
+ * type1font The name of the PostScript type 1 font. When no
+ * explicit AFMfile is given via the -a option the
+ * name of the AFMfile will be constructed from this
+ * name by removing the extension (if supplied) and
+ * adding ".afm".
+ * [pkname] The name of the resulting PK font can be overruled
+ * with this name. The default name of the PK font is
+ * derived from the basename of the type1 font, the
+ * pointsize and <xres>. For example:
+ * ps2pk -P17.28 Utopia-Regular
+ * will result in:
+ * Utopia-Regular17.300pk
+ *
+ * ENVIRONMENTS
+ *
+ * PSRESOURCEPATH
+ * The path used for locating PS resource database files (PSres.upr
+ * on UNIX and psres.dpr on MSDOS). The default of the path will be
+ * shown by running ps2pk with the -v flag and a non-existant resource
+ * name.
+ *
+ * T1INPUTS
+ * The path used for locating PS type1 fonts, their AFM files and
+ * encoding vectors. Path may contain '//' (UNIX) or '!!' (MSDOS) to
+ * force ps2pk to look into subdirectories. Using PSRESOURCEPATH
+ * instead of T1INPUTS avoids recursion. The default of the path will
+ * be shown by running ps2pk with the -v flag and a non-existant
+ * filename.
+ *
+ * ACKNOWLEDGEMENTS
+ * This program uses the type1 hinting and rendering software IBM
+ * has donated to the X-consortium.
+ *
+ * Since version 1.5 the lookup of PS resources as described in
+ * `Programming the Display PostScript System with X (Appendix A:
+ * Locating PostScript Resources)' from Adobe Systems is used.
+ * SEE ALSO
+ * ``METAFONT: The Program'', Donald Knuth.
+ * ``The GFtoPK processor'', belonging to the METAFONTware.
+ * afm2tfm(1)
+ * mkpsres(1)
+ * mtpk(1)
+ * pk2bm(1)
+ * pkfonts(1)
+ * AUTHOR
+ * Piet Tutelaers
+ */
+
+#include "basics.h" /* basic definitions and fatal() */
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+/* PostScript Resource lookup functions */
+/*
+#include "PSres.h"
+*/
+#include "filenames.h" /* newname(), extension(), ps_resource() */
+#include "psearch.h" /* path search functions */
+#include "pkout.h" /* PK output functions */
+
+/* begin interface to type 1 software */
+#include "ffilest.h"
+
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "regions.h"
+#include "t1stdio.h"
+#include "util.h"
+#include "fontfcn.h"
+
+FontScalableRec vals;
+FontEntryRec entry;
+#define Succesful 85
+/* end interface to type 1 software */
+
+char *encfile = NULL, *afmfile;
+
+char ps2pk_args[MAXSTRLEN] = "none"; /* essential ps2pk arguments */
+
+#define POINTSPERINCH 72.27
+#define DEFAULTRES 300
+#define DEFAULTPOINTSIZE 10.0
+
+double pointsize = 0.0; /* wanted pointsize */
+int W, H, /* width and height of character glyph */
+ base_resolution = DEFAULTRES,
+ x_resolution = 0,
+ y_resolution = 0;
+
+int verbose = 0, debug = 0;
+
+/* Provide old (-O flag) and new (default) checksum function */
+static uint32_t checksum(encoding, int [256]);
+static uint32_t old_checksum(encoding, int [256]);
+uint32_t (*pchecksum)(encoding, int [256]) = checksum;
+
+/* Prototypes */
+static int next_pixel(void);
+#if 0
+static void print_pixmap(void);
+#endif
+static void first_pixel(CharInfoRec *);
+static int32_t TFMwidth(int);
+static int h_escapement(int);
+static void add_option(const char *, const char *);
+
+int main(int argc, char *argv[])
+{
+ char c;
+ int done, i;
+ const char *myname = "ps2pk";
+ char *psname, *psbasename, *afmname = NULL,
+ *encname = NULL, *psfile = NULL, *psfilebn, pkname[80],
+ *AFM_fontname = NULL,
+ *encodingscheme = NULL;
+
+ FontPtr fontptr;
+ unsigned char glyphcode[1]; /* must be an array */
+ CharInfoRec *glyphs[1];
+ unsigned int count;
+ int charcode, rc = -1, charno;
+ char comment[256];
+ long cs;
+ encoding ev;
+ int WX[256];
+
+ float efactor = 1.0, slant = 0.0;
+
+#ifdef KPATHSEA
+ kpse_set_program_name(argv[0], "ps2pk");
+#endif
+
+ while (--argc > 0 && (*++argv)[0] == '-') {
+ done=0;
+ while ((!done) && (c = *++argv[0])) /* allow -bcK like options */
+ switch (c) {
+ case 'a':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ afmname = argv[0];
+ done = 1;
+ break;
+ case 'd':
+ debug = 1;
+ break;
+ case 'e':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ encname = argv[0];
+ add_option("-e", encname);
+ done = 1;
+ break;
+ case 'E':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ efactor = atof(argv[0]);
+ add_option("-E", argv[0]);
+ done = 1;
+ break;
+ case 'O':
+ pchecksum = old_checksum;
+ add_option("-O", "");
+ break;
+ case 'P':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ pointsize = atof(argv[0]);
+ add_option("-P", argv[0]);
+ done = 1;
+ break;
+ case 'R':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ base_resolution = atoi(argv[0]);
+ add_option("-R", argv[0]);
+ done = 1;
+ break;
+ case 'S':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ slant = atof(argv[0]);
+ add_option("-S", argv[0]);
+ done = 1;
+ break;
+ case 'X':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ x_resolution = atoi(argv[0]); done = 1;
+ if (y_resolution == 0) y_resolution = x_resolution;
+ add_option("-X", argv[0]);
+ break;
+ case 'Y':
+ if (*++argv[0] == '\0') {
+ argc--; argv++;
+ }
+ if (argv[0] == '\0') goto invalid;
+ y_resolution = atoi(argv[0]); done = 1;
+ if (x_resolution == 0) x_resolution = y_resolution;
+ add_option("-Y", argv[0]);
+ break;
+ case 'v':
+ verbose = 1;
+ break;
+invalid:
+ default:
+ fatal("%s: %c invalid option\n", myname, c);
+ }
+ }
+
+ if (argc < 1 || argc >2) {
+ msg ("ps2pk version " PACKAGE_VERSION " (1992-2016)\n");
+ msg ("Usage: %s [options] type1font [pkname]\n", myname);
+ msg ("options: -d -v -e<enc> -X<xres> -E<expansion> -S<slant>\n");
+ fatal("options: -O -P<pointsize> -Y<yres> -a<AFM> -R<baseres>\n");
+ }
+
+ psname = argv[0]; argc--; argv++;
+
+#ifndef KPATHSEA
+ if (ps_resource(psname)) {
+ /* if psname does neither contain a DIRSEP or `.' character
+ * then find the filename of this resource in one of the PS
+ * resource database(s) available in PSRESOURCEPATH.
+ */
+ char **names, **files; int i, count;
+
+ psrespath = path(PSRESOURCEPATH, getenv("PSRESOURCEPATH"));
+ if (verbose) msg("PSRESOURCEPATH := %s\n", psrespath);
+
+ count = ListPSResourceFiles(psrespath, NULL,
+ "FontOutline", psname, &names, &files);
+ if (count == 0)
+ fatal("No FontOutline resource found for %s\n", psname);
+ if (verbose && count > 1) {
+ msg("More than one FontOutline resource for %s\n", psname);
+ for (i = 0; i < count; i++) msg("\t<%s>\n", files[i]);
+ }
+ psfile = files[0];
+ if (verbose) msg("Resource <%s>\n", psfile);
+ psbasename = psname;
+ }
+
+ if (psfile != NULL) {
+ char **names, **files; int count;
+
+ if (afmname == NULL || ps_resource(afmname)) {
+ if (afmname == NULL) afmname = psname;
+ count = ListPSResourceFiles(psrespath, NULL,
+ "FontAFM", afmname, &names, &files);
+ if (count == 0)
+ fatal("No FontAFM resource found for %s\n", afmname);
+ if (verbose && count > 1) {
+ msg("More than one FontAFM resource for %s\n", afmname);
+ for (i = 0; i < count; i++) msg("\t<%s>\n", files[i]);
+ }
+ afmfile = files[0];
+ if (verbose) msg("Resource <%s>\n", afmfile);
+ }
+ else fatal("%s: invalid resource name\n", afmname);
+
+ if (encname != NULL) {
+ if (!ps_resource(encname))
+ fatal("%s: invalid Encoding resource\n", encname);
+ count = ListPSResourceFiles(psrespath, NULL,
+ "Encoding", encname, &names, &files);
+ if (count == 0)
+ fatal("No Encoding resource found for %s\n", encname);
+ if (verbose && count > 1) {
+ msg("More than one Encoding resource for %s\n", encname);
+ for (i = 0; i < count; i++) msg("\t<%s>\n", files[i]);
+ }
+ encfile = files[0];
+ if (verbose) msg("Resource <%s>\n", encfile);
+ }
+ }
+ else { /* No PS resource database or no resource for type1font */
+#endif
+#ifdef KPATHSEA
+ psfile = kpse_find_file(psname,kpse_type1_format,0);
+ if (!psfile) {
+ /* kpse_find_file does not look for alternate suffixes */
+ char *altname = newname(psname, ".pfb");
+ psfile = kpse_find_file(altname, kpse_type1_format, 0);
+ free(altname);
+ }
+ if (!psfile)
+ fatal("%s: PS file %s not found!\n", kpse_invocation_name,
+ psname);
+ if (afmname == NULL)
+ afmname = newname(psname, ".afm");
+ afmfile = kpse_find_file(afmname,kpse_afm_format,0);
+ if (!afmfile)
+ fatal("%s: AFM file %s not found!\n", kpse_invocation_name,
+ afmname);
+
+ if (encname) {
+ encfile = kpse_find_file(encname,kpse_enc_format,0);
+ if (!encfile)
+ fatal("%s: enc file %s not found!\n", kpse_invocation_name,
+ encname);
+ }
+ else
+ encfile = NULL;
+ printf("psfile = %s\n", psfile);
+ printf("afmfile = %s\n", afmfile);
+ if (encfile) printf("encfile = %s\n", encfile);
+#else
+ t1inputs = path(T1INPUTS, getenv("T1INPUTS"));
+ if (verbose) msg("T1INPUTS := %s\n", t1inputs);
+
+ psfile = search_file(t1inputs, psname, FATAL);
+ if (verbose) msg("Font file <%s>\n", psfile);
+
+ if (afmname == NULL) afmname = newname(psfile, ".afm");
+ afmfile = search_file(t1inputs, afmname, FATAL);
+ if (verbose) msg("AFM file <%s>\n", afmfile);
+
+ /* get encoding when -e<enc> provided */
+ if (encname) {
+ encfile = search_file(t1inputs, encname, FATAL);
+ if (verbose) msg("Encoding file <%s>\n", encfile);
+ }
+#endif
+ psbasename = basename(psname, extension(psname));
+#ifndef KPATHSEA
+ }
+#endif
+ psfilebn = basename(psfile, NULL);
+
+ if (pointsize == 0.0) pointsize = DEFAULTPOINTSIZE;
+ if (x_resolution == 0) x_resolution = DEFAULTRES;
+ if (y_resolution == 0) y_resolution = x_resolution;
+ if (verbose)
+ msg("Loading encoding vector from %s ...",
+ encname? encname: basename(afmfile, NULL));
+ getenc(&AFM_fontname, &encodingscheme, ev, WX);
+ if (efactor != 1.0)
+ for (i=0; i < 256; i++) {
+ if (ev[i] == NULL) continue;
+ WX[i] = WX[i] * efactor + 0.5;
+ }
+ if (verbose) msg(" done\n");
+
+ if (argc == 1) strcpy(pkname, argv[0]);
+ else
+ sprintf(pkname, "%s%d.%dpk", psbasename,
+ (int) (pointsize + 0.5), x_resolution);
+
+ /* next values are needed! */
+ vals.x = x_resolution;
+ vals.y = y_resolution;
+ vals.point = 10.0 * pointsize + 0.5; /* DECIPOINTS */
+ vals.pixel = pointsize * y_resolution / POINTSPERINCH + 0.5;
+
+ if (verbose) msg("Checking type1 font %s ...", psfilebn);
+ Type1RegisterFontFileFunctions();
+ if (verbose) msg(" done\n");
+
+ /* next line prevents UNIX core dumps */
+ entry.name.name = "-adobe-utopia-medium-r-normal--0-0-0-0-p-0-iso8859-1";
+ if (verbose)
+ msg("Creating character glyphs for %s ...", psfilebn);
+ rc = Type1OpenScalable(ev, &fontptr, 0, &entry,
+ psfile, &vals, 0, 0, efactor, slant);
+ if (rc != Succesful)
+ fatal("Type1OpenScalable error (result: %d) on %s \n", rc, psfile);
+ if (verbose) msg(" done\n");
+
+ pk_open(pkname);
+ sprintf(comment, "%s rendered at %f points", psbasename, pointsize);
+ cs = pchecksum(ev, WX);
+ pk_preamble(comment, pointsize, cs, x_resolution, y_resolution);
+ charno = 0;
+ if (verbose) msg("Creating %s from %s\n", pkname, psfilebn);
+ for (charcode = 0; charcode < 256; charcode++) {
+ if (ev[charcode] == NULL) continue;
+ glyphcode[0] = charcode;
+ (fontptr->get_glyphs)(fontptr, 1, glyphcode, 0, &count, glyphs);
+ if (count > 0) {
+ if (debug) {
+ msg("'%03o ", charcode); charno++;
+ if (charno == 8) {
+ msg("%c", '\n'); charno = 0;
+ }
+ }
+ first_pixel(glyphs[0]); /* assigns W and H */
+ pk_char(charcode, /* charcode */
+ TFMwidth(WX[charcode]), /* TFMwidth */
+ h_escapement(WX[charcode]), /* h_escapement */
+ W, H, /* width and height */
+ - glyphs[0]->metrics.leftSideBearing, /* h_offset */
+ glyphs[0]->metrics.ascent, /* v_offset */
+ next_pixel); /* pixel generator */
+ }
+ }
+ if (debug) msg("%c", '\n');
+ ps2pk_postamble(psbasename, encodingscheme,
+ base_resolution, x_resolution, y_resolution, pointsize,
+ ps2pk_args);
+ pk_close();
+ exit(0);
+}
+
+/*
+ * The checksum should garantee that our PK file belongs to the correct TFM
+ * file! Exactly the same as the afm2tfm (dvips5487) calculation.
+ */
+static uint32_t old_checksum(encoding ev, int width[256])
+{
+ int i;
+ uint32_t s1 = 0, s2 = 0;
+ char *p ;
+
+ for (i=0; i<256; i++) {
+ if (ev[i] == NULL) continue;
+ s1 = (s1<<1) ^ width[i]; /* left shift */
+ for (p=ev[i]; *p; p++)
+ s2 = s2 * 3 + *p ;
+ }
+ return (s1<<1) ^ s2 ;
+}
+
+/*
+ * The new checksum algorithm.
+ */
+static uint32_t checksum(encoding ev, int width[256])
+{
+ int i;
+ uint32_t s1 = 0, s2 = 0;
+ char *p ;
+
+ for (i=0; i<256; i++) {
+ if (ev[i] == NULL) continue;
+ s1 = ((s1<<1) ^ (s1>>31)) ^ width[i]; /* cyclic left shift */
+ for (p=ev[i]; *p; p++)
+ s2 = s2 * 3 + *p ;
+ }
+ return (s1<<1) ^ s2 ;
+}
+
+static int row, col;
+static int data, bitno;
+static unsigned char *p_data;
+
+static int
+next_pixel(void)
+{
+ int pixel;
+
+ while (row < H) {
+ if (col++ < W) {
+ if (bitno == 0) { data = *p_data++; bitno = 8; }
+ pixel = data & 0x80? BLACK: WHITE;
+ data <<= 1; bitno--; return pixel;
+ }
+ col = 0; row++; bitno = 0;
+ }
+ fatal("Not that many pixels!\n");
+}
+
+static void
+first_pixel(CharInfoRec *G)
+{
+ row = col = 0;
+ p_data = (unsigned char *) G->bits;
+ W = G->metrics.rightSideBearing - G->metrics.leftSideBearing;
+ H = G->metrics.ascent + G->metrics.descent;
+ bitno = 0;
+}
+
+#if 0
+static void
+print_pixmap(void)
+{
+ int c, r;
+ unsigned char *save_p_data;
+
+ save_p_data = p_data;
+ if (W*H == 0) return; /* easy */
+ for (r = 0; r < H; r++) {
+ for (c = 0; c < W; c++)
+ if (next_pixel() == BLACK) msg("%c", 'X');
+ else msg("%c", '.');
+ msg("%c", '\n');
+ }
+ /* reset data for scanning pixmap */
+ p_data = save_p_data;
+ bitno = 0; row = 0; col = 0;
+}
+#endif
+
+/* Next function computes the width as a fix_word. A fix_word is
+ an integer representation for fractions. The decimal point is
+ left from bit 20. (The method is `stolen' from afm2tfm.) */
+
+static int32_t
+TFMwidth(int wx)
+{
+ return (((wx / 1000) << 20) +
+ (((wx % 1000) << 20) + 500) / 1000) ;
+}
+
+static float HXU = -1.0; /* horizontal pixels per design unit */
+
+/* the horizontal escapent is the number of pixels to next origin */
+static int
+h_escapement(int wx)
+{
+ if (HXU == -1.0)
+ HXU = (pointsize * x_resolution) / 72270.0;
+ return wx * HXU + 0.5;
+}
+
+/* add ps2pk option to string */
+static void
+add_option(const char *option, const char *value)
+{
+ static char *p_args = NULL;
+
+ if (p_args == NULL) {
+ p_args = ps2pk_args;
+ sprintf(p_args, "%s%s", option, value);
+ }
+ else
+ sprintf(p_args, " %s%s", option, value);
+ p_args+= strlen(p_args);
+}
+
+/* Next stuff is needed by type1 rendering functions */
+
+int CheckFSFormat(int format, int fmask, int *bit, int *Byte, int *scan,
+ int *glyph, int *image)
+{
+ *bit = *Byte = 1;
+ *glyph = *scan = *image = 1;
+ return Successful;
+
+}
+
+intptr_t MakeAtom(const char *p, unsigned int len, int foo)
+{
+ return (intptr_t)p;
+}
+
+#if 0
+void GetClientResolutions(int *resP)
+{
+ *resP = 0;
+}
+#endif
+
+void *Xalloc(size_t size)
+{
+ void *p;
+ p = malloc(size);
+ if (p == NULL) fatal("Out of memory\n");
+ return p;
+}
+
+void Xfree(void *p)
+{
+ free(p);
+}
diff --git a/fonts/utilities/ps2pk/psearch.c b/fonts/utilities/ps2pk/psearch.c
new file mode 100644
index 0000000000..0d81c57f44
--- /dev/null
+++ b/fonts/utilities/ps2pk/psearch.c
@@ -0,0 +1,557 @@
+/* FILE: psearch.c
+ * PURPOSE: PATH search module
+ * VERSION: 1.7 (December 2014)
+ * AUTHOR: Piet Tutelaers
+ * (see README for license)
+ */
+
+#define _POSIX_SOURCE 1
+#ifdef ultrix
+#define __POSIX /* otherwise MAXNAMLEN undefined */
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h> /* struct stat */
+#include <dirent.h> /* opendir(), readdir(), closedir() */
+#include "ctype.h" /* isalpha() */
+#include <stdio.h> /* sprintf(), fclose() */
+#include "stdlib.h" /* getenv(), malloc() */
+#include <stdarg.h> /* va_start(), va_arg(), va_end() */
+#include "string.h" /* strcat(), strchr(), strcmp(), strcpy(), strlen(),
+ strncmp(), strncpy(), strstr() */
+#include "basics.h" /* fatal() */
+#include "strexpr.h" /* strexpr() */
+#include "filenames.h" /* equal(), extension() */
+#include "texfiles.h" /* four(), one(), two() */
+
+#ifdef UNIX
+#include <pwd.h> /* getpwnam() */
+
+int tilde = 1; /* Substitute ~ and ~user */
+static char *home = NULL;
+
+/*
+ * During scanning of paths we often need to replace ~user with user's
+ * HOME directory and ~ with HOME directory. Subtilde() copies the actual
+ * value of `~' or `~user' from <path> into <fn>. The pointers <fn> and
+ * <path> are `updated'.
+ */
+void subtilde(char **fn, char **path)
+{ char pattern[32], *p; int i;
+
+ i = 0; p = *path;
+ while (*p != '\0' && *p != DIRSEP && *p != PATHSEP)
+ pattern[i++] = *p++ ;
+ pattern[i] = '\0' ;
+ if (pattern[0] != '~') return;
+ if (pattern[1] == '\0') {
+ if (home == NULL)
+ home = getenv("HOME");
+ if (home == NULL) fatal("You don't have a HOME!\n");
+ sprintf(*fn, "%s\0", home);
+ *fn += strlen(*fn);
+ *path = p;
+ }
+ else {
+ struct passwd *pw;
+ if (pw = getpwnam(&pattern[1])) {
+ sprintf(*fn, "%s\0", pw->pw_dir);
+ *fn += strlen(*fn); *path = p;
+ }
+ else
+ fatal("%s: no such user\n", &pattern[1]) ;
+ }
+}
+#else
+static int tilde = 0; /* Don't substitute ~ and ~user */
+static void subtilde(char **fn, char **path) {}
+#endif
+
+/*
+ * Return a path constructed by <env> and <deFault>. If <env> is empty
+ * the returned path equals <deFault>, otherwise the returned path is
+ * <env> in which empty path elements are replaced by <deFault>. Double
+ * path elements are NOT removed.
+ */
+char *path(char *deFault, char *env) {
+ char *e, *p, *q; int len, left = MAXPATHLEN;
+
+ if (env == NULL) return deFault;
+
+ p = (char *) malloc(MAXPATHLEN);
+ if (p == NULL) fatal("Out of memory\n");
+
+ q = p; e = env;
+ while (*e) {
+ if (*e == PATHSEP) {
+ if (left == MAXPATHLEN) {
+ len = strlen(deFault);
+ if (len > left-1) fatal("'%s' path too long!\n", env);
+ strcpy(q, deFault);
+ q += len; left -= len;
+ *q++ = *e++; left--;
+ }
+ else if (*(e+1) == PATHSEP || *(e+1) == '\0') {
+ *q++ = *e++; left--;
+ len = strlen(deFault);
+ if (len > left) fatal("'%s' path too long!\n", env);
+ strcpy(q, deFault);
+ q += len; left -= len;
+ }
+ else {
+ *q++ = *e++; left--;
+ }
+ }
+ else {
+ *q++ = *e++; left--;
+ }
+ if (left == 0) fatal("'%s' path too long!\n", env);
+ }
+ *q = '\0';
+ return p;
+}
+
+/*
+ * Rsearch() searches <file> through <path>. Recursion introduced by
+ * RECURSIVE string (system dependant) will be followed. Search stops
+ * after first match.
+ */
+static char *rsearch(char *path, char *file)
+{
+ struct stat status;
+ DIR *D;
+ struct dirent *de;
+ int i;
+ char *res = NULL, *ext, *file_ext,
+ head[MAXPATHLEN], target[MAXPATHLEN], *tail;
+ char fn[MAXPATHLEN];
+
+ /* determine head and tail of path */
+ i = 0;
+ while (*(path+i) != '\0' && strncmp(path+i, RECURSIVE, 2) != 0) {
+ head[i] = *(path+i); i++;
+ }
+ head[i] = '\0';
+ if (*(path+i) == '\0') tail = NULL;
+ else tail = path+i+2;
+
+ /* Check if we have found <file> */
+ if (tail == NULL || *tail == '\0') {
+ sprintf(fn, "%s%c%s", head, DIRSEP, file);
+ if (stat(fn, &status) == 0) {
+ res = malloc(strlen(fn)+1);
+ if (res == NULL) fatal("Out of memory\n");
+ strcpy(res, fn);
+ return res;
+ }
+ /* No recursion, so stop */
+ if (tail == NULL) return NULL;
+ }
+
+ if ((D = opendir(head)) == NULL) return NULL;
+ file_ext = extension(file);
+
+ /* now read directories and probe files */
+ while ((de = readdir(D)) != NULL) {
+ /* Ignore `.' and `..' directories */
+ if (strcmp(de->d_name, ".") == 0) continue;
+ if (strcmp(de->d_name, "..") == 0) continue;
+
+ /* Check if we have a directory */
+ sprintf(fn, "%s%c%s", head, DIRSEP, de->d_name);
+ (void) stat(fn, &status);
+ if (!S_ISDIR(status.st_mode)) {
+ /* if we are looking for a file with an extension and we find
+ * files with the same or a different extension we may consider
+ * this directory as a wrong place unless the user has defined
+ * funny directory search paths
+ */
+ if (file_ext && (ext = extension(de->d_name))) {
+ if (equal(ext, ".pk")) break;
+ if (equal(ext, ".vf")) break;
+ if (equal(ext, ".mf")) break;
+ if (equal(ext, ".tfm")) break;
+ if (equal(ext, ".afm")) break;
+ }
+ continue;
+ }
+
+ /* Directories with no real subdirectories can be skipped
+ * unless the file we are looking for is there. Unfortunately
+ * this shortcut only works for UNIX systems. On other systems
+ * the above check on extensions may help.
+ */
+#if defined(UNIX)
+ if (status.st_nlink == 2) {
+ if (strchr(file, DIRSEP)) continue;
+ if ((*tail == '\0') && (res = rsearch(fn, file))) break;
+ continue;
+ }
+#endif
+
+ /* path of the form "/aap/noot/mies//" */
+ if (*tail == '\0') {
+ sprintf(fn, "%s%c%s%s", head, DIRSEP, de->d_name, RECURSIVE);
+ if (res = rsearch(fn, file)) break;
+ continue;
+ }
+
+ /* path of the form "/aap/noot//mies" */
+
+ /* search /aap/noot/<d_name>// <tail>/<file> */
+ sprintf(fn, "%s%c%s%s", head, DIRSEP, de->d_name, RECURSIVE);
+ sprintf(target, "%s%c%s", tail, DIRSEP, file);
+ if (res = rsearch(fn, target)) break;
+ }
+ closedir(D);
+ return res;
+}
+
+/* Is <name> an absolute filename? */
+int absname(char *name) {
+
+ if (*name == DIRSEP) return 1;
+#ifdef MSDOS
+ if (*(name+1) == ':' && *(name+2) == DIRSEP && isalpha(*name)) return 1;
+#endif
+ return 0;
+}
+
+/*
+ * Look for a <file> in <path>. Return absolute filename if found.
+ * If not found return NULL (if <terminate> is 0) or terminate program
+ * with appropriate message (if <terminate> is not equal to 0).
+ */
+char *search_file(char *path, char *file, int terminate) {
+ char *fn, pe[MAXPATHLEN], *ppe, *ppath;
+ struct stat status;
+
+ if (path == NULL || *path == '\0' || absname(file)) {
+ if (stat(file, &status) == 0) return file;
+ if (terminate) fatal("File <%s> not found\n", file);
+ return NULL;
+ }
+ ppath = path;
+ while (*ppath) {
+ /* copy next pathelement into pe */
+ ppe = pe;
+ while (*ppath != PATHSEP && *ppath != '\0') {
+ if (tilde && *ppath == '~')
+ subtilde(&ppe, &ppath);
+ else
+ *ppe++ = *ppath++;
+ }
+ *ppe = '\0';
+ if (*ppath == PATHSEP) ppath++;
+ if (fn = rsearch(pe, file)) return fn;
+ }
+ if (terminate) fatal("File <%s> not found in path \"%s\"\n", file, path);
+ return NULL;
+}
+
+/*
+ * Now some functions for PK font search
+ */
+
+/*
+ * replace <pattern> in <cs> by <value>. If the <pattern> is %b or %d
+ * the value will be converted to a decimal value.
+ */
+static void replace(char *cs, char *pattern, void *value) {
+ char temp[MAXPATHLEN], *p, *q; int len;
+
+ while (q = strstr(cs, pattern)) {
+ strcpy(temp, q+strlen(pattern));
+ switch (*(pattern+1)) {
+ case 'b':
+ case 'd':
+ sprintf(q, "%d", *((int *)value));
+ len = strlen(q);
+ break;
+ case 'F':
+ sprintf(q, "%-8s", (char *) value);
+ len = strlen (q);
+ break;
+ case 'f':
+ sprintf(q, "%s", (char *) value);
+ len = strlen (q);
+ break;
+ default:
+ sprintf(q, "%s", (char *) value);
+ len = strlen (q);
+ break;
+ }
+ strcpy(q+len, temp);
+ }
+}
+
+/*
+ * This function substitutes the <patterns> encountered in <str>
+ * with their corresponding <value>. Recognized patterns are %b, %d,
+ * %f, %F and %m. They will be replaced with their corresponding integer
+ * (%b, %d) or string values (%f, %F and %m). These values can be used as
+ * placeholders for basic resolution (%b), resolution (%d), font name
+ * (%f or %F) or mode definition (%m). The %F is a special case for
+ * representing the fontname leftadjusted in a string of eight characters.
+ */
+
+void substitute(char *str, char *patterns, ...) {
+ va_list ap;
+ char *p;
+ char *svalue; int ivalue;
+
+ /* get arguments ... */
+ va_start(ap, patterns);
+ for (p = patterns; *p; p++) {
+ if (*p != '%') {
+ fatal("%s: invalid format\n");
+ }
+ switch (*++p) {
+ case 'b':
+ ivalue = va_arg(ap, int);
+ replace(str, "%b", &ivalue);
+ break;
+ case 'd':
+ ivalue = va_arg(ap, int);
+ replace(str, "%d", &ivalue);
+ break;
+ case 'F':
+ svalue = va_arg(ap, char *);
+ replace(str, "%F", svalue);
+ break;
+ case 'f':
+ svalue = va_arg(ap, char *);
+ replace(str, "%f", svalue);
+ break;
+ case 'm':
+ svalue = va_arg(ap, char *);
+ replace(str, "%m", svalue);
+ break;
+ case 'p':
+ svalue = va_arg(ap, char *);
+ replace(str, "%p", svalue);
+ break;
+ default:
+ fatal("%s: invalid letter (%c) in format\n", patterns, *p);
+ }
+ }
+ va_end(ap);
+}
+
+/* global font searching parameters */
+static char *_mode = NULL;
+static int _margin = 0, _bdpi = -1;
+static char *_tolerance = NULL;
+
+void init_pksearch(int bdpi, char *mode, int margin, char *tolerance) {
+ _bdpi = bdpi;
+ _mode = mode;
+ _margin = margin;
+ _tolerance = tolerance;
+}
+
+/* evaluate <expr> after substituting %d with <dpi>. Return the
+ * integer result or abort with message when invalid expression.
+ */
+int evaluate(char *expr, int dpi) {
+ char expression[128];
+ int result;
+
+ if (expr == NULL || *expr == '\0') return 0;
+ strcpy(expression, expr);
+ substitute(expression, "%d", dpi);
+ if (strexpr(&result, expression))
+ fatal("%s: expression error\n", expression);
+ return result;
+}
+
+#define INT(x) ((int)(x+0.5))
+
+/*
+ * Round <dpi> to a whole or half magstep if the difference is within
+ * a certain _tolerance from it.
+ */
+int nearesthalf(int dpi) {
+ double near = _bdpi, half = 1.095445115; int tolerance;
+
+ tolerance = evaluate(_tolerance, dpi);
+ if (tolerance == 0 || dpi == _bdpi) return dpi;
+ if (dpi > INT(near)+tolerance)
+ while (dpi > INT(near)+tolerance) near*=half;
+ else if (dpi < INT(near)-tolerance)
+ while (dpi < INT(near)-tolerance) near/=half;
+ if (dpi >= INT(near)-tolerance && dpi <= INT(near)+tolerance)
+ return INT(near);
+ return dpi;
+}
+
+/*
+ * Look for a PK <font> of resolution <dpi> in <path>. To avoid floating
+ * around lots of different font sizes TeX prefers to work with whole
+ * and half magsteps. So instead of using a 330 dpi font for a 11 point
+ * version of a 300 dpi font we would prefer the 329 dpi size because
+ * this size matches magstep 0.5 of 300 (329 = int(300 * 1.2 ** 0.5).
+ * The process of truncating real font sizes to magsteps can be
+ * controlled by the global parameter <tolerance> which may be an
+ * expression of the actual value of <dpi> itself. The value dvips(1)
+ * uses for <tolerance> is 1 + <dpi> / 500 allowing more tolerance in
+ * bigger sizes. Due to round-off different DVI drivers choose different
+ * <dpi> sizes. With <margin> we can define what font sizes are looked
+ * at whenever size <dpi> is wanted. With <margin> set to zero only the
+ * exact size is looked at, while a value of one would allow for a
+ * round-off of one. Both <margin> and <tolerance> can be set before a
+ * search starts otherwise they get their default values (zero) with
+ * init_pksearch().
+ *
+ * When <path> does contain placeholders like %b, %d, %f, %p and %m
+ * they will be substituted by their corresponding values _bdpi, <dpi>,
+ * <font>, "pk" and _mode respectivally. This allows to define paths
+ * for a whole range of printers. Occurrences off ~ or * ~user in <path>
+ * will be substituted by the corresponding HOME directories on UNIX.
+ *
+ * The result of search_pkfile() is a pointer to the name of <font> when
+ * one is found otherwise NULL.
+ */
+char *search_pkfile(char *path, char *texfont, int dpi) {
+ char *ppe, *pkpath, pe[MAXPATHLEN];
+ int del;
+ char *pkname;
+ struct stat status;
+
+ for (del=0; del <= _margin ; del=del>0?-del:-del+1) {
+ pkpath = path;
+ while (*pkpath) {
+ /* copy next pathelement into pe */
+ ppe = pe;
+ while (*pkpath != PATHSEP && *pkpath != '\0') {
+ if (tilde && *pkpath == '~')
+ subtilde(&ppe, &pkpath);
+ else
+ *ppe++ = *pkpath++;
+ }
+ *ppe = '\0';
+ if (strchr(pe, '%')) {
+ if (strstr(pe, "%d") && strstr(pe, "%f")) {
+ /* try filename after replacing placeholders */
+ substitute(pe, "%b%m%f%d%p",
+ _bdpi, _mode, texfont, dpi+del, "pk");
+ if (stat(pe, &status) == 0) {
+ pkname = malloc(strlen(pe)+1);
+ if (pkname == NULL) fatal("Out of memory\n");
+ strcpy(pkname, pe);
+ return pkname;
+ }
+ }
+ else /* %f and %d are required! */
+ fatal("%s: incomplete path element!\n", pe);
+ }
+ else {
+ sprintf(ppe, "%c%s.%dpk", DIRSEP, texfont, dpi+del);
+ if (stat(pe, &status) == 0) {
+ pkname = malloc(strlen(pe)+1);
+ if (pkname == NULL) fatal("Out of memory\n");
+ strcpy(pkname, pe);
+ return pkname;
+ }
+ }
+ if (*pkpath == PATHSEP) pkpath++;
+ }
+ }
+ return NULL;
+}
+
+/*
+ * Functions for handling emTeX's FLI files.
+ */
+
+/*
+ * Look at the fonts in the font library by calling the function <font>.
+ * This function can stop the search by returning a 1 or continue by
+ * returning a zero. In this way we can look for just one font or for
+ * a whole series of fonts. If the search is stopped the name of the
+ * current FLI file is returned otherwise a NULL pointer.
+ */
+char *search_flifile(char *fliname, int (*font)(char *, int)) {
+ unsigned short len, numsizes, numfonts, version1, version2;
+ char fontname[50];
+ int i, size;
+
+ FILE *FLI;
+
+ FLI = fopen(fliname, RB);
+ if (FLI == NULL) return NULL;
+
+ for (i=0; i<4; i++) {
+ fontname[i] = one(FLI); /* read header */
+ }
+ version1 = one(FLI);
+ version2 = one(FLI);
+ if (strncmp(fontname,"FLIB",4)!=0 || version1 != 2 || version2 != 0)
+ fatal("incorrect font library format");
+
+ (void) two(FLI); /* ignore directory length */
+ numsizes = two(FLI); /* number of sizes */
+ numfonts = two(FLI); /* number of fonts */
+ len = two(FLI); /* length of comment */
+ for (i=0; i<len; i++)
+ (void)one(FLI); /* skip comment */
+
+ for ( ;numsizes>0; numsizes--) {
+ /* for each font size in this library */
+ (void)two(FLI); /* length of size entry - ignore */
+ numfonts = two(FLI); /* number of fonts */
+ /* DPI (fixed point 16.16) */
+ size = (int)(four(FLI)/65536.0+0.5);
+
+ for ( ;numfonts > 0; numfonts--) {
+ /* read each entry */
+ (void)four(FLI); /* ignore length of font */
+ (void)four(FLI); /* offset to font */
+ len = one(FLI); /* length of name */
+ for (i=0; i<len; i++)
+ fontname[i] = one(FLI);
+ fontname[len] = '\0';
+ if (font(fontname, size) == 1) {
+ fclose(FLI);
+ return fliname;
+ };
+ }
+ }
+ fclose(FLI);
+ return NULL;
+}
+
+/*
+ * Look for font libraries in <path> (ex.: c:\emtex\texfonts;fli_0;fli_1).
+ * Run <font()> function for each .fli file found in <path>. Continue
+ * if this function returns NULL, stop otherwise.
+ */
+char *search_flipath(char *flipath, int (*font)(char *, int)) {
+ char fn[MAXPATHLEN], *pfn, *pfli, *fliname;
+ int len;
+
+ if (flipath == NULL) fatal("Invalid fli path\n");
+
+ /* treat first element of flipath as a directory */
+ pfn = fn;
+ while (*flipath != PATHSEP && *flipath != '\0') {
+ *pfn++ = *flipath++;
+ }
+ *pfn = '\0'; len = strlen(fn);
+ if (len >= 1 && fn[len-1] != DIRSEP) *pfn++ = DIRSEP;
+
+ /* and next elements as fli files */
+ while (*flipath != '\0') {
+ /* copy next pathelement into fn */
+ pfli = pfn; flipath++;
+ while (*flipath != PATHSEP && *flipath != '\0') {
+ *pfli++ = *flipath++;
+ }
+ *pfli = '\0'; len = strlen(pfn);
+ if (len > 4 && strcmp(pfli-4, ".fli") != 0)
+ strcat(pfli, ".fli");
+ if ((fliname = search_flifile(fn, font)) != NULL)
+ return fliname;
+ }
+ return NULL;
+}
diff --git a/fonts/utilities/ps2pk/psearch.h b/fonts/utilities/ps2pk/psearch.h
new file mode 100644
index 0000000000..333a679e00
--- /dev/null
+++ b/fonts/utilities/ps2pk/psearch.h
@@ -0,0 +1,115 @@
+/* FILE: psearch.h
+ * PURPOSE: PATH search module
+ * VERSION: 1.0 (Oct. 1995)
+ * AUTHOR: Piet Tutelaers
+ * (see README for license)
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+/*
+ * This function initiates a path by using a built-in <deFault> and
+ * a PATH environment variable that can be set at run time by the user.
+ * A typical usage is
+ * userenv = path(".:/someplace", getenv("USERENV"))
+ *
+ * If USERENV is not set getenv("USERENV") returns NULL and the returned
+ * path equals the value of the first argument. Otherwise the returned
+ * path is the value of second argument in which empty path elements are
+ * replaced by <deFault>. For example when USERENV is set to "~/myplace:"
+ * the resulting path will be "~myplace:.:/someplace".
+ */
+char *path(char *deFault, char *env);
+
+/*
+ * This function substitutes the <patterns> encountered in <str>
+ * with their corresponding <value>. Recognized patterns are %b, %d,
+ * %f, %F and %m. They will be replaced with their corresponding integer
+ * (%b, %d) or string values (%f, %F and %m). These values can be used as
+ * placeholders for basic resolution (%b), resolution (%d), font name
+ * (%f or %F) or mode definition (%m). The %F is a special case for
+ * representing the fontname leftadjusted in a string of eight characters.
+ */
+void substitute(char *str, char *patterns, ...);
+
+#define NONFATAL 0
+#undef FATAL
+#define FATAL 1
+/*
+ * Look for a <file> in <path>. Return absolute filename if found.
+ * If not found return NULL (if <terminate> is NONFATAL) or terminate
+ * program with appropriate message (if <terminate> is FATAL).
+ * On UNIX ~ or ~someone in paths are evaluated to the proper HOME
+ * directories.
+ * When the path does contain recursion characters ("//" on UNIX and
+ * "!!" on MSDOS) directories are searched recursively.
+ */
+char *search_file(char *path, char *file, int terminate);
+
+/* set global paramaters for PK font search */
+void init_pksearch(int bdpi, char *mode, int margin, char *tolerance);
+
+/*
+ * Look for a PK <font> of resolution <dpi> in <path>. To avoid floating
+ * around lots of different font sizes TeX prefers to work with whole
+ * and half magsteps. So instead of using a 330 dpi font for a 11 point
+ * version of a 300 dpi font we would prefer the 329 dpi size because
+ * this size matches magstep 0.5 of 300 (329 = int(300 * 1.2 ** 0.5).
+ * The process of truncating real font sizes to magsteps can be
+ * controlled by the global parameter <tolerance> which may be an
+ * expression of the actual value of <dpi> itself. The value dvips(1)
+ * uses for <tolerance> is 1 + <dpi> / 500 allowing more tolerance in
+ * bigger sizes. Due to round-off different DVI drivers choose different
+ * <dpi> sizes. With <margin> we can define what font sizes are looked
+ * at whenever size <dpi> is wanted. With <margin> set to zero only the
+ * exact size is looked at, while a value of one would allow for a
+ * round-off of one. Both <margin> and <tolerance> can be set before a
+ * search starts otherwise they get their default values (zero) with
+ * init_pksearch().
+ *
+ * When <path> does contain placeholders like %b, %d, %f, %p and %m
+ * they will be substituted by their corresponding values _bdpi, <dpi>,
+ * <font>, "pk" and _mode respectivally. This allows to define paths
+ * for a whole range of printers. Occurrences off ~ or * ~user in <path>
+ * will be substituted by the corresponding HOME directories on UNIX.
+ *
+ * The result of search_pkfile() is a pointer to the name of <font> when
+ * one is found otherwise NULL.
+ */
+char *search_pkfile(char *path, char *font, int dpi);
+
+/*
+ * evaluate <expr> after substituting %d with <dpi>. Return the
+ * integer result or abort with message when invalid expression.
+ */
+int evaluate(char *expr, int dpi);
+
+/*
+ * Round <dpi> to a whole or half magstep of <bdpi> if the distance of
+ * <dpi> is within a certain <tolerance> from it. The value of <bdpi> and
+ * <tolerance> should be set with init_pksearch().
+ */
+int nearesthalf(int dpi);
+
+extern int tilde;
+
+/*
+ * During scanning of paths we often need to replace ~user with user's
+ * HOME directory and ~ with HOME directory. Subtilde() copies the actual
+ * value of `~' or `~user' from <path> into <fn>. The pointers <fn> and
+ * <path> are `updated'.
+ */
+void subtilde(char **fn, char **path);
+
+/* Is <name> an absolute filename? */
+int absname(char *name);
+
+/*
+ * Look for font libraries in <path> (ex.: c:\emtex\texfonts;fli_0;fli_1).
+ * Run <font()> function for each .fli file found in <path>. Continue
+ * if this function returns 0, stop when if this function return a 1.
+ * In the last case the name of the FLI file is returned.
+ */
+char *search_flipath(char *flipath, int (*font)(char *, int));
+
diff --git a/fonts/utilities/ps2pk/regions.c b/fonts/utilities/ps2pk/regions.c
new file mode 100644
index 0000000000..f1b4b8b470
--- /dev/null
+++ b/fonts/utilities/ps2pk/regions.c
@@ -0,0 +1,1589 @@
+/* $XConsortium: regions.c,v 1.4 91/10/10 11:18:57 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+ /* REGIONS CWEB V0023 LOTS */
+/*
+:h1 id=regions.REGIONS Module - Regions Operator Handler
+
+This module is responsible for creating and manipulating regions.
+
+&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com)
+
+
+:h3.Include Files
+
+The included files are:
+*/
+
+#include "types.h"
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "regions.h"
+#include "curves.h"
+#include "lines.h"
+#include "pictures.h"
+#include "fonts.h"
+#include "hints.h"
+#include "strokes.h" /* to pick up 'DoStroke' */
+static void Unwind(struct edgelist *);
+static void newfilledge(register struct region *, fractpel, fractpel,
+ fractpel, fractpel, int);
+static void vertjoin(register struct edgelist *, register struct edgelist *);
+static void discard(register struct edgelist *, register struct edgelist *);
+static void edgemin(register int, register pel *, register pel *);
+static void edgemax(register int, register pel *, register pel *);
+static struct edgelist *splitedge(struct edgelist *, pel);
+static int touches(int, pel *, pel *);
+static int crosses(int, pel *, pel *);
+static struct edgelist *NewEdge(pel, pel, pel, pel, pel *, int);
+
+/*
+:h3.Functions Provided to the TYPE1IMAGER User
+
+This module provides the following TYPE1IMAGER entry points:
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.Functions Provided to Other Modules
+
+This module provides the following entry points to other modules:
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.Macros Provided to Other Modules
+
+:h4.GOING_TO() - Macro Predicate Needed for Changing Direction, Etc.
+
+The actual generation of run end lists (edge boundaries) is left
+to the low level rasterizing modules, LINES and CURVES. There
+are some global region-type
+questions that occur when doing a low-level
+rasterization:
+:ol.
+:li.Did we just change direction in Y and therefore need to start
+a new edge?
+:li.Did we run out of allocated edge space?
+:li.Do the minimum or maximum X values for the current edge need
+updating?
+:eol.
+In general the REGIONS is not smart enough to answer those questions
+itself. (For example, determining if and when a curve changes direction
+may need detailed curve knowledge.) Yet, this must be done efficiently.
+We provide a macro "GOING_TO" where the invoker tells us where it is
+heading for (x2,y2), plus where it is now (x1,y1), plus the current
+region under construction, and the macro answers the questions above.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h2.Data Structures Used to Represent Regions
+
+:h3.The "region" Structure
+
+The region structure is an anchor for a linked list of "edgelist"
+structures (see :hdref refid=edgelist..). It also summarizes the
+information in the edgelist structures (for example, the bounding
+box of the region). And, it contains scratch areas used during
+the creation of a region.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+The ISOPTIMIZED flag tells us if we've put a permanent region in
+'optimal' form.
+*/
+#define ISOPTIMIZED(flag) ((flag)&0x10)
+
+/*
+The ISRECTANGULAR flag tells us if a region is a rectangle. We don't
+always notice rectangles--if this flag is set, the region definitely
+is a rectangle, but some rectangular regions will not have the flag
+set. The flag is used to optimize some paths.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h4."T1_INFINITY" - A Constant Region Structure of Infinite Extent
+
+Infinity is the complement of a null area:
+Note - removed the refcount = 1 init, replaced with references = 2 3-26-91 PNM
+*/
+static struct region t1_infinity = { REGIONTYPE,
+ ISCOMPLEMENT(ON)+ISINFINITE(ON)+ISPERMANENT(ON)+ISIMMORTAL(ON), 2,
+ { 0, 0 }, { 0, 0 },
+ 0, 0, 0, 0,
+ NULL, NULL,
+ 0, 0, 0, 0, 0, NULL, NULL,
+ NULL, 0, NULL, NULL };
+struct region *T1_INFINITY = &t1_infinity;
+
+/*
+:h4."EmptyRegion" - A Region Structure with Zero Area
+
+This structure is used to initialize the region to be built in
+Interior():
+Note - replaced refcount = 1 init with references = 2 3-26-91 PNM
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+struct region EmptyRegion = { REGIONTYPE,
+ ISPERMANENT(ON)+ISIMMORTAL(ON), 2,
+ { 0, 0 }, { 0, 0 },
+ MAXPEL, MAXPEL, MINPEL, MINPEL,
+ NULL, NULL,
+ 0, 0, 0, 0, 0, NULL, NULL,
+ NULL, 0, NULL, NULL };
+
+/*
+:h3 id=edgelist.The "edgelist" Structure
+
+Regions are represented by a linked list of 'edgelist' structures.
+When a region is complete, the structures are paired, one for the
+left and one for the right edge. While a region is being built,
+this rule may be violated temporarily.
+
+An 'edgelist' structure contains the X values for a given span
+of Y values. The (X,Y) pairs define an edge. We use the crack
+and edge coordinate system, so that integer values of X and Y
+go between pels. The edge is defined between the minimum Y and
+maximum Y.
+
+The linked list is kept sorted from top to bottom, that is, in
+increasing y. Also, if 'e1' is an edgelist structure and 'e2' is the
+next one in the list, they must have exactly the same ymin,ymax values
+or be totally disjoint. These two requirements mean that if e2's ymin
+is less than e1's ymax, it must be exactly equal to e1's ymin. A
+sublist of structures with identical ymin and ymax values is called a
+'swath'.
+
+In addition, edgelist structures are separately linked together based
+on what subpath originally created them; each subpath is kept as a
+separate circular linked list. This information is ignored unless
+continuity checking is invoked. See :hdref refid=subpath. for a
+complete description of this.
+*/
+
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+The "edgelist" structure follows the convention of TYPE1IMAGER user
+objects, having a type field and a flag field as the first two
+elements. However, the user never sees "edgelist" structures
+directly; he is given handles to "region" structures only.
+
+By having a type field, we can use the "copy" feature of Allocate()
+to duplicate edge lists quickly.
+
+We also define two flag bits for this structure. The ISDOWN bit is set
+if the edge is going in the direction of increasing Y. The ISAMBIGUOUS
+bit is set if the edge is identical to its neighbor (edge->link); such
+edges may be "left" when they should be "right", or vice versa,
+unnecessarily confusing the continuity checking logic. The FixSubPaths()
+routine in HINTS will swap ambiguous edges if that avoids crossing edges;
+see :hdref refid=fixsubp..
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h3.KillRegion() - Destroys a Region
+
+KillRegion nominally just decrements the reference count to that region.
+If the reference count becomes 0, all memory associated with it is
+freed. We just follow the linked list, freeing as we go, then kill any
+associated (thresholded) picture.
+Note - added conditional return based on references 3-26-91 PNM
+*/
+
+void KillRegion(
+ register struct region *area) /* area to free */
+{
+ register struct edgelist *p; /* loop variable */
+ register struct edgelist *next; /* loop variable */
+
+ if (area->references < 0)
+ t1_abort("KillRegion: negative reference count");
+ if ( (--(area->references) > 1) ||
+ ( (area->references == 1) && !ISPERMANENT(area->flag) ) )
+ return;
+
+ for (p=area->anchor; p != NULL; p=next) {
+ next = p->link;
+ Free(p);
+ }
+ if (area->thresholded != NULL)
+ KillPicture(area->thresholded);
+ Free(area);
+}
+/*
+:h3.CopyRegion() - Makes a Copy of a Region
+*/
+struct region *CopyRegion(
+ register struct region *area) /* region to duplicate */
+{
+ register struct region *r; /* output region built here */
+ register struct edgelist *last; /* loop variable */
+ register struct edgelist *p,*newp; /* loop variables */
+
+ r = (struct region *)Allocate(sizeof(struct region), area, 0);
+ r->anchor = NULL;
+
+ for (p=area->anchor; VALIDEDGE(p); p=p->link) {
+
+ newp = NewEdge(p->xmin, p->xmax, p->ymin, p->ymax, p->xvalues, ISDOWN(p->flag));
+ if (r->anchor == NULL)
+ r->anchor = last = newp;
+ else
+ last->link = newp;
+
+ last = newp;
+ }
+ if (area->thresholded != NULL)
+ /* replaced DupPicture with Dup() 3-26-91 PNM */
+ r->thresholded = (struct picture *)Dup((struct xobject *)area->thresholded);
+ return(r);
+}
+/*
+:h4.NewEdge() - Allocates and Returns a New "edgelist" Structure
+
+We allocate space for the X values contiguously with the 'edgelist'
+structure that locates them. That way, we only have to free the
+edgelist structure to free all memory associated with it. Damn
+clever, huh?
+*/
+
+static struct edgelist *NewEdge(
+ pel xmin, pel xmax, /* X extent of edge */
+ pel ymin, pel ymax, /* Y extent of edge */
+ pel *xvalues, /* list of X values for entire edge */
+ int isdown) /* flag: TRUE means edge progresses downward */
+{
+ static struct edgelist template = {
+ EDGETYPE, 0, 1, NULL, NULL,
+ 0, 0, 0, 0, NULL };
+
+ register struct edgelist *r; /* returned structure */
+ register int iy; /* ymin adjusted for 'long' alignment purposes */
+
+ IfTrace2((RegionDebug),"....new edge: ymin=%d, ymax=%d ",
+ (int32_t)ymin, (int32_t) ymax);
+ if (ymin >= ymax)
+ t1_abort("newedge: height not positive");
+/*
+We are going to copy the xvalues into a newly allocated area. It
+helps performance if the values are all "long" aligned. We can test
+if the xvalues are long aligned by ANDing the address with the
+(sizeof(long) - 1)--if non zero, the xvalues are not aligned well. We
+set 'iy' to the ymin value that would give us good alignment:
+*/
+#ifdef _WIN64
+ iy = ymin - (((unsigned __int64) xvalues) & (sizeof(int32_t) - 1)) / sizeof(pel);
+#else
+ iy = ymin - (((unsigned long) xvalues) & (sizeof(int32_t) - 1)) / sizeof(pel);
+#endif
+
+ r = (struct edgelist *)Allocate(sizeof(struct edgelist), &template,
+ (ymax - iy) * sizeof(pel));
+
+ if (isdown) r->flag = ISDOWN(ON);
+ r->xmin = xmin;
+ r->xmax = xmax;
+ r->ymin = ymin;
+ r->ymax = ymax;
+
+ r->xvalues = (pel *) FOLLOWING(r);
+ if (ymin != iy) {
+ r->xvalues += ymin - iy;
+ xvalues -= ymin - iy;
+ }
+
+/*
+We must round up (ymax - iy) so we get the ceiling of the number of
+longs. The destination must be able to hold these extra bytes because
+Allocate() makes everything it allocates be in multiples of longs.
+*/
+ INT32COPY(&r[1], xvalues, (ymax - iy) * sizeof(pel) + sizeof(int32_t) - 1);
+
+ IfTrace1((RegionDebug),"result=%p\n", r);
+ return(r);
+}
+
+/*
+:h2.Building Regions
+
+:h3.Interior() - Iterate Through a Path, Building a Region
+
+This routine is the workhorse driver routine that iterates through a
+path, calling the appropriate stepping routines to actually produce the
+run end "edgelist" structures.
+
+:ol.
+:li."Interior" calls StepLine or StepConic or StepBezier as appropriate
+to produce run ends.
+:li.Occasionally these routines will notice a change in Y direction
+and will call ChangeDirection (through the GOING_TO macro); this is
+a call back to the REGIONS module.
+:li.ChangeDirection will call whatever function is in the region
+structure; for Interior, this function is 'newfilledge'.
+:li.Newfilledge will call NewEdge to create a new edgelist structure,
+then, call SortSwath to sort it onto the linked list being built at
+the region "anchor".
+:eol.
+
+By making the function called by ChangeDirection be a parameter of the
+region, we allow the same ChangeDirection logic to be used by stroking.
+*/
+
+static struct edgelist *SortSwath( struct edgelist *, struct edgelist *,
+ struct edgelist *(*)());
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+struct region *Interior(
+ register struct segment *p, /* take interior of this path */
+ register int fillrule) /* rule to follow if path crosses itself */
+{
+ register fractpel x,y; /* keeps ending point of path segment */
+ fractpel lastx,lasty; /* previous x,y from path segment before */
+ register struct region *R; /* region I will build */
+ register struct segment *nextP; /* next segment of path */
+ struct fractpoint hint; /* accumulated hint value */
+ char tempflag; /* flag; is path temporary? */
+ char Cflag; /* flag; should we apply continuity? */
+
+ IfTrace2((MustTraceCalls),". INTERIOR(%p, %d)\n", p, (int32_t) fillrule);
+
+ if (p == NULL)
+ return(NULL);
+/*
+Establish the 'Cflag' continuity flag based on user's fill rule and
+our own 'Continuity' pragmatic (0: never do continuity, 1: do what
+user asked, >1: do it regardless).
+*/
+ if (fillrule > 0) {
+ Cflag = Continuity > 0;
+ fillrule -= CONTINUITY;
+ }
+ else
+ Cflag = Continuity > 1;
+
+ ARGCHECK((fillrule != WINDINGRULE && fillrule != EVENODDRULE),
+ "Interior: bad fill rule", NULL, NULL, (1,p), struct region *);
+
+ if (p->type == TEXTTYPE)
+/* if (fillrule != EVENODDRULE)
+ else */
+ return((struct region *)UniquePath(p));
+ if (p->type == STROKEPATHTYPE) {
+ if (fillrule == WINDINGRULE)
+ return((struct region *)DoStroke(p));
+ else
+ p = CoercePath(p);
+ }
+
+ R = (struct region *)Allocate(sizeof(struct region), &EmptyRegion, 0);
+
+ ARGCHECK(!ISPATHANCHOR(p), "Interior: bad path", p, R, (0), struct region *);
+ ARGCHECK((p->type != MOVETYPE), "Interior: path not closed", p, R, (0), struct region *);
+
+
+/* changed definition from !ISPERMANENT to references <= 1 3-26-91 PNM */
+ tempflag = (p->references <= 1); /* only first segment in path is so marked */
+ if (!ISPERMANENT(p->flag)) p->references -= 1;
+
+ R->newedgefcn = newfilledge;
+/*
+Believe it or not, "R" is now completely initialized. We are counting
+on the copy of template to get other fields the way we want them,
+namely
+:ol.
+:li.anchor = NULL
+:li.xmin, ymin, xmax, ymax, to minimum and maximum values respectively.
+:eol.
+Anchor = NULL is very
+important to ChangeDirection.
+See :hdref refid=CD..
+
+To minimize problems of "wrapping" in our pel arithmetic, we keep an
+origin of the region which is the first move. Hopefully, that keeps
+numbers within plus or minus 32K pels.
+*/
+ R->origin.x = 0/*TOFRACTPEL(NEARESTPEL(p->dest.x))*/;
+ R->origin.y = 0/*TOFRACTPEL(NEARESTPEL(p->dest.y))*/;
+ lastx = - R->origin.x;
+ lasty = - R->origin.y;
+/*
+ChangeDirection initializes other important fields in R, such as
+lastdy, edge, edgeYstop, edgexmin, and edgexmax. The first segment
+is a MOVETYPE, so it will be called first.
+*/
+/*
+The hints data structure must be initialized once for each path.
+*/
+
+ if (ProcessHints)
+ InitHints(); /* initialize hint data structure */
+
+ while (p != NULL) {
+
+ x = lastx + p->dest.x;
+ y = lasty + p->dest.y;
+
+ IfTrace2((HintDebug > 0),"Ending point = (%d,%d)\n", x, y);
+
+ nextP = p->link;
+
+/*
+Here we start the hints processing by initializing the hint value to
+zero. If ProcessHints is FALSE, the value will remain zero.
+Otherwise, hint accumulates the computed hint values.
+*/
+
+ hint.x = hint.y = 0;
+
+/*
+If we are processing hints, and this is a MOVE segment (other than
+the first on the path), we need to close (reverse) any open hints.
+*/
+
+ if (ProcessHints)
+ if ((p->type == MOVETYPE) && (p->last == NULL)) {
+ CloseHints(&hint);
+ IfTrace2((HintDebug>0),"Closed point= (%d,%d)\n",
+ x+hint.x, y+hint.y);
+ }
+
+/*
+Next we run through all the hint segments (if any) attached to this
+segment. If ProcessHints is TRUE, we will accumulate computed hint
+values. In either case, nextP will be advanced to the first non-HINT
+segment (or NULL), and each hint segment will be freed if necessary.
+*/
+
+ while ((nextP != NULL) && (nextP->type == HINTTYPE)) {
+ if (ProcessHints)
+ ProcessHint((struct hintsegment *)nextP, x + hint.x, y + hint.y, &hint);
+
+ {
+ register struct segment *saveP = nextP;
+
+ nextP = nextP->link;
+ if (tempflag)
+ Free(saveP);
+ }
+ }
+
+/*
+We now apply the full hint value to the ending point of the path segment.
+*/
+
+ x += hint.x;
+ y += hint.y;
+
+ IfTrace2((HintDebug>0),"Hinted ending point = (%d,%d)\n", x, y);
+
+ switch(p->type) {
+
+ case LINETYPE:
+ StepLine(R, lastx, lasty, x, y);
+ break;
+
+ case CONICTYPE:
+ {
+
+/*
+For a conic curve, we apply half the hint value to the conic midpoint.
+*/
+
+ }
+ break;
+
+ case BEZIERTYPE:
+ {
+ register struct beziersegment *bp = (struct beziersegment *) p;
+
+/*
+For a Bezier curve, we apply the full hint value to the Bezier C point.
+*/
+
+ StepBezier(R, lastx, lasty,
+ lastx + bp->B.x, lasty + bp->B.y,
+ lastx + bp->C.x + hint.x,
+ lasty + bp->C.y + hint.y,
+ x, y);
+ }
+ break;
+
+ case MOVETYPE:
+/*
+At this point we have encountered a MOVE segment. This breaks the
+path, making it disjoint.
+*/
+ if (p->last == NULL) /* i.e., not first in path */
+ ChangeDirection(CD_LAST, R, lastx, lasty, (fractpel) 0);
+
+ ChangeDirection(CD_FIRST, R, x, y, (fractpel) 0);
+/*
+We'll just double check for closure here. We forgive an appended
+MOVETYPE at the end of the path, if it isn't closed:
+*/
+ if (!ISCLOSED(p->flag) && p->link != NULL)
+ return((struct region *)ArgErr("Fill: sub-path not closed", p, NULL));
+ break;
+
+ default:
+ t1_abort("Interior: path type error");
+ }
+/*
+We're done with this segment. Advance to the next path segment in
+the list, freeing this one if necessary:
+*/
+ lastx = x; lasty = y;
+
+ if (tempflag)
+ Free(p);
+ p = nextP;
+ }
+ ChangeDirection(CD_LAST, R, lastx, lasty, (fractpel) 0);
+ R->ending.x = lastx;
+ R->ending.y = lasty;
+/*
+Finally, clean up the region's based on the user's 'fillrule' request:
+*/
+ if (Cflag)
+ ApplyContinuity(R);
+ if (fillrule == WINDINGRULE)
+ Unwind(R->anchor);
+ return(R);
+}
+/*
+:h4.Unwind() - Discards Edges That Fail the Winding Rule Test
+
+The winding rule says that upward going edges should be paired with
+downward going edges only, and vice versa. So, if two upward edges
+or two downward edges are nominally left/right pairs, Unwind() should
+discard the second one. Everything should balance; we should discard
+an even number of edges; of course, we abort if we don't.
+*/
+static void Unwind(
+ register struct edgelist *area) /* input area modified in place */
+{
+ register struct edgelist *last,*next; /* struct before and after current one */
+ register int y; /* ymin of current swath */
+ register int count,newcount; /* winding count registers */
+
+ IfTrace1((RegionDebug>0),"...Unwind(%p)\n", area);
+
+ while (VALIDEDGE(area)) {
+
+ count = 0;
+ y = area->ymin;
+
+ do {
+ next = area->link;
+
+ if (ISDOWN(area->flag))
+ newcount = count + 1;
+ else
+ newcount = count - 1;
+
+ if (count == 0 || newcount == 0)
+ last = area;
+ else
+ discard(last, next);
+
+ count = newcount;
+ area = next;
+
+ } while (area != NULL && area->ymin == y);
+
+ if (count != 0)
+ t1_abort("Unwind: uneven edges");
+ }
+}
+/*
+:h3."workedge" Array
+
+This is a statically allocated array where edges are built
+before being copied into more permanent storage by NewEdge().
+*/
+
+#ifndef MAXEDGE
+#define MAXEDGE 1000
+#endif
+
+static pel workedge[MAXEDGE];
+static pel *currentworkarea = workedge;
+static pel currentsize = MAXEDGE;
+
+/*
+:h3 id=cd.ChangeDirection() - Called When Y Direction Changes
+
+The rasterizing routines call this entry point when they detect
+a change in Y. We then build the current edge and sort it into
+emerging edgelist at 'anchor' by calling whatever "newedgefcn"
+is appropriate.
+*/
+
+void ChangeDirection(
+ int type, /* CD_FIRST, CD_CONTINUE, or CD_LAST */
+ register struct region *R, /* region in which we are changing direction */
+ fractpel x, fractpel y, /* current beginning x,y */
+ fractpel dy) /* direction and magnitude of change in y */
+{
+ register fractpel ymin,ymax; /* minimum and maximum Y since last call */
+ register pel iy; /* nearest integer pel to 'y' */
+ register pel idy; /* nearest integer pel to 'dy' */
+ register int ydiff; /* allowed Y difference in 'currentworkarea' */
+
+ IfTrace4((RegionDebug>0),"Change Y direction (%d) from (%d,%d), dy=%d\n",
+ (int32_t) type, x, y, dy);
+
+ if (type != CD_FIRST) {
+
+ if (R->lastdy > 0) {
+ ymin = R->firsty;
+ ymax = y;
+ }
+ else {
+ ymin = y;
+ ymax = R->firsty;
+ }
+
+ if (ymax < ymin)
+ t1_abort("negative sized edge?");
+
+
+ /* FIXME: there are not as much parameters as here. */
+ (*R->newedgefcn)(R, R->edgexmin, R->edgexmax, ymin, ymax,
+ R->lastdy > 0 /*, x_at_ymin, x_at_ymax */);
+
+ }
+
+ R->firsty = y;
+ R->firstx = x;
+ R->lastdy = dy;
+
+ iy = NEARESTPEL(y);
+ idy = NEARESTPEL(dy);
+ if (currentworkarea != workedge && idy < MAXEDGE && idy > -MAXEDGE) {
+ NonObjectFree(currentworkarea);
+ currentworkarea = workedge;
+ currentsize = MAXEDGE;
+ }
+ ydiff = currentsize - 1;
+ if (dy > 0) {
+ R->edge = &currentworkarea[-iy];
+ R->edgeYstop = TOFRACTPEL(ydiff + iy) + FPHALF;
+ }
+ else {
+ R->edge = &currentworkarea[ydiff - iy];
+ R->edgeYstop = TOFRACTPEL(iy - ydiff) - FPHALF;
+ }
+ R->edgexmax = R->edgexmin = x;
+/*
+If this is the end of a subpath, we complete the subpath circular
+chain:
+*/
+ if (type == CD_LAST && R->lastedge != NULL) {
+ register struct edgelist *e = R->firstedge;
+
+ while (e->subpath != NULL)
+ e = e->subpath;
+ e->subpath = R->lastedge;
+ R->lastedge = R->firstedge = NULL;
+ }
+}
+/*
+:h3 id=newfill.newfilledge() - Called When We Have a New Edge While Filling
+
+This is the prototypical "newedge" function passed to "Rasterize" and
+stored in "newedgefcn" in the region being built.
+
+If the edge is non-null, we sort it onto the list of edges we are
+building at "anchor".
+
+This function also has to keep the bounding box of the region
+up to date.
+*/
+static struct edgelist *swathxsort(struct edgelist *, struct edgelist *);
+
+static void newfilledge(register struct region *R,
+ fractpel xmin, fractpel xmax, fractpel ymin, fractpel ymax, int isdown)
+{
+ register pel pelxmin,pelymin,pelxmax,pelymax; /* pel versions of bounds */
+ register struct edgelist *edge; /* newly created edge */
+
+ pelymin = NEARESTPEL(ymin);
+ pelymax = NEARESTPEL(ymax);
+ if (pelymin == pelymax)
+ return;
+
+ pelxmin = NEARESTPEL(xmin);
+ pelxmax = NEARESTPEL(xmax);
+
+ if (pelxmin < R->xmin) R->xmin = pelxmin;
+ if (pelxmax > R->xmax) R->xmax = pelxmax;
+ if (pelymin < R->ymin) R->ymin = pelymin;
+ if (pelymax > R->ymax) R->ymax = pelymax;
+
+ edge = NewEdge(pelxmin, pelxmax, pelymin, pelymax, &R->edge[pelymin], isdown);
+ edge->subpath = R->lastedge;
+ R->lastedge = edge;
+ if (R->firstedge == NULL)
+ R->firstedge = edge;
+
+ R->anchor = SortSwath(R->anchor, edge, swathxsort);
+
+}
+
+/*
+:h2.Sorting Edges
+
+:h3.SortSwath() - Vertically Sort an Edge into a Region
+
+This routine sorts an edge or a pair of edges into a growing region,
+so that the region maintains its top-to-bottom, left-to-right form.
+The rules for sorting horizontally may vary depending on what you
+are doing, but the rules for vertical sorting are always the same.
+This routine is passed an argument that is a function that will
+perform the horizontal sort on demand (for example, swathxsort() or
+SwathUnion()).
+
+This is a recursive routine. A new edge (or edge pair) may overlap
+the list I am building in strange and wonderful ways. Edges may
+cross. When this happens, my strategy is to split the incoming edge
+(or the growing list) in two at that point, execute the actual sort on
+the top part of the split, and recursively call myself to figure out
+exactly where the bottom part belongs.
+*/
+
+#define TOP(e) ((e)->ymin) /* the top of an edge (for readability */
+#define BOTTOM(e) ((e)->ymax) /* the bottom of an edge (for readability */
+
+static struct edgelist *SortSwath(
+ struct edgelist *anchor, /* list being built */
+ register struct edgelist *edge, /* incoming edge or pair of edges */
+ struct edgelist *(*swathfcn)()) /* horizontal sorter */
+{
+ register struct edgelist *before,*after;
+ struct edgelist base;
+
+ if (RegionDebug > 0) {
+ IfTrace3(TRUE,"SortSwath(anchor=%p, edge=%p, fcn=%p)\n",
+ anchor, edge, swathfcn);
+ }
+ if (anchor == NULL)
+ return(edge);
+
+ before = &base;
+ before->ymin = before->ymax = MINPEL;
+ before->link = after = anchor;
+
+/*
+If the incoming edge is above the current list, we connect the current
+list to the bottom of the incoming edge. One slight complication is
+if the incoming edge overlaps into the current list. Then, we
+first split the incoming edge in two at the point of overlap and recursively
+call ourselves to sort the bottom of the split into the current list:
+*/
+ if (TOP(edge) < TOP(after)) {
+ if (BOTTOM(edge) > TOP(after)) {
+
+ after = SortSwath(after, splitedge(edge, TOP(after)), swathfcn);
+ }
+ vertjoin(edge, after);
+ return(edge);
+ }
+/*
+At this point the top of edge is not higher than the top of the list,
+which we keep in 'after'. We move the 'after' point down the list,
+until the top of the edge occurs in the swath beginning with 'after'.
+
+If the bottom of 'after' is below the bottom of the edge, we have to
+split the 'after' swath into two parts, at the bottom of the edge.
+If the bottom of 'after' is above the bottom of the swath,
+*/
+
+ while (VALIDEDGE(after)) {
+
+ if (TOP(after) == TOP(edge)) {
+ if (BOTTOM(after) > BOTTOM(edge))
+ vertjoin(after, splitedge(after, BOTTOM(edge)));
+ else if (BOTTOM(after) < BOTTOM(edge)) {
+ after = SortSwath(after,
+ splitedge(edge, BOTTOM(after)), swathfcn);
+ }
+ break;
+ }
+ else if (TOP(after) > TOP(edge)) {
+ IfTrace0((BOTTOM(edge) < TOP(after) && RegionDebug > 0),
+ "SortSwath: disjoint edges\n");
+ if (BOTTOM(edge) > TOP(after)) {
+ after = SortSwath(after,
+ splitedge(edge, TOP(after)), swathfcn);
+ }
+ break;
+ }
+ else if (BOTTOM(after) > TOP(edge))
+ vertjoin(after, splitedge(after, TOP(edge)));
+
+ before = after;
+ after = after->link;
+ }
+
+/*
+At this point 'edge' exactly corresponds in height to the current
+swath pointed to by 'after'.
+*/
+ if (after != NULL && TOP(after) == TOP(edge)) {
+ before = (*swathfcn)(before, edge);
+ after = before->link;
+ }
+/*
+At this point 'after' contains all the edges after 'edge', and 'before'
+contains all the edges before. Whew! A simple matter now of adding
+'edge' to the linked list in its rightful place:
+*/
+ before->link = edge;
+ if (RegionDebug > 1) {
+ IfTrace3(TRUE,"SortSwath: in between %p and %p are %p",
+ before, after, edge);
+ while (edge->link != NULL) {
+ edge = edge->link;
+ IfTrace1(TRUE," and %p", edge);
+ }
+ IfTrace0(TRUE,"\n");
+ }
+ else
+ for (; edge->link != NULL; edge = edge->link) { ; }
+
+ edge->link = after;
+ return(base.link);
+}
+
+/*
+:h3.splitedge() - Split an Edge or Swath in Two at a Given Y Value
+
+This function returns the edge or swath beginning at the Y value, and
+is guaranteed not to change the address of the old swath while splitting
+it.
+*/
+
+static struct edgelist *splitedge(
+ struct edgelist *list, /* area to split */
+ register pel y) /* Y value to split list at */
+{
+ register struct edgelist *new; /* anchor for newly built list */
+ register struct edgelist *last; /* end of newly built list */
+ register struct edgelist *r; /* temp pointer to new structure */
+ register struct edgelist *lastlist; /* temp pointer to last 'list' value */
+
+ IfTrace2((RegionDebug > 1),"splitedge of %p at %d ", list, (int32_t) y);
+
+ lastlist = new = NULL;
+
+ while (list != NULL) {
+ if (y < list->ymin)
+ break;
+ if (y >= list->ymax)
+ t1_abort("splitedge: above top of list");
+ if (y == list->ymin)
+ t1_abort("splitedge: would be null");
+
+ r = (struct edgelist *)Allocate(sizeof(struct edgelist), list, 0);
+/*
+At this point 'r' points to a copy of the single structure at 'list'.
+We will make 'r' be the new split 'edgelist'--the lower half.
+We don't bother to correct 'xmin' and 'xmax', we'll take the
+the pessimistic answer that results from using the old values.
+*/
+ r->ymin = y;
+ r->xvalues = list->xvalues + (y - list->ymin);
+/*
+Note that we do not need to allocate new memory for the X values,
+they can remain with the old "edgelist" structure. We do have to
+update that old structure so it is not as high:
+*/
+ list->ymax = y;
+/*
+Insert 'r' in the subpath chain:
+*/
+ r->subpath = list->subpath;
+ list->subpath = r;
+/*
+Now attach 'r' to the list we are building at 'new', and advance
+'list' to point to the next element in the old list:
+*/
+ if (new == NULL)
+ new = r;
+ else
+ last->link = r;
+ last = r;
+ lastlist = list;
+ list = list->link;
+ }
+/*
+At this point we have a new list built at 'new'. We break the old
+list at 'lastlist', and add the broken off part to the end of 'new'.
+Then, we return the caller a pointer to 'new':
+*/
+ if (new == NULL)
+ t1_abort("null splitedge");
+ lastlist->link = NULL;
+ last->link = list;
+ IfTrace1((RegionDebug > 1),"yields %p\n", new);
+ return(new);
+}
+
+/*
+:h3.vertjoin() - Join Two Disjoint Edge Lists Vertically
+
+The two edges must be disjoint vertically.
+*/
+static void vertjoin(register struct edgelist *top,
+ register struct edgelist *bottom)
+{
+ if (BOTTOM(top) > TOP(bottom))
+ t1_abort("vertjoin not disjoint");
+
+ for (; top->link != NULL; top=top->link) { ; }
+
+ top->link = bottom;
+ return;
+}
+
+/*
+:h3.swathxsort() - Sorting by X Values
+
+We need to sort 'edge' into its rightful
+place in the swath by X value, taking care that we do not accidentally
+advance to the next swath while searching for the correct X value. Like
+all swath functions, this function returns a pointer to the edge
+BEFORE the given edge in the sort.
+*/
+
+static struct edgelist *swathxsort(
+ register struct edgelist *before0, /* edge before this swath */
+ register struct edgelist *edge) /* input edge */
+{
+ register struct edgelist *before;
+ register struct edgelist *after;
+ register pel y = 0;
+
+ before = before0;
+ after = before->link;
+
+ while (after != NULL && TOP(after) == TOP(edge)) {
+
+ register pel *x1,*x2;
+
+ y = TOP(edge);
+ x1 = after->xvalues;
+ x2 = edge->xvalues;
+
+ while (y < BOTTOM(edge) && *x1 == *x2) {
+ x1++; x2++; y++;
+ }
+ if (y >= BOTTOM(edge)) {
+ edge->flag |= ISAMBIGUOUS(ON);
+ after->flag |= ISAMBIGUOUS(ON);
+ break;
+ }
+
+ if (*x1 >= *x2)
+ break;
+
+ before = after;
+ after = after->link;
+ }
+
+/*
+At this point, 'edge' is between 'before' and 'after'. If 'edge' didn't
+cross either of those other edges, we would be done. We check for
+crossing. If it does cross, we split the problem up by calling SortSwath
+recursively with the part of the edge that is below the crossing point:
+*/
+{
+ register int h0,h; /* height of edge--number of scans */
+
+ h0 = h = BOTTOM(edge) - y;
+ y -= TOP(edge);
+
+ if (h0 <= 0) {
+ IfTrace0((RegionDebug>0),"swathxsort: exactly equal edges\n");
+ return(before);
+ }
+
+ if (TOP(before) == TOP(edge))
+ h -= crosses(h, &before->xvalues[y], &edge->xvalues[y]);
+ if (after != NULL && TOP(after) == TOP(edge))
+ h -= crosses(h, &edge->xvalues[y], &after->xvalues[y]);
+
+ if (h < h0) {
+ SortSwath(before0->link,
+ splitedge(edge, TOP(edge) + y + h),
+ swathxsort);
+
+ }
+}
+
+ return(before);
+}
+/*
+:h3.SwathUnion() - Union Two Edges by X Value
+
+We have a left and right edge that must be unioned into a growing
+swath. If they are totally disjoint, they are just added in. The
+fun comes in they overlap the existing edges. Then some edges
+will disappear.
+*/
+
+static struct edgelist *SwathUnion(
+ register struct edgelist *before0, /* edge before the swath */
+ register struct edgelist *edge) /* list of two edges to be unioned */
+{
+ register int h; /* saves height of edge */
+ register struct edgelist *rightedge; /* saves right edge of 'edge' */
+ register struct edgelist *before,*after; /* edge before and after */
+ int h0; /* saves initial height */
+
+ IfTrace2((RegionDebug > 1),"SwathUnion entered, before=%p, edge=%p\n",
+ before0, edge);
+
+ h0 = h = edge->ymax - edge->ymin;
+ if (h <= 0)
+ t1_abort("SwathUnion: 0 height swath?");
+
+ before = before0;
+ after = before->link;
+
+ while (after != NULL && TOP(after) == TOP(edge)) {
+ register struct edgelist *right;
+
+ right = after->link;
+ if (right->xvalues[0] >= edge->xvalues[0])
+ break;
+ before = right;
+ after = before->link;
+ }
+/*
+This is the picture at this point. 'L' indicates a left hand edge,
+'R' indicates the right hand edge.
+'<--->' indicates the degree of uncertainty as to its placement
+relative to other edges:
+:xmp atomic.
+ before after
+ R <---L----> R L R L R
+ <---L---> <------R-------------------------->
+ edge
+:exmp.
+In case the left of 'edge' touches 'before', we need to reduce
+the height by that amount.
+*/
+ if (TOP(before) == TOP(edge))
+ h -= touches(h, before->xvalues, edge->xvalues);
+
+ rightedge = edge->link;
+
+ if (after == NULL || TOP(after) != TOP(edge) ||
+ after->xvalues[0] > rightedge->xvalues[0]) {
+ IfTrace2((RegionDebug > 1),
+ "SwathUnion starts disjoint: before=%p after=%p\n",
+ before, after);
+/*
+On this side of the the above 'if', the new edge is disjoint from the
+existing edges in the swath. This is the picture:
+:xmp atomic.
+ before after
+ R L R L R L R
+ L R
+ edge
+:exmp.
+We will verify it remains disjoint for the entire height. If the
+situation changes somewhere down the edge, we split the edge at that
+point and recursively call ourselves (through 'SortSwath') to figure
+out the new situation:
+*/
+ if (after != NULL && TOP(after) == TOP(edge))
+ h -= touches(h, rightedge->xvalues, after->xvalues);
+ if (h < h0)
+ SortSwath(before0->link, splitedge(edge, edge->ymin + h), SwathUnion);
+ /* go to "return" this edge pair; it is totally disjoint */
+ }
+ else {
+/*
+At this point, at the 'else', we know that the
+new edge overlaps one or more pairs in the existing swath. Here is
+a picture of our knowledge and uncertainties:
+:xmp atomic.
+ before after
+ R L R L R L R
+ <---L---> <---R------------------->
+ edge
+:exmp.
+We need to move 'after' along until it is to the right of the
+right of 'edge'. ('After' should always point to a left edge of a pair:)
+*/
+ register struct edgelist *left; /* variable to keep left edge in */
+
+ do {
+ left = after;
+ after = (after->link)->link;
+
+ } while (after != NULL && TOP(after) == TOP(edge)
+ && after->xvalues[0] <= rightedge->xvalues[0]);
+/*
+At this point this is the picture:
+:xmp atomic.
+ before left after
+ R L R L R L R
+ <---L---> <---R--->
+ edge
+:exmp.
+We need to verify that the situation stays like this all the way
+down the edge. Again, if the
+situation changes somewhere down the edge, we split the edge at that
+point and recursively call ourselves (through 'SortSwath') to figure
+out the new situation:
+*/
+
+ h -= crosses(h, left->xvalues, rightedge->xvalues);
+ h -= crosses(h, edge->xvalues, ((before->link)->link)->xvalues);
+
+ if (after != NULL && TOP(after) == TOP(edge))
+
+ h -= touches(h, rightedge->xvalues, after->xvalues);
+
+ IfTrace3((RegionDebug > 1),
+ "SwathUnion is overlapped until %d: before=%p after=%p\n",
+ (int32_t) TOP(edge) + h, before, after);
+/*
+OK, if we touched either of our neighbors we need to split at that point
+and recursively sort the split edge onto the list. One tricky part
+is that when we recursively sort, 'after' will change if it was not
+in our current swath:
+*/
+ if (h < h0) {
+ SortSwath(before0->link,
+ splitedge(edge, edge->ymin + h),
+ SwathUnion);
+
+ if (after == NULL || TOP(after) != TOP(edge))
+ for (after = before0->link;
+ TOP(after) == TOP(edge);
+ after = after->link) { ; }
+ }
+/*
+Now we need to augment 'edge' by the left and right of the overlapped
+swath, and to discard all edges between before and after, because they
+were overlapped and have been combined with the new incoming 'edge':
+*/
+ edge->xmin = MIN(edge->xmin, (before->link)->xmin);
+ edge->xmax = MIN(edge->xmax, (before->link)->xmax);
+ edgemin(h, edge->xvalues, (before->link)->xvalues);
+ rightedge->xmin = MAX(rightedge->xmin, (left->link)->xmin);
+ rightedge->xmax = MAX(rightedge->xmax, (left->link)->xmax);
+ edgemax(h, rightedge->xvalues, (left->link)->xvalues);
+ discard(before, after);
+ }
+ return(before);
+}
+#if 0
+/*
+:h3.swathrightmost() - Simply Sorts New Edge to Rightmost of Swath
+
+Like all swath functions, this function returns a pointer to the edge
+BEFORE the given edge in the sort.
+*/
+
+struct edgelist *swathrightmost(
+ register struct edgelist *before, /* edge before this swath */
+ register struct edgelist *edge) /* input edge */
+{
+ register struct edgelist *after;
+
+ after = before->link;
+
+ while (after != NULL && TOP(after) == TOP(edge)) {
+ before = after;
+ after = after->link;
+ }
+
+ return(before);
+
+}
+#endif
+/*
+:h3.touches() - Returns the Remaining Height When Two Edges Touch
+
+So, it will return 0 if they never touch. Allows incredibly(?) mnemonic
+if (touches(...)) construct.
+*/
+
+static int touches(int h, register pel *left, register pel *right)
+{
+ for (; h > 0; h--)
+ if (*left++ >= *right++)
+ break;
+ return(h);
+}
+/*
+:h3.crosses() - Returns the Remaining Height When Two Edges Cross
+
+So, it will return 0 if they never cross.
+*/
+
+static int crosses(register int h, register pel *left, register pel *right)
+{
+ for (; h > 0; h--)
+ if (*left++ > *right++)
+ break;
+ return(h);
+}
+#if 0
+/*
+:h3.cedgemin() - Stores the Mininum of an Edge and an X Value
+*/
+
+static void cedgemin(register int h, register pel *e1, register pel x)
+{
+ for (; --h >= 0; e1++)
+ if (*e1 > x)
+ *e1 = x;
+}
+/*
+:h3.cedgemax() - Stores the Maximum of an Edge and an X Value
+*/
+
+static void cedgemax(register int h, register pel *e1, register pel x)
+{
+ for (; --h >= 0; e1++)
+ if (*e1 < x)
+ *e1 = x;
+}
+#endif
+/*
+:h3.edgemin() - Stores the Mininum of Two Edges in First Edge
+*/
+
+static void edgemin(register int h, register pel *e1, register pel *e2)
+{
+ for (; --h >= 0; e1++,e2++)
+ if (*e1 > *e2)
+ *e1 = *e2;
+}
+/*
+:h3.edgemax() - Stores the Maximum of Two Edges in First Edge
+*/
+
+static void edgemax(register int h, register pel *e1, register pel *e2)
+{
+ for (; --h >= 0; e1++,e2++)
+ if (*e1 < *e2)
+ *e1 = *e2;
+}
+/*
+:h3 id=discard.discard() - Discard All Edges Between Two Edges
+
+At first glance it would seem that we could discard an edgelist
+structure merely by unlinking it from the list and freeing it. You are
+wrong, region-breath! For performance, the X values associated with an
+edge are allocated contiguously with it. So, we free the X values when
+we free a structure. However, once an edge has been split, we are no
+longer sure which control block actually is part of the memory block
+that contains the edges. Rather than trying to decide, we play it safe
+and never free part of a region.
+
+So, to mark a 'edgelist' structure as discarded, we move it to the end
+of the list and set ymin=ymax.
+*/
+
+static void discard(register struct edgelist *left, register struct edgelist *right)
+{
+ register struct edgelist *beg,*end,*p;
+
+ IfTrace2((RegionDebug > 0),"discard: l=%p, r=%p\n", left, right);
+
+ beg = left->link;
+ if (beg == right)
+ return;
+
+ for (p = beg; p != right; p = p->link) {
+ if (p->link == NULL && right != NULL)
+ t1_abort("discard(): ran off end");
+ IfTrace1((RegionDebug > 0),"discarding %p\n", p);
+ p->ymin = p->ymax = 32767;
+ end = p;
+ }
+ /*
+ * now put the chain beg/end at the end of right, if it is not
+ * already there:
+ */
+ if (right != NULL) {
+ left->link = right;
+ while (right->link != NULL)
+ right = right->link;
+ right->link = beg;
+ }
+ end->link = NULL;
+}
+
+/*
+:h2.Changing the Representation of Regions
+
+For convenience and/or performance, we sometimes like to change the way
+regions are represented. This does not change the object itself, just
+the representation, so these transformations can be made on a permanent
+region.
+
+*/
+
+void MoveEdges(
+ register struct region *R, /* region to modify */
+ register fractpel dx, /* delta X ... */
+ register fractpel dy) /* ... and Y to move edge list by */
+{
+ register struct edgelist *edge; /* for looping through edges */
+
+ R->origin.x += dx;
+ R->origin.y += dy;
+ R->ending.x += dx;
+ R->ending.y += dy;
+ if (R->thresholded != NULL) {
+ R->thresholded->origin.x -= dx;
+ R->thresholded->origin.y -= dy;
+ }
+/*
+From now on we will deal with dx and dy as integer pel values:
+*/
+ dx = NEARESTPEL(dx);
+ dy = NEARESTPEL(dy);
+ if (dx == 0 && dy == 0)
+ return;
+
+ R->xmin += dx;
+ R->xmax += dx;
+ R->ymin += dy;
+ R->ymax += dy;
+
+ for (edge = R->anchor; VALIDEDGE(edge); edge = edge->link) {
+ edge->ymin += dy;
+ edge->ymax += dy;
+ if (dx != 0) {
+ register int h; /* loop index; height of edge */
+ register pel *Xp; /* loop pointer to X values */
+
+ edge->xmin += dx;
+ edge->xmax += dx;
+ for (Xp = edge->xvalues, h = edge->ymax - edge->ymin;
+ --h >= 0; )
+ *Xp++ += dx;
+ }
+ }
+}
+
+/*
+:h3.UnJumble() - Sort a Region Top to Bottom
+
+It is an open question whether it pays in general to do this.
+*/
+
+void UnJumble(
+ struct region *region) /* region to sort */
+{
+ register struct edgelist *anchor; /* new lists built here */
+ register struct edgelist *edge; /* edge pointer for loop */
+ register struct edgelist *next; /* ditto */
+
+ anchor = NULL;
+
+ for (edge=region->anchor; VALIDEDGE(edge); edge=next) {
+ if (edge->link == NULL)
+ t1_abort("UnJumble: unpaired edge?");
+ next = edge->link->link;
+ edge->link->link = NULL;
+ anchor = SortSwath(anchor, edge, SwathUnion);
+ }
+
+ if (edge != NULL)
+ vertjoin(anchor, edge);
+
+ region->anchor = anchor;
+ region->flag &= ~ISJUMBLED(ON);
+}
+
+/*
+:h2.Miscelaneous Routines
+
+:h3.MoreWorkArea() - Allocate New Space for "edge"
+
+Our strategy is to temporarily allocate an array to hold this
+unexpectedly large edge. ChangeDirection frees this array any time
+it gets a shorter 'dy'.
+*/
+
+/*ARGSUSED*/
+void MoreWorkArea(
+ struct region *R, /* region we are generating */
+ fractpel x1, fractpel y1, /* starting point of line */
+ fractpel x2, fractpel y2) /* ending point of line */
+{
+ register int idy; /* integer dy of line */
+
+ idy = NEARESTPEL(y1) - NEARESTPEL(y2);
+ if (idy < 0) idy = - idy;
+
+ /*
+ * we must add one to the delta for the number of run ends we
+ * need to store:
+ */
+ if (++idy > currentsize) {
+ IfTrace1((RegionDebug > 0),"Allocating edge of %d pels\n", idy);
+ if (currentworkarea != workedge)
+ NonObjectFree(currentworkarea);
+ currentworkarea = (pel *)Allocate(0, NULL, idy * sizeof(pel));
+ currentsize = idy;
+ }
+ ChangeDirection(CD_CONTINUE, R, x1, y1, y2 - y1);
+}
+
+/*
+:h3.RegionBounds() - Returns Bounding Box of a Region
+*/
+
+struct segment *RegionBounds(register struct region *R)
+{
+ register struct segment *path; /* returned path */
+
+ path = BoxPath(IDENTITY, R->ymax - R->ymin, R->xmax - R->xmin);
+ path = Join(PathSegment(MOVETYPE, R->origin.x + TOFRACTPEL(R->xmin),
+ R->origin.y + TOFRACTPEL(R->ymin) ),
+ path);
+ return(path);
+}
+
+#if 0
+/*
+:h2.Formatting/Dump Routines for Debug
+
+:h3.DumpArea() - Display a Region
+*/
+void DumpArea(register struct region *area)
+{
+ IfTrace1(TRUE,"Dumping area %p,", area);
+ IfTrace4(TRUE," X %d:%d Y %d:%d;", (int32_t) area->xmin,
+ (int32_t) area->xmax, (int32_t) area->ymin,(int32_t) area->ymax);
+ IfTrace4(TRUE," origin=(%d,%d), ending=(%d,%d)\n",
+ area->origin.x, area->origin.y, area->ending.x, area->ending.y);
+ DumpEdges(area->anchor);
+}
+
+#define INSWATH(p, y0, y1) (p != NULL && p->ymin == y0 && p->ymax == y1)
+/*
+:h3.DumpEdges() - Display Run End Lists (Edge Lists)
+*/
+
+static pel RegionDebugYMin = MINPEL;
+static pel RegionDebugYMax = MAXPEL;
+
+void DumpEdges(register struct edgelist *edges)
+{
+ register struct edgelist *p,*p2;
+ register pel ymin = MINPEL;
+ register pel ymax = MINPEL;
+ register int y;
+
+ if (edges == NULL) {
+ IfTrace0(TRUE," NULL area.\n");
+ return;
+ }
+ if (RegionDebug <= 1) {
+ for (p=edges; p != NULL; p = p->link) {
+ edgecheck(p, ymin, ymax);
+ ymin = p->ymin; ymax = p->ymax;
+ IfTrace3(TRUE,". at %p type=%d flag=%x",
+ p, (int32_t) p->type,(int32_t) p->flag);
+ IfTrace4(TRUE," bounding box HxW is %dx%d at (%d,%d)\n",
+ (int32_t) ymax - ymin, (int32_t) p->xmax - p->xmin,
+ (int32_t) p->xmin, (int32_t) ymin);
+ }
+ }
+ else {
+
+ for (p2=edges; p2 != NULL; ) {
+
+ edgecheck(p2, ymin, ymax);
+ ymin = p2->ymin;
+ ymax = p2->ymax;
+
+ if (RegionDebug > 3 || (ymax > RegionDebugYMin
+ && ymin < RegionDebugYMax)) {
+ IfTrace2 (TRUE,". Swath from %d to %d:\n",
+ ymin, ymax);
+ for (p=p2; INSWATH(p,ymin,ymax); p = p->link) {
+ IfTrace4(TRUE,". . at %p[%x] range %d:%d, ",
+ p, (int32_t) p->flag,
+ (int32_t) p->xmin, (int32_t)p->xmax);
+ IfTrace1(TRUE, "subpath=%p,\n", p->subpath);
+ }
+ }
+ for (y=MAX(ymin,RegionDebugYMin); y < MIN(ymax, RegionDebugYMax); y++) {
+ IfTrace1(TRUE,". . . Y[%5d] ", (int32_t) y);
+ for (p=p2; INSWATH(p,ymin,ymax); p = p->link)
+ IfTrace1(TRUE,"%5d ",
+ (int32_t) p->xvalues[y - ymin]);
+ IfTrace0(TRUE,"\n");
+ }
+ while (INSWATH(p2, ymin, ymax))
+ p2 = p2->link;
+ }
+ }
+}
+
+/*
+:h3.edgecheck() - For Debug, Verify that an Edge Obeys the Rules
+*/
+
+/*ARGSUSED*/
+static void edgecheck(struct edgelist *edge, int oldmin, int oldmax)
+{
+ if (edge->type != EDGETYPE)
+ t1_abort("EDGE ERROR: non EDGETYPE in list");
+/*
+The following check is not valid if the region is jumbled so I took it
+out:
+*/
+/* if (edge->ymin < oldmax && edge->ymin != oldmin)
+ t1_abort("EDGE ERROR: overlapping swaths"); */
+}
+#endif
diff --git a/fonts/utilities/ps2pk/regions.h b/fonts/utilities/ps2pk/regions.h
new file mode 100644
index 0000000000..aec9323f29
--- /dev/null
+++ b/fonts/utilities/ps2pk/regions.h
@@ -0,0 +1,205 @@
+/* $XConsortium: regions.h,v 1.2 91/10/10 11:19:06 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/*SHARED*/
+
+struct region {
+ XOBJ_COMMON /* xobject common data define 3-26-91 PNM */
+ /* type = REGIONTYPE */
+ struct fractpoint origin; /* beginning handle: X,Y origin of region */
+ struct fractpoint ending; /* ending handle: X,Y change after painting region */
+ pel xmin,ymin; /* minimum X,Y of region */
+ pel xmax,ymax; /* mat1_mum X,Y of region */
+ struct edgelist *anchor; /* list of edges that bound the region */
+ struct picture *thresholded; /* region defined by thresholded picture*/
+/*
+Note that the ending handle and the bounding box values are stored
+relative to 'origin'.
+
+The above elements describe a region. The following elements are
+scratchpad areas used while the region is being built:
+*/
+ fractpel lastdy; /* direction of last segment */
+ fractpel firstx,firsty; /* starting point of current edge */
+ fractpel edgexmin,edgexmax; /* x extent of current edge */
+ struct edgelist *lastedge,*firstedge; /* last and first edges in subpath */
+ pel *edge; /* pointer to array of X values for edge */
+ fractpel edgeYstop; /* Y value where 'edges' array ends */
+ void (*newedgefcn)(struct region *, fractpel, fractpel,
+ fractpel, fractpel, int); /* function to use when
+ building a new edge */
+ struct strokeinfo *strokeinfo; /* scratchpad info during stroking only */
+} ;
+/*
+The ISCOMPLEMENT flag indicates the region is reversed--it is the
+"outside" of the nominal region.
+*/
+#define ISCOMPLEMENT(flag) ((flag)&0x80)
+/*
+The ISJUMBLED flag indicates the region is not sorted top-to-bottom.
+*/
+#define ISJUMBLED(flag) ((flag)&0x40)
+/*
+The ISINFINITE flag allows a quick check for an INFINITE region, which
+is frequently intersected.
+*/
+#define ISINFINITE(flag) ((flag)&0x20)
+
+/*END SHARED*/
+/*SHARED*/
+
+#define ISRECTANGULAR(flag) ((flag)&0x08)
+
+/*END SHARED*/
+/*SHARED*/
+
+#define EmptyRegion t1_EmptyRegion
+
+/*END SHARED*/
+/*SHARED*/
+
+struct edgelist {
+ XOBJ_COMMON /* xobject common data define 3-26-91 PNM */
+ /* type = EDGETYPE */
+ struct edgelist *link; /* pointer to next in linked list */
+ struct edgelist *subpath; /* informational link for "same subpath" */
+ pel xmin,xmax; /* range of edge in X */
+ pel ymin,ymax; /* range of edge in Y */
+ pel *xvalues; /* pointer to ymax-ymin X values */
+} ;
+/*
+The end of the list is marked by either "link" being NULL, or by
+ymin == ymax. See :hdref refid=discard.. We define the VALIDEDGE
+predicate to test for the opposite of these conditions:
+*/
+
+#define VALIDEDGE(p) ((p)!=NULL&&(p)->ymin<(p)->ymax)
+
+/*END SHARED*/
+/*SHARED*/
+
+#define Interior(p,rule) t1_Interior(p,rule)
+#define Union(a1,a2) t1_Union(a1,a2)
+#define Intersect(a1,a2) t1_Intersect(a1,a2)
+#define Complement(area) t1_Complement(area)
+#define Overlap(a1,a2) t1_OverLap(a1,a2)
+
+struct region *t1_Interior(struct segment *, int);
+ /* returns the interior of a closed path */
+struct region *t1_Union(); /* set union of paths or regions */
+struct region *t1_Intersect(); /* set intersection of regions */
+struct region *t1_Complement(); /* complement of a region */
+int t1_Overlap(); /* returns a Boolean; TRUE if regions overlap */
+
+#define T1_INFINITY t1_Infinity
+
+/*END SHARED*/
+/*SHARED*/
+
+#define ChangeDirection(type,R,x,y,dy) t1_ChangeDirection(type,R,x,y,dy)
+
+void t1_ChangeDirection(int, struct region *, fractpel, fractpel, fractpel);
+ /* called when we change direction in Y */
+#define CD_FIRST -1 /* enumeration of ChangeDirection type */
+#define CD_CONTINUE 0 /* enumeration of ChangeDirection type */
+#define CD_LAST 1 /* enumeration of ChangeDirection type */
+
+#define MoreWorkArea(R,x1,y1,x2,y2) t1_MoreWorkArea(R,x1,y1,x2,y2)
+#define KillRegion(area) t1_KillRegion(area)
+#define CopyRegion(area) t1_CopyRegion(area)
+#define RegionBounds(r) t1_RegionBounds(r)
+#define CoerceRegion(p) t1_CoerceRegion(p)
+#define MoveEdges(R,dx,dy) t1_MoveEdges(R,dx,dy)
+#define UnJumble(R) t1_UnJumble(R)
+
+void t1_MoreWorkArea(struct region *, fractpel, fractpel, fractpel,
+ fractpel); /* get longer edge list for stepping */
+struct region *t1_CopyRegion(struct region *); /* duplicate a region */
+void t1_KillRegion(struct region *); /* destroy a region */
+struct segment *t1_RegionBounds(struct region *);
+ /* returns bounding box of a region */
+struct region *t1_CoerceRegion(); /* force text to become a true region */
+void t1_MoveEdges(struct region *, fractpel, fractpel);
+ /* moves the edge values in a region */
+void t1_UnJumble(struct region *);
+ /* sort the edges and reset the jumbled flag */
+
+/*END SHARED*/
+/*SHARED*/
+
+#define GOING_TO(R, x1, y1, x2, y2, dy) { \
+ if (dy < 0) { \
+ if (R->lastdy >= 0) \
+ ChangeDirection(CD_CONTINUE, R, x1, y1, dy); \
+ if (y2 < R->edgeYstop) \
+ MoreWorkArea(R, x1, y1, x2, y2); \
+ } \
+ else if (dy > 0) { \
+ if (R->lastdy <= 0) \
+ ChangeDirection(CD_CONTINUE, R, x1, y1, dy); \
+ if (y2 > R->edgeYstop) \
+ MoreWorkArea(R, x1, y1, x2, y2); \
+ } \
+ else /* dy == 0 */ ChangeDirection(CD_CONTINUE, R, x1, y1, dy); \
+ if (x2 < R->edgexmin) R->edgexmin = x2; \
+ else if (x2 > R->edgexmax) R->edgexmax = x2; \
+}
+
+
+#define MINPEL (-1<<(8*sizeof(pel)-1)) /* smallest value fitting in a pel */
+#define MAXPEL ((1<<(8*sizeof(pel)-1))-1)/* largest value fitting in a pel */
+
+/*
+The "Unique"-type macro is different (unique?) for regions, because some
+regions structures are shared among several objects, and might have
+to be made unique for that reason (i.e., references > 1).
+*/
+
+#define ConsumeRegion(R) MAKECONSUME(R,KillRegion(R))
+#define UniqueRegion(R) MAKEUNIQUE(R,CopyRegion(R))
+
+
+/*END SHARED*/
+/*SHARED*/
+
+#define ISDOWN(f) ((f)&0x80)
+
+#define ISAMBIGUOUS(f) ((f)&0x40)
+
+/*END SHARED*/
+/*SHARED*/
+
+/*
+Interior() rule enumerations:
+*/
+#define WINDINGRULE -2
+#define EVENODDRULE -3
+
+#define CONTINUITY 0x80 /* can be added to above rules; e.g. WINDINGRULE+CONTINUITY */
+
+/*END SHARED*/
diff --git a/fonts/utilities/ps2pk/scanfont.c b/fonts/utilities/ps2pk/scanfont.c
new file mode 100644
index 0000000000..9224928246
--- /dev/null
+++ b/fonts/utilities/ps2pk/scanfont.c
@@ -0,0 +1,1480 @@
+/* $XConsortium: scanfont.c,v 1.9 92/07/07 17:14:56 gildea Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* Author: Katherine A. Hitchcock IBM Almaden Research Laboratory */
+
+#include "types.h"
+#include <string.h>
+
+#include "t1stdio.h"
+#include "util.h"
+#include "token.h"
+#include "objects.h"
+#include "spaces.h"
+#include "fontmisc.h"
+#include "ffilest.h"
+#include "fontfcn.h"
+#include "blues.h"
+
+
+static int rc;
+static boolean InPrivateDict;
+static boolean WantFontInfo;
+static boolean TwoSubrs;
+static psobj inputFile;
+static psobj filterFile;
+static psobj *inputP;
+
+
+/**********************************************************************/
+/* Init_BuiltInEncoding() */
+/* */
+/* Initializes the StandardEncoding and ISOLatin1Encoding vector. */
+/* */
+/**********************************************************************/
+typedef struct /* Builtin Standard Encoding */
+{
+ int index;
+ const char *name;
+} EncodingTable;
+
+static EncodingTable StdEnc[] = {
+ { 040 , "space" },
+ { 041 , "exclam" },
+ { 042 , "quotedbl" },
+ { 043 , "numbersign" },
+ { 044 , "dollar" },
+ { 045 , "percent" },
+ { 046 , "ampersand" },
+ { 047 , "quoteright" },
+ { 050 , "parenleft" },
+ { 051 , "parenright" },
+ { 052 , "asterisk" },
+ { 053 , "plus" },
+ { 054 , "comma" },
+ { 055 , "hyphen" },
+ { 056 , "period" },
+ { 057 , "slash" },
+ { 060 , "zero" },
+ { 061 , "one" },
+ { 062 , "two" },
+ { 063 , "three" },
+ { 064 , "four" },
+ { 065 , "five" },
+ { 066 , "six" },
+ { 067 , "seven" },
+ { 070 , "eight" },
+ { 071 , "nine" },
+ { 072 , "colon" },
+ { 073 , "semicolon" },
+ { 074 , "less" },
+ { 075 , "equal" },
+ { 076 , "greater" },
+ { 077 , "question" },
+ { 0100 , "at" },
+ { 0101 , "A" },
+ { 0102 , "B" },
+ { 0103 , "C" },
+ { 0104 , "D" },
+ { 0105 , "E" },
+ { 0106 , "F" },
+ { 0107 , "G" },
+ { 0110 , "H" },
+ { 0111 , "I" },
+ { 0112 , "J" },
+ { 0113 , "K" },
+ { 0114 , "L" },
+ { 0115 , "M" },
+ { 0116 , "N" },
+ { 0117 , "O" },
+ { 0120 , "P" },
+ { 0121 , "Q" },
+ { 0122 , "R" },
+ { 0123 , "S" },
+ { 0124 , "T" },
+ { 0125 , "U" },
+ { 0126 , "V" },
+ { 0127 , "W" },
+ { 0130 , "X" },
+ { 0131 , "Y" },
+ { 0132 , "Z" },
+ { 0133 , "bracketleft" },
+ { 0134 , "backslash" },
+ { 0135 , "bracketright" },
+ { 0136 , "asciicircum" },
+ { 0137 , "underscore" },
+ { 0140 , "quoteleft" },
+ { 0141 , "a" },
+ { 0142 , "b" },
+ { 0143 , "c" },
+ { 0144 , "d" },
+ { 0145 , "e" },
+ { 0146 , "f" },
+ { 0147 , "g" },
+ { 0150 , "h" },
+ { 0151 , "i" },
+ { 0152 , "j" },
+ { 0153 , "k" },
+ { 0154 , "l" },
+ { 0155 , "m" },
+ { 0156 , "n" },
+ { 0157 , "o" },
+ { 0160 , "p" },
+ { 0161 , "q" },
+ { 0162 , "r" },
+ { 0163 , "s" },
+ { 0164 , "t" },
+ { 0165 , "u" },
+ { 0166 , "v" },
+ { 0167 , "w" },
+ { 0170 , "x" },
+ { 0171 , "y" },
+ { 0172 , "z" },
+ { 0173 , "braceleft" },
+ { 0174 , "bar" },
+ { 0175 , "braceright" },
+ { 0176 , "asciitilde" },
+ { 0241 , "exclamdown" },
+ { 0242 , "cent" },
+ { 0243 , "sterling" },
+ { 0244 , "fraction" },
+ { 0245 , "yen" },
+ { 0246 , "florin" },
+ { 0247 , "section" },
+ { 0250 , "currency" },
+ { 0251 , "quotesingle" },
+ { 0252 , "quotedblleft" },
+ { 0253 , "guillemotleft" },
+ { 0254 , "guilsinglleft" },
+ { 0255 , "guilsinglright" },
+ { 0256 , "fi" },
+ { 0257 , "fl" },
+ { 0261 , "endash" },
+ { 0262 , "dagger" },
+ { 0263 , "daggerdbl" },
+ { 0264 , "periodcentered" },
+ { 0266 , "paragraph" },
+ { 0267 , "bullet" },
+ { 0270 , "quotesinglbase" },
+ { 0271 , "quotedblbase" },
+ { 0272 , "quotedblright" },
+ { 0273 , "guillemotright" },
+ { 0274 , "ellipsis" },
+ { 0275 , "perthousand" },
+ { 0277 , "questiondown" },
+ { 0301 , "grave" },
+ { 0302 , "acute" },
+ { 0303 , "circumflex" },
+ { 0304 , "tilde" },
+ { 0305 , "macron" },
+ { 0306 , "breve" },
+ { 0307 , "dotaccent" },
+ { 0310 , "dieresis" },
+ { 0312 , "ring" },
+ { 0313 , "cedilla" },
+ { 0315 , "hungarumlaut" },
+ { 0316 , "ogonek" },
+ { 0317 , "caron" },
+ { 0320 , "emdash" },
+ { 0341 , "AE" },
+ { 0343 , "ordfeminine" },
+ { 0350 , "Lslash" },
+ { 0351 , "Oslash" },
+ { 0352 , "OE" },
+ { 0353 , "ordmasculine" },
+ { 0361 , "ae" },
+ { 0365 , "dotlessi" },
+ { 0370 , "lslash" },
+ { 0371 , "oslash" },
+ { 0372 , "oe" },
+ { 0373 , "germandbls" },
+ { 0, 0 }
+};
+
+static EncodingTable ISO8859Enc[] = {
+ { 32, "space" },
+ { 33, "exclam" },
+ { 34, "quotedbl" },
+ { 35, "numbersign" },
+ { 36, "dollar" },
+ { 37, "percent" },
+ { 38, "ampersand" },
+ { 39, "quoteright" },
+ { 40, "parenleft" },
+ { 41, "parenright" },
+ { 42, "asterisk" },
+ { 43, "plus" },
+ { 44, "comma" },
+ { 45, "minus" },
+ { 46, "period" },
+ { 47, "slash" },
+ { 48, "zero" },
+ { 49, "one" },
+ { 50, "two" },
+ { 51, "three" },
+ { 52, "four" },
+ { 53, "five" },
+ { 54, "six" },
+ { 55, "seven" },
+ { 56, "eight" },
+ { 57, "nine" },
+ { 58, "colon" },
+ { 59, "semicolon" },
+ { 60, "less" },
+ { 61, "equal" },
+ { 62, "greater" },
+ { 63, "question" },
+ { 64, "at" },
+ { 65, "A" },
+ { 66, "B" },
+ { 67, "C" },
+ { 68, "D" },
+ { 69, "E" },
+ { 70, "F" },
+ { 71, "G" },
+ { 72, "H" },
+ { 73, "I" },
+ { 74, "J" },
+ { 75, "K" },
+ { 76, "L" },
+ { 77, "M" },
+ { 78, "N" },
+ { 79, "O" },
+ { 80, "P" },
+ { 81, "Q" },
+ { 82, "R" },
+ { 83, "S" },
+ { 84, "T" },
+ { 85, "U" },
+ { 86, "V" },
+ { 87, "W" },
+ { 88, "X" },
+ { 89, "Y" },
+ { 90, "Z" },
+ { 91, "bracketleft" },
+ { 92, "backslash" },
+ { 93, "bracketright" },
+ { 94, "asciicircum" },
+ { 95, "underscore" },
+ { 96, "quoteleft" },
+ { 97, "a" },
+ { 98, "b" },
+ { 99, "c" },
+ { 100, "d" },
+ { 101, "e" },
+ { 102, "f" },
+ { 103, "g" },
+ { 104, "h" },
+ { 105, "i" },
+ { 106, "j" },
+ { 107, "k" },
+ { 108, "l" },
+ { 109, "m" },
+ { 110, "n" },
+ { 111, "o" },
+ { 112, "p" },
+ { 113, "q" },
+ { 114, "r" },
+ { 115, "s" },
+ { 116, "t" },
+ { 117, "u" },
+ { 118, "v" },
+ { 119, "w" },
+ { 120, "x" },
+ { 121, "y" },
+ { 122, "z" },
+ { 123, "braceleft" },
+ { 124, "bar" },
+ { 125, "braceright" },
+ { 126, "asciitilde" },
+ { 161, "exclamdown" },
+ { 162, "cent" },
+ { 163, "sterling" },
+ { 164, "currency" },
+ { 165, "yen" },
+ { 166, "brokenbar" },
+ { 167, "section" },
+ { 168, "dieresis" },
+ { 169, "copyright" },
+ { 170, "ordfeminine" },
+ { 171, "guillemotleft" },
+ { 172, "logicalnot" },
+ { 173, "hyphen" },
+ { 174, "registered" },
+ { 175, "macron" },
+ { 176, "degree" },
+ { 177, "plusminus" },
+ { 178, "twosuperior" },
+ { 179, "threesuperior" },
+ { 180, "acute" },
+ { 181, "mu" },
+ { 182, "paragraph" },
+ { 183, "periodcentered" },
+ { 184, "cedilla" },
+ { 185, "onesuperior" },
+ { 186, "ordmasculine" },
+ { 187, "guillemotright" },
+ { 188, "onequarter" },
+ { 189, "onehalf" },
+ { 190, "threequarters" },
+ { 191, "questiondown" },
+ { 192, "Agrave" },
+ { 193, "Aacute" },
+ { 194, "Acircumflex" },
+ { 195, "Atilde" },
+ { 196, "Adieresis" },
+ { 197, "Aring" },
+ { 198, "AE" },
+ { 199, "Ccedilla" },
+ { 200, "Egrave" },
+ { 201, "Eacute" },
+ { 202, "Ecircumflex" },
+ { 203, "Edieresis" },
+ { 204, "Igrave" },
+ { 205, "Iacute" },
+ { 206, "Icircumflex" },
+ { 207, "Idieresis" },
+ { 208, "Eth" },
+ { 209, "Ntilde" },
+ { 210, "Ograve" },
+ { 211, "Oacute" },
+ { 212, "Ocircumflex" },
+ { 213, "Otilde" },
+ { 214, "Odieresis" },
+ { 215, "multiply" },
+ { 216, "Oslash" },
+ { 217, "Ugrave" },
+ { 218, "Uacute" },
+ { 219, "Ucircumflex" },
+ { 220, "Udieresis" },
+ { 221, "Yacute" },
+ { 222, "Thorn" },
+ { 223, "germandbls" },
+ { 224, "agrave" },
+ { 225, "aacute" },
+ { 226, "acircumflex" },
+ { 227, "atilde" },
+ { 228, "adieresis" },
+ { 229, "aring" },
+ { 230, "ae" },
+ { 231, "ccedilla" },
+ { 232, "egrave" },
+ { 233, "eacute" },
+ { 234, "ecircumflex" },
+ { 235, "edieresis" },
+ { 236, "igrave" },
+ { 237, "iacute" },
+ { 238, "icircumflex" },
+ { 239, "idieresis" },
+ { 240, "eth" },
+ { 241, "ntilde" },
+ { 242, "ograve" },
+ { 243, "oacute" },
+ { 244, "ocircumflex" },
+ { 245, "otilde" },
+ { 246, "odieresis" },
+ { 247, "divide" },
+ { 248, "oslash" },
+ { 249, "ugrave" },
+ { 250, "uacute" },
+ { 251, "ucircumflex" },
+ { 252, "udieresis" },
+ { 253, "yacute" },
+ { 254, "thorn" },
+ { 255, "ydieresis" },
+ { 0, 0 }
+};
+
+static psobj *StdEncArrayP = NULL;
+psobj *ISOLatin1EncArrayP = NULL;
+
+static psobj *MakeEncodingArrayP(EncodingTable *encodingTable)
+{
+ int i;
+ psobj *encodingArrayP;
+
+ encodingArrayP = (psobj *)vm_alloc(256*(sizeof(psobj)));
+ if (!encodingArrayP)
+ return NULL;
+
+ /* initialize everything to .notdef */
+ for (i=0; i<256;i++)
+ objFormatName(&(encodingArrayP[i]),7, ".notdef");
+
+ for (i=0; encodingTable[i].name; i++)
+ {
+ objFormatName(&(encodingArrayP[encodingTable[i].index]),
+ strlen(encodingTable[i].name),
+ encodingTable[i].name);
+ }
+
+ return(encodingArrayP);
+}
+
+boolean Init_BuiltInEncoding(void)
+{
+ StdEncArrayP = MakeEncodingArrayP(StdEnc);
+ ISOLatin1EncArrayP = MakeEncodingArrayP(ISO8859Enc);
+ return (StdEncArrayP && ISOLatin1EncArrayP);
+}
+
+/********************************************************************/
+/***================================================================***/
+static int getNextValue(int valueType)
+{
+ scan_token(inputP);
+ if (tokenType != valueType) {
+ return(SCAN_ERROR);
+ }
+ return(SCAN_OK);
+
+}
+/***================================================================***/
+/* This routine will set the global rc if there is an error */
+/***================================================================***/
+static int getInt(void)
+{
+ scan_token(inputP);
+ if (tokenType != TOKEN_INTEGER) {
+ rc = SCAN_ERROR;
+ return(0);
+ }
+ else {
+ return( tokenValue.integer);
+ }
+
+}
+/***================================================================***/
+/*
+ * See Sec 10.3 of ``Adobe Type 1 Font Format'' v1.1,
+ * for parsing Encoding.
+ */
+static int getEncoding(psobj *arrayP)
+{
+
+ scan_token(inputP);
+ if ((tokenType == TOKEN_NAME)
+ &&
+ (((tokenLength==16) && (!strncmp(tokenStartP,"StandardEncoding",16))) ||
+ (((tokenLength==17) && (!strncmp(tokenStartP,"ISOLatin1Encoding",17))))))
+ {
+ /* Adobe Standard Encoding */
+
+ if (tokenLength == 16)
+ arrayP->data.valueP = (char *) StdEncArrayP;
+ else
+ arrayP->data.valueP = (char *) ISOLatin1EncArrayP;
+
+ arrayP->len = 256;
+ return(SCAN_OK);
+ }
+ else if ( (tokenType == TOKEN_LEFT_BRACE) ||
+ (tokenType == TOKEN_LEFT_BRACKET) )
+ {
+ /* Array of literal names */
+
+ psobj *objP;
+ int i;
+
+ objP = (psobj *)vm_alloc(256*(sizeof(psobj)));
+ if (!(objP)) return(SCAN_OUT_OF_MEMORY);
+
+ arrayP->data.valueP = (char *) objP;
+ arrayP->len = 256;
+
+ for (i=0; i<256; i++, objP++)
+ {
+ scan_token(inputP);
+
+ if (tokenType != TOKEN_LITERAL_NAME)
+ return(SCAN_ERROR);
+
+ if (!(vm_alloc(tokenLength)) ) return(SCAN_OUT_OF_MEMORY);
+ objFormatName(objP,tokenLength,tokenStartP);
+ }
+
+ scan_token(inputP);
+ if ( (tokenType == TOKEN_RIGHT_BRACE) ||
+ (tokenType == TOKEN_RIGHT_BRACKET) )
+ return(SCAN_OK);
+ }
+ else
+ {
+ /* Must be sequences of ``dup <index> <charactername> put" */
+
+ psobj *objP;
+ int i;
+
+ objP = (psobj *)vm_alloc(256*(sizeof(psobj)));
+ if (!(objP)) return(SCAN_OUT_OF_MEMORY);
+
+ arrayP->data.valueP = (char *) objP;
+ arrayP->len = 256;
+
+ for (i=0; i<256; i++)
+ objFormatName(objP + i, 7, ".notdef");
+
+ while (TRUE)
+ {
+ scan_token(inputP);
+
+ switch (tokenType)
+ {
+ case TOKEN_NAME:
+ if (tokenLength == 3)
+ {
+ if (strncmp(tokenStartP,"dup",3) == 0)
+ {
+ /* get <index> */
+ scan_token(inputP);
+ if (tokenType != TOKEN_INTEGER ||
+ tokenValue.integer < 0 ||
+ tokenValue.integer > 255)
+ return (SCAN_ERROR);
+ i = tokenValue.integer;
+
+ /* get <characer_name> */
+ scan_token(inputP);
+ if (tokenType != TOKEN_LITERAL_NAME)
+ return(SCAN_ERROR);
+
+ if (!(vm_alloc(tokenLength)) )
+ return(SCAN_OUT_OF_MEMORY);
+ objFormatName(objP + i,tokenLength,tokenStartP);
+
+ /* get "put" */
+ scan_token(inputP);
+ if (tokenType != TOKEN_NAME)
+ return(SCAN_ERROR);
+ }
+ else if (strncmp(tokenStartP,"def",3) == 0)
+ return (SCAN_OK);
+ }
+ break;
+ case TOKEN_EOF:
+ case TOKEN_NONE:
+ case TOKEN_INVALID:
+ return (SCAN_ERROR);
+ }
+ }
+ }
+
+ return (SCAN_ERROR);
+}
+/***================================================================***/
+static int getArray(psobj *arrayP)
+{
+ int N; /* count the items in the array */
+ psobj *objP;
+
+
+ scan_token(inputP);
+ if ( (tokenType != TOKEN_LEFT_BRACE) &&
+ (tokenType != TOKEN_LEFT_BRACKET) ) {
+ return(SCAN_ERROR);
+ }
+ /* format the array in memory, save pointer to the beginning */
+ arrayP->data.valueP = tokenStartP;
+ /* loop, picking up next object, until right BRACE or BRACKET */
+ N = 0;
+ do {
+ scan_token(inputP);
+ if ( (tokenType == TOKEN_RIGHT_BRACE) ||
+ (tokenType == TOKEN_RIGHT_BRACKET) ) {
+ /* save then number of items in the array */
+ arrayP->len = N;
+ return(SCAN_OK);
+ }
+ /* allocate the space for the object */
+ objP = (psobj *)vm_alloc(sizeof(psobj));
+ if (!(objP)) return(SCAN_OUT_OF_MEMORY);
+
+ /* array is an array of numbers, (real or integer) */
+ if (tokenType == TOKEN_REAL) {
+ objFormatReal(objP, tokenValue.real);
+ }
+ else
+ if (tokenType == TOKEN_INTEGER) {
+ objFormatInteger(objP, tokenValue.integer);
+ }
+ else return(SCAN_ERROR);
+ N++;
+ } while ( 1>0 );
+ /* NOTREACHED*/
+}
+/***================================================================***/
+static int getName(const char *nameP)
+{
+ do {
+ scan_token(inputP);
+ if (tokenType <= TOKEN_NONE) {
+ if (tokenTooLong) return(SCAN_OUT_OF_MEMORY);
+ return(SCAN_ERROR);
+ }
+ } while ((tokenType != TOKEN_NAME) ||
+ (0 != strncmp(tokenStartP,nameP,strlen(nameP))) );
+ /* found */
+ return(SCAN_OK);
+}
+/***================================================================***/
+static int getNbytes(int N)
+{
+ int I;
+
+ if (N > vm_free_bytes()) {
+ if (!vm_init()) return(SCAN_OUT_OF_MEMORY);
+ }
+ tokenStartP = vm_next_byte();
+ I = fread(tokenStartP,1,N,inputP->data.fileP);
+ if ( I != N ) return(SCAN_FILE_EOF);
+ return(SCAN_OK);
+}
+
+/***================================================================***/
+/* getLiteralName(nameObjP) */
+/* scan for next literal. */
+/* if we encounter the name 'end' then terminate and say ok. */
+/* It means that the CharStrings does not have as many characters */
+/* as the dictionary said it would and that is ok. */
+/***================================================================***/
+static int getLiteralName(psobj *nameObjP)
+{
+ do {
+ scan_token(inputP);
+ if (tokenType <= TOKEN_NONE) {
+ if (tokenTooLong) return(SCAN_OUT_OF_MEMORY);
+ return(SCAN_ERROR);
+ }
+ if (tokenType == TOKEN_NAME) {
+ if (0 == strncmp(tokenStartP,"end",3) ) {
+ return(SCAN_END);
+ }
+ }
+ } while (tokenType != TOKEN_LITERAL_NAME) ;
+ nameObjP->len = tokenLength;
+ /* allocate all the names in the CharStrings Structure */
+ if (!(vm_alloc(tokenLength)) ) return(SCAN_OUT_OF_MEMORY);
+ nameObjP->data.valueP = tokenStartP;
+ /* found */
+ return(SCAN_OK);
+}
+
+/***================================================================***/
+/*
+ * BuildSubrs routine
+ */
+/***================================================================***/
+
+static int BuildSubrs(psfont *FontP)
+{
+ int N; /* number of values in Subrs */
+ int I; /* index into Subrs */
+ int i; /* loop thru Subrs */
+ int J; /* length of Subrs entry */
+ psobj *arrayP;
+
+ /* next token should be a positive int */
+ /* note: rc is set by getInt. */
+ N = getInt();
+ if (rc) return(rc);
+ if (N < 0 ) return(SCAN_ERROR);
+ /* if we already have a Subrs, then skip the second one */
+ /* The second one is for hiresolution devices. */
+ if (FontP->Subrs.data.arrayP != NULL) {
+ TwoSubrs = TRUE;
+ /* process all the Subrs, but do not update anything */
+ /* can not just skip them because of the binary data */
+ for (i=0;i<N;i++) {
+ /* look for dup */
+ rc = getName("dup");
+ if (rc) return(rc);
+ /* get 2 integers */
+ I = getInt();
+ if (rc) return(rc);
+ J = getInt();
+ if (rc) return(rc);
+ if ( (I < 0) || (J < 0 ) ) return (SCAN_ERROR);
+ /* get the next token, it should be RD or -|, either is ok */
+ rc = getNextValue(TOKEN_NAME);
+ if ( rc != SCAN_OK ) return(rc);
+ rc = getNbytes(J);
+ if (rc) return(rc);
+ }
+ return(SCAN_OK);
+ }
+
+ arrayP = (psobj *)vm_alloc(N*sizeof(psobj));
+ if (!(arrayP) ) return(SCAN_OUT_OF_MEMORY);
+ FontP->Subrs.len = N;
+ FontP->Subrs.data.arrayP = arrayP;
+ /* get N values for Subrs */
+ for (i=0;i<N;i++) {
+ /* look for dup */
+ rc = getName("dup");
+ if (rc) return(rc);
+ /* get 2 integers */
+ I = getInt();
+ if (rc) return(rc);
+ J = getInt();
+ if (rc) return(rc);
+ if ( (I < 0) || (J < 0 ) ) return (SCAN_ERROR);
+ arrayP[I].len = J;
+ /* get the next token, it should be RD or -|, either is ok */
+ rc = getNextValue(TOKEN_NAME);
+ if ( rc != SCAN_OK ) return(rc);
+ rc = getNbytes(J);
+ if (rc == SCAN_OK) {
+ arrayP[I].data.valueP = tokenStartP;
+ if ( !(vm_alloc(J)) ) return(SCAN_OUT_OF_MEMORY);
+ }
+ else return(rc);
+ }
+ return(SCAN_OK);
+
+}
+/***================================================================***/
+/***================================================================***/
+/*
+ * BuildCharStrings routine
+ */
+/***================================================================***/
+
+static int BuildCharStrings(psfont *FontP)
+{
+ int N; /* number of values in CharStrings */
+ int i; /* loop thru Subrs */
+ int J; /* length of Subrs entry */
+ psdict *dictP;
+
+ /* next token should be a positive int */
+ N = getInt();
+ if (rc) {
+ /* check if file had TwoSubrs, hi resolution stuff is in file*/
+ if (TwoSubrs) {
+ do {
+ scan_token(inputP);
+ if (tokenType <= TOKEN_NONE) {
+ if (tokenTooLong) return(SCAN_OUT_OF_MEMORY);
+ return(SCAN_ERROR);
+ }
+ } while (tokenType != TOKEN_INTEGER);
+ N = tokenValue.integer;
+ }
+ else return(rc); /* if next token was not an Int */
+ }
+ if (N<=0) return(SCAN_ERROR);
+ /* save number of entries in the dictionary */
+
+ dictP = (psdict *)vm_alloc((N+1)*sizeof(psdict));
+ if (!(dictP)) return(SCAN_OUT_OF_MEMORY);
+ FontP->CharStringsP = dictP;
+ dictP[0].key.len = N;
+ /* get N values for CharStrings */
+ for (i=1;i<=N;i++) {
+ /* look for next literal name */
+ rc = getLiteralName(&(dictP[i].key));
+ if (rc) return(rc);
+ /* get 1 integer */
+ J = getInt();
+ if (rc) return(rc); /* if next token was not an Int */
+ if (J<0) return (SCAN_ERROR);
+ dictP[i].value.len = J;
+ /* get the next token, it should be RD or -|, either is ok */
+ rc = getNextValue(TOKEN_NAME);
+ if ( rc != SCAN_OK ) return(rc);
+ rc = getNbytes(J);
+ if (rc == SCAN_OK) {
+ dictP[i].value.data.valueP = tokenStartP;
+ if ( !(vm_alloc(J)) ) return(SCAN_OUT_OF_MEMORY);
+ }
+ else return(rc);
+ }
+ return(SCAN_OK);
+
+}
+/***================================================================***/
+/***================================================================***/
+/*
+ * BuildFontInfo Dictionary
+ */
+/***================================================================***/
+static int BuildFontInfo(psfont *fontP)
+{
+ psdict *dictP;
+
+ /* allocate the private dictionary */
+ dictP = (psdict *)vm_alloc(20*sizeof(psdict));
+ if (!(dictP)) return(SCAN_OUT_OF_MEMORY);
+
+ fontP->fontInfoP = dictP;
+ fontP->fontInfoP[0].key.len = 17; /* number of actual entries */
+ objFormatName(&(dictP[FONTNAME].key),8,"FontName");
+ objFormatName(&(dictP[FONTNAME].value),0,NULL);
+ objFormatName(&(dictP[PAINTTYPE].key),9,"PaintType");
+ objFormatInteger(&(dictP[PAINTTYPE].value),0);
+ objFormatName(&(dictP[FONTTYPENUM].key),8,"FontType");
+ objFormatInteger(&(dictP[FONTTYPENUM].value),0);
+ objFormatName(&(dictP[FONTMATRIX].key),10,"FontMatrix");
+ objFormatArray(&(dictP[FONTMATRIX].value),0,NULL);
+ objFormatName(&(dictP[FONTBBOX].key),8,"FontBBox");
+ objFormatArray(&(dictP[FONTBBOX].value),0,NULL);
+ objFormatName(&(dictP[ENCODING].key),8,"Encoding");
+ objFormatEncoding(&(dictP[ENCODING].value),0,NULL);
+ objFormatName(&(dictP[UNIQUEID].key),8,"UniqueID");
+ objFormatInteger(&(dictP[UNIQUEID].value),0);
+ objFormatName(&(dictP[STROKEWIDTH].key),11,"StrokeWidth");
+ objFormatReal(&(dictP[STROKEWIDTH].value),0.0);
+ objFormatName(&(dictP[VERSION].key),7,"version");
+ objFormatString(&(dictP[VERSION].value),0,NULL);
+ objFormatName(&(dictP[NOTICE].key),6,"Notice");
+ objFormatString(&(dictP[NOTICE].value),0,NULL);
+ objFormatName(&(dictP[FULLNAME].key),8,"FullName");
+ objFormatString(&(dictP[FULLNAME].value),0,NULL);
+ objFormatName(&(dictP[FAMILYNAME].key),10,"FamilyName");
+ objFormatString(&(dictP[FAMILYNAME].value),0,NULL);
+ objFormatName(&(dictP[WEIGHT].key),6,"Weight");
+ objFormatString(&(dictP[WEIGHT].value),0,NULL);
+ objFormatName(&(dictP[ITALICANGLE].key),11,"ItalicAngle");
+ objFormatReal(&(dictP[ITALICANGLE].value),0.0);
+ objFormatName(&(dictP[ISFIXEDPITCH].key),12,"isFixedPitch");
+ objFormatBoolean(&(dictP[ISFIXEDPITCH].value),FALSE);
+ objFormatName(&(dictP[UNDERLINEPOSITION].key),17,"UnderlinePosition");
+ objFormatReal(&(dictP[UNDERLINEPOSITION].value),0.0);
+ objFormatName(&(dictP[UNDERLINETHICKNESS].key),18,"UnderlineThickness");
+ objFormatReal(&(dictP[UNDERLINETHICKNESS].value),0.0);
+ return(SCAN_OK);
+}
+/***================================================================***/
+/*
+ * BuildPrivate Dictionary
+ */
+/***================================================================***/
+static int BuildPrivate(psfont *fontP)
+{
+ psdict *Private;
+
+ /* allocate the private dictionary */
+ Private = (psdict *)vm_alloc(20*sizeof(psdict));
+
+ if (!(Private)) return(SCAN_OUT_OF_MEMORY);
+
+ fontP->Private = Private;
+ fontP->Private[0].key.len = 16; /* number of actual entries */
+
+ objFormatName(&(Private[BLUEVALUES].key),10,"BlueValues");
+ objFormatArray(&(Private[BLUEVALUES].value),0,NULL);
+ objFormatName(&(Private[OTHERBLUES].key),10,"OtherBlues");
+ objFormatArray(&(Private[OTHERBLUES].value),0,NULL);
+ objFormatName(&(Private[FAMILYBLUES].key),11,"FamilyBlues");
+ objFormatArray(&(Private[FAMILYBLUES].value),0,NULL);
+ objFormatName(&(Private[FAMILYOTHERBLUES].key),16,"FamilyOtherBlues");
+ objFormatArray(&(Private[FAMILYOTHERBLUES].value),0,NULL);
+ objFormatName(&(Private[BLUESCALE].key),9,"BlueScale");
+ objFormatReal(&(Private[BLUESCALE].value),DEFAULTBLUESCALE);
+ objFormatName(&(Private[BLUESHIFT].key),9,"BlueShift");
+ objFormatInteger(&(Private[BLUESHIFT].value),DEFAULTBLUESHIFT);
+ objFormatName(&(Private[BLUEFUZZ].key),8,"BlueFuzz");
+ objFormatInteger(&(Private[BLUEFUZZ].value),DEFAULTBLUEFUZZ);
+ objFormatName(&(Private[STDHW].key),5,"StdHW");
+ objFormatArray(&(Private[STDHW].value),0,NULL);
+ objFormatName(&(Private[STDVW].key),5,"StdVW");
+ objFormatArray(&(Private[STDVW].value),0,NULL);
+ objFormatName(&(Private[STEMSNAPH].key),9,"StemSnapH");
+ objFormatArray(&(Private[STEMSNAPH].value),0,NULL);
+ objFormatName(&(Private[STEMSNAPV].key),9,"StemSnapV");
+ objFormatArray(&(Private[STEMSNAPV].value),0,NULL);
+ objFormatName(&(Private[FORCEBOLD].key),9,"ForceBold");
+ objFormatBoolean(&(Private[FORCEBOLD].value),DEFAULTFORCEBOLD);
+ objFormatName(&(Private[LANGUAGEGROUP].key),13,"LanguageGroup");
+ objFormatInteger(&(Private[LANGUAGEGROUP].value),DEFAULTLANGUAGEGROUP);
+ objFormatName(&(Private[LENIV].key),5,"LenIV");
+ objFormatInteger(&(Private[LENIV].value),DEFAULTLENIV);
+ objFormatName(&(Private[RNDSTEMUP].key),9,"RndStemUp");
+ objFormatBoolean(&(Private[RNDSTEMUP].value),DEFAULTRNDSTEMUP);
+ objFormatName(&(Private[EXPANSIONFACTOR].key),9,"ExpansionFactor");
+ objFormatReal(&(Private[EXPANSIONFACTOR].value),
+ DEFAULTEXPANSIONFACTOR);
+ return(SCAN_OK);
+}
+/***================================================================***/
+/**********************************************************************/
+/* GetType1Blues(fontP) */
+/* */
+/* Routine to support font-level hints. */
+/* */
+/* Gets all the Blues information from the Private dictionary */
+/* for the font. */
+/* */
+/* */
+/**********************************************************************/
+static int GetType1Blues(psfont *fontP)
+{
+ psdict *PrivateDictP; /* the Private dict relating to hints */
+ struct blues_struct *blues; /* ptr for the blues struct we will allocate */
+ int i;
+ psobj *HintEntryP;
+
+
+
+ /* get the Private dictionary pointer */
+ PrivateDictP = fontP->Private;
+
+ /* allocate the memory for the blues structure */
+ blues = (struct blues_struct *) vm_alloc(sizeof(struct blues_struct));
+
+ if (!blues) return(SCAN_OUT_OF_MEMORY);
+
+ /* Make fontP's blues ptr point to this newly allocated structure. */
+ fontP->BluesP = blues;
+
+ /* fill in the BlueValues array */
+ HintEntryP = &(PrivateDictP[BLUEVALUES].value);
+ /* check to see if the entry exists and if it's an array */
+ if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 ))
+ blues->numBlueValues = 0;
+ else {
+ /* get the number of values in the array */
+ if (HintEntryP->len > NUMBLUEVALUES) {
+ blues->numBlueValues = NUMBLUEVALUES;
+ } else
+ blues->numBlueValues = HintEntryP->len;
+ for (i = 0; i<= blues->numBlueValues-1; ++i) {
+ if (objPIsInteger(&HintEntryP->data.arrayP[i]))
+ blues->BlueValues[i] =
+ HintEntryP->data.arrayP[i].data.integer;
+ else if (objPIsReal(&HintEntryP->data.arrayP[i]))
+ blues->BlueValues[i] =
+ HintEntryP->data.arrayP[i].data.real;
+ else
+ blues->BlueValues[i] = 0;
+ }
+ }
+
+ /* fill in the OtherBlues array */
+ HintEntryP = &(PrivateDictP[OTHERBLUES].value);
+ /* check to see if the entry exists and if it's an array */
+ if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 ))
+ blues->numOtherBlues = 0;
+ else {
+ /* get the number of values in the array */
+ if (HintEntryP->len > NUMOTHERBLUES) {
+ blues->numOtherBlues = NUMOTHERBLUES;
+ } else
+ blues->numOtherBlues = HintEntryP->len;
+ for (i = 0; i<= blues->numOtherBlues-1; ++i) {
+ if (objPIsInteger(&HintEntryP->data.arrayP[i]))
+ blues->OtherBlues[i] =
+ HintEntryP->data.arrayP[i].data.integer;
+ else if (objPIsReal(&HintEntryP->data.arrayP[i]))
+ blues->OtherBlues[i] =
+ HintEntryP->data.arrayP[i].data.real;
+ else
+ blues->OtherBlues[i] = 0;
+ }
+ }
+
+ /* fill in the FamilyBlues array */
+ HintEntryP = &(PrivateDictP[FAMILYBLUES].value);
+ /* check to see if the entry exists and if it's an array */
+ if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 ))
+ blues->numFamilyBlues = 0;
+ else {
+ /* get the number of values in the array */
+ if (HintEntryP->len > NUMFAMILYBLUES) {
+ blues->numFamilyBlues = NUMFAMILYBLUES;
+ } else
+ blues->numFamilyBlues = HintEntryP->len;
+ for (i = 0; i<= blues->numFamilyBlues-1; ++i) {
+ if (objPIsInteger(&HintEntryP->data.arrayP[i]))
+ blues->FamilyBlues[i] =
+ HintEntryP->data.arrayP[i].data.integer;
+ else if (objPIsReal(&HintEntryP->data.arrayP[i]))
+ blues->FamilyBlues[i] =
+ HintEntryP->data.arrayP[i].data.real;
+ else
+ blues->FamilyBlues[i] = 0;
+ }
+ }
+
+ /* fill in the FamilyOtherBlues array */
+ HintEntryP = &(PrivateDictP[FAMILYOTHERBLUES].value);
+ /* check to see if the entry exists and if it's an array */
+ if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 ))
+ blues->numFamilyOtherBlues = 0;
+ else {
+ /* get the number of values in the array */
+ if (HintEntryP->len > NUMFAMILYOTHERBLUES) {
+ blues->numFamilyOtherBlues = NUMFAMILYOTHERBLUES;
+ } else
+ blues->numFamilyOtherBlues = HintEntryP->len;
+ for (i = 0; i<= blues->numFamilyOtherBlues-1; ++i) {
+ if (objPIsInteger(&HintEntryP->data.arrayP[i]))
+ blues->FamilyOtherBlues[i] =
+ HintEntryP->data.arrayP[i].data.integer;
+ else if (objPIsReal(&HintEntryP->data.arrayP[i]))
+ blues->FamilyOtherBlues[i] =
+ HintEntryP->data.arrayP[i].data.real;
+ else
+ blues->FamilyOtherBlues[i] = 0;
+ }
+ }
+
+ /* fill in the StemSnapH array */
+ HintEntryP = &(PrivateDictP[STEMSNAPH].value);
+ /* check to see if the entry exists and if it's an array */
+ if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 ))
+ blues->numStemSnapH = 0;
+ else {
+ /* get the number of values in the array */
+ if (HintEntryP->len > NUMSTEMSNAPH) {
+ blues->numStemSnapH = NUMSTEMSNAPH;
+ } else
+ blues->numStemSnapH = HintEntryP->len;
+ for (i = 0; i<= blues->numStemSnapH-1; ++i) {
+ if (objPIsInteger(&HintEntryP->data.arrayP[i]))
+ blues->StemSnapH[i] =
+ HintEntryP->data.arrayP[i].data.integer;
+ else if (objPIsReal(&HintEntryP->data.arrayP[i]))
+ blues->StemSnapH[i] =
+ HintEntryP->data.arrayP[i].data.real;
+ else
+ blues->StemSnapH[i] = 0;
+ }
+ }
+
+ /* fill in the StemSnapV array */
+ HintEntryP = &(PrivateDictP[STEMSNAPV].value);
+ /* check to see if the entry exists and if it's an array */
+ if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 ))
+ blues->numStemSnapV = 0;
+ else {
+ /* get the number of values in the array */
+ if (HintEntryP->len > NUMSTEMSNAPV) {
+ blues->numStemSnapV = NUMSTEMSNAPV;
+ } else
+ blues->numStemSnapV = HintEntryP->len;
+ for (i = 0; i<= blues->numStemSnapV-1; ++i) {
+ if (objPIsInteger(&HintEntryP->data.arrayP[i]))
+ blues->StemSnapV[i] =
+ HintEntryP->data.arrayP[i].data.integer;
+ else if (objPIsReal(&HintEntryP->data.arrayP[i]))
+ blues->StemSnapV[i] =
+ HintEntryP->data.arrayP[i].data.real;
+ else
+ blues->StemSnapV[i] = 0;
+ }
+ }
+
+ /* fill in the StdVW array */
+ HintEntryP = &(PrivateDictP[STDVW].value);
+ /* check to see if the entry exists and if it's an array */
+ if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 ))
+ /* a value of zero signifies no entry */
+ blues->StdVW = 0;
+ else {
+ if (HintEntryP->len > NUMSTDVW) {
+ }
+ if (objPIsInteger(&HintEntryP->data.arrayP[0]))
+ blues->StdVW = HintEntryP->data.arrayP[0].data.integer;
+ else if (objPIsReal(&HintEntryP->data.arrayP[0]))
+ blues->StdVW = HintEntryP->data.arrayP[0].data.real;
+ else
+ blues->StdVW = 0;
+ }
+
+ /* fill in the StdHW array */
+ HintEntryP = &(PrivateDictP[STDHW].value);
+ /* check to see if the entry exists and if it's an array */
+ if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 ))
+ /* a value of zero signifies no entry */
+ blues->StdHW = 0;
+ else {
+ if (HintEntryP->len > NUMSTDHW) {
+ }
+ if (objPIsInteger(&HintEntryP->data.arrayP[0]))
+ blues->StdHW = HintEntryP->data.arrayP[0].data.integer;
+ else if (objPIsReal(&HintEntryP->data.arrayP[0]))
+ blues->StdHW = HintEntryP->data.arrayP[0].data.real;
+ else
+ blues->StdHW = 0;
+ }
+
+
+ /* get the ptr to the BlueScale entry */
+ HintEntryP = &(PrivateDictP[BLUESCALE].value);
+ /* put the BlueScale in the blues structure */
+ if (objPIsInteger(HintEntryP)) /* Must be integer! */
+ blues->BlueScale = HintEntryP->data.integer;
+ else if (objPIsReal(HintEntryP)) /* Error? */
+ blues->BlueScale = HintEntryP->data.real;
+ else
+ blues->BlueScale = DEFAULTBLUESCALE;
+
+ /* get the ptr to the BlueShift entry */
+ HintEntryP = &(PrivateDictP[BLUESHIFT].value);
+ if (objPIsInteger(HintEntryP)) /* Must be integer! */
+ blues->BlueShift = HintEntryP->data.integer;
+ else if (objPIsReal(HintEntryP)) /* Error? */
+ blues->BlueShift = HintEntryP->data.real;
+ else
+ blues->BlueShift = DEFAULTBLUESHIFT;
+
+ /* get the ptr to the BlueFuzz entry */
+ HintEntryP = &(PrivateDictP[BLUEFUZZ].value);
+ if (objPIsInteger(HintEntryP)) /* Must be integer! */
+ blues->BlueFuzz = HintEntryP->data.integer;
+ else if (objPIsReal(HintEntryP)) /* Error? */
+ blues->BlueFuzz = HintEntryP->data.real;
+ else
+ blues->BlueFuzz = DEFAULTBLUEFUZZ;
+
+ /* get the ptr to the ForceBold entry */
+ HintEntryP = &(PrivateDictP[FORCEBOLD].value);
+ if (objPIsBoolean(HintEntryP)) /* Must be integer! */
+ blues->ForceBold = HintEntryP->data.boolean;
+ else
+ blues->ForceBold = DEFAULTFORCEBOLD;
+
+ /* get the ptr to the LanguageGroup entry */
+ HintEntryP = &(PrivateDictP[LANGUAGEGROUP].value);
+ if (objPIsInteger(HintEntryP)) /* Must be integer! */
+ blues->LanguageGroup = HintEntryP->data.integer;
+ else
+ blues->LanguageGroup = DEFAULTLANGUAGEGROUP;
+
+ /* get the ptr to the RndStemUp entry */
+ HintEntryP = &(PrivateDictP[RNDSTEMUP].value);
+ if (objPIsBoolean(HintEntryP)) /* Must be integer! */
+ blues->RndStemUp = HintEntryP->data.boolean;
+ else
+ blues->RndStemUp = DEFAULTRNDSTEMUP;
+
+ /* get the ptr to the lenIV entry */
+ HintEntryP = &(PrivateDictP[LENIV].value);
+ if (objPIsInteger(HintEntryP)) /* Must be integer! */
+ blues->lenIV = HintEntryP->data.integer;
+ else
+ blues->lenIV = DEFAULTLENIV;
+
+ /* get the ptr to the ExpansionFactor entry */
+ HintEntryP = &(PrivateDictP[EXPANSIONFACTOR].value);
+ if (objPIsInteger(HintEntryP))
+ blues->ExpansionFactor = HintEntryP->data.integer;
+ else if (objPIsReal(HintEntryP))
+ blues->ExpansionFactor = HintEntryP->data.real;
+ else
+ blues->ExpansionFactor = DEFAULTEXPANSIONFACTOR;
+ return(SCAN_OK);
+}
+/**********************************************************************/
+/* GetType1CharString(fontP,code) */
+/* */
+/* Look up code in the standard encoding vector and return */
+/* the charstring associated with the character name. */
+/* */
+/* fontP is the psfont structure. */
+/* */
+/* Returns a psobj (string) */
+/**********************************************************************/
+psobj *GetType1CharString(psfont *fontP, unsigned char code)
+{
+ int N; /* the 'Nth' entry in the CharStrings */
+ psobj *charnameP; /* points to psobj that is name of character*/
+
+ psdict *CharStringsDictP; /* dictionary with char strings */
+ psobj *theStringP; /* the definition for the code */
+
+
+
+ if (StdEncArrayP == NULL) {
+ return(NULL);
+ }
+ /* use the code to index into the standard encoding vector */
+ charnameP = &(StdEncArrayP[code]);
+
+ /* test if the encoding array points to a name */
+ if (!(objPIsName(charnameP)) ) {
+ return(NULL);
+ }
+
+ /* Now that we have the character name out of the standardencoding */
+ /* get the character definition out of the current font */
+ CharStringsDictP = fontP->CharStringsP;
+
+ /* search the chars string for this charname as key */
+ N = SearchDictName(CharStringsDictP,charnameP);
+ if (N<=0) {
+ return(NULL);
+ }
+ /* OK, the nth item is the psobj that is the string for this char */
+ theStringP = &(CharStringsDictP[N].value);
+
+ return(theStringP);
+}
+
+/***================================================================***/
+/*
+ * FindDictValue
+ */
+/***================================================================***/
+
+static int FindDictValue(psdict *dictP)
+{
+ psobj LitName;
+ int N;
+ int V;
+
+ /* we have just scanned a token and it is a literal name */
+ /* need to check if that name is in Private dictionary */
+ objFormatName(&LitName,tokenLength,tokenStartP);
+ /* is it in the dictP */
+ N = SearchDictName(dictP,&LitName);
+ /* if found */
+ if ( N > 0 ) {
+ /* what type */
+ switch (dictP[N].value.type) {
+ case OBJ_ENCODING:
+ V = getEncoding(&(dictP[N].value));
+ if ( V != SCAN_OK ) return(V);
+ break;
+ case OBJ_ARRAY:
+ V = getArray(&(dictP[N].value));
+ if ( V != SCAN_OK ) return(V);
+ break;
+ case OBJ_INTEGER:
+ /* next value in integer */
+ dictP[N].value.data.integer = getInt();
+ if (rc) return(rc); /* if next token was not an Int */
+ break;
+ case OBJ_REAL:
+ /* next value must be real or int, store as a real */
+ scan_token(inputP);
+ if (tokenType == TOKEN_REAL) {
+ dictP[N].value.data.real = tokenValue.real;
+ }
+ else
+ if (tokenType == TOKEN_INTEGER) {
+ dictP[N].value.data.real = tokenValue.integer;
+ }
+ else return(SCAN_ERROR);
+ break;
+ case OBJ_NAME:
+ V = getNextValue(TOKEN_LITERAL_NAME);
+ if ( V != SCAN_OK ) return(V);
+ if (!(vm_alloc(tokenLength)) ) return(SCAN_OUT_OF_MEMORY);
+ objFormatName(&(dictP[N].value),tokenLength,tokenStartP);
+ break;
+ case OBJ_STRING:
+ V = getNextValue(TOKEN_STRING);
+ if ( V != SCAN_OK ) return(V);
+ if (!(vm_alloc(tokenLength)) ) return(SCAN_OUT_OF_MEMORY);
+ objFormatString(&(dictP[N].value),tokenLength,tokenStartP);
+ break;
+ case OBJ_BOOLEAN:
+ scan_token(inputP);
+ if (tokenType != TOKEN_NAME) {
+ return(SCAN_ERROR);
+ }
+ if (0 == strncmp(tokenStartP,"true",4) ) {
+ dictP[N].value.data.boolean =TRUE;
+ }
+ else
+ if (0 == strncmp(tokenStartP,"false",5) ) {
+ dictP[N].value.data.boolean =FALSE;
+ }
+ else return(SCAN_ERROR);
+ break;
+
+ default:
+ return(SCAN_ERROR);
+ break;
+ }
+ }
+ /* Name is not in dictionary. That is ok. */
+ return(SCAN_OK);
+
+}
+/***================================================================***/
+
+/*
+ * -------------------------------------------------------------------
+ * Scan the next token and convert it into an object
+ * Result is placed on the Operand Stack as next object
+ * -------------------------------------------------------------------
+ */
+int scan_font(psfont *FontP)
+{
+
+
+ char filename[128];
+ char filetype[3];
+ FILE *fileP;
+ const char *nameP;
+ int namelen;
+ int V;
+ int i;
+ boolean starthex80;
+
+ starthex80 = FALSE;
+ filetype[0] = 'r';
+ filetype[1] = 'b';
+ filetype[2] = '\0';
+ /* copy the filename and remove leading or trailing blanks */
+ /* point to name and search for leading blanks */
+ nameP= FontP->FontFileName.data.nameP;
+ namelen = FontP->FontFileName.len;
+ while (nameP[0] == ' ') {
+ nameP++;
+ namelen--;
+ }
+ /* now remove any trailing blanks */
+ while ((namelen>0) && ( nameP[namelen-1] == ' ')) {
+ namelen--;
+ }
+ strncpy(filename,nameP,namelen);
+ filename[namelen] = '\0';
+ /* file name is now constructed */
+ inputFile.data.fileP = NULL;
+ filterFile.data.fileP = NULL;
+
+ inputP = &inputFile;
+ if ((fileP = fopen(filename,filetype))) {
+ /* get the first byte of file */
+ V = getc(fileP);
+ /* if file starts with x'80' then skip next 5 bytes */
+ if ( V == 0X80 ) {
+ for (i=0;i<5;i++) V = getc(fileP);
+ starthex80 = TRUE;
+ }
+ else ungetc(V,fileP);
+ objFormatFile(inputP,fileP);
+ }
+ else {
+ return(SCAN_FILE_OPEN_ERROR);
+ };
+
+ WantFontInfo = TRUE;
+ InPrivateDict = FALSE;
+ TwoSubrs = FALSE;
+ rc = BuildFontInfo(FontP);
+ if (rc != 0) return(rc);
+
+ /* Assume everything will be OK */
+ rc = 0;
+
+ /* Loop until complete font is read */
+ do {
+ /* Scan the next token */
+ scan_token(inputP);
+
+ /* ==> tokenLength, tokenTooLong, tokenType, and tokenValue are */
+ /* now set */
+
+ switch (tokenType) {
+ case TOKEN_EOF:
+ case TOKEN_NONE:
+ case TOKEN_INVALID:
+ /* in this case we are done */
+ if (tokenTooLong) return(SCAN_OUT_OF_MEMORY);
+ rc = SCAN_ERROR;
+ break;
+ case TOKEN_LITERAL_NAME:
+ /* Look up the name */
+ tokenStartP[tokenLength] = '\0';
+ if (InPrivateDict ) {
+ if (0== strncmp(tokenStartP,"Subrs",5) ) {
+ rc = BuildSubrs(FontP);
+ break;
+ }
+ if (0== strncmp(tokenStartP,"CharStrings",11) ) {
+ rc = BuildCharStrings(FontP);
+ if ( (rc == SCAN_OK) ||(rc == SCAN_END) ) {
+ fclose(inputP->data.fileP);
+ /* Build the Blues Structure */
+ rc = GetType1Blues(FontP);
+ /* whatever the return code, return it */
+ /* all the work is done. This is the normal exit.*/
+ return(rc);
+ }
+ break;
+ }
+ rc = FindDictValue(FontP->Private);
+ /* we are not going to report errors */
+ /* Sometimes the font file may test a value such as */
+ /* testing to see if the font is alreadly loaded with */
+ /* same UniqueID. We would faile on /UniqueID get */
+ /* because we are expecting a int to follow UniqueID*/
+ /* If the correct object type does not follow a Name*/
+ /* then we will skip over it without reporting error*/
+ rc = SCAN_OK;
+ break;
+ } /* end of reading Private dictionary */
+ else
+ if (0== strncmp(tokenStartP,"Private",7) ) {
+ InPrivateDict = TRUE;
+ rc = BuildPrivate(FontP);
+ break;
+ }
+ else
+ if (WantFontInfo) {
+ rc = FindDictValue(FontP->fontInfoP);
+ /* we are not going to report errors */
+ rc = SCAN_OK;
+ break;
+ }
+ break;
+ case TOKEN_NAME:
+ if (0 == strncmp(tokenStartP,"eexec",5) ) {
+ /* if file started with x'80', check next 5 bytes */
+ if (starthex80) {
+ V = getc(fileP);
+ if ( V == 0X80 ) {
+ for (i=0;i<5;i++) V = getc(fileP);
+ }
+ else ungetc(V,fileP);
+ }
+ filterFile.data.fileP = T1eexec(inputP->data.fileP);
+ if (filterFile.data.fileP == NULL) {
+ fclose(inputFile.data.fileP);
+ return(SCAN_FILE_OPEN_ERROR);
+ }
+ inputP = &filterFile;
+
+ WantFontInfo = FALSE;
+ }
+ break;
+ }
+
+ }
+ while (rc ==0);
+ fclose(inputP->data.fileP);
+ if (tokenTooLong) return(SCAN_OUT_OF_MEMORY);
+ return(rc);
+}
+
diff --git a/fonts/utilities/ps2pk/sexpr.c b/fonts/utilities/ps2pk/sexpr.c
new file mode 100644
index 0000000000..d069cce1c0
--- /dev/null
+++ b/fonts/utilities/ps2pk/sexpr.c
@@ -0,0 +1,25 @@
+/*
+ * File: sexpr.c
+ * Purpose: evaluate algebraic expression from single argument
+ * (Derived from expr.c from J.T. Conklin <jtc@netbsd.org>.)
+ * Version: 1.0 (Nov 1995)
+ * Author: Piet Tutelaers
+ */
+
+#include <stdio.h>
+#include "strexpr.h" /* strexpr() */
+#include "basics.h" /* fatal() */
+
+int main(int argc, char *argv[]) {
+ int result;
+
+ if (argc < 2) fatal("Usage: sexpr expression ...\n");
+
+ while (--argc > 0) {
+ if (strexpr(&result, *++argv))
+ fatal("expression error\n");
+
+ printf("%s = %d\n", argv[0] , result);
+ }
+ exit(0);
+}
diff --git a/fonts/utilities/ps2pk/spaces.c b/fonts/utilities/ps2pk/spaces.c
new file mode 100644
index 0000000000..a8845e3a22
--- /dev/null
+++ b/fonts/utilities/ps2pk/spaces.c
@@ -0,0 +1,999 @@
+/* $XConsortium: spaces.c,v 1.4 91/10/10 11:19:16 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+ /* SPACES CWEB V0021 ******** */
+/*
+:h1 id=spaces.SPACES Module - Handles Coordinate Spaces
+
+This module is responsible for handling the TYPE1IMAGER "XYspace" object.
+
+&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com)
+
+
+:h3.Include Files
+*/
+#include "types.h"
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "pictures.h"
+#include "fonts.h"
+#include "arith.h"
+
+static void FindFfcn(DOUBLE, DOUBLE, fractpel (**)());
+static void FindIfcn(DOUBLE, DOUBLE, fractpel *, fractpel *, fractpel (**)());
+/*
+:h3.Entry Points Provided to the TYPE1IMAGER User
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h3.Entry Points Provided to Other Modules
+*/
+
+/*
+In addition, other modules call the SPACES module through function
+vectors in the "XYspace" structure. The entry points accessed that
+way are "FConvert()", "IConvert()", and "ForceFloat()".
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h3.Macros and Typedefs Provided to Other Modules
+
+:h4.Duplicating and Killing Spaces
+
+Destroying XYspaces is so simple we can do it with a
+macro:
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+On the other hand, duplicating XYspaces is slightly more difficult
+because of the need to keep a unique ID in the space, see
+:hdref refid=dupspace..
+
+:h4.Fixed Point Pel Representation
+
+We represent pel positions with fixed point numbers. This does NOT
+mean integer, but truly means fixed point, with a certain number
+of binary digits (FRACTBITS) representing the fractional part of the
+pel.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+/*
+:h2.Data Structures for Coordinate Spaces and Points
+*/
+/*
+:h3 id=matrix.Matrices
+
+TYPE1IMAGER uses 2x2 transformation matrices. We'll use C notation for
+such a matrix (M[2][2]), the first index being rows, the second columns.
+*/
+
+/*
+:h3.The "doublematrix" Structure
+
+We frequently find it desirable to store both a matrix and its
+inverse. We store these in a "doublematrix" structure.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h3.The "XYspace" Structure
+
+The XYspace structure represents the XYspace object.
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+#define RESERVED 10 /* 'n' IDs are reserved for invalid & immortal spaces */
+/*
+*/
+#define NEXTID ((SpaceID < RESERVED) ? (SpaceID = RESERVED) : ++SpaceID)
+
+static unsigned int SpaceID = 1;
+
+struct XYspace *CopySpace(register struct XYspace *S)
+{
+ S = (struct XYspace *)Allocate(sizeof(struct XYspace), S, 0);
+ S->ID = NEXTID;
+ return(S);
+}
+/*
+:h3.The "fractpoint" Structure
+
+A fractional point is just a "fractpel" x and y:
+*/
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h3.Lazy Evaluation of Matrix Inverses
+
+Calculating the inverse of a matrix is somewhat involved, and we usually
+do not need them. So, we flag whether or not the space has the inverse
+already calculated:
+*/
+
+#define HASINVERSE(flag) ((flag)&0x80)
+
+/*
+The following macro forces a space to have an inverse:
+*/
+
+#define CoerceInverse(S) if (!HASINVERSE((S)->flag)) { \
+ MatrixInvert((S)->tofract.normal, (S)->tofract.inverse); (S)->flag |= HASINVERSE(ON); }
+/*
+:h3.IDENTITY Space
+
+IDENTITY space is (logically) the space corresponding to the identity
+transformation matrix. However, since all our transformation matrices
+have a common FRACTFLOAT scale factor to convert to 'fractpel's, that
+is actually what we store in 'tofract' matrix of IDENTITY:
+*/
+
+static struct XYspace identity = { SPACETYPE, ISPERMANENT(ON) + ISIMMORTAL(ON)
+ + HASINVERSE(ON), 2, /* added 3-26-91 PNM */
+ NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ INVALIDID + 1, 0,
+ { { { FRACTFLOAT, 0.0 }, { 0.0, FRACTFLOAT } },
+ { { 1.0/FRACTFLOAT, 0.0 }, { 0.0, 1.0/FRACTFLOAT } } },
+ { { 0, 0 }, { 0, 0 } } };
+struct XYspace *IDENTITY = &identity;
+
+/*
+*/
+#define MAXCONTEXTS 16
+
+static struct doublematrix contexts[MAXCONTEXTS];
+
+#if 0
+
+static int nextcontext = 1;
+
+/*SHARED LINE(S) ORIGINATED HERE*/
+
+/*
+:h3.FindDeviceContext() - Find the Context Given a Device
+
+This routine, given a device, returns the index of the device's
+transformation matrix in the context array. If it cannot find it,
+it will allocate a new array entry and fill it out.
+*/
+
+static int FindDeviceContext(
+ void *device) /* device token */
+{
+ DOUBLE M[2][2]; /* temporary matrix */
+ float Xres,Yres; /* device resolution */
+ int orient = -1; /* device orientation */
+ int rc = -1; /* return code for QueryDeviceState */
+
+ if (rc != 0) /* we only bother with this check once */
+ t1_abort("Context: QueryDeviceState didn't work");
+
+ M[0][0] = M[1][0] = M[0][1] = M[1][1] = 0.0;
+
+ switch (orient) {
+ case 0:
+ M[0][0] = Xres; M[1][1] = -Yres;
+ break;
+ case 1:
+ M[1][0] = Yres; M[0][1] = Xres;
+ break;
+ case 2:
+ M[0][0] = -Xres; M[1][1] = Yres;
+ break;
+ case 3:
+ M[1][0] = -Yres; M[0][1] = -Xres;
+ break;
+ default:
+ t1_abort("QueryDeviceState returned invalid orientation");
+ }
+ return(FindContext(M));
+}
+
+/*
+:h3.FindContext() - Find the Context Given a Matrix
+
+This routine, given a matrix, returns the index of that matrix matrix in
+the context array. If it cannot find it, it will allocate a new array
+entry and fill it out.
+*/
+
+int FindContext(
+ DOUBLE M[2][2]) /* array to search for */
+{
+ register int i; /* loop variable for search */
+ for (i=0; i < nextcontext; i++)
+ if (M[0][0] == contexts[i].normal[0][0] && M[1][0] == contexts[i].normal[1][0]
+ && M[0][1] == contexts[i].normal[0][1] && M[1][1] == contexts[i].normal[1][1])
+ break;
+
+ if (i >= nextcontext) {
+ if (i >= MAXCONTEXTS)
+ t1_abort("Context: out of them");
+ INT32COPY(contexts[i].normal, M, sizeof(contexts[i].normal));
+ MatrixInvert(M, contexts[i].inverse);
+ nextcontext++;
+ }
+
+ return(i);
+}
+
+/*
+:h3.Context() - Create a Coordinate Space for a Device
+
+This user operator is implemented by first finding the device context
+array index, then transforming IDENTITY space to create an appropriate
+cooridnate space.
+*/
+
+struct XYspace *Context(
+ void *device, /* device token */
+ DOUBLE units) /* multiples of one inch */
+{
+ DOUBLE M[2][2]; /* device transformation matrix */
+ register int n; /* will hold device context number */
+ register struct XYspace *S; /* XYspace constructed */
+
+ IfTrace2((MustTraceCalls),"Context(%p, %f)\n", device, units);
+
+ ARGCHECK((device == NULL), "Context of NULLDEVICE not allowed",
+ NULL, IDENTITY, (0), struct XYspace *);
+ ARGCHECK((units == 0.0), "Context: bad units", NULL, IDENTITY, (0), struct XYspace *);
+
+ n = FindDeviceContext(device);
+
+ INT32COPY(M, contexts[n].normal, sizeof(M));
+
+ M[0][0] *= units;
+ M[0][1] *= units;
+ M[1][0] *= units;
+ M[1][1] *= units;
+
+ S = (struct XYspace *)Xform(IDENTITY, M);
+
+ S->context = n;
+ return(S);
+}
+#endif
+
+/*
+:h3.ConsiderContext() - Adjust a Matrix to Take Out Device Transform
+
+Remember, we have :f/x times U times D/ and :f/M/ and and we want :f/x
+times U times M times D/. An easy way to do this is to calculate
+:f/D sup <-1> times M times D/, because:
+:formula.
+x times U times D times D sup <-1> times M times D = x times U times M times D
+:formula.
+So this subroutine, given an :f/M/and an object, finds the :f/D/ for that
+object and modifies :f/M/ so it is :f/D sup <-1> times M times D/.
+*/
+
+static void ConsiderContext(
+ register struct xobject *obj, /* object to be transformed */
+ register DOUBLE M[2][2]) /* matrix (may be changed) */
+{
+ register int context; /* index in contexts array */
+
+ if (obj == NULL) return;
+
+ if (ISPATHTYPE(obj->type)) {
+ struct segment *path = (struct segment *) obj;
+
+ context = path->context;
+ }
+ else if (obj->type == SPACETYPE) {
+ struct XYspace *S = (struct XYspace *) obj;
+
+ context = S->context;
+ }
+ else if (obj->type == PICTURETYPE) {
+ context = NULLCONTEXT;
+ }
+ else
+ context = NULLCONTEXT;
+
+ if (context != NULLCONTEXT) {
+ MatrixMultiply(contexts[context].inverse, M, M);
+ MatrixMultiply(M, contexts[context].normal, M);
+ }
+}
+
+/*
+:h2.Conversion from User's X,Y to "fractpel" X,Y
+
+When the user is building paths (lines, moves, curves, etc.) he passes
+the control points (x,y) for the paths together with an XYspace. We
+must convert from the user's (x,y) to our internal representation
+which is in pels (fractpels, actually). This involves transforming
+the user's (x,y) under the coordinate space transformation. It is
+important that we do this quickly. So, we store pointers to different
+conversion functions right in the XYspace structure. This allows us
+to have simpler special case functions for the more commonly
+encountered types of transformations.
+
+:h3.Convert(), IConvert(), and ForceFloat() - Called Through "XYspace" Structure
+
+These are functions that fit in the "convert" and "iconvert" function
+pointers in the XYspace structure. They call the "xconvert", "yconvert",
+"ixconvert", and "iyconvert" as appropriate to actually do the work.
+These secondary routines come in many flavors to handle different
+special cases as quickly as possible.
+*/
+
+static void FXYConvert(
+ register struct fractpoint *pt, /* point to set */
+ register struct XYspace *S, /* relevant coordinate space */
+ register DOUBLE x, register DOUBLE y) /* user's coordinates of point */
+{
+ pt->x = (*S->xconvert)(S->tofract.normal[0][0], S->tofract.normal[1][0], x, y);
+ pt->y = (*S->yconvert)(S->tofract.normal[0][1], S->tofract.normal[1][1], x, y);
+}
+
+static void IXYConvert(
+ register struct fractpoint *pt, /* point to set */
+ register struct XYspace *S, /* relevant coordinate space */
+ register int32_t x, register int32_t y)
+ /* user's coordinates of point */
+{
+ pt->x = (*S->ixconvert)(S->itofract[0][0], S->itofract[1][0], x, y);
+ pt->y = (*S->iyconvert)(S->itofract[0][1], S->itofract[1][1], x, y);
+}
+
+/*
+ForceFloat is a substitute for IConvert(), when we just do not have
+enough significant digits in the coefficients to get high enough
+precision in the answer with fixed point arithmetic. So, we force the
+integers to floats, and do the arithmetic all with floats:
+*/
+
+static void ForceFloat(
+ register struct fractpoint *pt, /* point to set */
+ register struct XYspace *S, /* relevant coordinate space */
+ register int32_t x, register int32_t y)
+ /* user's coordinates of point */
+{
+ (*S->convert)(pt, S, (DOUBLE) x, (DOUBLE) y);
+}
+
+/*
+:h3.FXYboth(), FXonly(), FYonly() - Floating Point Conversion
+
+These are the routines we use when the user has given us floating
+point numbers for x and y. FXYboth() is the general purpose routine;
+FXonly() and FYonly() are special cases when one of the coefficients
+is 0.0.
+*/
+
+static fractpel FXYboth(
+ register DOUBLE cx, register DOUBLE cy, /* x and y coefficients */
+ register DOUBLE x, register DOUBLE y) /* user x,y */
+{
+ register DOUBLE r; /* temporary float */
+
+ r = x * cx + y * cy;
+ return((fractpel) r);
+}
+
+/*ARGSUSED*/
+static fractpel FXonly(
+ register DOUBLE cx, register DOUBLE cy, /* x and y coefficients */
+ register DOUBLE x, register DOUBLE y) /* user x,y */
+{
+ register DOUBLE r; /* temporary float */
+
+ r = x * cx;
+ return((fractpel) r);
+}
+
+/*ARGSUSED*/
+static fractpel FYonly(
+ register DOUBLE cx, register DOUBLE cy, /* x and y coefficients */
+ register DOUBLE x, register DOUBLE y) /* user x,y */
+{
+ register DOUBLE r; /* temporary float */
+
+ r = y * cy;
+ return((fractpel) r);
+}
+
+/*
+:h3.IXYboth(), IXonly(), IYonly() - Simple Integer Conversion
+
+These are the routines we use when the user has given us integers for
+x and y, and the coefficients have enough significant digits to
+provide precise answers with only "long" (32 bit?) multiplication.
+IXYboth() is the general purpose routine; IXonly() and IYonly() are
+special cases when one of the coefficients is 0.
+*/
+
+static fractpel IXYboth(
+ register fractpel cx, register fractpel cy, /* x and y coefficients */
+ register int32_t x, register int32_t y) /* user x,y */
+{
+ return(x * cx + y * cy);
+}
+
+/*ARGSUSED*/
+static fractpel IXonly(
+ register fractpel cx, register fractpel cy, /* x and y coefficients */
+ register int32_t x, register int32_t y) /* user x,y */
+{
+ return(x * cx);
+}
+
+/*ARGSUSED*/
+static fractpel IYonly(
+ register fractpel cx, register fractpel cy, /* x and y coefficients */
+ register int32_t x, register int32_t y) /* user x,y */
+{
+ return(y * cy);
+}
+
+
+/*
+:h3.FPXYboth(), FPXonly(), FPYonly() - More Involved Integer Conversion
+
+These are the routines we use when the user has given us integers for
+x and y, but the coefficients do not have enough significant digits to
+provide precise answers with only "long" (32 bit?) multiplication.
+We have increased the number of significant bits in the coefficients
+by FRACTBITS; therefore we must use "double long" (64 bit?)
+multiplication by calling FPmult(). FPXYboth() is the general purpose
+routine; FPXonly() and FPYonly() are special cases when one of the
+coefficients is 0.
+
+Note that it is perfectly possible for us to calculate X with the
+"FP" method and Y with the "I" method, or vice versa. It all depends
+on how the functions in the XYspace structure are filled out.
+*/
+
+static fractpel FPXYboth(
+ register fractpel cx, register fractpel cy, /* x and y coefficients */
+ register int32_t x, register int32_t y) /* user x,y */
+{
+ return( FPmult(x, cx) + FPmult(y, cy) );
+}
+
+/*ARGSUSED*/
+static fractpel FPXonly(
+ register fractpel cx, register fractpel cy, /* x and y coefficients */
+ register int32_t x, register int32_t y) /* user x,y */
+{
+ return( FPmult(x, cx) );
+}
+
+/*ARGSUSED*/
+static fractpel FPYonly(
+ register fractpel cx, register fractpel cy, /* x and y coefficients */
+ register int32_t x, register int32_t y) /* user x,y */
+{
+ return( FPmult(y, cy) );
+}
+
+
+
+/*
+:h3.FillOutFcns() - Determine the Appropriate Functions to Use for Conversion
+
+This function fills out the "convert" and "iconvert" function pointers
+in an XYspace structure, and also fills the "helper"
+functions that actually do the work.
+*/
+
+static void FillOutFcns(
+ register struct XYspace *S) /* functions will be set in this structure */
+{
+ S->convert = FXYConvert;
+ S->iconvert = IXYConvert;
+
+ FindFfcn(S->tofract.normal[0][0], S->tofract.normal[1][0], &S->xconvert);
+ FindFfcn(S->tofract.normal[0][1], S->tofract.normal[1][1], &S->yconvert);
+ FindIfcn(S->tofract.normal[0][0], S->tofract.normal[1][0],
+ &S->itofract[0][0], &S->itofract[1][0], &S->ixconvert);
+ FindIfcn(S->tofract.normal[0][1], S->tofract.normal[1][1],
+ &S->itofract[0][1], &S->itofract[1][1], &S->iyconvert);
+
+ if (S->ixconvert == NULL || S->iyconvert == NULL)
+ S->iconvert = ForceFloat;
+}
+
+/*
+:h4.FindFfcn() - Subroutine of FillOutFcns() to Fill Out Floating Functions
+
+This function tests for the special case of one of the coefficients
+being zero:
+*/
+
+static void FindFfcn(
+ register DOUBLE cx, register DOUBLE cy, /* x and y coefficients */
+ register fractpel (**fcnP)()) /* pointer to function to set */
+{
+ if (cx == 0.0)
+ *fcnP = FYonly;
+ else if (cy == 0.0)
+ *fcnP = FXonly;
+ else
+ *fcnP = FXYboth;
+}
+
+/*
+:h4.FindIfcn() - Subroutine of FillOutFcns() to Fill Out Integer Functions
+
+There are two types of integer functions, the 'I' type and the 'FP' type.
+We use the I type functions when we are satisfied with simple integer
+arithmetic. We used the FP functions when we feel we need higher
+precision (but still fixed point) arithmetic. If all else fails,
+we store a NULL indicating that this we should do the conversion in
+floating point.
+*/
+
+static void FindIfcn(
+ register DOUBLE cx, DOUBLE cy, /* x and y coefficients */
+ register fractpel *icxP, /* fixed point ... */
+ register fractpel *icyP, /* ... coefficients to set */
+ register fractpel (**fcnP)()) /* pointer to function to set */
+{
+ register fractpel imax; /* maximum of cx and cy */
+
+ *icxP = cx;
+ *icyP = cy;
+
+ if (cx != (float) (*icxP) || cy != (float) (*icyP)) {
+/*
+At this point we know our integer approximations of the coefficients
+are not exact. However, we will still use them if the maximum
+coefficient will not fit in a 'fractpel'. Of course, we have little
+choice at that point, but we haven't lost that much precision by
+staying with integer arithmetic. We have enough significant digits
+so that
+any error we introduce is less than one part in 2:sup/16/.
+*/
+
+ imax = MAX(ABS(*icxP), ABS(*icyP));
+ if (imax < (fractpel) (1<<(FRACTBITS-1)) ) {
+/*
+At this point we know our integer approximations just do not have
+enough significant digits for accuracy. We will add FRACTBITS
+significant digits to the coefficients (by multiplying them by
+1<<FRACTBITS) and go to the "FP" form of the functions. First, we
+check to see if we have ANY significant digits at all (that is, if
+imax == 0). If we don't, we suspect that adding FRACTBITS digits
+won't help, so we punt the whole thing.
+*/
+ if (imax == 0) {
+ *fcnP = NULL;
+ return;
+ }
+ cx *= FRACTFLOAT;
+ cy *= FRACTFLOAT;
+ *icxP = cx;
+ *icyP = cy;
+ *fcnP = FPXYboth;
+ }
+ else
+ *fcnP = IXYboth;
+ }
+ else
+ *fcnP = IXYboth;
+/*
+Now we check for special cases where one coefficient is zero (after
+integer conversion):
+*/
+ if (*icxP == 0)
+ *fcnP = (*fcnP == FPXYboth) ? FPYonly : IYonly;
+ else if (*icyP == 0)
+ *fcnP = (*fcnP == FPXYboth) ? FPXonly : IXonly;
+}
+/*
+:h3.UnConvert() - Find User Coordinates From FractPoints
+
+The interesting thing with this routine is that we avoid calculating
+the matrix inverse of the device transformation until we really need
+it, which is to say, until this routine is called for the first time
+with a given coordinate space.
+
+We also only calculate it only once. If the inverted matrix is valid,
+we don't calculate it; if not, we do. We never expect matrices with
+zero determinants, so by convention, we mark the matrix is invalid by
+marking both X terms zero.
+*/
+
+void UnConvert(
+ register struct XYspace *S, /* relevant coordinate space */
+ register struct fractpoint *pt, /* device coordinates */
+ DOUBLE *xp, DOUBLE *yp) /* where to store resulting x,y */
+{
+ DOUBLE x,y;
+
+ CoerceInverse(S);
+ x = pt->x;
+ y = pt->y;
+ *xp = S->tofract.inverse[0][0] * x + S->tofract.inverse[1][0] * y;
+ *yp = S->tofract.inverse[0][1] * x + S->tofract.inverse[1][1] * y;
+}
+
+/*
+:h2.Transformations
+*/
+/*
+:h3 id=xform.Xform() - Transform Object in X and Y
+
+TYPE1IMAGER wants transformations of objects like paths to be identical
+to transformations of spaces. For example, if you scale a line(1,1)
+by 10 it should yield the same result as generating the line(1,1) in
+a coordinate space that has been scaled by 10.
+
+We handle fonts by storing the accumulated transform, for example, SR
+(accumulating on the right). Then when we map the font through space TD,
+for example, we multiply the accumulated font transform on the left by
+the space transform on the right, yielding SRTD in this case. We will
+get the same result if we did S, then R, then T on the space and mapping
+an unmodified font through that space.
+*/
+static void PseudoSpace(struct XYspace *, DOUBLE[2][2]);
+
+struct xobject *t1_Xform(
+ register struct xobject *obj, /* object to transform */
+ register DOUBLE M[2][2]) /* transformation matrix */
+{
+ if (obj == NULL)
+ return(NULL);
+
+ if (obj->type == FONTTYPE) {
+ register struct font *F = (struct font *) obj;
+
+ F = UniqueFont(F);
+ return((struct xobject*)F);
+ }
+ if (obj->type == PICTURETYPE) {
+/*
+In the case of a picture, we choose both to update the picture's
+transformation matrix and keep the handles up to date.
+*/
+ register struct picture *P = (struct picture *) obj;
+ register struct segment *handles; /* temporary path to transform handles */
+
+ P = UniquePicture(P);
+ handles = PathSegment(LINETYPE, P->origin.x, P->origin.y);
+ handles = Join(handles,
+ PathSegment(LINETYPE, P->ending.x, P->ending.y) );
+ handles = (struct segment *)Xform((struct xobject *) handles, M);
+ P->origin = handles->dest;
+ P->ending = handles->link->dest;
+ KillPath(handles);
+ return((struct xobject *)P);
+ }
+
+ if (ISPATHTYPE(obj->type)) {
+ struct XYspace pseudo; /* local temporary space */
+ PseudoSpace(&pseudo, M);
+ return((struct xobject *) PathTransform((struct segment *)obj, &pseudo));
+ }
+
+
+ if (obj->type == SPACETYPE) {
+ register struct XYspace *S = (struct XYspace *) obj;
+
+/* replaced ISPERMANENT(S->flag) with S->references > 1 3-26-91 PNM */
+ if (S->references > 1)
+ S = CopySpace(S);
+ else
+ S->ID = NEXTID;
+
+ MatrixMultiply(S->tofract.normal, M, S->tofract.normal);
+ /*
+ * mark inverted matrix invalid:
+ */
+ S->flag &= ~HASINVERSE(ON);
+
+ FillOutFcns(S);
+ return((struct xobject *) S);
+ }
+
+ return(ArgErr("Untransformable object", obj, obj));
+}
+
+/*
+:h3.Transform() - Transform an Object
+
+This is the external user's entry point.
+*/
+struct xobject *t1_Transform(
+ struct xobject *obj,
+ DOUBLE cxx, DOUBLE cyx, /* 2x2 transform matrix ... */
+ DOUBLE cxy, DOUBLE cyy) /* ... elements in row order */
+{
+ DOUBLE M[2][2];
+
+ IfTrace1((MustTraceCalls),"Transform(%p,", obj);
+ IfTrace4((MustTraceCalls)," %f %f %f %f)\n", cxx, cyx, cxy, cyy);
+
+ M[0][0] = cxx;
+ M[0][1] = cyx;
+ M[1][0] = cxy;
+ M[1][1] = cyy;
+ ConsiderContext(obj, M);
+ return(Xform(obj, M));
+}
+/*
+:h3.Scale() - Special Case of Transform()
+
+This is a user operator.
+*/
+
+struct xobject *t1_Scale(
+ struct xobject *obj, /* object to scale */
+ DOUBLE sx, DOUBLE sy) /* scale factors in x and y */
+{
+ DOUBLE M[2][2];
+ IfTrace3((MustTraceCalls),"Scale(%p, %f, %f)\n", obj, sx, sy);
+ M[0][0] = sx;
+ M[1][1] = sy;
+ M[1][0] = M[0][1] = 0.0;
+ ConsiderContext(obj, M);
+ return(Xform(obj, M));
+}
+
+#if 0
+/*
+:h3 id=rotate.Rotate() - Special Case of Transform()
+
+We special-case different settings of 'degrees' for performance
+and accuracy within the DegreeSin() and DegreeCos() routines themselves.
+*/
+
+struct xobject *xiRotate(
+ struct xobject *obj, /* object to be transformed */
+ DOUBLE degrees) /* degrees of COUNTER-clockwise rotation */
+{
+ DOUBLE M[2][2];
+
+
+ IfTrace2((MustTraceCalls),"Rotate(%p, %f)\n", obj, degrees);
+
+ M[0][0] = M[1][1] = DegreeCos(degrees);
+ M[1][0] = - (M[0][1] = DegreeSin(degrees));
+ ConsiderContext(obj, M);
+ return(Xform(obj, M));
+}
+#endif
+
+/*
+:h3.PseudoSpace() - Build a Coordinate Space from a Matrix
+
+Since we have built all this optimized code that, given an (x,y) and
+a coordinate space, yield transformed (x,y), it seems a shame not to
+use the same logic when we need to multiply an (x,y) by an arbitrary
+matrix that is not (initially) part of a coordinate space. This
+subroutine takes the arbitrary matrix and builds a coordinate
+space, with all its nifty function pointers.
+*/
+
+static void PseudoSpace(
+ struct XYspace *S, /* coordinate space structure to fill out */
+ DOUBLE M[2][2]) /* matrix that will become 'tofract.normal' */
+{
+ S->type = SPACETYPE;
+ S->flag = ISPERMANENT(ON) + ISIMMORTAL(ON);
+ S->references = 2; /* 3-26-91 added PNM */
+ S->tofract.normal[0][0] = M[0][0];
+ S->tofract.normal[1][0] = M[1][0];
+ S->tofract.normal[0][1] = M[0][1];
+ S->tofract.normal[1][1] = M[1][1];
+
+ FillOutFcns(S);
+}
+
+/*
+:h2 id=matrixa.Matrix Arithmetic
+
+Following the convention in Newman and Sproull, :hp1/Interactive
+Computer Graphics/,
+matrices are organized:
+:xmp.
+ | cxx cyx |
+ | cxy cyy |
+:exmp.
+A point is horizontal, for example:
+:xmp.
+ [ x y ]
+:exmp.
+This means that:
+:formula/x prime = cxx times x + cxy times y/
+:formula/y prime = cyx times x + cyy times y/
+I've seen the other convention, where transform matrices are
+transposed, equally often in the literature.
+*/
+
+/*
+:h3.MatrixMultiply() - Implements Multiplication of Two Matrices
+
+Implements matrix multiplication, A * B = C.
+
+To remind myself, matrix multiplication goes rows of A times columns
+of B.
+The output matrix may be the same as one of the input matrices.
+*/
+void MatrixMultiply(
+ register DOUBLE A[2][2], /* input ... */
+ register DOUBLE B[2][2], /* ... matrices */
+ register DOUBLE C[2][2]) /* output matrix */
+{
+ register DOUBLE txx,txy,tyx,tyy;
+
+ txx = A[0][0] * B[0][0] + A[0][1] * B[1][0];
+ txy = A[1][0] * B[0][0] + A[1][1] * B[1][0];
+ tyx = A[0][0] * B[0][1] + A[0][1] * B[1][1];
+ tyy = A[1][0] * B[0][1] + A[1][1] * B[1][1];
+
+ C[0][0] = txx;
+ C[1][0] = txy;
+ C[0][1] = tyx;
+ C[1][1] = tyy;
+}
+/*
+:h3.MatrixInvert() - Invert a Matrix
+
+My reference for matrix inversion was :hp1/Elementary Linear Algebra/
+by Paul C. Shields, Worth Publishers, Inc., 1968.
+*/
+void MatrixInvert(
+ DOUBLE M[2][2], /* input matrix */
+ DOUBLE Mprime[2][2]) /* output inverted matrix */
+{
+ register DOUBLE D; /* determinant of matrix M */
+ register DOUBLE txx,txy,tyx,tyy;
+
+ txx = M[0][0];
+ txy = M[1][0];
+ tyx = M[0][1];
+ tyy = M[1][1];
+
+ D = M[1][1] * M[0][0] - M[1][0] * M[0][1];
+ if (D == 0.0)
+ t1_abort("MatrixInvert: can't");
+
+ Mprime[0][0] = tyy / D;
+ Mprime[1][0] = -txy / D;
+ Mprime[0][1] = -tyx / D;
+ Mprime[1][1] = txx / D;
+}
+/*
+:h2.Initialization, Queries, and Debug
+*/
+/*
+:h3.InitSpaces() - Initialize Constant Spaces
+
+For compatibility, we initialize a coordinate space called USER which
+maps 72nds of an inch to pels on the default device.
+*/
+
+struct XYspace *USER = &identity;
+
+void InitSpaces(void)
+{
+ IDENTITY->type = SPACETYPE;
+ FillOutFcns(IDENTITY);
+
+ contexts[NULLCONTEXT].normal[1][0]
+ = contexts[NULLCONTEXT].normal[0][1]
+ = contexts[NULLCONTEXT].inverse[1][0]
+ = contexts[NULLCONTEXT].inverse[0][1] = 0.0;
+ contexts[NULLCONTEXT].normal[0][0]
+ = contexts[NULLCONTEXT].normal[1][1]
+ = contexts[NULLCONTEXT].inverse[0][0]
+ = contexts[NULLCONTEXT].inverse[1][1] = 1.0;
+
+ USER->flag |= ISIMMORTAL(ON);
+ CoerceInverse(USER);
+}
+/*
+:h3.QuerySpace() - Returns the Transformation Matrix of a Space
+
+Since the tofract matrix of an XYspace includes the scale factor
+necessary to produce fractpel results (i.e., FRACTFLOAT), this
+must be taken out before we return the matrix to the user. Fortunately,
+this is simple: just multiply by the inverse of IDENTITY!
+*/
+
+void QuerySpace(
+ register struct XYspace *S, /* space asked about */
+ register DOUBLE *cxxP, register DOUBLE *cyxP, /* where to ... */
+ register DOUBLE *cxyP, register DOUBLE *cyyP) /* ... put answer */
+{
+ DOUBLE M[2][2]; /* temp matrix to build user's answer */
+
+ if (S->type != SPACETYPE) {
+ ArgErr("QuerySpace: not a space", S, NULL);
+ return;
+ }
+ MatrixMultiply(S->tofract.normal, IDENTITY->tofract.inverse, M);
+ *cxxP = M[0][0];
+ *cxyP = M[1][0];
+ *cyxP = M[0][1];
+ *cyyP = M[1][1];
+}
+
+#if 0
+/*
+:h3.FormatFP() - Format a Fixed Point Pel
+
+We format the pel as "dddd.XXXX", where XX's are hexidecimal digits,
+and the dd's are decimal digits. This might be a little confusing
+mixing hexidecimal and decimal like that, but it is convenient
+to use for debug.
+
+We make sure we have N (FRACTBITS/4) digits past the decimal point.
+*/
+#define FRACTMASK ((1<<FRACTBITS)-1) /* mask for fractional part */
+
+static void FormatFP(
+ register char *str, /* output str */
+ register fractpel fpel) /* fractional pel input */
+{
+ char temp[8];
+ register char *s;
+ register const char *sign;
+
+ if (fpel < 0) {
+ sign = "-";
+ fpel = -fpel;
+ }
+ else
+ sign = "";
+
+ sprintf(temp, "000%x", fpel & FRACTMASK);
+ s = temp + strlen(temp) - (FRACTBITS/4);
+
+ sprintf(str, "%s%d.%sx", sign, fpel >> FRACTBITS, s);
+}
+
+/*
+:h3.DumpSpace() - Display a Coordinate Space
+*/
+/*ARGSUSED*/
+void DumpSpace(register struct XYspace *S)
+{
+ IfTrace4(TRUE,"--Coordinate space at %p,ID=%d,convert=%p,iconvert=%p\n",
+ S, S->ID, S->convert, S->iconvert);
+ IfTrace2(TRUE," | %12.3f %12.3f |",
+ S->tofract.normal[0][0], S->tofract.normal[0][1]);
+ IfTrace2(TRUE," [ %d %d ]\n", S->itofract[0][0], S->itofract[0][1]);
+ IfTrace2(TRUE," | %12.3f %12.3f |",
+ S->tofract.normal[1][0], S->tofract.normal[1][1]);
+ IfTrace2(TRUE," [ %d %d ]\n", S->itofract[1][0], S->itofract[1][1]);
+}
+#endif
diff --git a/fonts/utilities/ps2pk/spaces.h b/fonts/utilities/ps2pk/spaces.h
new file mode 100644
index 0000000000..baadecf167
--- /dev/null
+++ b/fonts/utilities/ps2pk/spaces.h
@@ -0,0 +1,152 @@
+/* $XConsortium: spaces.h,v 1.3 91/10/10 11:19:22 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF
+ * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE
+ * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE
+ * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE
+ * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL
+ * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+/*SHARED*/
+
+#include "types.h"
+
+#define USER t1_User
+#define IDENTITY t1_Identity
+
+typedef SHORT pel; /* integer pel locations */
+typedef int32_t fractpel; /* fractional pel locations */
+
+#define FRACTBITS 16 /* number of fractional bits in 'fractpel' */
+/*
+We define the following macros to convert from 'fractpel' to 'pel' and
+vice versa:
+*/
+#define TOFRACTPEL(p) (((fractpel)p)<<FRACTBITS)
+#define FPHALF (1<<(FRACTBITS-1))
+#define NEARESTPEL(fp) (((fp)+FPHALF)>>FRACTBITS)
+#define FRACTFLOAT (DOUBLE)(1L<<FRACTBITS)
+
+/*END SHARED*/
+/*SHARED*/
+
+struct doublematrix {
+ DOUBLE normal[2][2];
+ DOUBLE inverse[2][2];
+} ;
+
+/*END SHARED*/
+/*SHARED*/
+
+struct XYspace {
+ XOBJ_COMMON /* xobject common data define 3-26-91 PNM */
+ /* type = SPACETYPE */
+ void (*convert)(); /* calculate "fractpoint" X,Y from float X,Y */
+ void (*iconvert)(); /* calculate "fractpoint" X,Y from int X,Y */
+ fractpel (*xconvert)(); /* subroutine of convert */
+ fractpel (*yconvert)(); /* subroutine of convert */
+ fractpel (*ixconvert)(); /* subroutine of iconvert */
+ fractpel (*iyconvert)(); /* subroutine of iconvert */
+ int ID; /* unique identifier (used in font caching) */
+ unsigned char context; /* device context of coordinate space */
+ struct doublematrix tofract; /* xform to get to fractional pels */
+ fractpel itofract[2][2]; /* integer version of "tofract.normal" */
+} ;
+
+#define INVALIDID 0 /* no valid space will have this ID */
+
+/*END SHARED*/
+/*SHARED*/
+
+struct fractpoint {
+ fractpel x,y;
+} ;
+
+/*END SHARED*/
+/*SHARED*/
+
+extern struct XYspace *IDENTITY;
+extern struct XYspace *USER;
+
+/*END SHARED*/
+/*SHARED*/
+
+#define Context(d,u) t1_Context(d,u)
+#define Transform(o,f1,f2,f3,f4) t1_Transform(o,f1,f2,f3,f4)
+#define Rotate(o,d) t1_Rotate(o,d)
+#define Scale(o,sx,sy) t1_Scale(o,sx,sy)
+#define QuerySpace(S,f1,f2,f3,f4) t1_QuerySpace(S,f1,f2,f3,f4)
+#define Warp(s1,o,s2) t1_Warp(s1,o,s2)
+
+struct XYspace *t1_Context(); /* creates a coordinate space for a device */
+struct xobject *t1_Transform(struct xobject *, DOUBLE, DOUBLE, DOUBLE,
+ DOUBLE); /* transform an object */
+struct xobject *t1_Rotate(); /* rotate an object */
+struct xobject *t1_Scale(struct xobject *, DOUBLE, DOUBLE); /* scale an object */
+struct xobject *t1_Warp(); /* transform like delta of two spaces */
+void t1_QuerySpace(struct XYspace *, DOUBLE *, DOUBLE *, DOUBLE *, DOUBLE *);
+ /* returns coordinate space matrix */
+
+/*END SHARED*/
+/*SHARED*/
+
+#define DeviceResolution t1_DeviceResolution
+#define InitSpaces t1_InitSpaces
+#define CopySpace(s) t1_CopySpace(s)
+#define Xform(o,M) t1_Xform(o,M)
+#define UnConvert(S,pt,xp,yp) t1_UnConvert(S,pt,xp,yp)
+#define MatrixMultiply(A,B,C) t1_MMultiply(A,B,C)
+#define MatrixInvert(A,B) t1_MInvert(A,B)
+#define FindContext(M) t1_FindContext(M)
+
+void t1_InitSpaces(void); /* initialize pre-defined coordinate spaces */
+struct XYspace *t1_CopySpace(struct XYspace *);
+ /* duplicate a coordinate space */
+struct xobject *t1_Xform(struct xobject *, DOUBLE[2][2]);
+ /* transform object by matrix */
+void t1_UnConvert(struct XYspace *, struct fractpoint *, DOUBLE *, DOUBLE *);
+ /* return user coordinates from device coordinates */
+void t1_MMultiply(DOUBLE[2][2], DOUBLE[2][2], DOUBLE[2][2]);
+ /* multiply two matrices */
+void t1_MInvert(DOUBLE[2][2], DOUBLE[2][2]); /* invert a matrix */
+int t1_FindContext(); /* return the "context" represented by a matrix */
+
+/*END SHARED*/
+/*SHARED*/
+
+/* #define KillSpace(s) Free(s)
+Note - redefined KillSpace() to check references !
+3-26-91 PNM */
+
+#define KillSpace(s) if ( (--(s->references) == 0) ||\
+ ( (s->references == 1) && ISPERMANENT(s->flag) ) )\
+ Free(s)
+
+#define ConsumeSpace(s) MAKECONSUME(s,KillSpace(s))
+#define UniqueSpace(s) MAKEUNIQUE(s,CopySpace(s))
+
+/*END SHARED*/
+/*SHARED*/
+
+#define NULLCONTEXT 0
+
+/*END SHARED*/
diff --git a/fonts/utilities/ps2pk/strexpr.c b/fonts/utilities/ps2pk/strexpr.c
new file mode 100644
index 0000000000..ebfcc8fcdf
--- /dev/null
+++ b/fonts/utilities/ps2pk/strexpr.c
@@ -0,0 +1,292 @@
+/*
+ * File: strexpr.c
+ * Purpose: calculate value from algebraic string expression
+ * (Stripped down from expr.c from J.T. Conklin <jtc@netbsd.org>.)
+ * Version: 1.0 (Nov 1995)
+ * Author: Piet Tutelaers
+ */
+
+#include <stdio.h> /* sprintf() */
+#include <stdlib.h> /* free(), malloc() */
+#include <string.h> /* strchr(), strcpy() */
+#include <ctype.h> /* isdigit(), isspace() */
+#include "basics.h" /* fatal() */
+
+const char *OPERATORS = "+-*/%()";
+
+enum token {
+ ADD, SUB, MUL, DIV, MOD, LP, RP, OPERAND, EOI
+};
+
+struct val {
+ enum {
+ integer,
+ string
+ } type;
+
+ union {
+ char *s;
+ int i;
+ } u;
+};
+
+enum token token;
+struct val *tokval;
+char *pexpr;
+
+struct val *
+make_int(int i)
+{
+ struct val *vp;
+
+ vp = (struct val *) malloc(sizeof(*vp));
+ if (vp == NULL) fatal("expression error\n");
+ vp->type = integer;
+ vp->u.i = i;
+ return vp;
+}
+
+
+struct val *
+make_str(char *s)
+{
+ char operand[32]; int i;
+
+ struct val *vp;
+
+ vp = (struct val *) malloc(sizeof(*vp));
+ if (vp == NULL) fatal("expression error\n");
+
+ pexpr = s; i = 0;
+ while (1) {
+ if (isspace(*pexpr) || *pexpr == '\0') break;
+ if (strchr(OPERATORS, *pexpr) != NULL) break;
+ if (i == 30) fatal("operand too large\n");
+ operand[i++] = *pexpr++;
+ }
+ if (i == 0) fatal("invalid operand\n");
+ operand[i] = '\0';
+ vp->u.s = malloc(i+1);
+ if (vp->u.s == NULL) fatal("Out of memory\n");
+ strcpy(vp->u.s, operand);
+ vp->type = string;
+ return vp;
+}
+
+
+void
+free_value(struct val *vp)
+{
+ if (vp->type == string)
+ free(vp->u.s);
+ free(vp);
+}
+
+
+/* determine if vp is an integer; if so, return it's value in *r */
+int
+is_integer(struct val *vp, int *r)
+{
+ char *s;
+ int neg;
+ int i;
+
+ if (vp->type == integer) {
+ *r = vp->u.i;
+ return 1;
+ }
+
+ /*
+ * POSIX.2 defines an "integer" as an optional unary minus
+ * followed by digits.
+ */
+ s = vp->u.s;
+ i = 0;
+
+ neg = (*s == '-');
+ if (neg)
+ s++;
+
+ while (*s) {
+ if (!isdigit(*s))
+ return 0;
+
+ i *= 10;
+ i += *s - '0';
+
+ s++;
+ }
+
+ if (neg)
+ i *= -1;
+
+ *r = i;
+ return 1;
+}
+
+
+/* coerce to vp to an integer */
+int
+to_integer(struct val *vp)
+{
+ int r;
+
+ if (vp->type == integer)
+ return 1;
+
+ if (is_integer(vp, &r)) {
+ free(vp->u.s);
+ vp->u.i = r;
+ vp->type = integer;
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/* coerce to vp to an string */
+void
+to_string(struct val *vp)
+{
+ char *tmp;
+
+ if (vp->type == string)
+ return;
+
+ tmp = malloc(25);
+ if (tmp == NULL) fatal("Out of memory\n");
+ sprintf(tmp, "%d", vp->u.i);
+ vp->type = string;
+ vp->u.s = tmp;
+}
+
+void
+nexttoken()
+{
+ char *i; /* index */
+
+ while (isspace(*pexpr)) pexpr++;
+
+ if (*pexpr == '\0') {
+ token = EOI;
+ return;
+ }
+
+ if ((i = strchr(OPERATORS, *pexpr)) != NULL) {
+ pexpr++;
+ token = i - OPERATORS;
+ return;
+ }
+ tokval = make_str(pexpr);
+ token = OPERAND;
+ return;
+}
+
+struct val *
+eval6()
+{
+ struct val *eval3(void);
+ struct val *v;
+
+ if (token == OPERAND) {
+ nexttoken();
+ return tokval;
+
+ } else if (token == LP) {
+ nexttoken();
+ v = eval3();
+
+ if (token != RP)
+ fatal("missing parenthesis in expression\n");
+ nexttoken();
+ return v;
+ } else fatal("expression error\n");
+ /* NOTREACHED */
+}
+
+/* Parse and evaluate multiplication and division expressions */
+struct val *
+eval4()
+{
+ struct val *l, *r;
+ enum token op;
+
+ l = eval6();
+ while ((op = token) == MUL || op == DIV || op == MOD) {
+ nexttoken();
+ r = eval6();
+
+ if (!to_integer(l) || !to_integer(r)) {
+ fatal("non-numeric argument\n");
+ }
+
+ if (op == MUL) {
+ l->u.i *= r->u.i;
+ } else {
+ if (r->u.i == 0) {
+ fatal("division by zero\n");
+ }
+ if (op == DIV) {
+ l->u.i /= r->u.i;
+ } else {
+ l->u.i %= r->u.i;
+ }
+ }
+
+ free_value(r);
+ }
+
+ return l;
+}
+
+/* Parse and evaluate addition and subtraction expressions */
+struct val *
+eval3()
+{
+ struct val *l, *r;
+ enum token op;
+
+ l = eval4();
+ while ((op = token) == ADD || op == SUB) {
+ nexttoken();
+ r = eval4();
+
+ if (!to_integer(l) || !to_integer(r)) {
+ fatal("non-numeric argument\n");
+ }
+
+ if (op == ADD) {
+ l->u.i += r->u.i;
+ } else {
+ l->u.i -= r->u.i;
+ }
+
+ free_value(r);
+ }
+
+ return l;
+}
+
+/*
+ * Evaluate the algebraic expression contained in <expression>. The
+ * value will be assigned to <result>. When errors are encountered
+ * non-zero is returned (if program is not aborted) otherwise zero.
+ */
+int strexpr(int *result, char *expression) {
+ struct val *vp;
+
+ pexpr = expression;
+
+ nexttoken();
+ vp = eval3();
+
+ if (token != EOI) return 1;
+
+ if (vp->type == integer || to_integer(vp)) {
+ *result = vp->u.i;
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/fonts/utilities/ps2pk/strexpr.h b/fonts/utilities/ps2pk/strexpr.h
new file mode 100644
index 0000000000..6012a8be56
--- /dev/null
+++ b/fonts/utilities/ps2pk/strexpr.h
@@ -0,0 +1,13 @@
+/*
+ * File: strexpr.h
+ * Purpose: calculate value from algebraic string expression
+ * Version: 1.0 (Nov 1995)
+ * Author: Piet Tutelaers
+ */
+
+/*
+ * Evaluate the algebraic expression contained in <expression>. The
+ * value will be assigned to <result>. When errors are encountered
+ * non-zero (if program is not aborted) is returned otherwise zero.
+ */
+int strexpr(int *result, char *expression);
diff --git a/fonts/utilities/ps2pk/strokes.h b/fonts/utilities/ps2pk/strokes.h
new file mode 100644
index 0000000000..5907632984
--- /dev/null
+++ b/fonts/utilities/ps2pk/strokes.h
@@ -0,0 +1,38 @@
+/* $XConsortium: strokes.h,v 1.2 91/10/10 11:19:25 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/*STUB*/
+
+#define CopyLineStyle(s) s
+#define CopyStrokePath(p) p
+#define KillStrokePath(p)
+#define KillLineStyle(s)
+#define CoercePath(sp) sp
+#define DoStroke(sp) sp
+
diff --git a/fonts/utilities/ps2pk/t1funcs.c b/fonts/utilities/ps2pk/t1funcs.c
new file mode 100644
index 0000000000..e95623f693
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1funcs.c
@@ -0,0 +1,493 @@
+/* $XConsortium: t1funcs.c,v 1.10 92/05/12 18:07:55 gildea Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License, subject to the license given below, to use,
+ * copy, modify, and distribute this software * and its
+ * documentation for any purpose and without fee is hereby
+ * granted, provided that the above copyright notice appear
+ * in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software
+ * without specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * Author: Jeffrey B. Lotspiech, IBM Almaden Research Center
+ * Modeled on spfuncs.c by Dave Lemke, Network Computing Devices, Inc
+ * which contains the following copyright and permission notices:
+ *
+ * Copyright 1990, 1991 Network Computing Devices;
+ * Portions Copyright 1987 by Digital Equipment Corporation and the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this protoype software
+ * and its documentation to Members and Affiliates of the MIT X Consortium
+ * any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Network Computing Devices, Digital or
+ * MIT not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission.
+ *
+ * NETWORK COMPUTING DEVICES, DIGITAL AND MIT DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, DIGITAL OR MIT BE
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "types.h"
+#include <string.h>
+#include "ffilest.h"
+#ifdef XSERVER
+#include <X11/Xfuncs.h>
+#include "FSproto.h"
+#endif
+#include "t1intf.h"
+
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "regions.h"
+#include "t1stdio.h"
+#include "util.h"
+#include "fontfcn.h"
+
+static int Type1GetGlyphs(struct _Font *pFont, uint32_t count,
+ unsigned char *chars, FontEncoding charEncoding,
+ uint32_t *glyphCount, struct _CharInfo **glyphs);
+static int Type1GetMetrics(struct _Font *pFont, uint32_t count,
+ unsigned char *chars, FontEncoding charEncoding,
+ uint32_t *glyphCount, xCharInfo **glyphs );
+static void fillrun(register char *p,pel x0,pel x1,int bit);
+static void fill(char *dest,int h,int w,struct region *area,
+ int byte,int bit,int wordsize);
+static void FontDefaultFormat(int *bit, int *byte, int *glyphs, int *scan);
+
+#define DECIPOINTSPERINCH 722.7
+
+/*ARGSUSED*/
+int Type1OpenScalable (
+ encoding ev,
+ FontPtr *ppFont,
+ int flags,
+ FontEntryPtr entry,
+ char *fileName,
+ FontScalablePtr vals,
+ fsBitmapFormat format,
+ fsBitmapFormatMask fmask,
+ DOUBLE efactor,
+ DOUBLE slant)
+{
+ FontPtr pFont;
+ int bit,
+ byte,
+ glyph,
+ scan,
+ image;
+ int pad,wordsize; /* scan & image in bits */
+ int size; /* for memory size calculations */
+ struct XYspace *S; /* coordinate space for character */
+ struct region *area;
+ DOUBLE scale; /* scale factor for font */
+ DOUBLE txx, tyx, txy, tyy;
+ CharInfoRec *glyphs;
+ register int i;
+ int len,rc;
+ struct type1font *type1;
+
+ /* set up default values */
+ FontDefaultFormat(&bit, &byte, &glyph, &scan);
+ /* get any changes made from above */
+ rc = CheckFSFormat(format, fmask, &bit, &byte, &scan, &glyph, &image);
+ if (rc != Successful)
+ return rc;
+
+ pad = glyph * 8;
+ wordsize = scan * 8;
+
+#define PAD(bits, pad) (((bits)+(pad)-1)&-(pad))
+
+ pFont = (FontPtr) Xalloc(sizeof(FontRec));
+ if (pFont == NULL)
+ return AllocError;
+
+ type1 = (struct type1font *)Xalloc(sizeof(struct type1font));
+ if (type1 == NULL) {
+ Xfree(pFont);
+ return AllocError;
+ }
+ (void) memset(type1, 0, sizeof(struct type1font));
+
+ scale = (DOUBLE) vals->pixel;
+
+ /* Code added by E. Schenk. July 25, 1992.
+ * The following code reads the FontMatrix for the font,
+ * and transforms the font using it. This is necessary
+ * for fonts that are just an oblique, or extend of
+ * a normal font.
+ */
+ { float fontmatrix[6];
+ int rc;
+ QueryFontLib(fileName,"FontMatrix",fontmatrix,&rc);
+ if (!rc) {
+ S = (struct XYspace *) Transform((struct xobject *)IDENTITY,
+ fontmatrix[0], fontmatrix[1], fontmatrix[2], fontmatrix[3]);
+ }
+ else {
+ S = (struct XYspace *) Scale((struct xobject *)IDENTITY,0.001,0.001);
+ }
+ }
+ /* End of additional code */
+
+ if (efactor == 1.0 && slant == 0.0)
+ S = (struct XYspace *)Permanent(Scale((struct xobject *)S, scale, - scale));
+ else {
+ txx = (DOUBLE)vals->x * efactor * vals->point / DECIPOINTSPERINCH;
+ tyy = (DOUBLE)vals->y * vals->point / DECIPOINTSPERINCH;
+ tyx = 0.0;
+ txy = (DOUBLE)vals->x * slant * vals->point / DECIPOINTSPERINCH;
+ S = (struct XYspace *) Permanent(Transform((struct xobject *)S, txx, tyx, txy, -tyy));
+ }
+
+ glyphs = type1->glyphs;
+
+ /* load font if not already loaded */
+ if (!fontfcnA(fileName, &rc))
+ return (rc);
+
+ for (i=0; i < 256-FIRSTCOL; i++) {
+ int32_t h,w;
+ int32_t paddedW;
+
+ if (ev[i] == NULL) continue;
+ len = strlen(ev[i]);
+
+ currentchar = i;
+
+ rc = 0;
+ area = fontfcnB(S, (unsigned char *)ev[i], &len, &rc);
+ if (rc < 0) {
+ rc = BadFontName;
+ break;
+ }
+ else if (rc > 0)
+ continue;
+
+ if (area == NULL)
+ continue;
+
+ h = area->ymax - area->ymin;
+ w = area->xmax - area->xmin;
+ paddedW = PAD(w, pad);
+
+ if (h > 0 && w > 0) {
+ size = h * paddedW / 8;
+ glyphs[i].bits = (char *)Xalloc(size);
+ if (glyphs[i].bits == NULL) {
+ rc = AllocError;
+ break;
+ }
+ }
+ else {
+ h = w = 0;
+ area->xmin = area->xmax = 0;
+ area->ymin = area->ymax = 0;
+ }
+
+ glyphs[i].metrics.leftSideBearing = area->xmin;
+ glyphs[i].metrics.characterWidth = NEARESTPEL(area->ending.x - area->origin.x);
+ glyphs[i].metrics.rightSideBearing = w + area->xmin;
+ glyphs[i].metrics.descent = area->ymax - NEARESTPEL(area->origin.y);
+ glyphs[i].metrics.ascent = h - glyphs[i].metrics.descent;
+
+ if (h > 0 && w > 0) {
+ (void) memset(glyphs[i].bits, 0, size);
+ fill(glyphs[i].bits, h, paddedW, area, byte, bit, wordsize );
+ }
+
+ Destroy(area);
+ }
+
+ if (i != 256 - FIRSTCOL) {
+ for (i--; i >= 0; i--)
+ if (glyphs[i].bits != NULL)
+ Xfree(glyphs[i].bits);
+ Xfree(type1);
+ Xfree(pFont);
+ return rc;
+ }
+ type1->pDefault = NULL;
+
+ pFont->format = format;
+
+ pFont->bit = bit;
+ pFont->byte = byte;
+ pFont->glyph = glyph;
+ pFont->scan = scan;
+
+ pFont->info.firstCol = FIRSTCOL;
+ pFont->info.lastCol = 255;
+ pFont->info.firstRow = 0;
+ pFont->info.lastRow = 0;
+
+ pFont->get_metrics = Type1GetMetrics;
+ pFont->get_glyphs = Type1GetGlyphs;
+ pFont->unload_font = Type1CloseFont;
+ pFont->refcnt = 0;
+ pFont->maxPrivate = -1;
+ pFont->devPrivates = 0;
+
+ pFont->fontPrivate = (unsigned char *) type1;
+
+ T1FillFontInfo(pFont, vals, fileName, entry->name.name);
+
+ *ppFont = pFont;
+ return Successful;
+}
+
+/* NOTE: ILH removed tests ...->characterWidth != 0 below because zero-width
+ does not mean the character is empty, simply that it has zero escapement. */
+
+static int
+Type1GetGlyphs(
+ FontPtr pFont,
+ uint32_t count,
+ register unsigned char *chars,
+ FontEncoding charEncoding,
+ uint32_t *glyphCount, /* RETURN */
+ CharInfoPtr *glyphs) /* RETURN */
+{
+ unsigned int firstRow;
+ unsigned int numRows;
+ CharInfoPtr *glyphsBase;
+ register unsigned int c;
+ unsigned int r;
+ CharInfoPtr pDefault;
+ register struct type1font *type1Font;
+ register int firstCol;
+
+ type1Font = (struct type1font *) pFont->fontPrivate;
+ firstCol = pFont->info.firstCol;
+ pDefault = type1Font->pDefault;
+ glyphsBase = glyphs;
+
+ switch (charEncoding) {
+
+ case Linear8Bit:
+ case TwoD8Bit:
+ if (pFont->info.firstRow > 0)
+ break;
+ while (count--) {
+ c = (*chars++);
+ if (c >= firstCol)
+ *glyphs++ = &type1Font->glyphs[c-firstCol];
+ else if (pDefault)
+ *glyphs++ = pDefault;
+ }
+ break;
+ case Linear16Bit:
+ while (count--) {
+ c = *chars++ << 8;
+ c = (c | *chars++);
+ if (c < 256 && c >= firstCol)
+ *glyphs++ = &type1Font->glyphs[c-firstCol];
+ else if (pDefault)
+ *glyphs++ = pDefault;
+ }
+ break;
+
+ case TwoD16Bit:
+ firstRow = pFont->info.firstRow;
+ numRows = pFont->info.lastRow - firstRow + 1;
+ while (count--) {
+ r = (*chars++) - firstRow;
+ c = (*chars++);
+ if (r < numRows && c < 256 && c >= firstCol)
+ *glyphs++ = &type1Font->glyphs[(r << 8) + c - firstCol];
+ else if (pDefault)
+ *glyphs++ = pDefault;
+ }
+ break;
+ }
+ *glyphCount = glyphs - glyphsBase;
+ return Successful;
+}
+
+static int
+Type1GetMetrics(
+ FontPtr pFont,
+ uint32_t count,
+ register unsigned char *chars,
+ FontEncoding charEncoding,
+ uint32_t *glyphCount, /* RETURN */
+ xCharInfo **glyphs) /* RETURN */
+{
+ static CharInfoRec nonExistantChar;
+
+ int ret;
+ struct type1font *type1Font;
+ CharInfoPtr oldDefault;
+
+ type1Font = (struct type1font *) pFont->fontPrivate;
+ oldDefault = type1Font->pDefault;
+ type1Font->pDefault = &nonExistantChar;
+ ret = Type1GetGlyphs(pFont, count, chars, charEncoding, glyphCount, (CharInfoPtr *) glyphs);
+ type1Font->pDefault = oldDefault;
+ return ret;
+}
+
+void Type1CloseFont(FontPtr pFont)
+{
+ register int i;
+ struct type1font *type1;
+
+ type1 = (struct type1font *) pFont->fontPrivate;
+ for (i=0; i < 256 - pFont->info.firstCol; i++)
+ if (type1->glyphs[i].bits != NULL)
+ Xfree(type1->glyphs[i].bits);
+ Xfree(type1);
+
+ if (pFont->info.props)
+ Xfree(pFont->info.props);
+
+ if (pFont->info.isStringProp)
+ Xfree(pFont->info.isStringProp);
+
+ Xfree(pFont);
+}
+
+
+static void fill(
+ register char *dest, /* destination bitmap */
+ int h, int w, /* dimensions of 'dest', w padded */
+ register struct region *area, /* region to write to 'dest' */
+ int Byte, int bit, /* flags; LSBFirst or MSBFirst */
+ int wordsize) /* number of bits per word for LSB/MSB purposes */
+{
+ register struct edgelist *edge; /* for looping through edges */
+ register char *p; /* current scan line in 'dest' */
+ register int y; /* for looping through scans */
+ register int wbytes = w / 8; /* number of bytes in width */
+ register pel *leftP,*rightP; /* pointers to X values, left and right */
+ int xmin = area->xmin; /* upper left X */
+ int ymin = area->ymin; /* upper left Y */
+
+ for (edge = area->anchor; VALIDEDGE(edge); edge = edge->link->link) {
+
+ p = dest + (edge->ymin - ymin) * wbytes;
+ leftP = edge->xvalues;
+ rightP = edge->link->xvalues;
+
+ for (y = edge->ymin; y < edge->ymax; y++) {
+ fillrun(p, (pel)(*leftP++ - xmin), (pel)(*rightP++ - xmin), bit);
+ p += wbytes;
+ }
+ }
+/*
+Now, as an afterthought, we'll go reorganize if odd byte order requires
+it:
+*/
+ if (Byte == LSBFirst && wordsize != 8) {
+ register int i;
+
+ switch (wordsize) {
+ case 16:
+ {
+ register unsigned short data,*p;
+
+ p = (unsigned short *) dest;
+
+ for (i = h * w /16; --i >= 0;) {
+ data = *p;
+ *p++ = (data << 8) + (data >> 8);
+ }
+ break;
+ }
+ case 64:
+ case 32:
+ {
+ register uint32_t data,*p;
+
+ p = (uint32_t *) dest;
+
+ for (i = h * w / 32; --i >= 0;) {
+ data = *p;
+ *p++ = (data << 24) + (data >> 24)
+ + (0xFF00 & (data >> 8))
+ + (0xFF0000 & (data << 8));
+ }
+ if (wordsize == 64) {
+
+ p = (uint32_t *) dest;
+
+ for (i = h * w / 64; --i >= 0;) {
+ data = *p++;
+ p[-1] = p[0];
+ *p++ = data;
+ }
+ }
+ break;
+ }
+ default:
+ t1_abort("xiFill: unknown format");
+ }
+ }
+
+}
+
+#define ALLONES 0xFF
+
+static void fillrun(register char *p, pel x0, pel x1, int bit)
+{
+ register int startmask,endmask; /* bits to set in first and last char*/
+ register int middle; /* number of chars between start and end + 1 */
+
+ if (x1 <= x0)
+ return;
+ middle = x1/8 - x0/8;
+ p += x0/8;
+ x0 &= 7; x1 &= 7;
+ if (bit == LSBFirst) {
+ startmask = ALLONES << x0;
+ endmask = ~(ALLONES << x1);
+ }
+ else {
+ startmask = ALLONES >> x0;
+ endmask = ~(ALLONES >> x1);
+ }
+ if (middle == 0)
+ *p++ |= startmask & endmask;
+ else {
+ *p++ |= startmask;
+ while (--middle > 0)
+ *p++ = ALLONES;
+ *p |= endmask;
+ }
+}
+
+
+void Type1RegisterFontFileFunctions(void)
+{
+ T1InitStdProps();
+}
+
+static void FontDefaultFormat(int *bit, int *byte, int *glyphs, int *scan) { ; }
diff --git a/fonts/utilities/ps2pk/t1hdigit.h b/fonts/utilities/ps2pk/t1hdigit.h
new file mode 100644
index 0000000000..9979ef55ce
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1hdigit.h
@@ -0,0 +1,40 @@
+/* $XConsortium: t1hdigit.h,v 1.2 91/10/10 11:19:31 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* Indicators for special characters in the p_hdigit.h tables */
+#define HERROR (0xfe)
+#define HWHITE_SPACE (0xfd)
+#define HRIGHT_ANGLE (0xfc)
+#define LAST_HDIGIT (0xf0)
+
+/* Declarations for the tables */
+#define HighHexP (HighHex+1)
+extern unsigned char HighHex[];
+#define LowHexP (LowHex+1)
+extern unsigned char LowHex[];
diff --git a/fonts/utilities/ps2pk/t1imager.h b/fonts/utilities/ps2pk/t1imager.h
new file mode 100644
index 0000000000..78eae98fd7
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1imager.h
@@ -0,0 +1,152 @@
+/* $XConsortium: t1imager.h,v 1.5 92/03/20 14:36:05 keith Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include "types.h"
+#include "fontmisc.h"
+
+typedef pointer xobject;
+typedef pointer location;
+typedef pointer path;
+typedef pointer region;
+typedef pointer XYspace;
+
+#ifndef NOEXTERNS
+/*
+The following are the user entry locations to TYPE1IMAGER
+*/
+extern path t1_Bezier();
+extern path t1_ClosePath();
+extern xobject t1_Destroy();
+extern xobject t1_Dup();
+extern char *t1_ErrorMsg();
+extern void t1_InitImager();
+extern region t1_Interior();
+extern location t1_ILoc();
+extern xobject t1_Join();
+extern path t1_Line();
+extern xobject t1_Permanent();
+extern path t1_Phantom();
+extern location t1_Loc();
+extern xobject t1_Scale();
+extern xobject t1_Snap();
+extern location t1_SubLoc();
+extern xobject t1_Temporary();
+
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+/*
+Here are some TYPE1IMAGER functions that are defined in terms of others:
+*/
+
+#define t1_AddLoc(p1,p2) t1_Join(p1,p2)
+
+#ifndef NONAMES
+/*
+Define the simple form of all the subroutine names:
+*/
+#define AddLoc(p1,p2) t1_AddLoc(p1,p2)
+#define Bezier(B,C,D) t1_Bezier(B,C,D)
+#define ClosePath(p) t1_ClosePath(p,0)
+#define Complement(area) t1_Complement(area)
+#define Destroy(o) t1_Destroy(o)
+#define Dup(o) t1_Dup(o)
+#define ErrorMsg() t1_ErrorMsg()
+#define HeadSegment(p) t1_HeadSegment(p)
+#define InitImager() t1_InitImager()
+#define Interior(p,rule) t1_Interior(p,rule)
+#define ILoc(S,x,y) t1_ILoc(S,x,y)
+#define Join(p1,p2) t1_Join(p1,p2)
+#define Line(P) t1_Line(P)
+#define Permanent(o) t1_Permanent(o)
+#define Phantom(o) t1_Phantom(o)
+#define Loc(S,x,y) t1_Loc(S,(DOUBLE)x,(DOUBLE)y)
+#define Scale(o,sx,sy) t1_Scale(o,(DOUBLE)sx,(DOUBLE)sy)
+#define Snap(o) t1_Snap(o)
+#define SubLoc(a,b) t1_SubLoc(a,b)
+#define Temporary(o) t1_Temporary(o)
+#define TermImager() t1_TermImager()
+#define Transform(o,cxx,cyx,cxy,cyy) t1_Transform(o,(DOUBLE)cxx,(DOUBLE)cyx,\
+ (DOUBLE)cxy,(DOUBLE)cyy)
+
+#endif
+
+#define WINDINGRULE -2
+#define EVENODDRULE -3
+
+#define CONTINUITY 0x80 /* can be added to above rules; e.g. WINDINGRULE+CONTINUITY */
+
+/*
+Stroke() line style constants:
+*/
+
+/*
+Coordinate space constants:
+*/
+#define IDENTITY t1_Identity
+extern XYspace *IDENTITY;
+
+/*
+Generic null object definition:
+*/
+#define NULLOBJECT ((xobject)NULL)
+
+/*
+Null path definition:
+*/
+#define NULLPATH NULLOBJECT
+
+/*
+Full page and null region definition:
+*/
+#define T1_INFINITY t1_Infinity
+#ifndef NOEXTERNS
+extern region *T1_INFINITY;
+#endif
+#ifdef NULLREGION
+#undef NULLREGION
+#endif
+#define NULLREGION NULLOBJECT
+
+#define FF_PARSE_ERROR 5
+#define FF_PATH 1
+
+extern pointer xiStub();
diff --git a/fonts/utilities/ps2pk/t1info.c b/fonts/utilities/ps2pk/t1info.c
new file mode 100644
index 0000000000..fd86c3c797
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1info.c
@@ -0,0 +1,380 @@
+/* $XConsortium: t1info.c,v 1.9 92/03/20 16:00:13 eswu Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License, subject to the license given below, to use,
+ * copy, modify, and distribute this software * and its
+ * documentation for any purpose and without fee is hereby
+ * granted, provided that the above copyright notice appear
+ * in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software
+ * without specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * Author: Carol H. Thompson IBM Almaden Research Center
+ * Modeled on spinfo.c by Dave Lemke, Network Computing Devices, Inc
+ * which contains the following copyright and permission notices:
+ *
+ * Copyright 1990, 1991 Network Computing Devices;
+ * Portions Copyright 1987 by Digital Equipment Corporation and the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this protoype software
+ * and its documentation to Members and Affiliates of the MIT X Consortium
+ * any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Network Computing Devices, Digital or
+ * MIT not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission.
+ *
+ * NETWORK COMPUTING DEVICES, DIGITAL AND MIT DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, DIGITAL OR MIT BE
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "types.h"
+#include <stdio.h>
+#include <string.h>
+#include "util.h"
+#include "ffilest.h"
+#ifdef XSERVER
+#include "FSproto.h"
+#endif
+#include "t1intf.h"
+
+#ifdef WIN32
+static void FontParseXLFDName(char *, FontScalablePtr, int);
+#endif
+static void FontComputeInfoAccelerators(FontInfoPtr);
+
+#define DECIPOINTSPERINCH 722.7
+#define DEFAULTRES 75
+#define DEFAULTPOINTSIZE 120
+
+enum scaleType {
+ atom, pixel_size, point_size, resolution_x, resolution_y,
+ average_width, scaledX, scaledY, unscaled, scaledXoverY,
+ uncomputed
+};
+
+typedef struct _fontProp {
+ const char *name;
+ int32_t atom;
+ enum scaleType type;
+} fontProp;
+
+static fontProp fontNamePropTable[] = { /* Example: */
+ { "FOUNDRY", 0, atom }, /* adobe */
+ { "FAMILY_NAME", 0, atom }, /* times roman */
+ { "WEIGHT_NAME", 0, atom }, /* bold */
+ { "SLANT", 0, atom }, /* i */
+ { "SETWIDTH_NAME", 0, atom }, /* normal */
+ { "ADD_STYLE_NAME", 0, atom }, /* */
+ { "PIXEL_SIZE", 0, pixel_size }, /* 18 */
+ { "POINT_SIZE", 0, point_size }, /* 180 */
+ { "RESOLUTION_X", 0, resolution_x }, /* 72 */
+ { "RESOLUTION_Y", 0, resolution_y }, /* 72 */
+ { "SPACING", 0, atom }, /* p */
+ { "AVERAGE_WIDTH", 0, average_width }, /* 0 */
+ { "CHARSET_REGISTRY", 0, atom }, /* ISO8859 */
+ { "CHARSET_ENCODING", 0, atom } /* 1 */
+};
+
+static fontProp extraProps[] = {
+ { "FONT", 0, atom },
+ { "COPYRIGHT", 0, atom }
+};
+
+/* this is a bit kludgy */
+#define FONTPROP 0
+#define COPYRIGHTPROP 1
+
+#define NNAMEPROPS (sizeof(fontNamePropTable) / sizeof(fontProp))
+#define NEXTRAPROPS (sizeof(extraProps) / sizeof(fontProp))
+
+#define NPROPS (NNAMEPROPS + NEXTRAPROPS)
+
+/*ARGSUSED*/
+static void
+FillHeader(
+ FontInfoPtr pInfo,
+ FontScalablePtr Vals)
+{
+ /* OpenScalable in T1FUNCS sets the following:
+ pInfo->firstCol,
+ pInfo->firstRow,
+ pInfo->lastCol, and
+ pInfo->lastRow. */
+ /* the following are ununsed
+ pInfo->pad. */
+
+ /* Items we should handle better someday +++ */
+ pInfo->defaultCh = 0;
+ pInfo->drawDirection = LeftToRight;
+ /* our size is based only on Vals->pixel, so we won't
+ create an anamorphic font (yet) */
+ pInfo->anamorphic = 0;
+ pInfo->inkMetrics = 0; /* no ink metrics here */
+ pInfo->cachable = 1; /* no licensing (yet) */
+}
+
+static void
+adjust_min_max(xCharInfo *minc, xCharInfo *maxc, xCharInfo *tmp)
+{
+#define MINMAX(field,ci) \
+ if (minc->field > (ci)->field) \
+ minc->field = (ci)->field; \
+ if (maxc->field < (ci)->field) \
+ maxc->field = (ci)->field;
+
+ MINMAX(ascent, tmp);
+ MINMAX(descent, tmp);
+ MINMAX(leftSideBearing, tmp);
+ MINMAX(rightSideBearing, tmp);
+ MINMAX(characterWidth, tmp);
+
+#undef MINMAX
+}
+
+static void
+ComputeBounds(
+ FontInfoPtr pInfo,
+ CharInfoPtr pChars,
+ FontScalablePtr Vals)
+{
+ int i;
+ xCharInfo minchar, maxchar;
+ int32_t width = 0;
+ int numchars = 0;
+ int totchars;
+ int overlap;
+ int maxlap;
+
+ minchar.ascent = minchar.descent =
+ minchar.leftSideBearing = minchar.rightSideBearing =
+ minchar.characterWidth = 32767;
+ minchar.attributes = 0; /* What's this for? +++ */
+ maxchar.ascent = maxchar.descent =
+ maxchar.leftSideBearing = maxchar.rightSideBearing =
+ maxchar.characterWidth = -32767;
+ maxchar.attributes = 0;
+
+ maxlap = -32767;
+ totchars = pInfo->lastCol - pInfo->firstCol + 1;
+ pInfo->allExist = 1;
+ for (i = 0; i < totchars; i++,pChars++) {
+ xCharInfo *pmetrics = &pChars->metrics;
+
+ if (pmetrics->characterWidth) {
+ width += pmetrics->characterWidth;
+ numchars++;
+ adjust_min_max(&minchar, &maxchar, pmetrics);
+ overlap = pmetrics->rightSideBearing - pmetrics->characterWidth;
+ if (overlap > maxlap) maxlap = overlap;
+ }
+ else pInfo->allExist = 0;
+ }
+
+ Vals->width = ((width * 10)+((numchars+1)/2)) / numchars;
+ /* (We think the above average width value should be put into
+ the Vals structure. This may be wrong, and the proper
+ behavior might be to regard the values in Vals as sacred,
+ and for us to squirrel the computed number in a static, and
+ then use that static in ComputeStdProps.) */
+ pInfo->maxbounds = maxchar;
+ pInfo->minbounds = minchar;
+ pInfo->ink_maxbounds = maxchar;
+ pInfo->ink_minbounds = minchar;
+ pInfo->maxOverlap = maxlap + -(minchar.leftSideBearing);
+
+ /* Set the pInfo flags */
+ /* Properties set by FontComputeInfoAccelerators:
+ pInfo->noOverlap;
+ pInfo->terminalFont;
+ pInfo->constantMetrics;
+ pInfo->constantWidth;
+ pInfo->inkInside;
+
+ */
+ FontComputeInfoAccelerators (pInfo);
+}
+
+static void
+ComputeProps(
+ FontInfoPtr pInfo,
+ FontScalablePtr Vals,
+ char *Filename)
+{
+ int infoint;
+ int infoBBox[4];
+ int rc;
+
+ QueryFontLib(Filename, "isFixedPitch", &infoint, &rc);
+ if (!rc) {
+ pInfo->constantWidth = infoint;
+ }
+ QueryFontLib((char *)0, "FontBBox", infoBBox, &rc);
+ if (!rc) {
+ pInfo->fontAscent = (infoBBox[3] * Vals->pixel) / 1000;
+ pInfo->fontDescent = - (infoBBox[1] * Vals->pixel) / 1000;
+ }
+}
+
+static void
+ComputeStdProps(
+ FontInfoPtr pInfo,
+ FontScalablePtr Vals,
+ char *Filename,
+ const char *Fontname)
+{
+ FontPropPtr pp;
+ int i,
+ nprops;
+ fontProp *fpt;
+ char *is_str;
+ char *ptr1,
+ *ptr2;
+ const char *infostrP;
+ int rc;
+ char scaledName[MAXFONTNAMELEN];
+
+ strcpy (scaledName, Fontname);
+#ifdef WIN32
+ /* Fill in our copy of the fontname from the Vals structure */
+ FontParseXLFDName (scaledName, Vals, FONT_XLFD_REPLACE_VALUE);
+#endif
+
+ /* This form of the properties is used by the X-client; the X-server
+ doesn't care what they are. */
+ nprops = pInfo->nprops = NPROPS;
+ pInfo->isStringProp = (char *) Xalloc(sizeof(char) * nprops);
+ pInfo->props = (FontPropPtr) Xalloc(sizeof(FontPropRec) * nprops);
+ if (!pInfo->isStringProp || !pInfo->props) {
+ Xfree(pInfo->isStringProp);
+ pInfo->isStringProp = (char *) 0;
+ Xfree(pInfo->props);
+ pInfo->props = (FontPropPtr) 0;
+ return;
+ }
+ (void) memset(pInfo->isStringProp, 0, (sizeof(char) * nprops));
+
+ ptr2 = scaledName;
+ for (i = NNAMEPROPS, pp = pInfo->props, fpt = fontNamePropTable, is_str = pInfo->isStringProp;
+ i;
+ i--, pp++, fpt++, is_str++) {
+ ptr1 = ptr2 + 1;
+ if (*ptr1 == '-')
+ ptr2 = ptr1;
+ else {
+ if (i > 1)
+ ptr2 = strchr(ptr1 + 1, '-');
+ else
+ ptr2 = strchr(ptr1 + 1, '\0');
+ }
+ pp->name = fpt->atom;
+ switch (fpt->type) {
+ case atom: /* Just copy info from scaledName */
+ *is_str = TRUE;
+ pp->value = MakeAtom(ptr1, ptr2 - ptr1, TRUE);
+ break;
+ case pixel_size:
+ pp->value = Vals->pixel;
+ break;
+ case point_size:
+ pp->value = Vals->point;
+ break;
+ case resolution_x:
+ pp->value = Vals->x;
+ break;
+ case resolution_y:
+ pp->value = Vals->y;
+ break;
+ case average_width:
+ pp->value = Vals->width;
+ break;
+ default: /* scaledX, scaledY, unscaled, scaledXoverY, and uncomputed */
+ break;
+ }
+ }
+
+ for (i = 0, fpt = extraProps;
+ i < NEXTRAPROPS;
+ i++, is_str++, pp++, fpt++) {
+ pp->name = fpt->atom;
+ switch (i) {
+ case FONTPROP:
+ /* Why do we need this property -- nice for debug anyway */
+ *is_str = TRUE;
+ pp->value = MakeAtom(scaledName, strlen(scaledName), TRUE);
+ break;
+ case COPYRIGHTPROP:
+ *is_str = TRUE;
+ QueryFontLib(Filename, "Notice", &infostrP, &rc);
+ if (rc || !infostrP) {
+ infostrP = "Copyright Notice not available";
+ }
+ pp->value = MakeAtom(infostrP, strlen(infostrP), TRUE);
+ break;
+ }
+ }
+}
+
+void
+T1FillFontInfo(
+ FontPtr pFont,
+ FontScalablePtr Vals,
+ char *Filename,
+ const char *Fontname)
+{
+ FontInfoPtr pInfo = &pFont->info;
+ struct type1font *p = (struct type1font *)pFont->fontPrivate;
+
+ FillHeader(pInfo, Vals);
+
+ ComputeBounds(pInfo, p->glyphs, Vals);
+
+ ComputeProps(pInfo, Vals, Filename);
+ ComputeStdProps(pInfo, Vals, Filename, Fontname);
+}
+
+/* Called once, at renderer registration time */
+void
+T1InitStdProps(void)
+{
+ int i;
+ fontProp *t;
+
+ i = sizeof(fontNamePropTable) / sizeof(fontProp);
+ for (t = fontNamePropTable; i; i--, t++)
+ t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE);
+ i = sizeof(extraProps) / sizeof(fontProp);
+ for (t = extraProps; i; i--, t++)
+ t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE);
+}
+
+#ifdef WIN32
+static void FontParseXLFDName(char *scaledName, FontScalablePtr Vals, int foo) { ; }
+#endif
+static void FontComputeInfoAccelerators(FontInfoPtr foo) { ; }
diff --git a/fonts/utilities/ps2pk/t1intf.h b/fonts/utilities/ps2pk/t1intf.h
new file mode 100644
index 0000000000..b79e1cf481
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1intf.h
@@ -0,0 +1,42 @@
+/* $XConsortium: t1intf.h,v 1.2 91/10/10 11:19:39 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#define FIRSTCOL 0
+
+struct type1font {
+ CharInfoPtr pDefault;
+ CharInfoRec glyphs[256-FIRSTCOL];
+};
+
+extern void T1FillFontInfo(struct _Font *pFont,
+ struct _FontScalable *Vals,
+ char *Filename,
+ const char *Fontname);
+extern void T1InitStdProps(void);
diff --git a/fonts/utilities/ps2pk/t1io.c b/fonts/utilities/ps2pk/t1io.c
new file mode 100644
index 0000000000..384e3d19c3
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1io.c
@@ -0,0 +1,287 @@
+/* $XConsortium: t1io.c,v 1.4 91/10/10 11:19:41 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * Author: Carol H. Thompson IBM Almaden Research Center
+ */
+/*******************************************************************
+* I/O package for Type 1 font reading
+********************************************************************/
+
+#ifndef STATIC
+#define STATIC static
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "c-auto.h"
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#include "t1stdio.h"
+#include "t1hdigit.h"
+
+/* Constants and variables used in the decryption */
+#define c1 ((unsigned short)52845)
+#define c2 ((unsigned short)22719)
+static unsigned short r;
+static int asc, Decrypt;
+static int extrach;
+static int haveextrach;
+
+/* Our single FILE structure and buffer for this package */
+STATIC F_FILE TheFile;
+STATIC unsigned char TheBuffer[F_BUFSIZ];
+
+/* Our routines */
+STATIC int T1Decrypt(unsigned char *, int), T1Fill(F_FILE *);
+
+/* -------------------------------------------------------------- */
+/*ARGSUSED*/
+F_FILE *T1Open(
+ char *fn, /* Pointer to filename */
+ char *mode) /* Pointer to open mode string */
+{
+ F_FILE *of = &TheFile;
+
+ Decrypt = 0;
+
+ /* We know we are only reading */
+#if defined(MSDOS) || defined(VMS) || defined(WIN32)
+ if ((of->fd=open(fn, O_RDONLY | O_BINARY)) < 0) return NULL;
+#else
+ if ((of->fd=open(fn, O_RDONLY)) < 0) return NULL;
+#endif
+
+ /* Initialize the buffer information of our file descriptor */
+ of->b_base = TheBuffer;
+ of->b_size = F_BUFSIZ;
+ of->b_ptr = NULL;
+ of->b_cnt = 0;
+ of->flags = 0;
+ of->error = 0;
+ haveextrach = 0;
+ return &TheFile;
+} /* end Open */
+
+/* -------------------------------------------------------------- */
+int T1Getc( /* Read one character */
+ F_FILE *f) /* Stream descriptor */
+{
+ if (f->b_base == NULL) return EOF; /* already closed */
+
+ if (f->flags & UNGOTTENC) { /* there is an ungotten c */
+ f->flags &= ~UNGOTTENC;
+ return (int) f->ungotc;
+ }
+
+ if (f->b_cnt == 0) /* Buffer needs to be (re)filled */
+ f->b_cnt = T1Fill(f);
+ if (f->b_cnt > 0) return (f->b_cnt--, (int) *(f->b_ptr++));
+ else {
+ f->flags |= FIOEOF;
+ return EOF;
+ }
+} /* end Getc */
+
+/* -------------------------------------------------------------- */
+int T1Ungetc( /* Put back one character */
+ int c,
+ F_FILE *f) /* Stream descriptor */
+{
+ if (c != EOF) {
+ f->ungotc = c;
+ f->flags |= UNGOTTENC; /* set flag */
+ f->flags &= ~FIOEOF; /* reset EOF */
+ }
+ return c;
+} /* end Ungetc */
+
+/* -------------------------------------------------------------- */
+int T1Read( /* Read n items into caller's buffer */
+ char *buffP, /* Buffer to be filled */
+ int size, /* Size of each item */
+ int n, /* Number of items to read */
+ F_FILE *f) /* Stream descriptor */
+{
+ int bytelen, cnt, i;
+ F_char *p = (F_char *)buffP;
+ int icnt; /* Number of characters to read */
+
+ if (f->b_base == NULL) return 0; /* closed */
+ icnt = (size!=1)?n*size:n; /* Number of bytes we want */
+
+ if (f->flags & UNGOTTENC) { /* there is an ungotten c */
+ f->flags &= ~UNGOTTENC;
+ *(p++) = f->ungotc;
+ icnt--; bytelen = 1;
+ }
+ else bytelen = 0;
+
+ while (icnt > 0) {
+ /* First use any bytes we have buffered in the stream buffer */
+ if ((cnt=f->b_cnt) > 0) {
+ if (cnt > icnt) cnt = icnt;
+ for (i=0; i<cnt; i++) *(p++) = *(f->b_ptr++);
+ f->b_cnt -= cnt;
+ icnt -= cnt;
+ bytelen += cnt;
+ }
+
+ if ((icnt == 0) || (f->flags & FIOEOF)) break;
+
+ f->b_cnt = T1Fill(f);
+ }
+ return ((size!=1)?bytelen/size:bytelen);
+} /* end Read */
+
+/* -------------------------------------------------------------- */
+int T1Close( /* Close the file */
+ F_FILE *f) /* Stream descriptor */
+{
+ if (f->b_base == NULL) return 0; /* already closed */
+ f->b_base = NULL; /* no valid stream */
+ return close(f->fd);
+} /* end Close */
+
+/* -------------------------------------------------------------- */
+F_FILE *T1eexec( /* Initialization */
+ F_FILE *f) /* Stream descriptor */
+{
+ int i, c;
+ int H;
+ unsigned char *p;
+ unsigned char randomP[8];
+
+ r = 55665; /* initial key */
+ asc = 1; /* indicate ASCII form */
+
+ /* Consume the 4 random bytes, determining if we are also to
+ ASCIIDecodeHex as we process our input. (See pages 63-64
+ of the Adobe Type 1 Font Format book.) */
+
+ /* Skip over any initial white space chars */
+ while (HighHexP[c=getc(f)] == HWHITE_SPACE) ;
+
+ /* If ASCII, the next 7 chars are guaranteed consecutive */
+ randomP[0] = c; /* store first non white space char */
+ fread((char *)randomP+1, 1, 3, f); /* read 3 more, for a total of 4 */
+ /* store first four chars */
+ for (i=0,p=randomP; i<4; i++) { /* Check 4 valid ASCIIEncode chars */
+ if (HighHexP[*p++] > LAST_HDIGIT) { /* non-ASCII byte */
+ asc = 0;
+ break;
+ }
+ }
+ if (asc) { /* ASCII form, convert first eight bytes to binary */
+ fread((char *)randomP+4, 1, 4, f); /* Need four more */
+ for (i=0,p=randomP; i<4; i++) { /* Convert */
+ H = HighHexP[*p++];
+ randomP[i] = H | LowHexP[*p++];
+ }
+ }
+
+ /* Adjust our key */
+ for (i=0,p=randomP; i<4; i++) {
+ r = (*p++ + r) * c1 + c2;
+ }
+
+ /* Decrypt the remaining buffered bytes */
+ f->b_cnt = T1Decrypt(f->b_ptr, f->b_cnt);
+ Decrypt = 1;
+ return (feof(f))?NULL:f;
+} /* end eexec */
+
+/* -------------------------------------------------------------- */
+STATIC int T1Decrypt(unsigned char *p, int len)
+{
+ int n;
+ int H = 0, L;
+ unsigned char *inp = p;
+ unsigned char *tblP;
+
+ if (asc) {
+ if (haveextrach) {
+ H = extrach;
+ tblP = LowHexP;
+ }
+ else tblP = HighHexP;
+ for (n=0; len>0; len--) {
+ L = tblP[*inp++];
+ if (L == HWHITE_SPACE) continue;
+ if (L > LAST_HDIGIT) break;
+ if (tblP == HighHexP) { /* Got first hexit value */
+ H = L;
+ tblP = LowHexP;
+ } else { /* Got second hexit value; compute value and store it */
+ n++;
+ tblP = HighHexP;
+ H |= L;
+ /* H is an int, 0 <= H <= 255, so all of this will work */
+ *p++ = H ^ (r >> 8);
+ r = (H + r) * c1 + c2;
+ }
+ }
+ if (tblP != HighHexP) { /* We had an odd number of hexits */
+ extrach = H;
+ haveextrach = 1;
+ } else haveextrach = 0;
+ return n;
+ } else {
+ for (n = len; n>0; n--) {
+ H = *inp++;
+ *p++ = H ^ (r >> 8);
+ r = (H + r) * c1 + c2;
+ }
+ return len;
+ }
+} /* end Decrypt */
+
+/* -------------------------------------------------------------- */
+STATIC int T1Fill( /* Refill stream buffer */
+ F_FILE *f) /* Stream descriptor */
+{
+ int rc;
+
+ rc = read(f->fd, f->b_base, F_BUFSIZ);
+ /* propagate any error or eof to current file */
+ if (rc <= 0) {
+ if (rc == 0) /* means EOF */
+ f->flags |= FIOEOF;
+ else {
+ f->error = (short)-rc;
+ f->flags |= FIOERROR;
+ rc = 0;
+ }
+ }
+ f->b_ptr = f->b_base;
+ if (Decrypt) rc = T1Decrypt(f->b_base, rc);
+ return rc;
+} /* end Fill */
diff --git a/fonts/utilities/ps2pk/t1snap.c b/fonts/utilities/ps2pk/t1snap.c
new file mode 100644
index 0000000000..7f1f29c1bc
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1snap.c
@@ -0,0 +1,81 @@
+/* $XConsortium: t1snap.c,v 1.3 91/10/10 11:19:47 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include "types.h"
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "pictures.h"
+
+/*
+:h2.Handle Functions
+
+:h3.Phantom() - Returns a Move Segment Equivalent to Handles
+
+This is a user operator. Its new name is QueryHandle.
+*/
+
+struct segment *t1_Phantom(
+ register struct segment *obj) /* object to take the Phantom of */
+{
+ struct fractpoint pt; /* handle size will built here */
+
+ if (obj == NULL)
+ pt.x = pt.y = 0;
+ else
+ PathDelta(obj, &pt);
+
+ return(PathSegment(MOVETYPE, pt.x, pt.y));
+}
+
+/*
+:h3.Snap() - Force Ending Handle of Object to Origin
+
+This is a user operator.
+*/
+
+struct segment *t1_Snap(
+ register struct segment *p) /* path to snap */
+{
+ struct fractpoint pt; /* for finding length of path */
+
+ if (p == NULL)
+ return(NULL);
+ p = UniquePath(p);
+
+ PathDelta(p, &pt);
+ if (p->last->type == MOVETYPE) {
+ p->last->dest.x -= pt.x;
+ p->last->dest.y -= pt.y;
+ }
+ else
+ p = JoinSegment(p, MOVETYPE, -pt.x, -pt.y, NULL);
+ return(p);
+}
diff --git a/fonts/utilities/ps2pk/t1stdio.h b/fonts/utilities/ps2pk/t1stdio.h
new file mode 100644
index 0000000000..f19d9627ed
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1stdio.h
@@ -0,0 +1,110 @@
+/* $XConsortium: t1stdio.h,v 1.4 91/10/10 11:19:49 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* T1IO FILE structure and related stuff */
+
+#include "types.h"
+
+#define FILE F_FILE
+typedef unsigned char F_char;
+
+typedef struct F_FILE {
+ F_char *b_base; /* Pointer to beginning of buffer */
+ int32_t b_size; /* Size of the buffer */
+ F_char *b_ptr; /* Pointer to next char in buffer */
+ int32_t b_cnt; /* Number of chars remaining in buffer */
+ F_char flags; /* other flags; != 0 means getc must call fgetc */
+ F_char ungotc; /* Place for ungotten char; flag set if present */
+ short error; /* error status */
+ int fd; /* underlying file descriptor */
+} F_FILE;
+
+
+/* defines for flags */
+#define UNGOTTENC (0x01)
+#define FIOEOF (0x80)
+#define FIOERROR (0x40)
+
+#ifndef NULL
+#define NULL 0 /* null pointer */
+#endif
+#define EOF (-1) /* end of file */
+#define F_BUFSIZ (512)
+
+#ifdef fopen
+#undef fopen
+#endif
+
+#ifdef fclose
+#undef fclose
+#endif
+
+#ifdef feof
+#undef feof
+#endif
+
+#ifdef ferror
+#undef ferror
+#endif
+
+#ifdef fread
+#undef fread
+#endif
+
+#ifdef getc
+#undef getc
+#endif
+
+#ifdef ungetc
+#undef ungetc
+#endif
+
+#ifdef fgetc
+#undef fgetc
+#endif
+
+#define getc(f) \
+ ( \
+ ( ((f)->b_cnt > 0) && ((f)->flags == 0) ) ? \
+ ( (f)->b_cnt--, (unsigned int)*( (f)->b_ptr++ ) ) : \
+ T1Getc(f) \
+ )
+
+extern F_FILE *T1Open(char *, char *), *T1eexec(F_FILE *);
+extern int T1Close(F_FILE *);
+extern int T1Read(char *, int, int, F_FILE *),
+ T1Getc(F_FILE *), T1Ungetc(int, F_FILE *);
+
+#define fclose(f) T1Close(f)
+#define fopen(name,mode) T1Open(name,mode)
+#define ungetc(c,f) T1Ungetc(c,f)
+#define fgetc(f) T1Getc(f)
+#define fread(bufP,size,n,f) T1Read(bufP,size,n,f)
+#define feof(f) (((f)->flags & FIOEOF) && ((f)->b_cnt==0))
+#define ferror(f) (((f)->flags & FIOERROR)?(f)->error:0)
diff --git a/fonts/utilities/ps2pk/t1stub.c b/fonts/utilities/ps2pk/t1stub.c
new file mode 100644
index 0000000000..6405b64c10
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1stub.c
@@ -0,0 +1,44 @@
+/* $XConsortium: t1stub.c,v 1.3 92/03/20 15:58:40 eswu Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include "objects.h" /* get #define for t1_abort() */
+
+xiStub(void)
+{
+ printf("xiStub called\n");
+ t1_abort("xiStub called");
+}
+
+struct segment;
+
+void t1_DumpText(struct segment * foo)
+{
+ xiStub();
+}
diff --git a/fonts/utilities/ps2pk/t1test.c b/fonts/utilities/ps2pk/t1test.c
new file mode 100644
index 0000000000..6629117378
--- /dev/null
+++ b/fonts/utilities/ps2pk/t1test.c
@@ -0,0 +1,529 @@
+/* $XConsortium: t1test.c,v 1.2 91/10/10 11:19:53 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include "ffilest.h"
+#ifdef XSERVER
+#include "FSproto.h"
+#endif
+
+void Display();
+
+#define DECIPOINTSPERINCH 722.7
+#define DEFAULTRES 75
+#define DEFAULTPOINTSIZE 120
+
+FontScalableRec vals;
+FontEntryRec entry;
+
+typedef char *encoding[256];
+
+/* PostScript ISOLatin1Encoding */
+
+char *ISOLatin1[256] = {
+ /* '000 000 "00 */ NULL,
+ /* '001 001 "01 */ NULL,
+ /* '002 002 "02 */ NULL,
+ /* '003 003 "03 */ NULL,
+ /* '004 004 "04 */ NULL,
+ /* '005 005 "05 */ NULL,
+ /* '006 006 "06 */ NULL,
+ /* '007 007 "07 */ NULL,
+ /* '010 008 "08 */ NULL,
+ /* '011 009 "09 */ NULL,
+ /* '012 010 "0A */ NULL,
+ /* '013 011 "0B */ NULL,
+ /* '014 012 "0C */ NULL,
+ /* '015 013 "0D */ NULL,
+ /* '016 014 "0E */ NULL,
+ /* '017 015 "0F */ NULL,
+ /* '020 016 "10 */ NULL,
+ /* '021 017 "11 */ NULL,
+ /* '022 018 "12 */ NULL,
+ /* '023 019 "13 */ NULL,
+ /* '024 020 "14 */ NULL,
+ /* '025 021 "15 */ NULL,
+ /* '026 022 "16 */ NULL,
+ /* '027 023 "17 */ NULL,
+ /* '030 024 "18 */ NULL,
+ /* '031 025 "19 */ NULL,
+ /* '032 026 "1A */ NULL,
+ /* '033 027 "1B */ NULL,
+ /* '034 028 "1C */ NULL,
+ /* '035 029 "1D */ NULL,
+ /* '036 030 "1E */ NULL,
+ /* '037 031 "1F */ NULL,
+ /* '040 032 "20 */ "space",
+ /* '041 033 "21 */ "exclam",
+ /* '042 034 "22 */ "quotedbl",
+ /* '043 035 "23 */ "numbersign",
+ /* '044 036 "24 */ "dollar",
+ /* '045 037 "25 */ "percent",
+ /* '046 038 "26 */ "ampersand",
+ /* '047 039 "27 */ "quoteright",
+ /* '050 040 "28 */ "parenleft",
+ /* '051 041 "29 */ "parenright",
+ /* '052 042 "2A */ "asterisk",
+ /* '053 043 "2B */ "plus",
+ /* '054 044 "2C */ "comma",
+ /* '055 045 "2D */ "hyphen",
+ /* '056 046 "2E */ "period",
+ /* '057 047 "2F */ "slash",
+ /* '060 048 "30 */ "zero",
+ /* '061 049 "31 */ "one",
+ /* '062 050 "32 */ "two",
+ /* '063 051 "33 */ "three",
+ /* '064 052 "34 */ "four",
+ /* '065 053 "35 */ "five",
+ /* '066 054 "36 */ "six",
+ /* '067 055 "37 */ "seven",
+ /* '070 056 "38 */ "eight",
+ /* '071 057 "39 */ "nine",
+ /* '072 058 "3A */ "colon",
+ /* '073 059 "3B */ "semicolon",
+ /* '074 060 "3C */ "less",
+ /* '075 061 "3D */ "equal",
+ /* '076 062 "3E */ "greater",
+ /* '077 063 "3F */ "question",
+ /* '100 064 "40 */ "at",
+ /* '101 065 "41 */ "A",
+ /* '102 066 "42 */ "B",
+ /* '103 067 "43 */ "C",
+ /* '104 068 "44 */ "D",
+ /* '105 069 "45 */ "E",
+ /* '106 070 "46 */ "F",
+ /* '107 071 "47 */ "G",
+ /* '110 072 "48 */ "H",
+ /* '111 073 "49 */ "I",
+ /* '112 074 "4A */ "J",
+ /* '113 075 "4B */ "K",
+ /* '114 076 "4C */ "L",
+ /* '115 077 "4D */ "M",
+ /* '116 078 "4E */ "N",
+ /* '117 079 "4F */ "O",
+ /* '120 080 "50 */ "P",
+ /* '121 081 "51 */ "Q",
+ /* '122 082 "52 */ "R",
+ /* '123 083 "53 */ "S",
+ /* '124 084 "54 */ "T",
+ /* '125 085 "55 */ "U",
+ /* '126 086 "56 */ "V",
+ /* '127 087 "57 */ "W",
+ /* '130 088 "58 */ "X",
+ /* '131 089 "59 */ "Y",
+ /* '132 090 "5A */ "Z",
+ /* '133 091 "5B */ "bracketleft",
+ /* '134 092 "5C */ "backslash",
+ /* '135 093 "5D */ "bracketright",
+ /* '136 094 "5E */ "asciicircum",
+ /* '137 095 "5F */ "underscore",
+ /* '140 096 "60 */ "quoteleft",
+ /* '141 097 "61 */ "a",
+ /* '142 098 "62 */ "b",
+ /* '143 099 "63 */ "c",
+ /* '144 100 "64 */ "d",
+ /* '145 101 "65 */ "e",
+ /* '146 102 "66 */ "f",
+ /* '147 103 "67 */ "g",
+ /* '150 104 "68 */ "h",
+ /* '151 105 "69 */ "i",
+ /* '152 106 "6A */ "j",
+ /* '153 107 "6B */ "k",
+ /* '154 108 "6C */ "l",
+ /* '155 109 "6D */ "m",
+ /* '156 110 "6E */ "n",
+ /* '157 111 "6F */ "o",
+ /* '160 112 "70 */ "p",
+ /* '161 113 "71 */ "q",
+ /* '162 114 "72 */ "r",
+ /* '163 115 "73 */ "s",
+ /* '164 116 "74 */ "t",
+ /* '165 117 "75 */ "u",
+ /* '166 118 "76 */ "v",
+ /* '167 119 "77 */ "w",
+ /* '170 120 "78 */ "x",
+ /* '171 121 "79 */ "y",
+ /* '172 122 "7A */ "z",
+ /* '173 123 "7B */ "braceleft",
+ /* '174 124 "7C */ "bar",
+ /* '175 125 "7D */ "braceright",
+ /* '176 126 "7E */ "asciitilde",
+ /* '177 127 "7F */ NULL,
+ /* '200 128 "80 */ NULL,
+ /* '201 129 "81 */ NULL,
+ /* '202 130 "82 */ NULL,
+ /* '203 131 "83 */ NULL,
+ /* '204 132 "84 */ NULL,
+ /* '205 133 "85 */ NULL,
+ /* '206 134 "86 */ NULL,
+ /* '207 135 "87 */ NULL,
+ /* '210 136 "88 */ NULL,
+ /* '211 137 "89 */ NULL,
+ /* '212 138 "8A */ NULL,
+ /* '213 139 "8B */ NULL,
+ /* '214 140 "8C */ NULL,
+ /* '215 141 "8D */ NULL,
+ /* '216 142 "8E */ NULL,
+ /* '217 143 "8F */ NULL,
+ /* '220 144 "90 */ "dotlessi",
+ /* '221 145 "91 */ "grave",
+ /* '222 146 "92 */ "acute",
+ /* '223 147 "93 */ "circumflex",
+ /* '224 148 "94 */ "tilde",
+ /* '225 149 "95 */ "macron",
+ /* '226 150 "96 */ "breve",
+ /* '227 151 "97 */ "dotaccent",
+ /* '230 152 "98 */ "dieresis",
+ /* '231 153 "99 */ NULL,
+ /* '232 154 "9A */ "ring",
+ /* '233 155 "9B */ "cedilla",
+ /* '234 156 "9C */ NULL,
+ /* '235 157 "9D */ "hungarumlaut",
+ /* '236 158 "9E */ "ogonek",
+ /* '237 159 "9F */ "caron",
+ /* '240 160 "A0 */ "space",
+ /* '241 161 "A1 */ "exclamdown",
+ /* '242 162 "A2 */ "cent",
+ /* '243 163 "A3 */ "sterling",
+ /* '244 164 "A4 */ "currency",
+ /* '245 165 "A5 */ "yen",
+ /* '246 166 "A6 */ "brokenbar",
+ /* '247 167 "A7 */ "section",
+ /* '250 168 "A8 */ "dieresis",
+ /* '251 169 "A9 */ "copyright",
+ /* '252 170 "AA */ "ordfeminine",
+ /* '253 171 "AB */ "guillemotleft",
+ /* '254 172 "AC */ "logicalnot",
+ /* '255 173 "AD */ "hyphen",
+ /* '256 174 "AE */ "registered",
+ /* '257 175 "AF */ "macron",
+ /* '260 176 "B0 */ "degree",
+ /* '261 177 "B1 */ "plusminus",
+ /* '262 178 "B2 */ "twosuperior",
+ /* '263 179 "B3 */ "threesuperior",
+ /* '264 180 "B4 */ "acute",
+ /* '265 181 "B5 */ "mu",
+ /* '266 182 "B6 */ "paragraph",
+ /* '267 183 "B7 */ "periodcentered",
+ /* '270 184 "B8 */ "cedilla",
+ /* '271 185 "B9 */ "onesuperior",
+ /* '272 186 "BA */ "ordmasculine",
+ /* '273 187 "BB */ "guillemotright",
+ /* '274 188 "BC */ "onequarter",
+ /* '275 189 "BD */ "onehalf",
+ /* '276 190 "BE */ "threequarters",
+ /* '277 191 "BF */ "questiondown",
+ /* '300 192 "C0 */ "Agrave",
+ /* '301 193 "C1 */ "Aacute",
+ /* '302 194 "C2 */ "Acircumflex",
+ /* '303 195 "C3 */ "Atilde",
+ /* '304 196 "C4 */ "Adieresis",
+ /* '305 197 "C5 */ "Aring",
+ /* '306 198 "C6 */ "AE",
+ /* '307 199 "C7 */ "Ccedilla",
+ /* '310 200 "C8 */ "Egrave",
+ /* '311 201 "C9 */ "Eacute",
+ /* '312 202 "CA */ "Ecircumflex",
+ /* '313 203 "CB */ "Edieresis",
+ /* '314 204 "CC */ "Igrave",
+ /* '315 205 "CD */ "Iacute",
+ /* '316 206 "CE */ "Icircumflex",
+ /* '317 207 "CF */ "Idieresis",
+ /* '320 208 "D0 */ "Eth",
+ /* '321 209 "D1 */ "Ntilde",
+ /* '322 210 "D2 */ "Ograve",
+ /* '323 211 "D3 */ "Oacute",
+ /* '324 212 "D4 */ "Ocircumflex",
+ /* '325 213 "D5 */ "Otilde",
+ /* '326 214 "D6 */ "Odieresis",
+ /* '327 215 "D7 */ "multiply",
+ /* '330 216 "D8 */ "Oslash",
+ /* '331 217 "D9 */ "Ugrave",
+ /* '332 218 "DA */ "Uacute",
+ /* '333 219 "DB */ "Ucircumflex",
+ /* '334 220 "DC */ "Udieresis",
+ /* '335 221 "DD */ "Yacute",
+ /* '336 222 "DE */ "Thorn",
+ /* '337 223 "DF */ "Germandbls",
+ /* '340 224 "E0 */ "agrave",
+ /* '341 225 "E1 */ "aacute",
+ /* '342 226 "E2 */ "acircumflex",
+ /* '343 227 "E3 */ "atilde",
+ /* '344 228 "E4 */ "adieresis",
+ /* '345 229 "E5 */ "aring",
+ /* '346 230 "E6 */ "ae",
+ /* '347 231 "E7 */ "ccedilla",
+ /* '350 232 "E8 */ "egrave",
+ /* '351 233 "E9 */ "eacute",
+ /* '352 234 "EA */ "ecircumflex",
+ /* '353 235 "EB */ "edieresis",
+ /* '354 236 "EC */ "igrave",
+ /* '355 237 "ED */ "iacute",
+ /* '356 238 "EE */ "icircumflex",
+ /* '357 239 "EF */ "idieresis",
+ /* '360 240 "F0 */ "eth",
+ /* '361 241 "F1 */ "ntilde",
+ /* '362 242 "F2 */ "ograve",
+ /* '363 243 "F3 */ "oacute",
+ /* '364 244 "F4 */ "ocircumflex",
+ /* '365 245 "F5 */ "otilde",
+ /* '366 246 "F6 */ "odieresis",
+ /* '367 247 "F7 */ "divide",
+ /* '370 248 "F8 */ "oslash",
+ /* '371 249 "F9 */ "ugrave",
+ /* '372 250 "FA */ "uacute",
+ /* '373 251 "FB */ "ucircumflex",
+ /* '374 252 "FC */ "udieresis",
+ /* '375 253 "FD */ "yacute",
+ /* '376 254 "FE */ "thorn",
+ /* '377 255 "FF */ "ydieresis"};
+
+int main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int h;
+ char temp[80];
+ char file[80];
+ char glyphcode[1];
+ FontPtr fontptr;
+ CharInfoRec *glyphs[1];
+ int count;
+ int code;
+ int rc = -1;
+ float efactor = 1.0, slant = 0.0;
+ encoding *ev = &ISOLatin1;
+
+ T1FillVals(&vals);
+ Type1RegisterFontFileFunctions();
+ entry.name.name = "-adobe-utopia-medium-r-normal--0-0-0-0-p-0-iso8859-1";
+
+ for (;;) {
+ printf("T1TEST: ");
+ gets(temp);
+ glyphcode[0] = '\0';
+
+ switch(temp[0]) {
+
+ case 'E':
+ if (1 != sscanf(&temp[2], "%f", &efactor))
+ printf("expansion factor?\n");
+ break;
+
+ case 'S':
+ if (1 != sscanf(&temp[2], "%f", &slant))
+ printf("slant?\n");
+ break;
+
+ case 'c':
+ if (1 != sscanf(&temp[2], "%c", glyphcode))
+ printf("glyph code?\n");
+ break;
+
+ case 'x':
+ if (1 != sscanf(&temp[2], "%x", &code))
+ printf("glyph code?\n");
+ else
+ glyphcode[0] = code;
+ break;
+
+ case 'd':
+ if (1 != sscanf(&temp[2], "%d", &code))
+ printf("glyph code?\n");
+ else
+ glyphcode[0] = code;
+ break;
+
+ case 'h':
+ if (1 != sscanf(&temp[2], "%d", &h))
+ printf("height?\n");
+ vals.pixel = h;
+ vals.point = (vals.pixel * DECIPOINTSPERINCH) / vals.y;
+ rc = Type1OpenScalable(*ev, &fontptr, 0, &entry,
+ file, &vals, 0, 0, efactor, slant);
+ break;
+
+ case 'f':
+ if (1 != sscanf(&temp[2], "%s", file))
+ printf("file name?\n");
+ rc = Type1OpenScalable(*ev, &fontptr, 0, &entry,
+ file, &vals, 0, 0, efactor, slant);
+ break;
+
+ case 't':
+ if (1 != sscanf(&temp[2], "%s", file))
+ printf("file name?\n");
+ vals.pixel = 8;
+ rc = Type1OpenScalable(*ev, &fontptr, 0, &entry,
+ file, &vals, 0, 0, efactor, slant);
+ if (rc != Successful) break;
+ vals.pixel = 20;
+ rc = Type1OpenScalable(*ev, &fontptr, 0, &entry,
+ file, &vals, 0, 0, efactor, slant);
+ if (rc != Successful) break;
+ vals.pixel = 50;
+ rc = Type1OpenScalable(*ev, &fontptr, 0, &entry,
+ file, &vals, 0, 0, efactor, slant);
+ glyphcode[0] = 'A';
+ printf("From font '%s':\n", file);
+ break;
+
+ case 'q':
+ return 0;
+
+ default:
+ printf("unknown command '%c', must one of 'ESqfchdxt'\n", temp[0]);
+
+ }
+ if (rc == Successful) {
+ if (glyphcode[0] != '\0') {
+ (*fontptr->get_glyphs)(fontptr, 1, glyphcode, 0, &count, glyphs);
+ if (count > 0)
+ Display(glyphs[0]);
+ else
+ printf("Code %x not valid in this font\n", glyphcode[0]);
+ }
+ }
+ else
+ printf("Bad font (rc = %d, file='%s')\n", rc, file);
+ }
+}
+
+void Display(glyph)
+ CharInfoRec *glyph;
+{
+ int h,w;
+ unsigned char *p;
+ int data;
+ int i;
+
+ p = (unsigned char *) glyph->bits;
+
+ printf("Metrics: left=%d, right=%d, w=%d, above=%d, below=%d\n",
+ glyph->metrics.leftSideBearing,
+ glyph->metrics.rightSideBearing,
+ glyph->metrics.characterWidth,
+ glyph->metrics.ascent,
+ glyph->metrics.descent);
+
+ for (h=glyph->metrics.ascent + glyph->metrics.descent; --h >= 0;) {
+ w = glyph->metrics.rightSideBearing - glyph->metrics.leftSideBearing;
+ while (w > 0) {
+ data = *p++;
+ for (i=0; i<8; i++) {
+ if (--w < 0)
+ break;
+ if (data & 0x80)
+ printf("X");
+ else
+ printf(".");
+ data <<= 1;
+ }
+ }
+ printf("\n");
+ }
+}
+
+T1FillVals(vals)
+ FontScalablePtr vals;
+{
+ fsResolution *res;
+ int x_res = DEFAULTRES;
+ int y_res = DEFAULTRES;
+ int pointsize = DEFAULTPOINTSIZE; /* decipoints */
+ int num_res;
+
+ /* Must have x, y, and pixel */
+ if (!vals->x || !vals->y || !vals->pixel) {
+ res = (fsResolution *) GetClientResolutions(&num_res);
+ if (num_res) {
+ if (res->x_resolution)
+ x_res = res->x_resolution;
+ if (res->y_resolution)
+ y_res = res->y_resolution;
+ if (res->point_size)
+ pointsize = res->point_size;
+ }
+ if (!vals->x)
+ vals->x = x_res;
+ if (!vals->y)
+ vals->y = y_res;
+ if (!vals->point) {
+ if (!vals->pixel) vals->point = pointsize;
+ else vals->point = (vals->pixel * DECIPOINTSPERINCH) / vals->y;
+ }
+ if (!vals->pixel)
+ vals->pixel = (vals->point * vals->y) / DECIPOINTSPERINCH;
+ /* Make sure above arithmetic is normally in range and will
+ round properly. +++ */
+ }
+}
+
+int CheckFSFormat(format, fmask, bit, byte, scan, glyph, image)
+ int format,fmask,*bit,*byte,*scan,*glyph,*image;
+{
+ *bit = *byte = 1;
+ *glyph = *scan = *image = 1;
+ return Successful;
+
+}
+
+char *MakeAtom(p)
+ char *p;
+{
+ return p;
+}
+GetClientResolutions(resP)
+ int *resP;
+{
+ *resP = 0;
+};
+
+char *Xalloc(size)
+ int size;
+{
+ extern char *malloc();
+ return(malloc(size));
+}
+
+void Xfree()
+{
+ free();
+}
+
+FontDefaultFormat() { ; }
+
+FontFileRegisterRenderer() { ; }
+
+GenericGetBitmaps() { ; }
+GenericGetExtents() { ; }
+
+FontParseXLFDName() { ; }
+FontComputeInfoAccelerators() { ; }
diff --git a/fonts/utilities/ps2pk/tests/Symbol.afm b/fonts/utilities/ps2pk/tests/Symbol.afm
new file mode 100644
index 0000000000..1cdbdae695
--- /dev/null
+++ b/fonts/utilities/ps2pk/tests/Symbol.afm
@@ -0,0 +1,209 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Wed Jan 17 21:48:26 1990
+Comment UniqueID 27004
+Comment VMusage 28489 37622
+FontName Symbol
+FullName Symbol
+FamilyName Symbol
+Weight Medium
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -180 -293 1090 1010
+UnderlinePosition -98
+UnderlineThickness 54
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
+EncodingScheme FontSpecific
+StartCharMetrics 189
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 128 -17 240 672 ;
+C 34 ; WX 713 ; N universal ; B 31 0 681 705 ;
+C 35 ; WX 500 ; N numbersign ; B 20 -16 481 673 ;
+C 36 ; WX 549 ; N existential ; B 25 0 478 707 ;
+C 37 ; WX 833 ; N percent ; B 63 -36 771 655 ;
+C 38 ; WX 778 ; N ampersand ; B 41 -18 750 661 ;
+C 39 ; WX 439 ; N suchthat ; B 48 -17 414 500 ;
+C 40 ; WX 333 ; N parenleft ; B 53 -191 300 673 ;
+C 41 ; WX 333 ; N parenright ; B 30 -191 277 673 ;
+C 42 ; WX 500 ; N asteriskmath ; B 65 134 427 551 ;
+C 43 ; WX 549 ; N plus ; B 10 0 539 533 ;
+C 44 ; WX 250 ; N comma ; B 56 -152 194 104 ;
+C 45 ; WX 549 ; N minus ; B 11 233 535 288 ;
+C 46 ; WX 250 ; N period ; B 69 -17 181 95 ;
+C 47 ; WX 278 ; N slash ; B 0 -18 254 646 ;
+C 48 ; WX 500 ; N zero ; B 23 -17 471 685 ;
+C 49 ; WX 500 ; N one ; B 117 0 390 673 ;
+C 50 ; WX 500 ; N two ; B 25 0 475 686 ;
+C 51 ; WX 500 ; N three ; B 39 -17 435 685 ;
+C 52 ; WX 500 ; N four ; B 16 0 469 685 ;
+C 53 ; WX 500 ; N five ; B 29 -17 443 685 ;
+C 54 ; WX 500 ; N six ; B 36 -17 467 685 ;
+C 55 ; WX 500 ; N seven ; B 24 -16 448 673 ;
+C 56 ; WX 500 ; N eight ; B 54 -18 440 685 ;
+C 57 ; WX 500 ; N nine ; B 31 -18 460 685 ;
+C 58 ; WX 278 ; N colon ; B 81 -17 193 460 ;
+C 59 ; WX 278 ; N semicolon ; B 83 -152 221 460 ;
+C 60 ; WX 549 ; N less ; B 26 0 523 522 ;
+C 61 ; WX 549 ; N equal ; B 11 141 537 390 ;
+C 62 ; WX 549 ; N greater ; B 26 0 523 522 ;
+C 63 ; WX 444 ; N question ; B 70 -17 412 686 ;
+C 64 ; WX 549 ; N congruent ; B 11 0 537 475 ;
+C 65 ; WX 722 ; N Alpha ; B 4 0 684 673 ;
+C 66 ; WX 667 ; N Beta ; B 29 0 592 673 ;
+C 67 ; WX 722 ; N Chi ; B -9 0 704 673 ;
+C 68 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C 69 ; WX 611 ; N Epsilon ; B 32 0 617 673 ;
+C 70 ; WX 763 ; N Phi ; B 26 0 741 673 ;
+C 71 ; WX 603 ; N Gamma ; B 24 0 609 673 ;
+C 72 ; WX 722 ; N Eta ; B 39 0 729 673 ;
+C 73 ; WX 333 ; N Iota ; B 32 0 316 673 ;
+C 74 ; WX 631 ; N theta1 ; B 18 -18 623 689 ;
+C 75 ; WX 722 ; N Kappa ; B 35 0 722 673 ;
+C 76 ; WX 686 ; N Lambda ; B 6 0 680 688 ;
+C 77 ; WX 889 ; N Mu ; B 28 0 887 673 ;
+C 78 ; WX 722 ; N Nu ; B 29 -8 720 673 ;
+C 79 ; WX 722 ; N Omicron ; B 41 -17 715 685 ;
+C 80 ; WX 768 ; N Pi ; B 25 0 745 673 ;
+C 81 ; WX 741 ; N Theta ; B 41 -17 715 685 ;
+C 82 ; WX 556 ; N Rho ; B 28 0 563 673 ;
+C 83 ; WX 592 ; N Sigma ; B 5 0 589 673 ;
+C 84 ; WX 611 ; N Tau ; B 33 0 607 673 ;
+C 85 ; WX 690 ; N Upsilon ; B -8 0 694 673 ;
+C 86 ; WX 439 ; N sigma1 ; B 40 -233 436 500 ;
+C 87 ; WX 768 ; N Omega ; B 34 0 736 688 ;
+C 88 ; WX 645 ; N Xi ; B 40 0 599 673 ;
+C 89 ; WX 795 ; N Psi ; B 15 0 781 684 ;
+C 90 ; WX 611 ; N Zeta ; B 44 0 636 673 ;
+C 91 ; WX 333 ; N bracketleft ; B 86 -155 299 674 ;
+C 92 ; WX 863 ; N therefore ; B 163 0 701 478 ;
+C 93 ; WX 333 ; N bracketright ; B 33 -155 246 674 ;
+C 94 ; WX 658 ; N perpendicular ; B 15 0 652 674 ;
+C 95 ; WX 500 ; N underscore ; B -2 -252 502 -206 ;
+C 96 ; WX 500 ; N radicalex ; B 480 881 1090 917 ;
+C 97 ; WX 631 ; N alpha ; B 41 -18 622 500 ;
+C 98 ; WX 549 ; N beta ; B 61 -223 515 741 ;
+C 99 ; WX 549 ; N chi ; B 12 -231 522 499 ;
+C 100 ; WX 494 ; N delta ; B 40 -19 481 740 ;
+C 101 ; WX 439 ; N epsilon ; B 22 -19 427 502 ;
+C 102 ; WX 521 ; N phi ; B 27 -224 490 671 ;
+C 103 ; WX 411 ; N gamma ; B 5 -225 484 499 ;
+C 104 ; WX 603 ; N eta ; B 0 -202 527 514 ;
+C 105 ; WX 329 ; N iota ; B 0 -17 301 503 ;
+C 106 ; WX 603 ; N phi1 ; B 36 -224 587 499 ;
+C 107 ; WX 549 ; N kappa ; B 33 0 558 501 ;
+C 108 ; WX 549 ; N lambda ; B 24 -17 548 739 ;
+C 109 ; WX 576 ; N mu ; B 33 -223 567 500 ;
+C 110 ; WX 521 ; N nu ; B -9 -16 475 507 ;
+C 111 ; WX 549 ; N omicron ; B 35 -19 501 499 ;
+C 112 ; WX 549 ; N pi ; B 10 -19 530 487 ;
+C 113 ; WX 521 ; N theta ; B 43 -17 485 690 ;
+C 114 ; WX 549 ; N rho ; B 50 -230 490 499 ;
+C 115 ; WX 603 ; N sigma ; B 30 -21 588 500 ;
+C 116 ; WX 439 ; N tau ; B 10 -19 418 500 ;
+C 117 ; WX 576 ; N upsilon ; B 7 -18 535 507 ;
+C 118 ; WX 713 ; N omega1 ; B 12 -18 671 583 ;
+C 119 ; WX 686 ; N omega ; B 42 -17 684 500 ;
+C 120 ; WX 493 ; N xi ; B 27 -224 469 766 ;
+C 121 ; WX 686 ; N psi ; B 12 -228 701 500 ;
+C 122 ; WX 494 ; N zeta ; B 60 -225 467 756 ;
+C 123 ; WX 480 ; N braceleft ; B 58 -183 397 673 ;
+C 124 ; WX 200 ; N bar ; B 65 -177 135 673 ;
+C 125 ; WX 480 ; N braceright ; B 79 -183 418 673 ;
+C 126 ; WX 549 ; N similar ; B 17 203 529 307 ;
+C 161 ; WX 620 ; N Upsilon1 ; B -2 0 610 685 ;
+C 162 ; WX 247 ; N minute ; B 27 459 228 735 ;
+C 163 ; WX 549 ; N lessequal ; B 29 0 526 639 ;
+C 164 ; WX 167 ; N fraction ; B -180 -12 340 677 ;
+C 165 ; WX 713 ; N infinity ; B 26 124 688 404 ;
+C 166 ; WX 500 ; N florin ; B 2 -193 494 686 ;
+C 167 ; WX 753 ; N club ; B 86 -26 660 533 ;
+C 168 ; WX 753 ; N diamond ; B 142 -36 600 550 ;
+C 169 ; WX 753 ; N heart ; B 117 -33 631 532 ;
+C 170 ; WX 753 ; N spade ; B 113 -36 629 548 ;
+C 171 ; WX 1042 ; N arrowboth ; B 24 -15 1024 511 ;
+C 172 ; WX 987 ; N arrowleft ; B 32 -15 942 511 ;
+C 173 ; WX 603 ; N arrowup ; B 45 0 571 910 ;
+C 174 ; WX 987 ; N arrowright ; B 49 -15 959 511 ;
+C 175 ; WX 603 ; N arrowdown ; B 45 -22 571 888 ;
+C 176 ; WX 400 ; N degree ; B 50 385 350 685 ;
+C 177 ; WX 549 ; N plusminus ; B 10 0 539 645 ;
+C 178 ; WX 411 ; N second ; B 20 459 413 737 ;
+C 179 ; WX 549 ; N greaterequal ; B 29 0 526 639 ;
+C 180 ; WX 549 ; N multiply ; B 17 8 533 524 ;
+C 181 ; WX 713 ; N proportional ; B 27 123 639 404 ;
+C 182 ; WX 494 ; N partialdiff ; B 26 -20 462 746 ;
+C 183 ; WX 460 ; N bullet ; B 50 113 410 473 ;
+C 184 ; WX 549 ; N divide ; B 10 71 536 456 ;
+C 185 ; WX 549 ; N notequal ; B 15 -25 540 549 ;
+C 186 ; WX 549 ; N equivalence ; B 14 82 538 443 ;
+C 187 ; WX 549 ; N approxequal ; B 14 135 527 394 ;
+C 188 ; WX 1000 ; N ellipsis ; B 111 -17 889 95 ;
+C 189 ; WX 603 ; N arrowvertex ; B 280 -120 336 1010 ;
+C 190 ; WX 1000 ; N arrowhorizex ; B -60 220 1050 276 ;
+C 191 ; WX 658 ; N carriagereturn ; B 15 -16 602 629 ;
+C 192 ; WX 823 ; N aleph ; B 175 -18 661 658 ;
+C 193 ; WX 686 ; N Ifraktur ; B 10 -53 578 740 ;
+C 194 ; WX 795 ; N Rfraktur ; B 26 -15 759 734 ;
+C 195 ; WX 987 ; N weierstrass ; B 159 -211 870 573 ;
+C 196 ; WX 768 ; N circlemultiply ; B 43 -17 733 673 ;
+C 197 ; WX 768 ; N circleplus ; B 43 -15 733 675 ;
+C 198 ; WX 823 ; N emptyset ; B 39 -24 781 719 ;
+C 199 ; WX 768 ; N intersection ; B 40 0 732 509 ;
+C 200 ; WX 768 ; N union ; B 40 -17 732 492 ;
+C 201 ; WX 713 ; N propersuperset ; B 20 0 673 470 ;
+C 202 ; WX 713 ; N reflexsuperset ; B 20 -125 673 470 ;
+C 203 ; WX 713 ; N notsubset ; B 36 -70 690 540 ;
+C 204 ; WX 713 ; N propersubset ; B 37 0 690 470 ;
+C 205 ; WX 713 ; N reflexsubset ; B 37 -125 690 470 ;
+C 206 ; WX 713 ; N element ; B 45 0 505 468 ;
+C 207 ; WX 713 ; N notelement ; B 45 -58 505 555 ;
+C 208 ; WX 768 ; N angle ; B 26 0 738 673 ;
+C 209 ; WX 713 ; N gradient ; B 36 -19 681 718 ;
+C 210 ; WX 790 ; N registerserif ; B 50 -17 740 673 ;
+C 211 ; WX 790 ; N copyrightserif ; B 51 -15 741 675 ;
+C 212 ; WX 890 ; N trademarkserif ; B 18 293 855 673 ;
+C 213 ; WX 823 ; N product ; B 25 -101 803 751 ;
+C 214 ; WX 549 ; N radical ; B 10 -38 515 917 ;
+C 215 ; WX 250 ; N dotmath ; B 69 210 169 310 ;
+C 216 ; WX 713 ; N logicalnot ; B 15 0 680 288 ;
+C 217 ; WX 603 ; N logicaland ; B 23 0 583 454 ;
+C 218 ; WX 603 ; N logicalor ; B 30 0 578 477 ;
+C 219 ; WX 1042 ; N arrowdblboth ; B 27 -20 1023 510 ;
+C 220 ; WX 987 ; N arrowdblleft ; B 30 -15 939 513 ;
+C 221 ; WX 603 ; N arrowdblup ; B 39 2 567 911 ;
+C 222 ; WX 987 ; N arrowdblright ; B 45 -20 954 508 ;
+C 223 ; WX 603 ; N arrowdbldown ; B 44 -19 572 890 ;
+C 224 ; WX 494 ; N lozenge ; B 18 0 466 745 ;
+C 225 ; WX 329 ; N angleleft ; B 25 -198 306 746 ;
+C 226 ; WX 790 ; N registersans ; B 50 -20 740 670 ;
+C 227 ; WX 790 ; N copyrightsans ; B 49 -15 739 675 ;
+C 228 ; WX 786 ; N trademarksans ; B 5 293 725 673 ;
+C 229 ; WX 713 ; N summation ; B 14 -108 695 752 ;
+C 230 ; WX 384 ; N parenlefttp ; B 40 -293 436 926 ;
+C 231 ; WX 384 ; N parenleftex ; B 40 -85 92 925 ;
+C 232 ; WX 384 ; N parenleftbt ; B 40 -293 436 926 ;
+C 233 ; WX 384 ; N bracketlefttp ; B 0 -80 341 926 ;
+C 234 ; WX 384 ; N bracketleftex ; B 0 -79 55 925 ;
+C 235 ; WX 384 ; N bracketleftbt ; B 0 -80 340 926 ;
+C 236 ; WX 494 ; N bracelefttp ; B 201 -75 439 926 ;
+C 237 ; WX 494 ; N braceleftmid ; B 14 -85 255 935 ;
+C 238 ; WX 494 ; N braceleftbt ; B 201 -70 439 926 ;
+C 239 ; WX 494 ; N braceex ; B 201 -80 255 935 ;
+C 241 ; WX 329 ; N angleright ; B 21 -198 302 746 ;
+C 242 ; WX 274 ; N integral ; B 2 -107 291 916 ;
+C 243 ; WX 686 ; N integraltp ; B 332 -83 715 921 ;
+C 244 ; WX 686 ; N integralex ; B 332 -88 415 975 ;
+C 245 ; WX 686 ; N integralbt ; B 39 -81 415 921 ;
+C 246 ; WX 384 ; N parenrighttp ; B 54 -293 450 926 ;
+C 247 ; WX 384 ; N parenrightex ; B 398 -85 450 925 ;
+C 248 ; WX 384 ; N parenrightbt ; B 54 -293 450 926 ;
+C 249 ; WX 384 ; N bracketrighttp ; B 22 -80 360 926 ;
+C 250 ; WX 384 ; N bracketrightex ; B 305 -79 360 925 ;
+C 251 ; WX 384 ; N bracketrightbt ; B 20 -80 360 926 ;
+C 252 ; WX 494 ; N bracerighttp ; B 17 -75 255 926 ;
+C 253 ; WX 494 ; N bracerightmid ; B 201 -85 442 935 ;
+C 254 ; WX 494 ; N bracerightbt ; B 17 -70 255 926 ;
+C -1 ; WX 790 ; N apple ; B 56 -3 733 808 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/fonts/utilities/ps2pk/tests/Symbol.alpha.hex b/fonts/utilities/ps2pk/tests/Symbol.alpha.hex
new file mode 100644
index 0000000000..53999742d7
--- /dev/null
+++ b/fonts/utilities/ps2pk/tests/Symbol.alpha.hex
@@ -0,0 +1,29 @@
+
+character : 97 (a)
+ height : 22
+ width : 24
+ xoff : -2
+ yoff : 21
+
+ 03f000
+ 0ff81c
+ 1e1c3c
+ 3c0e3c
+ 780638
+ 780378
+ 780378
+ f003f0
+ f001f0
+ f001e0
+ f001e0
+ f001e0
+ f001c0
+ f003c0
+ f003c0
+ 7803c1
+ 7807e1
+ 780721
+ 3c0e3b
+ 1e1e3f
+ 0f381e
+ 07e00c
diff --git a/fonts/utilities/ps2pk/tests/Symbol.alpha.pix b/fonts/utilities/ps2pk/tests/Symbol.alpha.pix
new file mode 100644
index 0000000000..fe8cbb32c6
--- /dev/null
+++ b/fonts/utilities/ps2pk/tests/Symbol.alpha.pix
@@ -0,0 +1,29 @@
+
+character : 97 (a)
+ height : 22
+ width : 24
+ xoff : -2
+ yoff : 21
+
+ ......******............
+ ....*********......***..
+ ...****....***....****..
+ ..****......***...****..
+ .****........**...***...
+ .****.........**.****...
+ .****.........**.****...
+ ****..........******....
+ ****...........*****....
+ ****...........****.....
+ ****...........****.....
+ ****...........****.....
+ ****...........***......
+ ****..........****......
+ ****..........****......
+ .****.........****.....*
+ .****........******....*
+ .****........***..*....*
+ ..****......***...***.**
+ ...****....****...******
+ ....****..***......****.
+ .....******.........**..
diff --git a/fonts/utilities/ps2pk/tests/Symbol.pfa b/fonts/utilities/ps2pk/tests/Symbol.pfa
new file mode 100644
index 0000000000..f8671f45af
--- /dev/null
+++ b/fonts/utilities/ps2pk/tests/Symbol.pfa
@@ -0,0 +1,1099 @@
+%!PS-AdobeFont-1.0: Symbol 001.007
+%%CreationDate: Wed Jan 17 21:48:17 1990
+%%VMusage: 28489 37622
+11 dict begin
+/FontInfo 10 dict dup begin
+/version (001.007) readonly def
+/Notice (Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.) readonly def
+/FullName (Symbol) readonly def
+/FamilyName (Symbol) readonly def
+/Weight (Medium) readonly def
+/ItalicAngle 0 def
+/isFixedPitch false def
+/UnderlinePosition -98 def
+/UnderlineThickness 54 def
+end readonly def
+/FontName /Symbol def
+/Encoding 256 array
+0 1 255 {1 index exch /.notdef put} for
+dup 32 /space put
+dup 33 /exclam put
+dup 34 /universal put
+dup 35 /numbersign put
+dup 36 /existential put
+dup 37 /percent put
+dup 38 /ampersand put
+dup 39 /suchthat put
+dup 40 /parenleft put
+dup 41 /parenright put
+dup 42 /asteriskmath put
+dup 43 /plus put
+dup 44 /comma put
+dup 45 /minus put
+dup 46 /period put
+dup 47 /slash put
+dup 48 /zero put
+dup 49 /one put
+dup 50 /two put
+dup 51 /three put
+dup 52 /four put
+dup 53 /five put
+dup 54 /six put
+dup 55 /seven put
+dup 56 /eight put
+dup 57 /nine put
+dup 58 /colon put
+dup 59 /semicolon put
+dup 60 /less put
+dup 61 /equal put
+dup 62 /greater put
+dup 63 /question put
+dup 64 /congruent put
+dup 65 /Alpha put
+dup 66 /Beta put
+dup 67 /Chi put
+dup 68 /Delta put
+dup 69 /Epsilon put
+dup 70 /Phi put
+dup 71 /Gamma put
+dup 72 /Eta put
+dup 73 /Iota put
+dup 74 /theta1 put
+dup 75 /Kappa put
+dup 76 /Lambda put
+dup 77 /Mu put
+dup 78 /Nu put
+dup 79 /Omicron put
+dup 80 /Pi put
+dup 81 /Theta put
+dup 82 /Rho put
+dup 83 /Sigma put
+dup 84 /Tau put
+dup 85 /Upsilon put
+dup 86 /sigma1 put
+dup 87 /Omega put
+dup 88 /Xi put
+dup 89 /Psi put
+dup 90 /Zeta put
+dup 91 /bracketleft put
+dup 92 /therefore put
+dup 93 /bracketright put
+dup 94 /perpendicular put
+dup 95 /underscore put
+dup 96 /radicalex put
+dup 97 /alpha put
+dup 98 /beta put
+dup 99 /chi put
+dup 100 /delta put
+dup 101 /epsilon put
+dup 102 /phi put
+dup 103 /gamma put
+dup 104 /eta put
+dup 105 /iota put
+dup 106 /phi1 put
+dup 107 /kappa put
+dup 108 /lambda put
+dup 109 /mu put
+dup 110 /nu put
+dup 111 /omicron put
+dup 112 /pi put
+dup 113 /theta put
+dup 114 /rho put
+dup 115 /sigma put
+dup 116 /tau put
+dup 117 /upsilon put
+dup 118 /omega1 put
+dup 119 /omega put
+dup 120 /xi put
+dup 121 /psi put
+dup 122 /zeta put
+dup 123 /braceleft put
+dup 124 /bar put
+dup 125 /braceright put
+dup 126 /similar put
+dup 161 /Upsilon1 put
+dup 162 /minute put
+dup 163 /lessequal put
+dup 164 /fraction put
+dup 165 /infinity put
+dup 166 /florin put
+dup 167 /club put
+dup 168 /diamond put
+dup 169 /heart put
+dup 170 /spade put
+dup 171 /arrowboth put
+dup 172 /arrowleft put
+dup 173 /arrowup put
+dup 174 /arrowright put
+dup 175 /arrowdown put
+dup 176 /degree put
+dup 177 /plusminus put
+dup 178 /second put
+dup 179 /greaterequal put
+dup 180 /multiply put
+dup 181 /proportional put
+dup 182 /partialdiff put
+dup 183 /bullet put
+dup 184 /divide put
+dup 185 /notequal put
+dup 186 /equivalence put
+dup 187 /approxequal put
+dup 188 /ellipsis put
+dup 189 /arrowvertex put
+dup 190 /arrowhorizex put
+dup 191 /carriagereturn put
+dup 192 /aleph put
+dup 193 /Ifraktur put
+dup 194 /Rfraktur put
+dup 195 /weierstrass put
+dup 196 /circlemultiply put
+dup 197 /circleplus put
+dup 198 /emptyset put
+dup 199 /intersection put
+dup 200 /union put
+dup 201 /propersuperset put
+dup 202 /reflexsuperset put
+dup 203 /notsubset put
+dup 204 /propersubset put
+dup 205 /reflexsubset put
+dup 206 /element put
+dup 207 /notelement put
+dup 208 /angle put
+dup 209 /gradient put
+dup 210 /registerserif put
+dup 211 /copyrightserif put
+dup 212 /trademarkserif put
+dup 213 /product put
+dup 214 /radical put
+dup 215 /dotmath put
+dup 216 /logicalnot put
+dup 217 /logicaland put
+dup 218 /logicalor put
+dup 219 /arrowdblboth put
+dup 220 /arrowdblleft put
+dup 221 /arrowdblup put
+dup 222 /arrowdblright put
+dup 223 /arrowdbldown put
+dup 224 /lozenge put
+dup 225 /angleleft put
+dup 226 /registersans put
+dup 227 /copyrightsans put
+dup 228 /trademarksans put
+dup 229 /summation put
+dup 230 /parenlefttp put
+dup 231 /parenleftex put
+dup 232 /parenleftbt put
+dup 233 /bracketlefttp put
+dup 234 /bracketleftex put
+dup 235 /bracketleftbt put
+dup 236 /bracelefttp put
+dup 237 /braceleftmid put
+dup 238 /braceleftbt put
+dup 239 /braceex put
+dup 241 /angleright put
+dup 242 /integral put
+dup 243 /integraltp put
+dup 244 /integralex put
+dup 245 /integralbt put
+dup 246 /parenrighttp put
+dup 247 /parenrightex put
+dup 248 /parenrightbt put
+dup 249 /bracketrighttp put
+dup 250 /bracketrightex put
+dup 251 /bracketrightbt put
+dup 252 /bracerighttp put
+dup 253 /bracerightmid put
+dup 254 /bracerightbt put
+readonly def
+/PaintType 0 def
+/FontType 1 def
+/FontMatrix [0.001 0 0 0.001 0 0] readonly def
+/UniqueID 27004 def
+/FontBBox{-180 -293 1090 1010}readonly def
+currentdict end
+currentfile eexec
+a8686bfddf470dd119f86e1b8e5b290ae7d910e9317a36f6768d8de89e7e
+d5b845166db0e18e3fca77c6e789f2ac61e3ba2248c0c4ccdb4c50344889
+3c2a909c36546b763088822eb34d1051d0ac662d8098db11f0a527a679e4
+ac03347df4319a689d7d65239e8502b5db9aef94cd6cebd07cee5af22db4
+c8c628a982cdd10c4e3b04736d073f90eb0b840b42ace3798961326b5fea
+769b604e99b2d79dadb8b7ab2e769c4efa129084478f38eb206f8fec149b
+0b6e326fc4c76c32fe3ea5164f588b21cf83c0dcb1548e4dbc4192fa8187
+5d1968283f0a8974422b2af5ccb6cfe6097902c0355e57be4514166ff58f
+ff2b47cbda355099fb31aa17e4e857dc0df1b653b9cc8a9a45292d41e3c8
+8ffe4036018811bf2fc55980ce1a4fa5161e167769c4e289627a8d3083cd
+52b08be6b1531c322f863631069f3a3ada3e2076bab4d62374eab5672cbc
+8537bbd7ed92c12f05909c25dd36e05b289b91b1fec65dc210e67c167de0
+44de197b03df0817a5f3faddc8d16ceb8b1be53b6765b6e659bf54d91981
+57c966649a774ee195c10eb3659115d7ad8bb83114beea798c45dc84db92
+b20e757059ab45e275c23f1be30b619ac8486127cc0bad1eed3eea4b7e86
+4e58fdb2a98ecf8b0380d25e481a4304e232e4e346ba781e0e68b0cea3f1
+0ee7b2fce0b144ffae9bd297b2506c7da44474845893e06c490f0eb2ffeb
+034a75292e59cc038e75e1dd9ad080719647fea7dd00f7c8913d92b9282a
+1765a2d357557cb0de7c0da979954cbd77694f99ba39246adb7495766058
+fb8a8d4151a4a0d0f740d776fa13c0ae11be76ec06f9b367b3006ea681f6
+1f640c3640a78d0c7ff521d477981e23e5956baf42252463fdbec49bb560
+a9428d248b0c5250cfa2a49cd9dbcef73123c13ba382d3cf6a7b8a8ca319
+1d379a659f0e2c6e9cafe9da2ac074f622e397a2f7c73347364ae249b11a
+e2c34aa7f0d27b5f35d548d5ad1228597dd16a478c901d3a34d82c32da87
+78486072ad36d8b1903689123f99be020d41cfa9ff521d1eef52a83f4b6f
+daecaeb404e3cab31da47ebe2cc011e458d64a6e2c5c1348b91c0ae0d799
+9c35ed72eef0db90ff2ec2c242328ace7bbc5ccc5ee7998e27d365ec0937
+b6a1d0581d6a28cecd8cfde5aaa0ab1d43ee1629ae7a70cc0171ca2f3d2b
+becc6cd9ffd9858f4767cd3338250c3e467d21efd5d365d7b28d3106dea9
+c0b68a52ebabf4b463cae58656a0c6cd0d56cb1e9a2faab1dc4696600ffb
+c2039816785e3dfe868e181378031bb9e8c502cc2ff6a457c458ee19b123
+a175c89ef640111781540cd9df8903ee6fa23d54262274559148057e9adc
+e2cc011470c1c168128822ac4f22b2b37ce77a358c9a7730a948b9d9bad1
+3f78e1d2cd986d9807d720243dfd898657943cefbce545ee38325e803c5c
+d2b755fa168ad5390b54cb33b9e0762fd22b13aa21643c022d40e697c8d2
+1d8c44d89f32a2ecd1992acb064881c5ebaa138d05ee0b4d302dff6f5bf1
+271174f933bf4f7162e0f80833dce8059bdbd626ab7e6d7498554fe49190
+43bb14842d91c888c0a68354c5c5539a82079e393710d408ec09dea09f95
+cb8fc26260f2c49ecf4a2f64c34b6ee86521f313326f38d12578f96b85c2
+649725bd3457eb8b156f4c991022e9d3b1e3c07e9519dbdb3032e90445b6
+e7e377278a37c589fb9b4cbf72a100dc7ffab7cbac93f3f648007948aaf6
+ab06d371f10ba0f9240b1a24c9c3f89c29fdc5b57dd99799ff4f68274159
+9d406456eb64e2cd4e02d80cdf90f0a7df99214b1111ca43a98301ab543d
+25084c6e7a4442aaf6f599fd0e3a02996c15700eb2e8389f33a7479d991e
+c67abd43893d113472b19972ef0550084f40a3e49cbc85c29b1ba3834e81
+ed3c553ce6727ccc5d0a0b2e0fc9a61624d916cfbf803360b278a8a9c4e4
+5fe435fd830daeb63879cd7ebe6bd5e3c4f6e516b24ba18038b3a936f74e
+2430149a0ffdc466bc93b4b8e9d7df66d6d09c2301085aa2e37f75728e29
+1e3557000ffeb9a47657d6b01e3f24386e45d356fd6eb98599b611d73cbe
+88c899e8e60efa6f99fe7e12d3039aac12f385081e4e95c8d833867a8666
+d5bd2153cfcc12187d7aabd79203e914ea680b4c977cdc9c2286f9a47d8f
+0378a687d1d48c9bee2ca64806a93961d644b4d70da7c173d5bc3213f8eb
+d3cffce79f20deb618299724865c5d594b7086b5fbba9d68f365aea313fc
+2d7c0af3dfcc007cf7c2b7647287f4e8be8255f2532796b42e8ef17c74a5
+921763696c8236f7902969a664ddcf185c3bda785c108fc48bd6b7d4dd17
+bf4964caebcc06392fda130c67d2b5dfaadf7c727a947e61725fcb8452dd
+33819fa3debd761a1769d3b186911b7927c0d49d5e7a2b53e044c784060d
+9600c2801a8095bc9985586564b28fbd26870ee6c0dafbc40857a44a606d
+dd95ed837e5799730f9d5246e3eaf6be8a37dff0901b065753d3d4d3a68b
+7a87af6b0e137e1cc4f7125479fc7ce782cbf663c7b858dfaf98c3f53957
+15de7e2d6a620e29234da977490ceed8cb72b49e2b5bca3acbddf342e184
+bcc24b3da9a1c234919e35d9cf53621f383f85c28655044ce05191ab0cd8
+7ca61e2dcf787237a162a93816bf7c5139d16ee799efcbf3386bcb9dbbe2
+3b5c52cb34eb7207aa39403001c86122f5b32ab35b32d4bc391955a3c84e
+896e1fa498aa99cb980316851de4fd4c5884d8c55ea10b791c68bd908d4f
+aa1f641a982bee3ecc433f311e28b4ba46b10fb9450061d5074509640a2c
+6e3bd08c10f4dc99ee2679700fdb3074e493e8b9ca673cf12f336b85521f
+c81f904afce3e03446bd8d4ddb4cd33bf24cf9443709b94aa6ff54809baf
+42eb9966d68f64d1958d36e170189462c484decc1a9aee047aff84a75296
+de9f230992046462a9a3d821f31924f6e063b23edf20590c2271ea26f96f
+5c8234ff0f2656506710d15387dfe9402a35fac32ce9bd709736adb09802
+239e6dccf3bb89e677e7fa2347f693a47ddbb82f6ab50796227f74a1687c
+d405e590389a2fa3a12494e637d69798722a4629f29d5f8ec0c28cd6a9d6
+c3613b06a9b48170dfb844290618452fdaf4258fc231836fa07eb842f496
+3d7f4baec587f7f8e1aa1ef70d02fce05d72b987639f416fb6d18abca742
+976bb4ae3cfb9bd8ab03fd01a267d2ca968014e648d68bf195855ad77bc9
+97f33dc586892d270f7df2671868be008921d9bab6f6cb2d3e2909f1ceef
+7f62586c44ff027c28d1b285d1c409c0a6f68e33684bcb04ddd8e8d338cd
+ecfc68488e9bcd337047c2135d66b24644a4fcd8578fa7d21001773db210
+6e989597faae907aa2d58b28357e6e2478bed2d0660947227ca40e089050
+14401885bb6d04fb705bd7ef86e51437f0f01aecc60f1bd71d480504aa20
+2d31e1e3de1f1103c68ae43948d25a4c34bc8f274fc38b4b1785a8e5bb55
+c458b4399b817db03be9a37c4f93cb04cb3d96e2ff74cca331de6080da74
+57eb89b94a67334119f33abd1273a16a440bf2503c7f412706743e880531
+43048517dccc0f0659d9fcb65808f260c9cee906c80262ee2a9f9e6c2aad
+b36cec10145e641a0b1240584bd2e082b404778a8f335cdc4d2523e67fc2
+7b7a9f4e91eff110ff727d2af7cc179188fe799197ea65527e8a763e289a
+8752072d43b427f86bb7b4a6395f9d787d34ca8fde4fb9a9b140a343a9a6
+3f7af293ce1a6f54f5bdfca90b7a30714ccb880b6676b50c5e3547a383a5
+1528157a06c8dbecd116885e5d3690d454b0495d14ae65ddb7d0ea5778bd
+90311442970aaf33f262a13bf86ba493fe947d27603651ac8b1d04ca5fae
+8f28cdf53203b3e691675407254ef6275a6da6ce9dc274c3cd492ee4d846
+ffcab2d2d35c1401727b0dcb170c77546e0d79823a26d2c5e14d1f6d1319
+f4435b76fc3891d7c30ef28b0a16ddabac526f3b51f8b89708b27014a84f
+5920f23e6a13e8c06aa5692c01d38872aaced2a0410e865619348b96d153
+a51d41c62f1d1206f422ba739299333656d32791195c9b87eefb1abc2bff
+3ea3af85cce2c3df1d6d7b0e01ebdbb0bac3033a5252ca06aea1c21201b0
+7fd8e5f7fda300de7c7f689836aaaed413b5114e0e87ad0d8f236382f388
+dc7a6e0d05369713388a2fcabd1b98468be00618077a00a4a359374cb8ed
+22513b15304cac497830a9a4b6c5f16f6b3130043db3d7367166e455fc5f
+ffa2f27d832015fbc432db0776953fc30771dfaf50995a60e0cea496759f
+f4260f807e9fb4a9e8e0292d714eb61d820a1c9c67ef0b08d5a52d362c12
+4a75112bbf2b9189f3a605ec592012abd7a3c27f907f2d521cb9eb27768d
+eb8388f1e872591ad29b41053db67ca08713497dba053be52d997b5ed0f0
+bd1246b0fe4f13695138f3ab7646782174647a7f27d88b0368cd81dc0531
+93b1daf6036e4e6be7c846bf0f5350c414629b45aba11c62b5d5e9adae9b
+57474271636efd71446bb26a275bb208f698bdc2d9905e30e920326297eb
+f6ba9092ac2000b5c937edcf0c8c79835ab722a951325867c4f17115a821
+4241b658d4aeea5d4026747c789f84b60e532d30ef8d8712b8e20439e78e
+b40f6153076b572816da799a60f4ec00220d3c111c695e58d005e4a64279
+f33e5a28f4e0a366e5490469cb7632a6be0b5f087ef7c08bb801f66d29a1
+8e2b8b107d4c8aaf2d4875d97c085e771e2e864fb0055ee292eb53b07834
+eaa8b71e6c0b1c65df3b864e2014022e88816e38a5629559893fecfefd8b
+fac67bb993a30a42d9c124f66c296294f26ba316b5a7093c3439c0e1d096
+e45dae1a6c747daf9edee56a0bed1f95e0f7470080614245c1d59830f075
+4448718ce6810d8631f2e072802d66fab9f9d52ff1f1de8a695dcd371c90
+85fd5f465befe96c894e8ac0cb58836e9bc3e3f3f0d78404c84b91533f61
+bff9d0aedca8511d9bc30554e043f307d4360e371d2fde541f77b6b415f0
+54d257980975602b6df53bd99dc3923b96d3f9e4b3d1b29865931093a73d
+3b2fb7aa6cc6f5c3db794c6909faa3e83673e4d94b506f33ca6a9e5b797e
+c486f9bb84106a4a85b3e850def844550c7eb5c128117da5e8da50ddbc3f
+41dba4d7b8a2945850f164d71dfd95f65fa980c2887d9da47fd4fa0dbd00
+5b5e677e969dec3860ad63781645dd8dbfed960d59d56994665ebf62e152
+4e6c12a6958d92bb156243e204368e13f406084be068d594fdf21774a1f9
+c3d3fea9ad298ee7c9ff47e27064cbaf84d7fe2265e953cd353da669ef14
+482029840a776f9d0afa8bebd2a636717e7eba08688d93e44e161a696d70
+c9ae0f702268f3a13b58db17ece7a3dd600cb6493c7a1684c3ad66044d52
+912421c39f6136471afbbfbde4cdffb5f1ff72ce1ecb208a236392f5b62e
+f92bc2271c5fb8504b386cb60b9b1b9e3699b2c1b53a4b92b492818bd004
+f17db76dc85bd164a96a77ad5a1a263d6affa10264fd17334f1cc89c4f95
+9345c182765f60135a4589093b45d0ce523645ca4b9103e9679b264c0602
+e5bad2d6e03b1d520bae2f4b8f06e50352032445f790b021a44aef0e16d5
+06dce9251834ea125177b46a37cc3c856b94ebe362de717e8b8fc6ab3c88
+d4c618115e56d3e8e4e9f68f816807f1e06b2c9ac53e44c938d3026492b5
+3e5489f328ef410e46b817ce3649ad8046ffd2c163c4ee6491ddac639877
+3f82fe4b0c55a695bbd98414b42e03dfcb152a1590802e518b3bb31364b9
+7f95cc993c08c53ea8b3c0826a468a61ffc8134db155874c5166f5bae260
+e6d8cea4aa701d8c33ed4c9a04761b2e51a865a9ff88fdb67e9dac28029d
+4438c38ce12e0e697b68b75200147589599ce8a5706355e2a952b58c1a77
+5b1733323a14b591bf7f67ac5746ed1064c7a0a507eba49d161bdd06a3fa
+6c82e40188119661121732722d1926f836a7f54db2928ead28c9e10d3995
+9c98245c8002edf97735c4a8fdb6abbf8fa2a2374d46553f964d6a1fe112
+9929dcfbfcaec32a22e535a78376168436231cf19323e4fced6ba2e00c07
+e38120cca376d42ac150c47d00b62a3159a6164a5d0cb6aee490fd31f7bf
+0676d582e55e6f5a119c1a2b5aed0f79e941b98e45aeef9df57395994aa2
+2682603ad7f4f4b4e6dfa9f1b7dcbf8b516566115191112a9d03a835be9f
+cd7f6c165431e3583e9548d7ec93d5de800a12651e83780030421de60be8
+9f35edf14cc8f44b384d3b60cf1dc0c6bee7510de78a074099cbaf218cfe
+74780fdbad5dfd1e611fc553d85c4f95dfdc13021d8cdd1aa3c2862b1352
+81c25b9032240ffd6c346699b7aac0dce23c71032dba631948586c102b96
+10371a2cdfef7e4c29f266c013678c8a5803a3060c76e4ac7d39b633f13e
+4f53ba8eae2006fe1eae01ca235f5a62119871dd78560131218cabb47f53
+862cc5c0fd6962fc3eb0cc4bac7fdedb4aa80748dad4941e7663628397c3
+0329efc42c9818eafa8dd6b71d1236635cb73fa8e6a245643a2fc5436b20
+0993293b062d409497d2983a2e3e8ac1f02debdafc87a1f428e2c2029ef4
+53dec66f9d71e80e2105a3f0750375c54a35edec553934ccf6a21f6c0ec6
+42f89b66f7275facac47364cc288ecb4af118fc7d431836531e4162cfb02
+328d43cc6d5cee04d7966b5e3580ba5ce14e2d0f763c4c3eae5664351415
+ad48e4c36c2d94b935a57c96841857f920234a9b371c9649bdb29692964f
+c370ba384810420bb538ef4ff3cbe4f770898c9496229cc5cba246f38b07
+3f94904ed3f00a3e478668930b7f77819c73905310c9b8dcf76150055458
+8fe9e3a36acc59e433e52ed6d7e0fc9f850695c9c569fc00b3201e685887
+8be41d4de89375ff51d7b0c727178bf99a3ac56aa8ab328beb140755e4ed
+cf7457688c673d43d81d108ecd6472153d35286c9b015d4bf4ceb52fc945
+b0d0353c1bfc3138f22eebda1258d4a772c9f6047a241a38e2889cfc4336
+9d60450a021b7d1a57305f652b6860b43f72f89136ccc3cc817f5ef2cb65
+3e149481c75e4051d770358cc5c14c9e5449333129ea5ab70b73919b2eaa
+94851b83e17adf1b0937e1623383ac461dd61f853bb2a19148cf1741b8d2
+261815705f6ae9313e9a5a7aba0a893265c8732c4a80218113f5a7623685
+f0d475f4b7488a7cc54867c6f4269f21ae484f6ed719e917f1b412c69bc8
+b48120c7044c32b0c844309d2ae90f43c7940b3d5261eeb2ebaeca757b89
+640ee3effbbaff2877cf311a180de67f0a8df934aad92a7eace8c6efc4f0
+9cbc06ed609c96cf891473abe1362a4d9f95a5d37d789d76325eebcba638
+e6fb891f9d7413217fe184dc2218577fce1f22e5d40b55ada7cfd71b1eec
+39231456df20ec121d6f4fa4e8ab3b291fdfce7286c10b774cb1ce7db9b2
+3c9c8322881641e3c6019e31334f2cc1d665cc479ad36c8ca694302cb574
+10bd789166ed99df4ded2ca40612b2a68c49b6ffc4c2c4ed667023711748
+a5baeeeaa20a1ab463c09c87b6f7f3901ecb0984cc23c24b66e89424eebe
+4f07f811cae8b3136abcdc64f0319d4cce4f8f2cacfc44109d3ea2890d11
+802e6bc28bfb0adf428e92f8c8e302908e1d7791358fd3f5e02ae3a7f50e
+ec45fa0f28091572c528fbaabbcdfcad65d66d8a7be76ecc58d5cb263430
+31d61a0d94e11dda5aaf9c4f66e4af19a31d29326ca2189cb61edfd36e98
+cc7e67aebcbff6befa0691f3f4cece202224d4d824884b845f664114b915
+1044df7b8f23c9cfc17127aef763f528360dbae912b49f194ea48b337c85
+bed117fe164030e19ed3ed6650ec283bc9b90a6702e719aaf72e3c79edee
+6eb5cf68ccf74cac3747484809d3c8a1e8993cb543e7bf7b2dbec7e996c4
+5b6326095c2938cf3fa05453c7787095a236fcb854d39935ba4e1cd90db8
+1a871fa058165b045ed582109ad90c2092dfbf376d3f43523ac2cc336cca
+d3dae039e02ddaed85e1d1428c58ecff2f1e969eaa1658330eb155ab33a9
+524ed336d1ad1b4ad4f09f25af25e2da4cca590f14fd18f1bf2de6649318
+5b54fa7db4c1b425f8a91af562895795746e8cfaee57f247ecb949924c26
+966145b848874a5c2731b8905136e8599ade111001a33b455105f4681eff
+6186070ed30e43454ed39c80b2720b77572de8a977329d2dcdffce6ba302
+740cc1f4fa5b804644b0283a7e783238e1832d6de3e6d8a1b2834cfaceb5
+62ae004d98b7deb05436f547e189e3529cde322ae38b38be6be02cefb389
+c7b9432711c0b528b7516a8d9a416a112b1cc51a2adc8d96b0bd098e80b5
+d6ca55953591fbaf29ca90ff480fb9a8b11589cfe2a8f52f76e03cfd7f2c
+eb497d2d51a4ef853dc69eec6c73ddf8acb29aee0167e103e8e0f0a070fd
+ade75354b85b722d56fe6a8a4a827fa17e8f9b7e7282f85d03ed13dd9adb
+40a3572188be0d269ca5574915012a6596604f77a730bfc7a10243379e55
+e0f155a002f0280f0bf8507c5439e33872e61eb21b1b90fa91a263475509
+1deb6b50774f0b3000acf9e6597ab7394d55feffbe319feddad4d7c5fa8c
+2240ff827cbd391934e32c5c6933218eb33fe11dc5c27a5067cdcc434510
+8801f15e5b9339e654382eefe167926869f5b09e004c3d4478990f4df71f
+3e500ba8782387819df65b7241d4f8e91c016399ce427bf970c135373ff2
+3320761fac67862a5a3eaff5d149fca9632445017e82ee8435b1f5205ebc
+a0d86c5bd0fdafd794b5b4906684eedde0f75236a3cc78faf940723334d6
+d4807b4b84ec78149e3d70293b8b8a6e5b37cf09f9b955507003d4333a8b
+b2e445962a326007d7cc23d17ae70e4eb3ceffd18eed2b9c1097b80b75f7
+eac6f9d34a7eb4ef04cbd02c60f0bcd72794562333dff3f94484cb7bc1e1
+b6ca1af53a8432ea8b4ffb87fd2f0cadf71931a6ed19fc8bc6d914b1a8b2
+633bf49929446174e580f5186099635c605dc1d4030b4e4019df73e796e8
+e41cfc84e0916e2ec637b4a86166e6fab41ac8750e2396641d9bdf1ceec3
+f448dc3d0b89a8bd33c0134fbb2c2e0395bb65c5fb243bbe2b22ed8f55c8
+bb8aaac2543f3352343717d97b71cdb22b5bf6fd62076fc41e1146533d73
+093dd421025e5b2e4225a9e47235fb30328774f0fd76b1362c85e69baec8
+7af39d8dfa4b3ae82ebe1bdf21f9cd1c20edee7ae5a17a48f84d5c5d28ca
+a3a18a0408d8420071c9eca26b71dc618881bbce3d0968aae3762934261f
+4cb03f26efeca6188177d804acfd250234474181de94fd711dbff420123e
+db91df92997cba49f726b8a4ba43a3f2f6f040bed8e370afe031556999bc
+9ca5a553effd814f1bf4f640cdea3406e34f65cfd625d9729701dbf02a03
+f7787e8c95dd08719c58e3b8a92c573381dc1392a7c49c2a72e796364d3d
+117e927be69f9bb70b53e450797503b1f8fb400c580f3e4ed94863747099
+dc3a102c29b013655e06e8d0bfe5e12f5d8b8b909f886bc9910eb42e7b62
+d1218bd94d8a5b20e03950c0a5887d6729937bcea0679fb52ad29514685e
+3e64c9e82e9c82c04f810cb5e86dae4cd7eea14041f1d27adf00526fde35
+9379ed1d0b7e06244ff354f343453fcf21514d8ebc5dfc005dfb9ca4e698
+dcdba07d0f79b129f2b71a8bf488ebf90e6ae748bc438fa5492e239dd4ea
+fd79f8b52408a4f244efbba527e131e6ebf6da23fb43186dfd414ab02344
+76dcf1c1ddf06e58b5ce5d5677740b4e285d8b87cd04f6011b54c4d5c322
+3c17ca906e90dc6271c103b4a49cf2f89896987e96484b45fefc41b04c00
+d9a8de774d861fae63f8bc9cc2fba2317a5e951ecbccaba5aad95ea61329
+3f1da5e3042ac4ba95837fc844eccbb76cbca769ee049d9c3f90f5d687b0
+97379bb7679a9a12eabf3ef0036300b90f0722807f81a871118418db0dac
+ffe28aae0c1031fdffeee2d3b831103fbbea005058b243be116dcc9729cd
+6d088d0f9cb9364f89e942177ef74d0643db9c3301155db0a9ec75829673
+922b1560e69c151fa9325a00c84a202eb41b134203b092736ee61cf1bd5c
+95532ed88d5b9b71e14accbc3dae675b52e49e4cf4c7580d13ddfbde33aa
+91f1aa4ccd64af5a5475f24553e339389c8dfbc14a6dad602cb23feb06e8
+aa30dff60f3aa223bf5ab110688326a72e543f0d17a2bd5d33ba449e1b2c
+6c4eaa0bc276a160c2a07a385ce22caff5c3aa7a5551196c48aebba6a3f4
+afd1cf8566eb6542a1ef37794ff98737ceefc0bb772d7cd07ad5a4302072
+bb172a5e82065e61d2aabc5411cc35a79cc0a63f29d7f62c09fa98b1e703
+825b2a9fe735c296dcf5d16adf235cf9a252e9538a30e38f67836cdca7c2
+a75c1b2657017c16f5ed7d125a3354289eaf233d52f082bb5d8f80389e8e
+9d5e50e4ab869f8f29734aa2d3c06b11dcc569351d446e9e45408e41a969
+9fc3a7c0116b8a6603949de556a52ad218272f497251f281fcdd2a71ceaa
+c2e9bfdb4c891e2d4a1b3423e9a8c30e3379756ee7e196cbc76affc12021
+a58d78151394692dd830c6ee1bd29149a37d9a45303a2ea3339b3bad881f
+ad6aa15b9e7aed09c4fb27fdbb859d6ce02d1a1d3ea90f2939ed801beb0f
+28f367ff5616f5b033970d040a411747ab706733752bf0c11217126324ce
+ab6530e67324e516b56a0b80977a395211e1a7f32db114d1b621f7669b23
+a8a53fc327a8ca38592ed16715c6d782503d7c2973fb4d4cb11e2ea3cc8b
+5df0dc8fcdf0af4ad28f18ddea460de623bb4f79e3d7a9345f47d555746a
+c1d9eca2f8ebe594fe42164a8970c20aa4440d4e9a6cae89845edbc74583
+edcd312b4fd93911e8c9c5c4e0a127d1ca4a78f6f8ce93a4a6c571fb72ee
+c0a73a194e246e5f9b6b8019be7ef975b3956ad798c64a580654943d6192
+d4b4f05172b7064e2c4782e7215265c5ee0c4f3e0331765a94273708830c
+fa0aa2cb6a5bb230f433abd5aef8aab8f91603eb59c29b9ce5b54d8548ca
+e59ad6e3609668094077006883d52967bfc43213ee7504d366bd6ab0fb3c
+295c3adceae4803b8d723d78f6bb53d6391f68b5a76f17d15ef40987c3b8
+b1b3fef926a9690ce2147b648792f250d2db8ee80455cea46ada1ddda0fe
+bf1b6fb4022fefa0c519b1d9793c5ed7dc0b0aa59c61a4cf3336679deca9
+9c4f2bb39b348b6bdd98bba8dc2d015255fa2684385cbafc8e7c2d82db00
+10b220d38fedb4255bfd65138bbb1016b53b04051a4c2d757ce0af776c58
+5313fc9888b79fe7341c271df06400b6a95edb836c45cf59d3faf312e015
+2278835e430e4b42aebf48a293ed6b789bf67edc92010fcc0fc9f5dae346
+18903f7b1251fc3f2d5eb5fde66f0ec1630e640568b1109eab8ca9f84617
+f30d4b5897c959db430132540cd1379f5dcb17658aa1c59dc6f509aec5c6
+24d225ef96194a075d9ab67011f10fd21d07434e7f101534e57247994d9c
+16a7fec8416e59ec750027be6e2ac9258dd30147146c3048c9c93d16f8fb
+b062ecf10f9e54b418a1fcf4ab24521bb27453ca57b5cc9b72c4e175edbc
+8a876db42aebafacc33ba6ab66f028ce8d29198781870a7120de21eaeebb
+aed44b65b24b837059ead5c5205d68d51a1506de9b51440774b57de55915
+fe05ba2e740c37ff24a077659b9fbb4a394a069c1fb33c50836287a28226
+c31f75903b44b25d3bccba417f46a8433da7744dc56113ace4a12c87cffa
+60fee38cd9643cec30b1aee59d18e508e944c53dba216345f133513e9329
+9fa822780b39d049a3f3ab235314b4a361866a8957b3e4fc3991f2e76d80
+7e16d9dd47a6de200c036d3ab6567175251f6c8769dd0519d53434b98bb5
+e7051d83592febfcfec038d4265963be24aac1d495c4df853bbcca5ac937
+843ede788ca0e73249a06f7227c04796e86282572318f185226173d3a347
+b548368afaf2b80b1857848be4e7092e38a2b01360e3066dc9517840ec06
+89e93b4ac163d778556f67268034e5658aa79c2ad79d474118f29e146753
+bac0b74456787d73f19d2bd96b017c9a270d3bec637a666f8d08c63d1fc4
+1480bf974c50ef693cc995f92bfc61646ed34bb3bfa262dd8e6bb548584a
+f3a73a4835ba8dc1059dec2083660b63356e30fb63f2b88e38bdab96199b
+9730b28b51092cf9677247562cb407230ed9cf30f89d7556d0b8eb22979a
+c7835f90a982ce70aa7b45d52cfbe97b434a077aa24d4aaaf674fe71ffb9
+0dfc5f18eea5a533c3cab25b5dcf08565447a4e09485513fe2347434b0be
+57b79e8eae0e1a01dfc7222002c7a364223250b08a3f378447582edaa55f
+bbb26a096542ee42adcea469ac07b728f33de035e3f5f1850dd772d75486
+220d731af6d26c41f4afdebe24caec68bbcb6d3c45b2ba3b1d961d2eb7c1
+404388865dc57d7fdbfc2edf5bf2b3f1b07dcb47837878abc49846e359c5
+73cc53ebbcb66e48e625dafed81f6548f17709705f513a7d0f34623f81b3
+6c28ee3f66f2c211427a1f0261faa0c5717a2f48b538fc79a40fba8dc99a
+94e01d754d64ce6c03e299ddd366801e87446b9c263734e559aa8b84e82b
+8d352cbd31c43705af067fe793b2572014ef5ebb7d4bd550aba0c65849f7
+9d958f225d85d29f40804518230abc0aeda63a594c7fb53e132e3f34475a
+16b5a5903f210db4e88dcd27120cd8d7c4e1009bc75796ae2bff4de7ceef
+7a15888afcc60903524c01cb4a905a0d40878202d381dcfb1a5adeed0f5d
+ace0f724e120649f94a508c8af92417a88522f67176985626d5d80904c51
+60809063ff4283d029e8ae00a748f5a87b47558e2454185e1c6e6e8deb72
+d50793625f0012fe530b499532e6a099eb188378ff2031058d2c03ce54cb
+15aa73fb9b43ac365d0437d9d738e4246e0d3b49d8471d360b2cf6963e72
+7c29cd37317bd5e49f0339976f5e9dedd1ce3c6838a6bc632cb3f3b87946
+39ebe5f5c76a7fea93142907ee6e70c404f89b5948904e531b8d2d1ede3f
+3e495e110a850df56535bdeabaa476acbb05bea4d2ac4d1165f057bc40bf
+bbbf7a3ddefa700d63531613d6cedf2ec5a6c99c83f2da1fe8d158e9c441
+a38059f327d17fad51f5976c7b27fc48cc3a179c414cbae5bf819abe5ac4
+ea5da1febf135cabc6a49f8078db4a6c64ed0fda651990151260eeae1d0a
+a17bc1f1f95ab368572f1f742e6150028ed8d6232d2ee9650afb384de052
+6114497d10f994bf388cf16e8cebbb62334f9ffeaf0df3a89c50bc6a88d2
+7021d296e7920ebf10bdbeae0bf1fa6a0ef3b7c9ff1ace94d39bc2374789
+09788432a7c826e329dfd1fe2e05c7f36fcd9d41b16145e3c4aae1d08f12
+9643e8797e81ddc38e18ff6793bd44fd1f62fdf30e0902c99a8b4ac58bb1
+e2349dbe1866b5be28a47973645d7b3f3629175e324d50f3783e35bc0119
+bc11a38a8472a1c534daaf25f5b4072432252d5ded842be4b1ad5ea57db0
+964867457849162d5335e8c86562365fd833b7ae84535ba53c4db95b0ff7
+bc61122e0eccd8af40c3e17cffe0ea4fa12e1438feeb67e8d530cb0811b3
+54955e947a92be3d753428ff010a2a1c746461bc8ec2bf78a76cca0f75ac
+0d65625712915ef3d18967962b8993082256214c408ea41866558b636ce0
+b453df438ee2642ce35a0c1f736c2788d98aab85992f842c492b3c7c11dd
+646de00b0ae62a269f2a50854f2aba06a06e3e3ee42c1c65217bbe11db79
+3580fffe2f57968ac21b095bcd9fbb3d2756bf6231226fe63a2abf321dbf
+b74b65c86ef514df6292c885a461e0e9db19eb2d153c0fb7960780de473c
+0e672515f592a4836f62188c11508fa593d1f5f9e5682d258e723cb7f068
+1b83ccf0c14b4b789da54a747f892086d58eb2da4618d86898f5125fed03
+1c3e7fdc0856e12c65fcdb9f34f052b0f416be940c99853d77a89a136dfe
+fa4d315125d05150c6d7755c66e6a84d0737074aed40104177149e8a2862
+1117f07ee708e71cbeda23673447e7e2ecc84ded1c2fdf40945cae38522c
+4316c75706f52f2dba1a9d43e97babab6f9157b7d8cd08ff409024889216
+27b3e8a94cdff1de0aa7cd30029f7ef45a41902a8297256de2b91aded584
+d098019bae6e763078e9e7634fce21359e074006aacc89a1c8c6199da648
+dc880002ddae31f5a3d2594d41803bc86475884658bee7c7691726fc61b5
+5385fbd5ca9fab4142e3c765e568d42e8e358aeb6406d3e31c1659e89b0c
+87f71bb7cdadd56d1aae187168231e375e8737e17c05208d5ffc3737a893
+fefd4da6f095e8de9340cbfd21bea1b0027afd7313a6d188315ef4d3caa2
+18b7dcc6dd4de6d569a0652f6115ab7cec90679da2735501f982a3d98cd0
+ec6ea48b449863f1ffff347523d3766bb67305d20bf0492eb2334a2c7320
+9935f4f35de5fc172cbb9431ab371c7f69e11f9fc69c9f0ad5780ddebc20
+3bf4275be7bf05c8801de5b4e5d007250346b4e159263031666571f87ce7
+411cc1d94ec0a4c65b2ee9f67f2ee39f70b3abab8e9911a38a014c4e839f
+47d2bc47cf0a5c88a1da47c6f47cfa2000b0f5f36f9f7a182d6998c37308
+3df1c4beb464643b7bcd26056efdd43fd7d90f15992f3ae6fc00a080f1dc
+d11bbb610a9809869f3712880ae4574d7de52c25fb8d56627e03acb055a1
+7e50f5862d3309ddb88353a85bccf98e203167107d8a631f1fbe87631718
+41e891b1cdedf9438c18264f9d014c0a99fba6c12974fe029d016b200a56
+ba8e67b5b4121de96f2141abe0338d0a1121fb389f3b7c38794e64cd5458
+e8ac4ead27c1aaf01d6e4f90713328249c8a35050d0c57c92c68615047ed
+607bb0b2e01dafb143567159ee43013f7b51ad57bdf4c0e42e56029940f0
+d65d9a408a9d0d57d91e4fc6ae2b7061482ec4fdd62f842494e8b8a1c4a1
+4a65d4dfe80a8e12346e37a8ef583a034b1096dc0dce0498b464c0e3e6fa
+902f805e2f620ad1cdee95d566d37754036c669fba48bcbf5a1e178720ef
+3afc4499ab001afff896b3c2e5b4d691578ca26e1b7c9bc2caf84aab60e4
+1ee5c91559c7e1ea5f7f5e49f32a9eb00bfa1a5ba53b7ad7ff25a97ec81a
+c3d6157941b69ce2e8d3c057d355874e85e626df6e0be7f5bd1d6034e571
+274302767ebeb3f362dd5e50fd850e7542fa920b015f276c5063eae79597
+0445431aea0987239853e77530b83d1ba630f003d0960f40388ac23f5445
+31e221b8b982352f6015b3e027d691fb7eb68b360d6846029dc69e6d9c5a
+885781a9ff40968799b46493f675cf4455b1c4abf6ddef65a20adc5ebe0d
+631a6018560df33eabbfd3fee26b2c4a158502978bbb70885f36c7b5f226
+f3183e8f978c7cb27094a947f4063106b3807c916ff00a6b488edeaa8c51
+9d4951e81e3c04cad9dfc80e882021978231f02816771baedf04eb25724b
+901ff4d73d024f2c47684f09068e1c9137f0a2f5de2891ff1c02fd59f447
+f793536eb41bbba5fb1caf6185f6a7256b847f7c4c562b981e9d2fb06029
+8d16b7bc55ebde4ec18f48caa85a08eb0c24fc8f54922b774acd2dc50660
+9da8d87b76def4c69562c175bb77b5e2b21436692445fed298003382afb1
+1ee906908b3ea15f766ed5317360935c0cb9a83d5a25c5bdd7d4c9c89f1e
+26b129f10cd26160e8b208aaffa5aa24f8e95af40e66077a4079d347f136
+7b943541c2d89542a78dc8731c195b5086bfa5cc8741ceb0c786e28a2a79
+768be51b726626a337d07021e4e662e3d88c93763a66cbb90452b28fd046
+ce6c4ac6e125c37b20fcc9de34f9697974603387bf6c6b0b800f00bff5cd
+a260efcc62818f5866b0d917984c79e4f394e54117915eaad55b01dc6b3f
+aee7c97ca5b55ab277532fcf8caee6e09b05f400022d8e84be366c2d18f0
+045677c5ccc98eb674e92dc13f0ef7e86e64c7928a8aa20e937eecb4ca31
+04a7244220d3ba68ac70066ffbf6a63f639f6830e34aa78f73d0d6a1a88d
+aba0283f2382223c4527d447fa7997477194bbb673ab25071335384c849f
+654ab0345af53d7c96f5c2ad635a9f1704158c4a69cc9037f74f83c1588a
+321403a06e09956a4dd863a2a77399f4dd13abe0cdb7a4cace56d5526974
+291da8012c26558bfbad653f29efa176a2d9d75e067d3e62d62e46ee4eb4
+cd7596654ead0a57fe6b80294fc8f7414df81d09258ded8c4928818f7e31
+14bc99c93ee1b8a4b955d66f268556970964f462738dd33454e8ae8d397c
+28e2871c2745ddb891b2fb43c881a043902e9aa0c6e2e049b090a04d744d
+2bc3ac5673fea830691b036a3f7881a175cfb771076676081a50227f086a
+27dc149a84ceb522e16a54a3669f00a02e6ae52a0b037ee0ee4b3c9a6f8e
+4d9b1ca74efa2e29669fe3141b3d9d5e15e08d534e798241c8ceaa466796
+1261e7c7d7502f8fc6be415d18b5ff6334ca3817ba5478debb3b80cd89c3
+966b5416b8e52b062942746f0306d05d80b14de7955a0df79e88d65d02a1
+b6c36b238e44e86aad035bc8a0cd08acdf69831acb83b7d8a05db9ee80f2
+042ddcf1bf5eb388848061138bc6f08e100d1371eeee171542f649fc8f45
+a94bb8df4d0803cd51c0b2aeae6c203ee6acdaa2fd6696b46d99a564d397
+2d05a6262f16353fb549ac735537c616ffcc18141a456b4333b0d1f38aa5
+f48fdd2a10162010f35ca5af6d12d60bc67902bfe26f4bc5e7462ef42400
+df06fbadb6886cc29d45e431805cf86cda8d4a5f23c295f118790bc64ecf
+9740ea83dc22a5e257ddff33e47fb9ba559fb4c7eeff0dba8692c5ccfcb9
+4d91ecdc1ced2d4474f1c4dfb969eb75abbe27b36fa47c0797b5cced1fab
+d1589bd823737d2350d562d241bd266d3e488f2c1de700ec07eb5ffe52dc
+9a7284314e5600eb812fc948874b08118c3143efa79442196ec391591ea0
+d01ffd1fa3a51908feaad02b402830ac414c26da1a0e15190872eeb8f163
+8da716486f1914fe6353b2487548ea30fdd14fc9b7a6b25a2c949d8ab5e6
+de8d21ef0c795e5fa28a7c6fabea50aedc95b66b7074d97ec409916e4631
+726738dea0d4d66c9df0a79680caf3b351ef95d4888e104cccdb9ee97160
+ae14c96b71be94896b4d290419bc9b0301729b22237289ef54620ee5e445
+08867b50a3128b2e8a53d33a501f466ae75b3fe05d47b073f8b57afbb3f1
+4326ab29bbde4d9e8954c7f99113cf766104dbae067ba02b702da3393e9d
+7d236c92bbd5637d4863ec6545e8827cf8f094f23f5369974f1e296c14ef
+4a1742abaee9995e3dc7a8e8c469df3b392b716c3a4aaacd801d17fa0c72
+d089b9e275f8cd065bcd3bcfe6875a03ee56ac64e1fe10307dbb2522fec9
+2eb25c296cc942360b38399591519c67aad6fbe733639bda24841588b04f
+4cae97237055906a8e8b7962e1f1f89d68ebc30fcdc598a322be4e471751
+8a07efc28efc59119d5fec75fe2e7b6066627fc957c8c4265d0f497cc32b
+b5342621fd58887c5ef6ecae52b1f137bfbcf6ec422c4148113dedf2b685
+71494034cb2ae19466123c60f9d651320bf6b3556017e58d73572c0b1983
+c6a2905e4c1e97b7b7ca6bc703eeb216a0ed382f375ea69af2a34bdcb296
+d4944992d6cfc10315e33e64fb7bd76d9b2bc48b7ddd6e84071e501c9663
+f8745473f74149d05dc9a3ebe1beababd8f776066e3b50cd58bcb93ff901
+365a62a28b65c7db8f0717563ef743637206d16d8d08b3b41da45e30b4b2
+3c10287f13c03426a55cab4c20054890d74ff74e917458313910aba8fd75
+78823f6437435d324b3f22f1ba509143af39f07fc1278310df068c0c52fc
+d5d8be0b19718f0c975dbc2f3d217884d8e22b17d1fcfc8ce3305e25db8f
+3bf0da80a564d51d227fd895f6131397b93d34d88027c1b96102b22df106
+b96b82346fb0b6814b56fb00957dab25aef8cfc08f34cfedae6dab39ffbe
+1a34e35695f2b3c061f5f8ebbc2999e579867b2add78712a8c0f8d9ba80c
+d0a013bab8ce12352d66e694071d25f68a314d35d71e020f2df6e465dbf5
+c9b2ce35f68e06a3da16eeb6ed9c9f7d59e822dc87e066c18e41e2c976e3
+1cc14ad6833298fc00494c494da1335572a69806c7f302fb62b3212acd42
+32e5bd732be9733c1e8ffab05fe671cbe302599ad14972cfcad413f2ddf6
+adc786815f4b884c537619722ea3371304a902d2f0041f7159bc079a4636
+d70125b0f63429c901530dab3c99ad7f1b07132d4051ca543c578a9fc20b
+1b5fe1d5a2bde2b2665a4030d1d3deaca3b4b2484c73bfe3ff38edc1ec24
+cf7c9cbdb208da62eb0ab921d1833dec9005251181125d1b4ae35a8c7e42
+5cfc523f649c9699a916747bdf6f299ca914446943f5ff2087288ced2f0d
+e486b761f1f8cd0e05f0ec2b5011a60d0b1001a1281de32d9facb15b0064
+c1d9e29a8dd04e8d721c3c499ea8283161213e4ae2a2712ca2c1820caba7
+dafe076d94488b625c2caf76de56b7684342156758656236cba122eefce4
+009fffa5e4fb66345c1f3c574aff543ae6bd0990fe7f7b55b5d2fb9e01a5
+405b0e125ac24c5205afba4f5bf091cbd3b71a5716a55e72dfa5044decd2
+0f26e18f143f51727806c9f34a8fcb32020cd41400f7f068b332e993af72
+57ea6c49c04bdfc7ebeaa09958eac5fbcdd367eabdf5b23689d0fdba5230
+091824139d362e484baaf7cda2a50b849df3842eee52254ebe957f03d81d
+cc3ce52d999a162252cfc5a6e45fd7b72179229dec5144c304c059274048
+a0e03bfcbe449abdb7b96a8620ef9691bf75c6ad40bfd454a465713fb670
+05cae613fcfb8fc4ec29ff3c5f8b5612492329f7965e77f6295e209de448
+d2a117baf2b8b5414442c8c3d9d8c64710288aed628c0078466551888849
+7e0fb1d09b5200585f8e453af16c7ef0496be96cf5a3c0049ea7f5571c20
+d29590db168bdc2909c2c5890b876a142cba5ba3401bb9e43de8eadff7e9
+261b3acfa13a12562eea1554b112aae29c1eefbca3d500ce88622fcd7e8c
+9e1f6f18bee5c8953d53260329e5362365836ddeceef3270eb6120e2566a
+ac43935f3ac71810852e05a514b5818697363e3dfe272315899dc6fb9b75
+7623bb4f529726d0a5051be3953d1f4fd34a97e1533fbe50ef1242aa7c7a
+12c75f9ad9e25995a57ce60e683ac14327a8ede099dcbe6385c2e7f39fbf
+431dd03d20f0fe86b585fb1233cb0a05abb00d3cff450d5852bb4da032b8
+b393c04886b904ded16f80032944a55d1c3f5b74b93bc43989a31cd88cb2
+b1d41a3b97cf4bd67c366c85fdaf088fe0e7169c6027ed2c084966972b47
+bb229b1c1b97a80661dfd5ddf40495984c015fff111c286c93dce15b2ff6
+2b7b84943784d9c7eadd8acd16e6c5228a48e41c985e6a8741a59de42003
+0819e38c82795040022ff264125d5d7baeee6304ab5899e6fbb16991a3a1
+20beadd0cf5bdea470063c338012fd96e71d836621e073f47fe8cc8638b4
+8d38a55c5efb752bc53a104ae3053c12e8570e820bcada8e7fec871be81c
+aaeefa45065f1ac0a6cf00c42a50b038e67d5d7143d15ba7507d62637332
+d23c5813820115183241969cc05290d3af8b27a487a9c1f9364b69c958c1
+b1071905fee7ac1ccef5fba9d33ff266fc27cd59489b352f8634d2bb900c
+ad14f4716f26c3421d39292ea926be6000870ca5325620ad3b1d8593011f
+ebecadb881c187b73fd4b1e53d5edac00738d55e17cd40347a3bd648f799
+4a1d9f170a7887353a0ac7097ffbb8b215ffd63acb8b294d24b44cf84e92
+abee700b8334ff826c952f019f81f62d9982185d48b34dd1568909eaf031
+8c1cd0c1da64eed3993c0ae0251e1b165950d1e734564e062c35ad393fac
+58d488d6825c9e20551d211837f93b833876bc055ad0ff49405e5d960a49
+e98d3ebb097cd1b5c31253b573f0ef5287a01f91a4c34549971e37948c82
+02f2b7e5c98ada831e67ea8c0d5693da3588f72e6c961e083c98218eca46
+b37fba941deda7123bd1a0e92ca2a1dbc20d369d19350bdb4a44da25f947
+470a1a5e053c2fba22e99fa32e0e74bdd51e69882fd2a43350761951176c
+67412389d41279a1c7a4e9f995b09930dc28a1d75359e5acad9c5a703544
+ce4961c39755d94db1c74d845869b78be8bf6dc97cfd2ed0bd187290abb7
+7fa806c8aaa2fe46c17c05ebc6141adbe4efe456743ea5672cd946ac45f2
+fd74712b4f36f962db5fc54afdad2e71ec2b034b6dd69f39f0acfe5c2c18
+07e4c60856b79931975f87020151ad0c05f2c6cff5a5bb7489f8cb6e8118
+6c0ad85881a4c159943fb53990cab8914a0d096a14bff414e2e9a31648c3
+d7dac80142aadfc3295f9cdaeb84cc5ac885f475acf94e6cca268a9d23cd
+705cfb4c1a14e1069d449967f58051f3bf54d19a310afcefc1d9a3242c9f
+bcaf5d7793faefb08214fff4535f646aa7f1596378fd86136b4c08c3a863
+6a2a5ebaace6e99390201f9ded66507e76a6f031fe1c3f81b6d9f7a59ba8
+c70c964e1583ea48460ec7dee4b738b28b6f3a03614554d9ef7b9f6b7202
+36e5d449747799a242ef96fd9de4bdb7059ce3053e02c7aa9e24536bd3d2
+1aaaa5884f7064937fa48653ea39a3e6e1401fd96e97d6aa15eed15d77e5
+80679eb37f36f9bd5736a036a308cb06ee20cf32de82a3cc4dbfae50c296
+642963acd7adbe3eff9463f69f976aa47eeaba0e88258a4ffc4f0933af5c
+8b5b5ccf51a5cfd83f96defaa217f5b4450492b146a0e1bba99664b7f484
+cc1a13c5d31779ef3598ce57a7f2f98851711d3447dcf54bf98aa2851be0
+1bb5372601e5986e6c7af78ed12642418c3a126db1157355f3a9e757d9a9
+27109466de9f4cefa15be737e6fee85313e4ab2522b8590dfc9136c10353
+cef0f76faaed3bce8617438a6ebc81db83e948d85bb231cda96710ea8db3
+fd406900bcdc73a75a78cb281ce0af94e574d6135ef05bbedff72a333ef6
+7e1cd73f1655e4c445919d87baab3cc1805691e80c3a16546d9b78357a60
+d516a53c084fa1b044c7b98e5a749e609e565b38231e6082d82e0f503936
+1afa972be4edd7eb44fff1b2c2e62e43d4e9b867a753cf9437b540f81905
+c0700f33c390fb06cea8a5b5cf8ea3a059e70dc1ffcd5b984beb34522ffb
+6b8e139d3c65aeaf10ee4510687f6f444b2eeefa7a9230eda603b20d5ab0
+9bd4ed89c94cfd636a40e19fef5f9cffc021e328753a4d94657f26041266
+e57b2f616e3ba924edd21ab5e0c112d50094df4953740857ffb9a528d92e
+a2a82c128394a6ceeed3b0eefae0d56ba1257cf423cee9f5b6e44a31d92e
+d17cca0ae2f59680dcc6ffe5402d4224de2c46731e9b431246e8caa84678
+cb8f88154805eb8afa1d643688056535471ffbe69021f8c14640705ff8a3
+ace43c6b8e6cd7a392d4dd587ed63b0d7556a509b1a04b057e2b64388b7d
+b8883fd1fea4957bf1efae7eaf60b6cc51915d8469f4413900dd810adc6f
+5454e7b23aca799d17f86fc6a940d72203099344101275c016e64ffcbdcb
+0fc05207fee7dd3efcf8e229a91d1ebf848e35ea739756100730e52f1bc1
+08e4132ea49e67d72e5611c57fbef7016ea1e54778cbf78994355b8ce81a
+cd4c73e242b7d1a047929dfbe50a005de1941b4da749a3ae9240610e1a22
+10fe35231fee309ad0dfb0c3fb7f37fc7388b10b9e0f94ebef8c1b371a3b
+ae1ad137928431d7cfa80df52db47e3287e4490df35effe46b9953beea19
+e3f96058a7c9adb2f10b36ef37d68c77d8e8bf4381500acdab38c78b3bd2
+5cd1a24faa406c599970447c8286ae0ec57916948e609287aa930ae24453
+da1a159a797eefaa166ed9a7240b66247833a3518f3f95420a0b3d09116e
+4c3b98e4efd8605ac502e4f905e575237153264b84511ffbe4072869737c
+738fe243e487ef6e22f74116eebf09aa2aaf63ff491a3a31d72dd908599c
+e9752a45671f74821e5acbb29aa871c0ea78a0c52a19d7280276156586ed
+59b61b715b7bba3195df8d0fe404d35a27d4a024eac9a7dbdbe3e2f60492
+17f5eb6c513aa42badbeb632f61375b2f51bc2cdb6902973b33e41b1924b
+2ebc1bb21ad24989d572b72c4a8c094f66b26a2f3c515782a285cab173a5
+901cf8a7c520c352e66006cb9ddd4f513886ad9041f5eca06edc316c378d
+8cd37ebee64c4af3e0093361e4e1b490c14eab48282d06e443729399c0c3
+e82423cae476393d203448a3a66567068a6b9f7a59d950113a39684f7472
+d5633aaf0d1eae46cbbb4452e35d5bd9ff31671b7ad333834aa66201d008
+0397f60831c62a157b54db32f2bd616a9d06a64bec27449e46b5a0a7de1c
+5753a48b1d78f7f3a08afe638519c9f9e35143c19664d07f879e305b3add
+34a1784cce04ce12f1d207e8a6e6dc2e96e15bb4847b0c1fb126560912c4
+510c2bac1b97b453b63b2ef06c4013ab3a036c83367535699d38523fa142
+5fa884b9c4496d310381018ad155ae8a9776a60860a1a142aa6a08fcb298
+f41d9c09e80639f17322299de0afbb66008e3de68b870b14db13585c93af
+a7a7453f103d934f3d97f26d1219203084161d3b5f0cd476b94734f24775
+5c1c537b3dcd97377bdf36b011070c185566890a4d94a5c2dac0f7a8b303
+a63a20a9c69bae5be9ef175e32d71ab9ea3b84a70b5aca09164e8ad904d8
+56537b464d84e0fda12bc3d704bc175ce278d5864dcf6f70ee0dd7a01eea
+5fb5500c4c8e70cb536c3fd74303b9036804360f08d511382e9c24c607b7
+721f2d10b5b2da52d05c3e3197b20ca67335278312aff8a78a984d539cc1
+ad1283d79e1a26fd94272527acf786ddd470b839e725c8964f156a47bfa7
+8f39f09b8e66a27d68cf1813b87c4a53f68ede700f465fecbf1dcb4671e6
+8882d65917f6c5eb5d6872d20674a7afe1809ade875f1ca99e7e946b7ffa
+cf55ba919901be74bcb76701ddb805e79f74fd9ab948e1743ce4b1928534
+dea3085d5cd3b810370b1c10bdcd6422133bfa5970599f7d6f0d345057d1
+1dd969a1caf29b540c509a7235b241fd54d180a126a22260bce48c6bc13a
+5a2628643648c3de80db360c3cda13f242cb7d951cb125cf15e25a811b00
+fd462ce46256d79b0f76c3e17b136ff34c0396ebef6794c2cb8b5c8f77e9
+1ec0d38110d871d2d3016982c7569e979b65e272ff63c5fcecb615cc1e51
+8c4f1ad4bd3c5c111d78bfecde89e7cf39e3fd9e1e96da91ce67d84d0f21
+f07a4633229ef928fb3a1e0057672ec81488873471cba85db82622b66b7f
+552ca4d5a8eaca181dcaeb1688075614260da43275b5ff9d3b1b857ff112
+ac1e4e23ce7cd023de78fc86658b970337be6f76d8f9b8cc004cab5ef459
+e45dc097c6ac28ffd024416348dcaf2465dc78737cd96ae9320fdd66204b
+b3ef22a7c03b893deb1319fee64ccbca911274dc067d81765212d93c4a19
+b3556985bb8ca78ed6242a741c7b989b9b9758a14db667993d1bb771a96e
+fcd8e11212e42238294b953acf9afbd043425107fe3be48f9dbe42fa4f56
+181b57c0f5775d21587ba02802abb04983e3a9505c90292488b5b67b20c1
+2f929046209df6e1ebc7c75d9d1ec0099f24c087c6ddd9d75e492618c137
+53ac1e0cf7f891eebbd132757ea250bbf083654ed84ead7d61c0d39d3836
+f6c61a19af3d3defef09075dd33902db9d1373ae1ba9736bbd2fd0f03fbb
+cfd56979ec616dffbbc9dd3be31d1966739e4734fd9687b0dd8dfe28c460
+69c2c49407fb1a97b77784b859d5458cd73b999e886c22dec444a1bb6f25
+23ec42de9809b6b3bb667a7f152e0acfcde4dfed0618f62b3056980c7026
+2021a18e0370be209adc1b535ed034181962c3aae8f3b0594379f329862c
+0b7fcd8a084fd92b09cb5ca092fcd31f1c79de205da08f09a2025cb60cc5
+c1ab1626beada762cb617cea852ab8009ee428be58e465761c8fba889282
+4328c5e6b4437d9e0171a4e64934a711af10e6999a0dd4013beaa89ec00e
+2b93549b602b99e78bac467f23b6c360c2a912c19cd0b05ba37dee185f04
+f35aa98cd0cafce7f04df9c9fd8e7ed397f67bdd09a5a10ad1fe78b5817e
+981470fc8006f3a8a25fe3ed3034a833d31d56df7af22247d18c4c62fd12
+3e18c958fed1f4af293fab1ccc17f80888e7702807254de89a71e0d75c98
+4b58c7fc2e405f48f339bc1b552d5efcde68ffe3390c0defc17cea9e075f
+8eceb401f8e0025a2e6aefca5b2a16c1d84df8aa9e95ec0bb1e6ea672fd1
+84cfad89a779df6430d775a30b6c1877480b23d14bc3fe1153896a11104a
+aaac146e386482b05baa5e200c206941fc9911115e3e9bc274f585a35c0e
+97c6836c21d7cef4ddbbdafa455c25f4bba41e11c925f9d4fe94078cce89
+0a7585f58ecb1ae850a1b2da8644987286a3e7495d7b4978e57e5e2741f9
+77e0caf22030b67c2f8ad794e12511eb1915b9553bdc26a6cdf0e35b1968
+cb80e8db6d2a2e97db63f4795357020c2bc3ca1837ab1e1c2fb3380fe0b0
+537dfba3945358dae2905772691786c3e3f475b5072b0e6413c8ad2d4cea
+006b630568961212fe907830c6a91f7718ff86febc0adbe1d3d8242145d7
+092a7e204ae34cc528bcc7b67baa6d4c1917c5bd39eee47fcc073aabcb93
+27c63bbb4017fba149837278895d06fa12d0085c19fd2164015fb6e7822a
+8994309a6afd9156b7d8a6a2239a2084c0a05b05d8bdf91171b9c840018f
+b23d0d28f5360a0bcca1e94e3c3a9de7451b033114ae73fe06d73891ed40
+65aa13581a464ebc84bee4bd0d081b8ba8546ddbb709735f23205b31f106
+0a1307d0de1bf1f8ca9c2c1dc5cbc7232c7627b48c37b1f5204b1179a934
+373a588f48dd1b50f9732855ebf0cbe96810b284009fc82860523c54f105
+063f6a73defce9f17c2c9d3379d77389666db5cd9e691714ba7b2f24c539
+02016e49e99c7849e89591ebf2902ef5cad9350d3f18ac7fd5eac076916b
+cc731d5a71704565881c0b68200e5614b1054e248eb894027bdc3c57a3a2
+0337b7e895e3e8f2e974ea33a01880cfa9858b0d2820092865fab5caff15
+79b62236f13276a02f458c35aabcaade56f1b2c7ab5a348e5545034d5431
+ec4d2a7a5a661cba46673971db0c769f7fb5144c7ab0c9ef1ea66e4a1f40
+a0e7842ca6b2bec0a17c9bce50c5deed9dd7bb2cf5c508d4646672d17c83
+0a0a83d613e0987bd7fc4100182e846ab45f7b175d0d35c635dafeb268bb
+cff34b020768b49d350e7a3e05000a8c1908c8fd8c5aaec284e41854a0fc
+72dc0c7f4133e16366be75afdecb7cbc2f47c0b8fa622c6a06d1c958c083
+2591f9c50a750364bc045e0062382d6263628620a9ca5a3a39cb97ab9450
+d9e839e57d327c65d8995242db5da370aa38a718704d91376ecda02a88fd
+cd663856666d6210714bc6489070a161eea4c3fd56f912515ea04ff6fa86
+41f735643ac42023596595f4864270314fe25cf928f58db399bc8b1f8949
+05d44901083204efa84ca557cb069398bfd15387028cfa5c2265849b5091
+997ed75d92870c347308cc5fe6fc13502d805bf21c3529b9a788410d5799
+81fdbc3929ae808ec0aede49afcc34cdfcb2826e20ae8e5d55253a5112a2
+838aaad0342a28b2fe40958af964dcc6682279ce5f5a971244ac8d9965bb
+30f0b4d1af25afadc7a3be40c168eb738c35a0795d37c62009d7a2592724
+7adc065dfcb416d1dffad3b54071e5958e13df684c48a5cee90eb7e0f166
+f688a3214e6bda46f06ffb0cab609de2309850d4a0ce12c9733439ba1187
+9d0e051ed8fa8962180f4cd6b38626a6065a8425ca360180d368f9734b21
+c0ffc9e8155f92d75382d096e894260c749d460466c2f866c335e23bf442
+4ad9875ef61ab14275fbc7dedec3d06bb3ba03581c8c330cfc30dbbd1e9d
+c92401a291f0c5eb5b4028aad99e5617f726531a422559db24ddf0bccc99
+f081dce48bbb731d91e06d2237c495ebd5b477afc744a8f17ba775630a2e
+90176e4e5e1c3f60b87112187f12e13d7880671aca68a24bf979fd4c790f
+09e477592571a105260eb97f062eb60273372c1bab4c4c6791bf9a45e1df
+d1e728cc5ca3ebba3b4fb96f8af68710b099ac2b5b0474634ea258d1b11b
+4b13be12fec7c5c193cd90be653063222469f13e2a4c77743b9fb0083d76
+64007c18ac981a7d9950dd97a3ceee037cdcc01e231a913de0a3ecddb871
+f20b4962e5847f87e3b41b52000d20d0031affad94d2aca4df047f3ba245
+5baf141cb493df6cca147fa3932d06a68f60598584dd4437fa16c32e9821
+082eb7fb11c5fb8cc0db33dbce8910bb26a7fe3deb515b06dffa37b12c91
+526eec637375ce1cd945046fa8793d2b7fea09aa573076e0de6a4ae83c0f
+1b7cde73a7f357b6acc6e41747f977637c5422f37926a2e26d646c1a7084
+ca157e28a75511a91de9f12d9df50950a22d3136c64f1e76db3134862738
+7e490000b8d76e688d18ca2b69c11da8a24866070d8b37e95a3eab084e11
+73570a54e21bb68f5b511c520e8211328355b96eec2c5e46f3281b415b6b
+d47d72e1d675231e2710599df129b3a4b859d77ae0be5a6750a73bef64e7
+4d4e09475d4067b26f4f77a72c00a9382826e1b5cde6f494809df9806ff8
+52efe0e7671fe9148afeaa63e1aa416c5998fde86fbb076a699e6062f1b0
+a7bb8a40b9c7470ee9d346736ce2536e8409be8845754e06bcb834a4a992
+5376e228f1e6b2ac37917379331a0af60a28771480fdbb3919a08a21ba58
+71d0ddc3aabdb186a80100eec21b2f847bdd24e75fefd5cfffbba60128e3
+541a77fc2ae46e0679e7d9f9a01f24b60bbc360ceb7c7d40f2dee7b98671
+09777f4d10668b5ceb2765dadb659bdab3f650e5c54009e40b66ecc1d46b
+4832afd2c75a79e11bd0d99ed7f9b38ede3b15c4a0fe86230870a5a1c762
+38f774cafdca5a6f89c42030333d486f68e85048a8d47aed82cbc8d42ac8
+e00915d1d99276d0de9f14965be6b50f325366b20f83f68d202286a62b89
+f4d866fd95b65b3228222aca3a61dc208f6aad2dca550adc0f6006d40f5f
+d352dce5bc7d50614794a9fdf62314e67afb3091d52b65ae0b6c49bcf86f
+3df5ed5912ab1212e706bf1964c6d8f56c608cccaa3b615a1b442fc95a18
+0d612791e4731c379fa09b30d01d72f167019e064b54c6967aaa73f91a3d
+d6ca39c3c256867dd8510bec55ae1bf70100bc4da31013724b35d8eafd91
+0c36b4cce0a23ae88f00c18fffc5f0b42af04d7f1f3395adedbf2f1167a6
+4ee33d311f0e7ba0bdb299c9e84db08c3aaa943c4155644987a9caa931e6
+429cbdb7c2181633fd60abfb0a0162aa9a3cf7902dabe7a15c21c6d5c0a7
+98933af01ce1e8586dc495d31894777a521c4df671837863df800f3eda6d
+ff691fd84dac4b4455250e80236a158c7f12a2611fb6643dfd2874f45740
+0950e899bdf61efc6b92223b1767f4726c0d1fc48188ad41880f3564dece
+3a71d318d2b728783360165494041af38d7a08b956e5ccdb4e0ceab31f67
+5ecc37c6e80cc69ea564f683e6ca41421bbabbaced13f9c4edb0bc7a7bea
+de9cf086f052d0efc6b510cc29a079d3137dc085757b89beae29ca372eed
+d334ab9eadfe9adcf40209ea9b7106aaeccc4f7c5064e9b1ef03a161dec0
+49ab0494966f312ff65c11582d2b213310eeaa04493bf663aef625d0a346
+017e734bac4d75056405e5b56bba89c9847d5bc32fe80bbe21905d9b037c
+fe1b007bd40db660a353b9887aa94fb50741d0dcbf4737429a362561b149
+cb4c4656884289f08bcc11a95d99d8746682ce0830d6a7ef0a0fa5d4f33f
+3c3f1cc13e0d3ddd44867d87f1b43a9add96ef2cc5b566fcedfff9933bb7
+522e5465aa5b83fdfaa36dacd17365d90183bee8367657d215b08fa01cc4
+cd75c1a328d321646a553d8bcac20e143ef018a788235193c0adf7908d05
+13a2e71c3dde6399b554970b44c9d085ca14db424afab61f33b6d1db2f19
+dabec03a92bdcae9bcd67d218498c43bd7cc75145ca4f88c49f55c0c00ba
+3d6fe75838dca4883eff7fcd39dbdba3488eb97e25dd449c8b3312863d07
+1cb2d0d77895733edafe6e0fec1534cdd1a21a991cf59291a9eb10d887e8
+a30a69c993305cdd2a6e953e9ecc992ff88617e9d374314958c2918cba34
+868099c16946d2ea1ff14697622f2f100bb680576df96dde0c1f2e4e33ac
+02d7ee2ae5a05d77f11683d271f2bb33432559aeb4b2fa18a6152076ad1b
+f415727bffc8962b58bb3d21e5916c85aea872e287d89a54c9f22cb3d3d5
+3fe094d881e9d972a5930976504f97fc7f496b29d3c6c7e74b840bc8da01
+c87a354a7ec46157816098ebf348b1dc4dee64c45bac4869f7b0bd77e9bf
+2b299f8c272ae57f5f8bf458e576a9efbd2f46cbfaa98e643f01ef4f7526
+34d8cdd724fb8d390bc9b66848157629134488ebaece3a60181d54d430e9
+bd2a98c52bf5b71c6c6097fc33420ccd7ba08a1ab1961cf04773bc3b0027
+465c6fb99c4fdc742d886acf122df963f92fb0e58538d1eae7c001532533
+17a92fdc63ec6c942c82457048dcfdd96c5dd71e54c892817892adec3098
+512b7f8d1ad020993b61018d32de244079425962d2a3f9a20d540e160407
+bc9ca63f6dc15ad408f2f20b0ca3762e6c5940100c3b23bcbcdcb13ed331
+8c7d43d4bf1f38c647592a3bbc4d5c2934fedc7d7d7022fb16274a5aba94
+b1ffcea6b94d390e97093db09bf4e8e3e5f0090326e92c20b6393cee7e5b
+1f52e50e82c532aa06d84789d3e1a30d4fbd4c23f96c76fa905020f30d4e
+b3fb8775ff97018d63be0afd799a888d0639c8c16a9bd808db1944fb76db
+0f7a15a3893a88209d9a291aa0d3dbd62520430fca052f45cded9adb03ce
+8590c7ba82739c46d92055809781c113cdf71cb395c2b5eefb807e52c621
+8f7e0c5f1ca5557a16bb7242af53ef182cdf9c5bc3962a86097482078c31
+93a854581c6473ea738086490e14ed5fa358daea43386991cd38ebad878f
+ab7713f0e31835681c26995375f2bbffe6e3aed7051f53c47bb1ee0fa258
+e1c4366764c1e460eb1d2fecddc58be23067122483e35b89ab583559ad58
+6048d401eb979ac134a90675496f1153f7e116c0b468db98fffe0581f939
+773d8830d2a7ff8a5e0d1e2ce0195b941ac983461bed5dfc6c141e1f814d
+244d40b512fbef72af2d0d6a0d52cab9e5da42f6714fd600a39bb007006b
+8567a0db724a576f3775ed2b8528117113adbfb2a76417c1b5d1f2213383
+fb4ca75fe49fdb060ecd2a2628aa798a76556daa082b419d31a19a5e70fc
+c68c824e00caeced378ebee62d0af03811ded8632f5f2745efb1f9d24768
+c69ade96e055bcfcc5d96752d96c0748ef653f8be91004ca14fe3561bbe5
+7d2135c2410e9f6c83bd0eeae2f071f28853b5d9fbb5fdd91bf0505c7a59
+1965f555270fbb48e90524575fd2cf50e325239bf9c184f9843a1008621f
+6f6f20cc8960c500ae600d3e2ba36da9c91ae2fd1a9efb1e55749c5920c2
+d13ffa390cbf4fe1e8bbddbc329bf30b1766c50fe0f714f8e21e562dd92a
+ae644774e04418b9698bfa1e7d74b60573862b0076016884da86dab655fe
+55b27db183f01b8a946c451b1cfa848a423c7e5e63cc0d0816e2d26b92a5
+0638dbe0d9eb68d1eb6049972ca0eb816de5d908a85420679cd87a539d7f
+81d3c5d865ee619f7cab188e84b3e281e374297d20b48f9c05b67364fd23
+12bc769289734c49a245d635d3246e91ccd1bf050c31e71bdeafca463552
+bab58b33f716fb8c484db217ae9cc1b7c57f9138cfbaf39c62cb4723cd4a
+85222610c639d5700eff6d0e07166a4cf27a749166580e5926c2496876bf
+9b0cfac6a6069ad45b0ae75c47150492b49625f4a862c12d7de81deafce6
+f8f869fd7bbcadcd60afaf00730ddad0b40c01b6590055aedece7f72d329
+db9585459b94ed3429cf1daa3e7bd4db54f9c9d69d7e0685b8e96589c9ff
+7f259a5d1b08a36cf7a57988b0b22a80547fc2a7f5d7a2fecb873195914a
+c7781d14b39b38a7e5bd1eb3e36db08cddf9f3d0d7d52cbc134af253d4fd
+640f0faa0668815975d36bae8ae6dcde20505e48df3505b02bf4159f1264
+d47f2f073cc9c4e15541f06385ed4889376f8ca26b2836b8831efa962f47
+02ce6fc0d13b1641c3b2b2a09692ebec091e2b8da489f9eda0e9e83b670e
+a70a63916b5934cfac9221aeda0a17d1d6e5ad459d29beb8c04c45c00561
+6a8a1a1755de39425c7999d04ed7b37fc6b8380a5a010809c909d22a6646
+8901953068c7ef52432782ff285d1263c18b04adaa0b0dbfcd938a35cacc
+3fd5110e7c18c76caf0bcb3f1c49f3eeb024e55e754223ba9501c287b367
+d037b5469c0f5eeaa9ebef41df5f736d0d352d07e285abfa1efe9df11925
+6252e5274bf361130efd2b3258bc01fbbf8ef89bce0412fa41e7308e146a
+30e1b0abc45615548c2b2b3512c8f505e24d937ff07d3379a72993b570c4
+4e156f98a84394eb3ea15808cbc77fe69276fd7f6a8c7e9589f1e9dd0f7d
+80ca2c06b8a654bdccac7517dd5acef2cc0ff887b7b6236ca8e5eba068e7
+fde83d763653985795891fd898197225fc94ab77defec4876af0576f6040
+0928dbe79403ce4aee10fa051139699a0067f19901bf6ecc5a8d732c8e87
+f27457639bca63abc0f7319dbdd66f1340d459ff5855de0967c6ee42b3aa
+e4746f377edd74d7480d7c56f5a275609cad8a335a309814a071e9948d1d
+e3cc9fbafd0268560e7e12379c956d165f618db68cbf1db33b6ec3483050
+1bf6e537e00118fc84cf6302098c9fc1841bb076f471bf80770d72898924
+21df74c93f8b765bc0261a186cf9bc561109e7674c9d6b8cb0f6bb29e0ad
+da7cda78cbcb86a4a858560df143a533c420241272346330d366d7aac8a8
+678204bfdfd15e49b46a703f2bce4affeafb26b2f76e2b21d34a5d71948f
+71c5d78c776483bb09341f800bbe786065fff786afc450aed3a2abc1e3f2
+5d2577271a12f2c5f5bc852662a19655bbc2ebeb24c6dccf28978fc52913
+dce655cb21576373bf33c740b324d8dfa745ac044f094ae7a14ec1b3e6cd
+08e03841833852f0779dc37a8e1617c21bfb7a824728db74d5023f839e50
+cd44126da917e643050c2f60fac3b411b857329c601548b493e202b77c14
+f4cb6ab08ba2aa727ebfd5bb40b66eec12f43c2759606f5ef2eba9010942
+d3d2b532ee0ddaff8269adeb75a12b00830918d30e4ebfa1a6aebb0dcdf7
+edfd3679ecfc6b283f11c30c98acc79a2ae311f016964b045ccb4c66c6c4
+34849aea17b02735481756437fe92abd575887506c7e4522dc6f7a6961e8
+24000bb68e8c7871ac1b704dffad8e04df8e814e93d0eb7503c1315dfa00
+f8b9341f478ac907d475ef650ae80587780f71e7f65550755b8e0a2963dc
+c86eb72f22ee87c16bcfc2ccfd0da6d811f52ad064c4ddd7aa375a2cd474
+df5e8bffb02df24c3c16998bd8294dbef8ad0dce209a7464eb7acd40d0d9
+a4678d159b9b1937d82c5cfb9029009c56e429e1e3d23f1522e91cd1f276
+025d75195883c43537b3fef47a841b672d49f63140c14a7cc1318768b76c
+a9850f49aa7ac9da33679f43986bc69e2c9610a6fddd044ff00240bc09a6
+e25681eba705e55621d33d04d1a041a639a577d584e60110720cb96af250
+c076dcc38197adaceea7eb0e0175788f5b71347c79277f3cda414683ce26
+4b7b64dc3af7d710d8790ccf0a61a9fe4bcfad32eefea3372fd924ae3be5
+ba738eea455df3912db0c2f3cbd6f2cf2b39365cbd5dcea69e79a7953a22
+698bc3a20bf6627bfcd0bd53fe1233b1dc428874fe84cfbebfb2ac04b1c4
+546edf0cd51ee85197841ec4e55830d03db9fcdbd97f63b44a95407399ed
+f69e0c14634ffb3cab9630e22a7665fcec4e493b7ae4d7769e71df76602c
+8daab61ca2f03a8376be6103a81448c3fb266f7cfeb8a6b1f6f7632484ed
+8603b99562942d09644bd9eb3890b5c0d62cd7797501a702f6a12daa54e2
+0300519a40c248f6c12d6cccaf8173f5bd985673b6884d7a1a41486be38f
+9229b6f930d8b98f892f457bd008a5bc354d9e2c5acb748381bca0ed2a1e
+0891f492c489bbb365938c80ce8eb82de271d351efefd394a791d9ab22e2
+7bef611803b087e84e12849808579369b9f0ec1c08cd1ea72eebc288f0b3
+cccaa240e430387ecee0e567ba431074223226ca222d8324dc706aa51aa2
+79fecc280429cd243cf56822a720fbb88a92d5d6f37363ab2edc5bc053ab
+ceb752a2ca80b78a9518059de8b1624ab90ccabb63a89422ab4f78ee3b94
+1d49e1caea3fa59f4b2e925d5d92d331d96412e133306980878c3614cb9c
+d99d644b4772a0470d2e1cfd7975e37179035ca5bc64d2d2a148e2d8f5d2
+c4a894ffcae6725d88552470cd3393f79c8b31aaf46b1790152aeb1865a9
+25af135b30f0ab01ab72534d0137e831e65787367301cb478d62f623c763
+7882a729eda0241b553cf31e51623af66a841482485c3a1287342da71916
+060a46e37e37a30dc99f3f524ae3cbe3dd075c8c38d187695c5e559bfbb7
+b7d94fac98f7ab7d94d615a8a22d6842dd09f995454666724a15efea104d
+f85626e9e6db009ce1805be05a29bdf063cb4cbd9f27f05a6f3d03353147
+e86f05390629a04c88bef21d2892b4b68cde132e631be2076e5867430f87
+8c57d3eedab592ffbf1f8c12dd7a6022d9a286469e6b6a181a58822d9587
+c457941da28c466ad86bbd7e9fbf2c6539f1cc5bb4a16ef65bbb0db5237a
+0f28925532d5fd394ea9267babd451ce56ad4d983172060237898a504ba4
+7cc4f3c43c2f6bab090534505c9a6c4609c19657177f9720de4529883dca
+9fd8c8cc0b217f1a8fe6c11b4d9782974f1872a6131ad0efbf5be03977bb
+625ca5c83fb60284aa6f4c31e50417ee21e3dda2a69ff6984925654198be
+41fc4c9fd11d635e1e3fe367191877b593440078c200abc78cfe822a78f2
+c6127f70caed225150ed8a185a7d2b247a18dfd63967af0420f9df2e7905
+0681c00b95493b97b5353ff0db28169af7e2270fa28dc208314652d59207
+168de1aa523e9f50abb42e68fe7399ac4f1839b43e41429e337947851391
+7d43463e623fb2502bc3d477e525d0c6e8aa5dedaff575337c0e499b7d12
+3edcf05ed0f494ede88769f188f8a4134f53cfc850362d9017dfb0f2a611
+e22ce4f18ff6d78559ca0092e7756320ed34fa849a56163a4236ba8940da
+6f9fde0eb3e2e71eebfa8d37ec8dac8b0cf6ea21a97ab3b30934ba8ac209
+9ec89085e15f42b6196dcedb9b775a066062346da41692b9d7e69d794215
+6e0f55241ff6f4f653caa58d29acd106c0b2863a2ae8c71366b929475713
+6d45234b208fb30c1c453e05e68c9a35712986c0eb5161592667dcf85fac
+37be40e947238a08f48cd294f453cc94a9417c9f211680074aa91bdb32fd
+bc0ad75251944001c0e3779fb03fa474f69743de8d160747e1bab93fbb23
+e75fb3bf3cd85e48cbaa2090c5398a4dbe174b9d98bd6cc056b067eee625
+44ef416db590d244728c488581710e3cf9c8874502f581884bd1d839d111
+5f1f77028d98977d83971ff0d2f242f74c108c5c4e98dfd28bcf4262afb5
+739ff804d54cbd8a0bf7d65bcc312c28bd5af696b97eb4f5b39ace5c742f
+342681f98f8bab16c959d6a16ef5368bd711c201a895f0971b26baf6ff7a
+9c635134983a54d2b49f5bced91010996994909648564344479e11e7589a
+603206110b90a3e6eb8eb089f3ce49b911b316be83209d7b6aa903d931a1
+12d42421c99a8ab0192325723019e31250cb5f130959b26687cd3ab0751c
+9ad02e20cd96820fd36e8dd97f9b3fa2f21d9436b62074e2e3a09ed74ba6
+847868b768482b44ddc6eb79add9655be334197532f3d978b94e667e51ff
+c5b6521e0ef83706b20147f5edf54549e5a505cc22917a613cf7617ed104
+c26c225ffc39ef7e30cafe37aab34ccf71a1c610a288d5038e481bead3d7
+364c646e4158659ace5f448dae82c18cb13ef42762c8269a107bccbdc8da
+44d4e3265e8b62aae6d70a4c14e8564adfed450fb7ae9057d661724a5aaf
+0eb818791004eecae762d4281231a91b3733efd99f35c2b222d1417ab81d
+fd64568840022c6be13632bf8a3eabd754d0d7979d70488b44b32abcb6d9
+e9ec65e227ea3b8391b66346f4d428c4fabe9927485f8891f677acdd7d8a
+4f58763af0f9ca3343d608ec13ee639ddb18a1f09f3038f65afbbc2f5eb1
+7c26befd7e57118952857acfeea1a8d65880778aefa626e4acda8232ee9b
+b8085ceec2f845be9ea4b0c1715a04ec166ddeff6108b2f30d05a38120e5
+91a650a942ffa49fe8cf7cf6572652be94953556d3bc1344779efc1b9f9c
+66278d614747d16bdc069ecab758c341a13e10a63556edf13a562ab27af5
+bc57242af4e708af899a0ae345e8251557eda3f15558f7f4aad4626edeb5
+e1e7f16160bd8940f02448a462b1e0648613388a9d3b6c0f2965e2b34e2b
+0bfead1df63667ebae172d58487b3c2ae07403ecc022f3317570e85e0a96
+053b32957fb6bef1f91bb6bf283f626954e712cea564110ce9a4c88edb28
+d87a8c32ade55a79bbe68cf93501110f59a020c02b0359f50a4aed99df4a
+069daba42eec26b132a2fcb2964dc73a5f0f123041b38ca854112a03a3cb
+a297a6fa4b045d658d291264495b6d1eacd8c683b5a44193747831182518
+27305c1a74945d3dd8eaa5943a74b7825c2030e3a8233a40046dd9446633
+52d6af102f737878091714621795368327c2d35d8907695acca5206862a1
+7804e1cf7fbd1fae40071d43e6e2cf101eccdf81f25ec91cb057321b8204
+60706a4f990f5d0a5e40fa2c3a07bee8af0100bdcf4298e8cfdf68932838
+6c525f06c125a4998a015db3a4cb96825015f4569183bf2e9d2745951de6
+c53ef9f1fd193781bad0897f1a5ea004510e815a90c6c957ec7577fd2652
+df67ce4efb3f8c30304d356509cc01fead119448b5983413a3c398e1fa98
+beba5e97dd9c7bc4ca825d8771cd1b8b8206892aee39cf9fca7511e301e2
+fd61754e2c36b3b9801cb123623b16c00dc15510a2c16c7dfb39d271acf3
+7f9b4d3709169c4e460b5752a2663e3b24fd6d6e23097ad38917b36993cd
+d5f1543ddd39167f72ab544823e02c0282f34876f4498b12a07ccfd9cc15
+4c96c4fbee226906f45de971027be08f78ab0b93b530db1f374a85b3ab16
+b123add1ce4ff1f39bbb5b1b80668afba767f2aa947073af88be267a21e7
+2c6d8d62585fbb7cfca3238639a017c3eb9e8335061f9f53cf7af75442e7
+2f8df88fbe8c06465cf9469692a57711e1d8a6d4b2b8bdd56957175888cf
+f2b56c2c7b1f4ed085864e8031f8bc7bfe708af06d7920da144678731584
+9e315c01b363be9f4841d255cb9c978c5dbe53b63b9c133bd41d9fe9b5ce
+fe685662bbaafce39c13c26136b0d19b8579d8e2be61f1e158851476e431
+63c31ef71dbef1b7de4696346d4be168944b1148fcf3220eeeb1b3a1b845
+fc5f4c55ea17b6644c277637f834766fcaf68f1f173c8784ae648624744f
+a07837e686fbf9b9845fa0d66a082cf8afd89e7b2393f8e2c299b656b09e
+3b960c369557f0b7736000603f4f9aafef291f7100cc1378216f808b06f8
+4f1797ed54bafb693d82a8133ade22edd3e06f7aa5f624f7823aa46cee9a
+59d48e84c53062b6f54744063847fbd79dad395ca365c635a5c93cdc9a56
+02a1e8d07a2734a5bb83b47f9642e918d6f848556e0c176b22142b2930c1
+c4753fe6377ad3967d9cdd718fd80eafbd6d4e51d4a641752fbce144f802
+bf5a89096128b725f577da8937e439404119ace13f3622be5e8f019acf3e
+15fffd271b9ba0f510e92e04f2638cd8c01ce389077ffcce1f23647eac11
+5095e56d625fa670cc1ccd42b9d785536793ad84d2772eab0be639d0c1d8
+3e12eeceba5ba8d2927e1e35a3eeee5c196ba9ebf69b72b2fddaa907032e
+4a77e4dad4b44e357d733819597de78b2eb52ffdd8f520791c67469c1fb5
+32f11f6cfbcc5605a40ca49553160b720189c1840c0f647795881496a4fb
+ba5fb1399577af150d7a2381db41d11f3de795a2239494cb434a97430eca
+e9600d8b3e23d1990c5fd55f2aedef7ed633bb3d3745f40f06d059dc5fae
+57d7d99c4be5da150d995f86c7ed928088fbe8ae45807531e9fea6c812c3
+66bfe43cd3858f8d479491c3d3c1c0efe22a1d7f5b7178b085f33c1bddcf
+7359a253dbac7f208bdbe359adc47dda6456e9e9e6da4193eeedcea7e1bf
+72a371dae857540032d2f8e8f5a16f647c07636e2c7a618933e95c609248
+7f3ed15f78c6cc25162513f3731fd125becc806a92c133036ae711b9bf62
+6ac52263c94150c9ea75cb77145fef1b2e01cc4f4fca08573e8f5a31718c
+e8277c4d685daa390eec5ec461e32e401188c14d7ad2909a70823b314730
+45549ee65c1142331880fdcd0a8fd511889b05692de6f932a1f700213a08
+d6f1b06abb6410d3ba1305cfbe9fb86fc47d82c092a927f07e7a4b163519
+f7dd9c4fd0658a442b318ddd44a79f0ff4e19f96c9df9c98d8b350978554
+97a0363e5aef9bdab0712547bfa8654749603332a4f18015c9ac8067a4fa
+66ca1d81cefe7bacb899e70529b785b2d03e565f7475484827476c1eb1c8
+add1648c3e41fd21e4fae0546aaba41ad528bed418f684c320971ff24218
+a0acb587b1531ad505ee5922bb7823140d70f54ec065419e7661b520484f
+14f737675b9e90135d872671ad819d63c2e3c22902c1640880877e04340e
+15ecf930069dacd15558a3de1be8ab83ceee18ea8cbe4d00129ff7e3d829
+59c4d25232afdfc5c56ffa2e0a9edab1b83b4edaaabaab1806c3aa90a955
+fc9596ab5ec9dc8e48b20729f9821855abdb3f7c0d533b690ba211be869b
+0d714478f6ac0124258f3b654b84ebd4453afa8164d0b1b3ec21b2b462f9
+b501cb7f8443070cec740f05fbf784ba236d851c9cb24819a7ec19fde67e
+35df0625f2212cddef4fe01c2b9f195346cdef6b7e7eebf1385ab3988a15
+7e6476b97c93e08471d5dd2cad24d028d40e5875e688911213f5ece58537
+9f2939cea04f8cf727acb15c186cdecc5c10794a92c9bfcdf47e85db06fd
+acf631f8f5980bacddac0eca5cdcbd3efc773e62af1d970c0134ba7374a9
+ef32aa06ad7955ea4638
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+cleartomark
diff --git a/fonts/utilities/ps2pk/tests/Symbol.pfb b/fonts/utilities/ps2pk/tests/Symbol.pfb
new file mode 100644
index 0000000000..ff00dde448
--- /dev/null
+++ b/fonts/utilities/ps2pk/tests/Symbol.pfb
Binary files differ
diff --git a/fonts/utilities/ps2pk/tests/Symbol10.300pk b/fonts/utilities/ps2pk/tests/Symbol10.300pk
new file mode 100644
index 0000000000..f4c2aa9ccd
--- /dev/null
+++ b/fonts/utilities/ps2pk/tests/Symbol10.300pk
Binary files differ
diff --git a/fonts/utilities/ps2pk/tests/lmmath.test b/fonts/utilities/ps2pk/tests/lmmath.test
new file mode 100755
index 0000000000..bc3123eb3b
--- /dev/null
+++ b/fonts/utilities/ps2pk/tests/lmmath.test
@@ -0,0 +1,24 @@
+#! /bin/sh -vx
+# $Id: lmmath.test 45809 2017-11-15 00:36:56Z karl $
+# Copyright 2017 Karl Berry <tex-live@tug.org>
+# Copyright 2014 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+test -d tests || mkdir -p tests
+
+TEXMFCNF=$srcdir/../kpathsea
+
+encpath=`$KPSEWHICH lm-mathit.enc` || exit 77
+ENCFONTS="`dirname $encpath`"
+
+t1path=`$KPSEWHICH lmmi12.pfb` || exit 77
+T1FONTS="`dirname $t1path`"
+
+afmpath=`$KPSEWHICH lmmi12.afm` || exit 77
+AFMFONTS="`dirname $afmpath`"
+
+export TEXMFCNF ENCFONTS T1FONTS AFMFONTS
+
+./ps2pk -elm-mathit.enc -X600 -Y600 -R600 -S0 -E1 -P12.0 lmmi12.pfb lmmi12.600pk || exit 1
+diff $srcdir/tests/lmmi12.600pk lmmi12.600pk || exit 1
+
diff --git a/fonts/utilities/ps2pk/tests/lmmi12.600pk b/fonts/utilities/ps2pk/tests/lmmi12.600pk
new file mode 100644
index 0000000000..5d2fa7d66d
--- /dev/null
+++ b/fonts/utilities/ps2pk/tests/lmmi12.600pk
Binary files differ
diff --git a/fonts/utilities/ps2pk/tests/ps2pk.test b/fonts/utilities/ps2pk/tests/ps2pk.test
new file mode 100755
index 0000000000..5f32933f1e
--- /dev/null
+++ b/fonts/utilities/ps2pk/tests/ps2pk.test
@@ -0,0 +1,43 @@
+#! /bin/sh -vx
+# $Id: ps2pk.test 48633 2018-09-09 17:56:55Z karl $
+# Copyright 2017-2018 Karl Berry <tex-live@tug.org>
+# Copyright 2012-2014 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE
+
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+TEXFONTS=.; export TEXFONTS
+
+rm -f Symbol*
+
+cp $srcdir/tests/Symbol.afm $srcdir/tests/Symbol.pfb .
+
+./pfb2pfa -v Symbol.pfb || exit 1
+diff $srcdir/tests/Symbol.pfa Symbol.pfa || exit 1
+
+./ps2pk -v Symbol.pfa || exit 1
+diff $srcdir/tests/Symbol10.300pk Symbol10.300pk || exit 1
+
+rm -f Symbol10.300pk
+./ps2pk -v Symbol.pfb || exit 1
+diff $srcdir/tests/Symbol10.300pk Symbol10.300pk || exit 1
+
+./pk2bm -h -ca Symbol10.300pk >Symbol.alpha.hex || exit 1
+diff $srcdir/tests/Symbol.alpha.hex Symbol.alpha.hex || exit 1
+
+./pk2bm -b -o141 Symbol10.300pk >Symbol.alpha.pix || exit 1
+diff $srcdir/tests/Symbol.alpha.pix Symbol.alpha.pix || exit 1
+./pktest -ca -W24 -H22 Symbol.alpha.pk <Symbol.alpha.pix || exit 1
+./pk2bm -b -ca Symbol.alpha.pk | \
+ sed 's/yoff : 28/yoff : 21/' >Symbol.alpha.out || exit 1
+diff Symbol.alpha.pix Symbol.alpha.out || exit 1
+
+val1='167 240 263 288'
+val2=`./mag -r -R240 $val1` || exit 1
+val3=`./mag -R240 $val2` || exit 1
+
+echo "./mag -r -R240 $val1 => $val2"
+echo "./mag -R240 $val2 => $val3"
+test "x$val1" = "x$val3" || exit 1
+
diff --git a/fonts/utilities/ps2pk/texfiles.c b/fonts/utilities/ps2pk/texfiles.c
new file mode 100644
index 0000000000..0ec4ce95e0
--- /dev/null
+++ b/fonts/utilities/ps2pk/texfiles.c
@@ -0,0 +1,26 @@
+/*
+ * File: texfiles.c
+ * Purpose: basic binary TeX reading functions
+ * Version: 1.0 (Nov 1993)
+ * Author: Piet Tutelaers (derived from xdvi/pl16)
+ */
+
+#include <stdio.h>
+#include "texfiles.h"
+
+#define one(fp) ((unsigned char) getc(fp))
+
+unsigned long num(FILE *fp, int size)
+{ unsigned long x = 0;
+
+ while (size--) x = (x << 8) | one(fp);
+ return x;
+}
+
+integer snum(FILE *fp, int size)
+{ integer x;
+
+ x = getc(fp);
+ while (--size) x = (x << 8) | one(fp);
+ return x;
+}
diff --git a/fonts/utilities/ps2pk/texfiles.h b/fonts/utilities/ps2pk/texfiles.h
new file mode 100644
index 0000000000..960c1d7a49
--- /dev/null
+++ b/fonts/utilities/ps2pk/texfiles.h
@@ -0,0 +1,29 @@
+/*
+ * File: texfiles.h
+ * Purpose: headerfile for texfiles.c
+ * Version: 1.0 (Nov 1993)
+ * Author: Piet Tutelaers
+ */
+
+#ifndef __TEXFILES__
+#define __TEXFILES__
+
+#include <stdio.h>
+
+#ifdef MSDOS
+typedef long integer ;
+#else
+typedef int integer ;
+#endif
+
+unsigned long num(FILE *fp, int size);
+integer snum(FILE *fp, int size);
+
+#define one(fp) ((unsigned char) getc(fp))
+#define sone(fp) ((long) one(fp))
+#define two(fp) num (fp, 2)
+#define stwo(fp) snum(fp, 2)
+#define four(fp) num (fp, 4)
+#define sfour(fp) snum(fp, 4)
+
+#endif /* __TEXFILES__ */
diff --git a/fonts/utilities/ps2pk/token.c b/fonts/utilities/ps2pk/token.c
new file mode 100644
index 0000000000..fd768072e3
--- /dev/null
+++ b/fonts/utilities/ps2pk/token.c
@@ -0,0 +1,1170 @@
+/* $XConsortium: token.c,v 1.2 91/10/10 11:19:55 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* Authors: Sig Nin & Carol Thompson IBM Almaden Research Laboratory */
+#include "types.h"
+#include "t1stdio.h"
+#include "util.h"
+#include "digit.h"
+#include "token.h"
+#include "tokst.h"
+#include "hdigit.h"
+/*
+ * -------------------------------------------------------------------
+ * Globals
+ * -------------------------------------------------------------------
+ */
+
+/* These variables are set by the caller */
+char *tokenStartP; /* Pointer to token buffer in VM */
+char *tokenMaxP; /* Pointer to last byte in buffer + 1 */
+
+/* These variables are set by TOKEN */
+int tokenLength; /* Characters in token */
+boolean tokenTooLong; /* Token too long for buffer */
+int tokenType; /* Type of token identified */
+psvalue tokenValue; /* Token value */
+
+/*
+ * -------------------------------------------------------------------
+ * Private variables
+ * -------------------------------------------------------------------
+ */
+
+static FILE *inputFileP; /* Current input file */
+
+
+/* Token */
+static char *tokenCharP; /* Pointer to next character in token */
+
+/*
+ * -------------------------------------------------------------------
+ * Private routines for manipulating numbers
+ * -------------------------------------------------------------------
+ */
+
+#define Exp10(e) \
+((e) == 0\
+ ? (DOUBLE)(1.0)\
+ : (-64 <= (e) && (e) <= 63\
+ ? Exp10T[(e)+64]\
+ : P10(e)\
+ )\
+)
+
+static DOUBLE Exp10T[128] = {
+ 1e-64, 1e-63, 1e-62, 1e-61, 1e-60, 1e-59, 1e-58, 1e-57,
+ 1e-56, 1e-55, 1e-54, 1e-53, 1e-52, 1e-51, 1e-50, 1e-49,
+ 1e-48, 1e-47, 1e-46, 1e-45, 1e-44, 1e-43, 1e-42, 1e-41,
+ 1e-40, 1e-39, 1e-38, 1e-37, 1e-36, 1e-35, 1e-34, 1e-33,
+ 1e-32, 1e-31, 1e-30, 1e-29, 1e-28, 1e-27, 1e-26, 1e-25,
+ 1e-24, 1e-23, 1e-22, 1e-21, 1e-20, 1e-19, 1e-18, 1e-17,
+ 1e-16, 1e-15, 1e-14, 1e-13, 1e-12, 1e-11, 1e-10, 1e-9,
+ 1e-8, 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1,
+ 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7,
+ 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
+ 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22, 1e23,
+ 1e24, 1e25, 1e26, 1e27, 1e28, 1e29, 1e30, 1e31,
+ 1e32, 1e33, 1e34, 1e35, 1e36, 1e37, 1e38, 1e39,
+ 1e40, 1e41, 1e42, 1e43, 1e44, 1e45, 1e46, 1e47,
+ 1e48, 1e49, 1e50, 1e51, 1e52, 1e53, 1e54, 1e55,
+ 1e56, 1e57, 1e58, 1e59, 1e60, 1e61, 1e62, 1e63
+};
+
+static DOUBLE P10(int32_t exponent)
+{
+ DOUBLE value, power;
+
+ if (exponent < 0) {
+ power = 0.1;
+ value = (exponent & 1 ? power : 1.0);
+ exponent = -((exponent + 1) >> 1); /* portable C for -(exponent/2) */
+ }
+ else {
+ power = 10.0;
+ value = (exponent & 1 ? power : 1.0);
+ exponent = exponent >> 1;
+ }
+
+ while(exponent > 0) {
+ power *= power;
+ if (exponent & 1)
+ value *= power;
+ exponent >>= 1;
+ }
+
+ return(value);
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Private routines and macros for manipulating the input
+ * -------------------------------------------------------------------
+ */
+
+/* Get next character from the input --
+ *
+ */
+#define next_ch() (getc(inputFileP))
+
+/* Push a character back into the input --
+ *
+ * Ungetc of EOF will fail, but that's ok: the next getc will
+ * return EOF.
+ *
+ * NOTE: These macros are presently written to return the character
+ * pushed, or EOF if none was pushed. However, they are not
+ * required to return anything in particular, and callers should
+ * not rely on the returned value.
+ */
+#define back_ch(ch) (ungetc(ch, inputFileP))
+
+/* Push a character back into the input if it was not white space.
+ * If it is a carriage return (\r) then check next char for
+ * linefeed and consume them both, otherwise put next char back.
+ *
+ */
+#define back_ch_not_white(ch) \
+(\
+isWHITE_SPACE(ch)\
+ ? ((ch == '\r')\
+ ? (((ch = next_ch()) == '\n')\
+ ? EOF\
+ : back_ch(ch)\
+ )\
+ : EOF\
+ )\
+ : back_ch(ch)\
+)
+
+/*
+ * -------------------------------------------------------------------
+ * Private routines and macros for manipulating the token buffer
+ * -------------------------------------------------------------------
+ */
+
+/* Add a character to the token
+ * ---- use ONLY when you KNOW that this character will
+ * be stored within the token buffer.
+ */
+#define save_unsafe_ch(ch) (*tokenCharP++ = ch)
+
+/* Add a character to the token, if not too long to fit */
+#define save_ch(ch) \
+((tokenCharP < tokenMaxP)\
+ ? save_unsafe_ch(ch)\
+ : (tokenTooLong = TRUE)\
+)
+
+/*
+ * -------------------------------------------------------------------
+ * Action Routines
+ *
+ * These routines all
+ * -- take int ch as a parameter
+ * -- return int ch if no token was recognized, DONE otherwise
+ * -- leave the next character in the input, if returning DONE
+ * -------------------------------------------------------------------
+ */
+
+#define DONE (256)
+
+/* Get the next input character */
+static int next_char(int ch)
+{
+ return(next_ch());
+}
+
+/* Add character to token */
+static int add_char(int ch)
+{
+ save_ch(ch);
+ return(next_ch());
+}
+
+
+/* -------------------------------------------------------------------
+ * Skip white space and comments
+ */
+
+/* Skip white space */
+static int skip_space(int ch)
+{
+ do {
+ ch = next_ch();
+ } while(isWHITE_SPACE(ch));
+ return(ch);
+}
+
+/* Skip comments */
+static int skip_comment(int ch)
+{
+ do {
+ ch = next_ch();
+ } while(isCOMMENT(ch));
+ return(ch);
+}
+
+/* -------------------------------------------------------------------
+ * Collect value elements for a number
+ */
+
+/* decimal integer or real number mantissa */
+static int m_sign;
+static int32_t m_value;
+static int32_t m_scale;
+
+/* real number exponent */
+static int e_sign;
+static int32_t e_value;
+static int32_t e_scale;
+
+/* radix number */
+static int32_t r_base;
+static int32_t r_value;
+static int32_t r_scale;
+
+static int add_sign(int ch)
+{
+ m_sign = ch;
+ save_unsafe_ch(ch);
+ return(next_ch());
+}
+
+static int add_1st_digits(int ch)
+{
+ m_sign = '+';
+ return(add_digits(ch));
+}
+
+static int add_digits(int ch)
+{
+ int32_t value, p_value, scale;
+ int digit;
+
+ /* On entry, expect m_sign to be set to '+' or '-';
+ * ch is a decimal digit.
+ * Expect at most one character saved at this point,
+ * a sign. This routine will save up to 10 more
+ * characters without checking the buffer boundary.
+ */
+
+ value = ch - '0';
+ save_unsafe_ch(ch);
+ ch = next_ch();
+
+ while(isDECIMAL_DIGIT(ch) && value < (MAX_INTEGER/10)) {
+ value = (value << 3) + (value << 1) + (ch - '0');
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ }
+
+ /* Quick exit for small integers --
+ * |x| <= 10*((MAX_INTEGER/10)-1)+9
+ * |x| <= 2,147,483,639 for 32 bit integers
+ */
+ if (isNUMBER_ENDER(ch)) {
+ back_ch_not_white(ch);
+ tokenValue.integer = (m_sign == '-' ? -value : value);
+ tokenType = TOKEN_INTEGER;
+ return(DONE);
+ }
+
+ /* Handle additional digits. Beyond the boundary case,
+ * 10*(MAX_INTEGER/10) <= |number| <= MAX_INTEGER
+ * just count the digits: the number is too large to
+ * represent as an integer and will be returned as a real.
+ * The mantissa of a real holds fewer bits than an integer.
+ */
+ p_value = value;
+ value = (m_sign == '-' ? -value : value);
+ scale = 0;
+
+ if (isDECIMAL_DIGIT(ch)) {
+
+ /* Handle the boundary case */
+ if (p_value == (MAX_INTEGER/10)) {
+ digit = ch - '0';
+
+ /* Must handle positive and negative values separately */
+ /* for 2's complement arithmetic */
+ if (value > 0) {
+ if (digit <= MAX_INTEGER%10)
+ value = (value << 3) + (value << 1) + digit;
+ else
+ ++scale; /* Too big, just count it */
+ }
+ else {
+ /* Use positive % operands for portability */
+ if (digit <= -(MIN_INTEGER+10)%10)
+ value = (value << 3) + (value << 1) - digit;
+ else
+ ++scale; /* Too big, just count it */
+ }
+ }
+ else
+ ++scale; /* Not boundary case, just count digit */
+
+ save_unsafe_ch(ch);
+ ch = next_ch();
+
+ /* Continue scanning digits, but can't store them */
+ while(isDECIMAL_DIGIT(ch)) {
+ ++scale;
+ save_ch(ch);
+ ch = next_ch();
+ }
+ }
+
+ /* Continue from here scanning radix integer or real */
+ m_value = value;
+ m_scale = scale;
+
+ /* Initialize for possible real */
+ e_sign = '+';
+ e_value = 0;
+ e_scale = 0;
+
+ return(ch);
+}
+
+static int add_1st_decpt(int ch)
+{
+ m_sign = '+';
+ return(add_decpt(ch));
+}
+
+static int add_decpt(int ch)
+{
+ /* On entry, expect m_sign to be set to '+' or '-' */
+ m_value = 0;
+ m_scale = 0;
+ save_unsafe_ch(ch);
+ return(next_ch());
+}
+
+static int add_fraction(int ch)
+{
+ int32_t value, scale;
+ int digit;
+
+ /* On entry, expect m_value and m_scale to be initialized,
+ * and m_sign to be set to '+' or '-'. Expect m_value and m_sign
+ * to be consistent (this is not checked).
+ */
+ value = m_value;
+ scale = m_scale;
+
+ /* Scan leading zeroes */
+ if (value == 0) {
+ while(ch == '0') {
+ --scale;
+ save_ch(ch);
+ ch = next_ch();
+ }
+
+ /* Scan first significant digit */
+ if (isDECIMAL_DIGIT(ch)) {
+ --scale;
+ value = ch - '0';
+ value = (m_sign == '-' ? -value : value);
+ save_ch(ch);
+ ch = next_ch();
+ }
+ else
+ /* no significant digits -- number is zero */
+ scale = 0;
+ }
+ /* value != 0 || value == 0 && !isDECIMAL_DIGIT(ch) */
+
+ /* Scan additional significant digits */
+ if (isDECIMAL_DIGIT(ch)) {
+ if (value > 0) {
+ while(isDECIMAL_DIGIT(ch) && value < (MAX_INTEGER/10)) {
+ --scale;
+ value = (value << 3) + (value << 1) + (ch - '0');
+ save_ch(ch);
+ ch = next_ch();
+ }
+ /* Check boundary case */
+ if (isDECIMAL_DIGIT(ch) && value == (MAX_INTEGER/10)) {
+ digit = ch - '0';
+ if (digit <= MAX_INTEGER%10) {
+ --scale;
+ value = (value << 3) + (value << 1) + digit;
+ save_ch(ch);
+ ch = next_ch();
+ }
+ }
+ }
+ else {
+ /* value < 0 */
+ while(isDECIMAL_DIGIT(ch) && value > -(-(MIN_INTEGER+10)/10+1)) {
+ /* Use positive / operands for portability */
+ --scale;
+ value = (value << 3) + (value << 1) - (ch - '0');
+ save_ch(ch);
+ ch = next_ch();
+ }
+ /* Check boundary case */
+ if (isDECIMAL_DIGIT(ch)
+ && value == -(-(MIN_INTEGER+10)/10+1)) {
+ digit = ch - '0';
+ if (digit <= -(MIN_INTEGER+10)%10) {
+ /* Use positive % operands for portability */
+ --scale;
+ value = (value << 3) + (value << 1) - digit;
+ save_ch(ch);
+ ch = next_ch();
+ }
+ }
+ }
+
+ /* Additional digits can be discarded */
+ while(isDECIMAL_DIGIT(ch)) {
+ save_ch(ch);
+ ch = next_ch();
+ }
+ }
+
+ /* Store results */
+ m_value = value;
+ m_scale = scale;
+
+ /* Initialize for possible real */
+ e_sign = '+';
+ e_value = 0;
+ e_scale = 0;
+
+ return(ch);
+}
+
+static int add_e_sign(int ch)
+{
+ e_sign = ch;
+ save_ch(ch);
+ return(next_ch());
+}
+
+static int add_exponent(int ch)
+{
+ int32_t value, p_value;
+ int32_t scale = 0;
+ int digit;
+
+ /* On entry, expect e_sign to be set to '+' or '-' */
+
+ value = ch - '0';
+ save_ch(ch);
+ ch = next_ch();
+
+ while(isDECIMAL_DIGIT(ch) && value < (MAX_INTEGER/10)) {
+ value = (value << 3) + (value << 1) + (ch - '0');
+ save_ch(ch);
+ ch = next_ch();
+ }
+
+ p_value = value;
+ value = (e_sign == '-' ? -value : value);
+
+ /* Handle additional digits. Beyond the boundary case,
+ * 10*(MAX_INTEGER/10) <= |number| <= MAX_INTEGER
+ * just count the digits: the number is too large to
+ * represent as an integer.
+ */
+ if (isDECIMAL_DIGIT(ch)) {
+
+ /* Examine boundary case */
+ if (p_value == (MAX_INTEGER/10)) {
+ digit = ch - '0';
+
+ /* Must handle positive and negative values separately */
+ /* for 2's complement arithmetic */
+ if (value > 0) {
+ if (digit <= MAX_INTEGER%10)
+ value = (value << 3) + (value << 1) + digit;
+ else
+ ++scale; /* Too big, just count it */
+ }
+ else {
+ /* Use positive % operands for portability */
+ if (digit <= -(MIN_INTEGER+10)%10)
+ value = (value << 3) + (value << 1) - digit;
+ else
+ ++scale; /* Too big, just count it */
+ }
+ }
+ else
+ ++scale; /* Not boundary case, just count digit */
+
+ save_ch(ch);
+ ch = next_ch();
+
+ /* Continue scanning digits, but can't store any more */
+ while(isDECIMAL_DIGIT(ch)) {
+ ++scale;
+ save_ch(ch);
+ ch = next_ch();
+ }
+ }
+
+ /* Store results */
+ e_value = value;
+ e_scale = scale;
+
+ return(ch);
+}
+
+static int add_radix(int ch)
+{
+ if (2 <= m_value && m_value <= 36 && m_scale == 0) {
+ r_base = m_value;
+ save_ch(ch);
+ return(next_ch());
+ }
+ else {
+ /* Radix invalid, complete a name token */
+ return(AAH_NAME(ch));
+ }
+}
+
+static int add_r_digits(int ch)
+{
+ uint32_t value;
+ int32_t radix, scale;
+ int digit;
+
+ /* NOTE: The syntax of a radix number allows only for
+ * values of zero or more. The value will be stored as
+ * a 32 bit integer, which PostScript then interprets
+ * as signed. This means, for example, that the numbers:
+ *
+ * 8#37777777777
+ * 10#4294967295
+ * 16#FFFFFFFF
+ * 36#1Z141Z3
+ *
+ * are all interpreted as -1. This routine implements this
+ * idea explicitly: it accumulates the number's value
+ * as unsigned, then casts it to signed when done.
+ */
+
+ /* Expect r_base to be initialized */
+ radix = r_base;
+ value = 0;
+ scale = 0;
+
+ /* Scan leading zeroes */
+ while(ch == '0') {
+ save_ch(ch);
+ ch = next_ch();
+ }
+
+ /* Handle first non-zero digit */
+ if ((digit=digit_value[ch]) < radix) {
+ value = digit;
+ save_ch(ch);
+ ch = next_ch();
+
+ /* Add digits until boundary case reached */
+ while((digit=digit_value[ch]) < radix
+ && value < (MAX_INT32 / radix)) {
+ value = value * radix + digit;
+ save_ch(ch);
+ ch = next_ch();
+ };
+
+ /* Scan remaining digits */
+ if ((digit=digit_value[ch]) < radix) {
+
+ /* Examine boundary case ---
+ * radix*(MAX_INT32/radix) <= number <= MAX_INT32
+ */
+ if (value == (MAX_INT32/radix) && digit <= MAX_INT32%radix)
+ value = value * radix + digit;
+ else
+ ++scale;
+
+ /* Continue scanning digits, but can't store them */
+ save_ch(ch);
+ ch = next_ch();
+ while(digit_value[ch] < radix) {
+ ++scale;
+ save_ch(ch);
+ ch = next_ch();
+ }
+ }
+ }
+
+ /* Store result */
+ r_value = (int32_t) value; /* result is signed */
+ r_scale = scale;
+
+ return(ch);
+}
+
+/* -------------------------------------------------------------------
+ * Complete a number; set token type and done flag.
+ * Put current input character back, if it is not white space.
+ */
+
+/* Done: Radix Number */
+static int RADIX_NUMBER(int ch)
+{
+ back_ch_not_white(ch);
+ if (r_scale == 0) {
+ tokenValue.integer = r_value;
+ tokenType = TOKEN_INTEGER;
+ }
+ else {
+ tokenType = TOKEN_NAME;
+ }
+ return(DONE);
+}
+
+/* Done: Integer */
+static int INTEGER(int ch)
+{
+ back_ch_not_white(ch);
+ if (m_scale == 0) {
+ tokenValue.integer = m_value;
+ tokenType = TOKEN_INTEGER;
+ }
+ else {
+ tokenValue.real = (DOUBLE)(m_value) * Exp10(m_scale);
+ tokenType = TOKEN_REAL;
+ }
+ return(DONE);
+}
+
+/* Done: Real */
+static int REAL(int ch)
+{
+ DOUBLE temp;
+
+ back_ch_not_white(ch);
+
+ /* NOTE: ignore e_scale, since e_value alone will cause
+ * exponent overflow if e_scale > 0.
+ */
+
+ /* HAZARD: exponent overflow of intermediate result
+ * (e.g., in 370 floating point); this should not be a problem
+ * with IEEE floating point. Reduce exponent overflow hazard by
+ * combining m_scale and e_value first, if they have different signs,
+ * or multiplying m_value and one of the other factors, if both
+ * m_scale and e_value are negative.
+ */
+ if ((m_scale >= 0 && e_value <= 0)
+ || (m_scale <= 0 && e_value >= 0)) {
+ tokenValue.real = (DOUBLE)(m_value) * Exp10(m_scale + e_value);
+ }
+ else {
+ temp = (DOUBLE)(m_value) * Exp10(m_scale);
+ tokenValue.real = temp * Exp10(e_value);
+ }
+
+ tokenType = TOKEN_REAL;
+ return(DONE);
+}
+
+
+/* -------------------------------------------------------------------
+ * Assemble a hex string; set token type and done flag.
+ */
+
+/* Done: Hex String */
+static int HEX_STRING(int ch)
+{
+ int value;
+
+ while(TRUE) {
+
+ /* Process odd digit */
+ ch = next_ch();
+ if (!isHEX_DIGIT(ch)) {
+
+ /* Skip white space */
+ while(isWHITE_SPACE(ch))
+ ch = next_ch();
+
+ /* Check for terminator */
+ if (!isHEX_DIGIT(ch)) {
+ break;
+ }
+ }
+ value = digit_value[ch] << 4;
+
+ /* Process even digit */
+ ch = next_ch();
+ if (!isHEX_DIGIT(ch)) {
+
+ /* Skip white space */
+ while(isWHITE_SPACE(ch))
+ ch = next_ch();
+
+ /* Check for terminator */
+ if (!isHEX_DIGIT(ch)) {
+ save_ch(value);
+ break;
+ }
+ }
+ save_ch(value + digit_value[ch]);
+ }
+
+ /* Classify result, based on why loop ended */
+ if (ch == '>')
+ tokenType = TOKEN_HEX_STRING;
+ else {
+ /* save the invalid character for error reporting */
+ save_ch(ch);
+ tokenType = TOKEN_INVALID;
+ }
+
+ return(DONE);
+}
+
+/* -------------------------------------------------------------------
+ * Assemble a string; set token type and done flag
+ */
+
+/* Save a backslash-coded character in a string --
+ *
+ * Store the proper character for special cases
+ * "\b", "\f", "\n", "\r", and "\t".
+ *
+ * Decode and store octal-coded character, up to
+ * three octal digits, "\o", "\oo", and "\ooo".
+ *
+ * The sequence "\<newline>" is a line continuation,
+ * so consume both without storing anything.
+ *
+ * The sequence "\<EOF>" is an error; exit without
+ * storing anything and let the caller handle it.
+ *
+ * For other characters, including the sequences
+ * "\\", "\(", and "\)", simply store the second
+ * character.
+ */
+static void save_digraph(int ch)
+{
+ int value;
+
+ switch (ch) {
+
+ case 'b': /* backspace */
+ ch = '\b';
+ break;
+
+ case 'f': /* formfeed */
+ ch = '\f';
+ break;
+
+ case 'n': /* newline */
+ ch = '\n';
+ break;
+
+ case 'r': /* carriage return */
+ ch = '\r';
+ break;
+
+ case 't': /* horizontal tab */
+ ch = '\t';
+ break;
+
+ case '\n': /* line continuation -- consume it */
+ return;
+
+ case '\r': /* carriage return -- consume it */
+ ch = next_ch(); /* look at next character, is it \n? */
+ if (ch == '\n') return;
+ back_ch(ch); /* if not a line feed, then return it */
+ return;
+
+ case EOF: /* end of file -- forget it */
+ return;
+
+ default:
+ /* scan up to three octal digits to get value */
+ if (isOCTAL_DIGIT(ch)) {
+ value = digit_value[ch];
+ ch = next_ch();
+ if (isOCTAL_DIGIT(ch)) {
+ value = (value << 3) + digit_value[ch];
+ ch = next_ch();
+ if (isOCTAL_DIGIT(ch))
+ value = (value << 3) + digit_value[ch];
+ else
+ back_ch(ch);
+ }
+ else
+ back_ch(ch);
+ ch = value;
+ }
+ }
+
+ /* Found a character to save */
+ save_ch(ch);
+}
+
+/* Done: String */
+static int STRING(int ch)
+{
+ int nest_level = 1;
+
+ tokenType = TOKEN_STRING;
+
+ do {
+
+ ch = next_ch();
+ while(!isSTRING_SPECIAL(ch)) {
+ save_ch(ch);
+ ch = next_ch();
+ };
+
+ switch (ch) {
+
+ case '(':
+ ++nest_level;
+ save_ch(ch);
+ break;
+
+ case ')':
+ if (--nest_level > 0)
+ save_ch(ch);
+ break;
+
+ case '\\':
+ save_digraph(next_ch());
+ break;
+
+ case '\r':
+ /* All carriage returns (\r) are turned into linefeeds (\n)*/
+ ch = next_ch(); /* get the next one, is it \n? */
+ if (ch != '\n') { /* if not, then put it back. */
+ back_ch(ch);
+ }
+ save_ch('\n'); /* in either case, save a linefeed */
+ break;
+
+
+ case EOF:
+ tokenType = TOKEN_INVALID; /* Unterminated string */
+ nest_level = 0;
+ break;
+ }
+
+ } while(nest_level > 0);
+
+ return(DONE);
+}
+
+
+/* -------------------------------------------------------------------
+ * Assemble a name; set token type and done flag.
+ * Put current input character back, if it is not white space.
+ */
+
+/* Done: Name
+ * (Safe version used to complete name tokens that
+ * start out looking like something else).
+ */
+
+static int AAH_NAME(int ch)
+{
+ do {
+ save_ch(ch);
+ ch = next_ch();
+ } while(isNAME(ch));
+
+ back_ch_not_white(ch);
+ tokenType = TOKEN_NAME;
+ return(DONE);
+}
+
+/* Done: Name */
+static int NAME(int ch)
+{
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ while(isNAME(ch)) {
+ save_ch(ch);
+ ch = next_ch();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ back_ch_not_white(ch);
+ tokenType = TOKEN_NAME;
+ return(DONE);
+}
+
+/* Done: Literal Name */
+static int LITERAL_NAME(int ch)
+{
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ while(isNAME(ch)) {
+ save_ch(ch);
+ ch = next_ch();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ back_ch_not_white(ch);
+ tokenType = TOKEN_LITERAL_NAME;
+ return(DONE);
+}
+
+/* Done: immediate Name */
+static int IMMED_NAME(int ch)
+{
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ if (isNAME(ch)) {
+ save_unsafe_ch(ch);
+ ch = next_ch();
+ while(isNAME(ch)) {
+ save_ch(ch);
+ ch = next_ch();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ back_ch_not_white(ch);
+ tokenType = TOKEN_IMMED_NAME;
+ return(DONE);
+}
+
+/* Done: Name found while looking for something else */
+static int OOPS_NAME(int ch)
+{
+ back_ch_not_white(ch);
+ tokenType = TOKEN_NAME;
+ return(DONE);
+}
+
+
+/* -------------------------------------------------------------------
+ * Complete a miscellaneous token; set token type and done flag.
+ */
+
+/* Done: Unmatched Right Angle-Bracket */
+static int RIGHT_ANGLE(int ch)
+{
+ tokenType = TOKEN_RIGHT_ANGLE;
+ return(DONE);
+}
+
+/* Done: Unmatched Right Parenthesis */
+static int RIGHT_PAREN(int ch)
+{
+ tokenType = TOKEN_RIGHT_PAREN;
+ return(DONE);
+}
+
+/* Done: Left Brace */
+static int LEFT_BRACE(int ch)
+{
+ tokenType = TOKEN_LEFT_BRACE;
+ return(DONE);
+}
+
+/* Done: Right Brace */
+static int RIGHT_BRACE(int ch)
+{
+ tokenType = TOKEN_RIGHT_BRACE;
+ return(DONE);
+}
+
+/* Done: Left Bracket */
+static int LEFT_BRACKET(int ch)
+{
+ save_unsafe_ch(ch);
+ tokenType = TOKEN_LEFT_BRACKET;
+ return(DONE);
+}
+
+/* Done: Right Bracket */
+static int RIGHT_BRACKET(int ch)
+{
+ save_unsafe_ch(ch);
+ tokenType = TOKEN_RIGHT_BRACKET;
+ return(DONE);
+}
+
+/* Done: Break */
+static int BREAK_SIGNAL(int ch)
+{
+ tokenType = TOKEN_BREAK;
+ return(DONE);
+}
+
+/* Done: No Token Found */
+static int NO_TOKEN(int ch)
+{
+ tokenType = TOKEN_EOF;
+ return(DONE);
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * scan_token -- scan one token from the input. It uses a simple
+ * finite state machine to recognize token classes.
+ *
+ * The input is from a file.
+ *
+ * On entry --
+ *
+ * inputP -> input PostScript object, a file.
+ * tokenStartP -> buffer in VM for accumulating the token.
+ * tokenMaxP -> last character in the token buffer
+ *
+ * On exit --
+ *
+ * tokenLength = number of characters in the token
+ * tokenTooLong = TRUE if the token did not fit in the buffer
+ * tokenType = code for the type of token parsed.
+ * tokenValue = converted value of a numeric token.
+ *
+ *
+ * -------------------------------------------------------------------
+ */
+void scan_token(psobj *inputP)
+{
+ int ch;
+ unsigned char *stateP = s0;
+ unsigned char entry;
+ int (*actionP)();
+
+ /* Define input source */
+ inputFileP = inputP->data.fileP;
+ if (inputFileP == NULL) {
+ tokenType = TOKEN_EOF;
+ return;
+ }
+
+ /* Ensure enough space for most cases
+ * (so we don't have to keep checking)
+ * The length needs to cover the maximum number
+ * of save_unsafe_ch() calls that might be executed.
+ * That number is 11 (a sign and 10 decimal digits, e.g.,
+ * when scanning -2147483648), but use MAX_NAME_LEN
+ * in case someone changes that without checking.
+ */
+ if (vm_free_bytes() < (MAX_NAME_LEN)) {
+ if (!(vm_init())) {
+ tokenLength = 0;
+ tokenTooLong = TRUE;
+ tokenType = TOKEN_NONE;
+ tokenValue.integer = 0;
+ return;
+ }
+ }
+
+ tokenStartP = vm_next_byte();
+
+ /* Reset token */
+ tokenCharP = tokenStartP;
+ tokenTooLong = FALSE;
+
+ /* Scan one token */
+ ch = next_ch();
+ do {
+ entry = stateP[ch];
+ stateP = classActionTable[entry].nextStateP;
+ actionP = classActionTable[entry].actionRoutineP;
+ ch = (*actionP)(ch);
+ } while(ch != DONE);
+
+
+ /* Return results */
+ tokenLength = tokenCharP - tokenStartP;
+}
diff --git a/fonts/utilities/ps2pk/token.h b/fonts/utilities/ps2pk/token.h
new file mode 100644
index 0000000000..272da4cbaa
--- /dev/null
+++ b/fonts/utilities/ps2pk/token.h
@@ -0,0 +1,61 @@
+/* $XConsortium: token.h,v 1.2 91/10/10 11:19:58 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+#ifndef TOKEN_H
+#define TOKEN_H
+
+/* Special characters */
+#define CONTROL_C (3)
+
+/* Token type codes */
+#define TOKEN_INVALID (-3)
+#define TOKEN_BREAK (-2)
+#define TOKEN_EOF (-1)
+#define TOKEN_NONE (0)
+#define TOKEN_LEFT_PAREN (1)
+#define TOKEN_RIGHT_PAREN (2)
+#define TOKEN_LEFT_ANGLE (3)
+#define TOKEN_RIGHT_ANGLE (4)
+#define TOKEN_LEFT_BRACE (5)
+#define TOKEN_RIGHT_BRACE (6)
+#define TOKEN_LEFT_BRACKET (7)
+#define TOKEN_RIGHT_BRACKET (8)
+#define TOKEN_NAME (9)
+#define TOKEN_LITERAL_NAME (10)
+#define TOKEN_INTEGER (11)
+#define TOKEN_REAL (12)
+#define TOKEN_RADIX_NUMBER (13)
+#define TOKEN_HEX_STRING (14)
+#define TOKEN_STRING (15)
+#define TOKEN_IMMED_NAME (16)
+
+/* Token routines */
+extern void scan_token(psobj *);
+
+#endif /* TOKEN_H */
diff --git a/fonts/utilities/ps2pk/tokst.h b/fonts/utilities/ps2pk/tokst.h
new file mode 100644
index 0000000000..53471c97af
--- /dev/null
+++ b/fonts/utilities/ps2pk/tokst.h
@@ -0,0 +1,508 @@
+/* $XConsortium: tokst.h,v 1.2 91/10/10 11:20:00 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* -------------------------------------- */
+/* --- MACHINE GENERATED, DO NOT EDIT --- */
+/* -------------------------------------- */
+
+#ifndef TOKST
+#define TOKST 1
+
+/*
+ * State Index Tables --
+ *
+ * These tables map the input character to the
+ * proper entry in the Class Action Table.
+ * There is one table for each state.
+ *
+ */
+#define s0 (si0+2)
+static unsigned char si0[258] = { 0x10,0x11,
+ 0x02,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x02,0x02,0x0F,0x0F,0x02,0x0F,0x0F,
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
+ 0x02,0x0F,0x0F,0x0F,0x0F,0x03,0x0F,0x0F,0x05,0x0B,0x0F,0x0D,0x0F,0x0D,0x0E,0x04,
+ 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0F,0x0F,0x08,0x0F,0x0C,0x0F,
+ 0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0F,0x0A,0x0F,0x0F,
+ 0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0F,0x09,0x0F,0x0F,
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
+ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F
+};
+
+#define s1 (si1+2)
+static unsigned char si1[258] = { 0x14,0x15,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x12,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
+ 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13
+};
+
+#define s2 (si2+2)
+static unsigned char si2[258] = { 0x1B,0x1C,
+ 0x16,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x16,0x16,0x1A,0x1A,0x16,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x16,0x1A,0x1A,0x1A,0x1A,0x17,0x1A,0x1A,0x17,0x17,0x1A,0x1A,0x1A,0x1A,0x19,0x17,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1A,0x1A,0x17,0x1A,0x17,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x17,0x1A,0x17,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x17,0x1A,0x17,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
+ 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A
+};
+
+#define s3 (si3+2)
+static unsigned char si3[258] = { 0x23,0x24,
+ 0x1D,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x1D,0x1D,0x22,0x22,0x1D,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x1D,0x22,0x22,0x20,0x22,0x1E,0x22,0x22,0x1E,0x1E,0x22,0x22,0x22,0x22,0x1F,0x1E,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x1E,0x22,0x1E,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x21,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x1E,0x22,0x1E,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x21,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x1E,0x22,0x1E,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22
+};
+
+#define s4 (si4+2)
+static unsigned char si4[258] = { 0x29,0x2A,
+ 0x25,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x25,0x25,0x28,0x28,0x25,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x25,0x28,0x28,0x28,0x28,0x26,0x28,0x28,0x26,0x26,0x28,0x28,0x28,0x28,0x28,0x26,
+ 0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x28,0x28,0x26,0x28,0x26,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x26,0x28,0x26,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x26,0x28,0x26,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
+ 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28
+};
+
+#define s5 (si5+2)
+static unsigned char si5[258] = { 0x30,0x31,
+ 0x2B,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2B,0x2B,0x2F,0x2F,0x2B,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2B,0x2F,0x2F,0x2F,0x2F,0x2C,0x2F,0x2F,0x2C,0x2C,0x2F,0x2F,0x2F,0x2F,0x2F,0x2C,
+ 0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2F,0x2F,0x2C,0x2F,0x2C,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2D,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2C,0x2F,0x2C,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2D,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2C,0x2F,0x2C,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,
+ 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F
+};
+
+#define s6 (si6+2)
+static unsigned char si6[258] = { 0x36,0x37,
+ 0x32,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x32,0x32,0x35,0x35,0x32,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x32,0x35,0x35,0x35,0x35,0x33,0x35,0x35,0x33,0x33,0x35,0x35,0x35,0x35,0x35,0x33,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x33,0x35,0x33,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x33,0x35,0x33,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x33,0x35,0x33,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
+ 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35
+};
+
+#define s7 (si7+2)
+static unsigned char si7[258] = { 0x3D,0x3E,
+ 0x38,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x38,0x38,0x3C,0x3C,0x38,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x38,0x3C,0x3C,0x3C,0x3C,0x39,0x3C,0x3C,0x39,0x39,0x3C,0x3A,0x3C,0x3A,0x3C,0x39,
+ 0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3C,0x3C,0x39,0x3C,0x39,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x39,0x3C,0x39,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x39,0x3C,0x39,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,
+ 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C
+};
+
+#define s8 (si8+2)
+static unsigned char si8[258] = { 0x43,0x44,
+ 0x3F,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3F,0x3F,0x42,0x42,0x3F,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x3F,0x42,0x42,0x42,0x42,0x40,0x42,0x42,0x40,0x40,0x42,0x42,0x42,0x42,0x42,0x40,
+ 0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x42,0x42,0x40,0x42,0x40,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x40,0x42,0x40,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x40,0x42,0x40,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,
+ 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42
+};
+
+#define s9 (si9+2)
+static unsigned char si9[258] = { 0x48,0x49,
+ 0x45,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x45,0x45,0x47,0x47,0x45,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x45,0x47,0x47,0x47,0x47,0x46,0x47,0x47,0x46,0x46,0x47,0x47,0x47,0x47,0x47,0x46,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x46,0x47,0x46,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x46,0x47,0x46,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x46,0x47,0x46,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
+ 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47
+};
+
+#define s10 (si10+2)
+static unsigned char si10[258] = { 0x4E,0x4F,
+ 0x4A,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4A,0x4A,0x4D,0x4D,0x4A,0x4D,0x4D,
+ 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,
+ 0x4A,0x4D,0x4D,0x4D,0x4D,0x4B,0x4D,0x4D,0x4B,0x4B,0x4D,0x4D,0x4D,0x4D,0x4D,0x4B,
+ 0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4D,0x4D,0x4B,0x4D,0x4B,0x4D,
+ 0x4D,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,
+ 0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4B,0x4D,0x4B,0x4D,0x4D,
+ 0x4D,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,
+ 0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4B,0x4D,0x4B,0x4D,0x4D,
+ 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,
+ 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,
+ 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,
+ 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,
+ 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,
+ 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,
+ 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,
+ 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D
+};
+
+#define s11 (si11+2)
+static unsigned char si11[258] = { 0x53,0x54,
+ 0x50,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x50,0x50,0x52,0x52,0x50,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x50,0x52,0x52,0x52,0x52,0x51,0x52,0x52,0x51,0x51,0x52,0x52,0x52,0x52,0x52,0x51,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x51,0x52,0x51,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x51,0x52,0x51,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x51,0x52,0x51,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,
+ 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52
+};
+
+/*
+ * Class Action Table --
+ *
+ * The entries in the Class Action Table indicate the
+ * action routine to be called, and the next state to
+ * enter, for each relevant character class in each.
+ * state. There are several entries for each state.
+ *
+ */
+static int AAH_NAME(int);
+static int BREAK_SIGNAL(int);
+static int HEX_STRING(int);
+static int IMMED_NAME(int);
+static int INTEGER(int);
+static int LEFT_BRACE(int);
+static int LEFT_BRACKET(int);
+static int LITERAL_NAME(int);
+static int NAME(int);
+static int NO_TOKEN(int);
+static int OOPS_NAME(int);
+static int RADIX_NUMBER(int);
+static int REAL(int);
+static int RIGHT_ANGLE(int);
+static int RIGHT_BRACE(int);
+static int RIGHT_BRACKET(int);
+static int RIGHT_PAREN(int);
+static int STRING(int);
+static int add_1st_decpt(int);
+static int add_1st_digits(int);
+static int add_char(int);
+static int add_decpt(int);
+static int add_digits(int);
+static int add_e_sign(int);
+static int add_exponent(int);
+static int add_fraction(int);
+static int add_r_digits(int);
+static int add_radix(int);
+static int add_sign(int);
+static int next_char(int);
+static int skip_comment(int);
+static int skip_space(int);
+
+static struct cat {
+ int (*actionRoutineP)();
+ unsigned char *nextStateP;
+} classActionTable[] = {
+
+ /* s0: Classify initial character */
+ /* 00 ALPHA */ {NAME, s0}, /* executable name */
+ /* 01 DIGIT */ {add_1st_digits, s3}, /* number? */
+ /* 02 WHITE_SPACE */ {skip_space, s0}, /* skip white space */
+ /* 03 PERCENT */ {skip_comment, s0}, /* comment? */
+ /* 04 SLASH */ {next_char, s1}, /* literal or imm name */
+ /* 05 LEFT_PAREN */ {STRING, s0}, /* string */
+ /* 06 LEFT_BRACE */ {LEFT_BRACE, s0}, /* begin procedure body */
+ /* 07 LEFT_BRACKET */ {LEFT_BRACKET, s0}, /* begin array */
+ /* 08 LEFT_ANGLE */ {HEX_STRING, s0}, /* hex string? */
+ /* 09 RIGHT_BRACE */ {RIGHT_BRACE, s0}, /* end procedure body */
+ /* 0A RIGHT_BRACKET */ {RIGHT_BRACKET, s0}, /* end array */
+ /* 0B RIGHT_PAREN */ {RIGHT_PAREN, s0}, /* unmatched right paren */
+ /* 0C RIGHT_ANGLE */ {RIGHT_ANGLE, s0}, /* unmatched right angle */
+ /* 0D SIGN */ {add_sign, s2}, /* signed number? */
+ /* 0E DECIMAL_POINT */ {add_1st_decpt, s4}, /* real number? */
+ /* 0F ANY */ {NAME, s0}, /* executable name */
+ /* 10 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 11 EOF */ {NO_TOKEN, s0}, /* no token found */
+
+ /* s1: Further classify a '/' */
+ /* 12 SLASH */ {IMMED_NAME, s0}, /* immediate name */
+ /* 13 ANY */ {LITERAL_NAME, s0}, /* literal name */
+ /* 14 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 15 EOF */ {OOPS_NAME, s0}, /* isolated sign */
+
+ /* s2: sign */
+ /* 16 WHITE_SPACE */ {OOPS_NAME, s0}, /* isolated sign */
+ /* 17 SPECIAL */ {OOPS_NAME, s0}, /* isolated sign */
+ /* 18 DIGIT */ {add_digits, s3}, /* number? */
+ /* 19 DECIMAL_POINT */ {add_decpt, s4}, /* real number? */
+ /* 1A ANY */ {NAME, s0}, /* executable name */
+ /* 1B BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 1C EOF */ {OOPS_NAME, s0}, /* isolated sign */
+
+ /* s3: sign? digit+ */
+ /* 1D WHITE_SPACE */ {INTEGER, s0}, /* n-digit integer */
+ /* 1E SPECIAL */ {INTEGER, s0}, /* n-digit integer */
+ /* 1F DECIMAL_POINT */ {add_char, s5}, /* real number? */
+ /* 20 POUND */ {add_radix, s10}, /* radix number? */
+ /* 21 eE */ {add_char, s7}, /* real with exponent? */
+ /* 22 ANY */ {AAH_NAME, s0}, /* executable name */
+ /* 23 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 24 EOF */ {INTEGER, s0}, /* n-digit integer */
+
+ /* s4: sign? . */
+ /* 25 WHITE_SPACE */ {OOPS_NAME, s0}, /* isolated +. or -. */
+ /* 26 SPECIAL */ {OOPS_NAME, s0}, /* isolated +. or -. */
+ /* 27 DIGIT */ {add_fraction, s6}, /* number? */
+ /* 28 ANY */ {NAME, s0}, /* executable name */
+ /* 29 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 2A EOF */ {OOPS_NAME, s0}, /* isolated +. or -. */
+
+ /* s5: sign? digit+ . */
+ /* 2B WHITE_SPACE */ {REAL, s0}, /* real with fraction */
+ /* 2C SPECIAL */ {REAL, s0}, /* real with fraction */
+ /* 2D eE */ {add_char, s7}, /* real with exponent? */
+ /* 2E DIGIT */ {add_fraction, s6}, /* number? */
+ /* 2F ANY */ {AAH_NAME, s0}, /* executable name */
+ /* 30 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 31 EOF */ {REAL, s0}, /* real with fraction */
+
+ /* s6: sign? (digit+ . digit+) | (. digit+) */
+ /* 32 WHITE_SPACE */ {REAL, s0}, /* real with fraction */
+ /* 33 SPECIAL */ {REAL, s0}, /* real with fraction */
+ /* 34 eE */ {add_char, s7}, /* real with exponent? */
+ /* 35 ANY */ {AAH_NAME, s0}, /* executable name */
+ /* 36 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 37 EOF */ {REAL, s0}, /* real with fraction */
+
+ /* s7: sign? ((digit+ (. digit*)?) | (. digit+)) Ee */
+ /* 38 WHITE_SPACE */ {OOPS_NAME, s0}, /* invalid real number */
+ /* 39 SPECIAL */ {OOPS_NAME, s0}, /* invalid real number */
+ /* 3A SIGN */ {add_e_sign, s8}, /* real w signed exponent? */
+ /* 3B DIGIT */ {add_exponent, s9}, /* real w exponent ? */
+ /* 3C ANY */ {AAH_NAME, s0}, /* executable name */
+ /* 3D BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 3E EOF */ {OOPS_NAME, s0}, /* invalid real number */
+
+ /* s8: sign? (digit+ (. digit*)? | (digit* . digit+) Ee sign */
+ /* 3F WHITE_SPACE */ {OOPS_NAME, s0}, /* invalid real number */
+ /* 40 SPECIAL */ {OOPS_NAME, s0}, /* invalid real number */
+ /* 41 DIGIT */ {add_exponent, s9}, /* real w exponent? */
+ /* 42 ANY */ {AAH_NAME, s0}, /* executable name */
+ /* 43 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 44 EOF */ {OOPS_NAME, s0}, /* invalid real number */
+
+ /* s9: sign? (digit+ (. digit*)? | (digit* . digit+) Ee sign? digit+ */
+ /* 45 WHITE_SPACE */ {REAL, s0}, /* real w exponent */
+ /* 46 SPECIAL */ {REAL, s0}, /* real w exponent */
+ /* 47 ANY */ {AAH_NAME, s0}, /* executable name */
+ /* 48 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 49 EOF */ {REAL, s0}, /* real w exponent */
+
+ /* s10: digit+ # */
+ /* 4A WHITE_SPACE */ {OOPS_NAME, s0}, /* invalid radix number */
+ /* 4B SPECIAL */ {OOPS_NAME, s0}, /* invalid radix number */
+ /* 4C R_DIGIT */ {add_r_digits, s11}, /* radix number? */
+ /* 4D ANY */ {AAH_NAME, s0}, /* executable name */
+ /* 4E BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 4F EOF */ {OOPS_NAME, s0}, /* invalid radix number */
+
+ /* s11: digit+ # r_digit+ */
+ /* 50 WHITE_SPACE */ {RADIX_NUMBER, s0}, /* radix number */
+ /* 51 SPECIAL */ {RADIX_NUMBER, s0}, /* radix number */
+ /* 52 ANY */ {AAH_NAME, s0}, /* executable name */
+ /* 53 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */
+ /* 54 EOF */ {RADIX_NUMBER, s0} /* radix number */
+};
+
+/*
+ * Character Classification Tables --
+ *
+ * The entries in the Character Classification Tables
+ * map character codes to character classes. The
+ * tables contains one entry per code. The bits in
+ * each entry indicate which classes the character
+ * code belongs to.
+ *
+ * The macros 'isInCLASS(ch)' generate code to test
+ * whether 'ch' is a character in 'CLASS'.
+ *
+ */
+/* Membership macros for classes defined in table 1 ... */
+#define isRADIX_DIGIT(c) ((isInP1[c] & 0x80) != 0)
+#define isHEX_DIGIT(c) ((isInP1[c] & 0x40) != 0)
+#define isDECIMAL_DIGIT(c) ((isInP1[c] & 0x10) != 0)
+#define isOCTAL_DIGIT(c) ((isInP1[c] & 0x20) != 0)
+
+/* Membership macros for classes defined in table 2 ... */
+#define isWHITE_SPACE(c) ((isInP2[c] & 0x80) != 0)
+#define isCOMMENT(c) ((isInP2[c] & 0x40) != 0)
+#define isNAME(c) ((isInP2[c] & 0x20) != 0)
+#define isSTRING_SPECIAL(c) ((isInP2[c] & 0x10) != 0)
+#define isNUMBER_ENDER(c) ((isInP2[c] & 0x08) != 0)
+
+#define isInP1 (isInT1+2)
+static unsigned char isInT1[258] = { 0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xD0,0xD0,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
+ 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
+ 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+#define isInP2 (isInT2+2)
+static unsigned char isInT2[258] = { 0x18,0x18,
+ 0xC8,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xC8,0x88,0x60,0x60,0x98,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0xC8,0x60,0x60,0x60,0x60,0x48,0x60,0x60,0x58,0x58,0x60,0x60,0x60,0x60,0x60,0x48,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x48,0x60,0x48,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x48,0x70,0x48,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x48,0x60,0x48,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
+ 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60
+};
+
+#endif
diff --git a/fonts/utilities/ps2pk/trig.h b/fonts/utilities/ps2pk/trig.h
new file mode 100644
index 0000000000..ebc253f243
--- /dev/null
+++ b/fonts/utilities/ps2pk/trig.h
@@ -0,0 +1,33 @@
+/* $XConsortium: trig.h,v 1.2 91/10/10 11:20:04 rws Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/*SHARED*/
+
+#define DegreeCos(d) xiStub()
+#define DegreeSin(d) xiStub()
diff --git a/fonts/utilities/ps2pk/type1.c b/fonts/utilities/ps2pk/type1.c
new file mode 100644
index 0000000000..edb112c70d
--- /dev/null
+++ b/fonts/utilities/ps2pk/type1.c
@@ -0,0 +1,1776 @@
+/* $XConsortium: type1.c,v 1.5 91/10/10 11:20:06 rws Exp $ */
+/* Copyright International Business Machines, Corp. 1991
+ * All Rights Reserved
+ * Copyright Lexmark International, Inc. 1991
+ * All Rights Reserved
+ * Portions Copyright (c) 1990 Adobe Systems Incorporated.
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM or Lexmark or Adobe
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission.
+ *
+ * IBM, LEXMARK, AND ADOBE PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY
+ * WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE
+ * ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING
+ * ANY DUTY TO SUPPORT OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY
+ * PORTION OF THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM,
+ * LEXMARK, OR ADOBE) ASSUMES THE ENTIRE COST OF ALL SERVICING, REPAIR AND
+ * CORRECTION. IN NO EVENT SHALL IBM, LEXMARK, OR ADOBE BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*********************************************************************/
+/* */
+/* Type 1 module - Converting fonts in Adobe Type 1 Font Format */
+/* to scaled and hinted paths for rasterization. */
+/* Files: type1.c, type1.h, and blues.h. */
+/* */
+/* Authors: Sten F. Andler, IBM Almaden Research Center */
+/* (Type 1 interpreter, stem & flex hints) */
+/* */
+/* Patrick A. Casey, Lexmark International, Inc. */
+/* (Font level hints & stem hints) */
+/* */
+/*********************************************************************/
+
+/******************/
+/* Include Files: */
+/******************/
+#include "types.h"
+#include <stdio.h> /* a system-dependent include, usually */
+
+#include "objects.h"
+#include "spaces.h"
+#include "paths.h"
+#include "fonts.h" /* understands about TEXTTYPEs */
+#include "pictures.h" /* understands about handles */
+#include "util.h" /* PostScript objects */
+#include "blues.h" /* Blues structure for font-level hints */
+#include "fontmisc.h"
+#include "ffilest.h"
+#include "fontfcn.h"
+
+/**********************************/
+/* Type1 Constants and Structures */
+/**********************************/
+#define MAXSTACK 24 /* Adobe Type1 limit */
+#define MAXCALLSTACK 10 /* Adobe Type1 limit */
+#define MAXPSFAKESTACK 32 /* Max depth of fake PostScript stack (local) */
+#define MAXSTRLEN 512 /* Max length of a Type 1 string (local) */
+#define MAXLABEL 256 /* Maximum number of new hints */
+#define MAXSTEMS 128 /* Maximum number of VSTEM and HSTEM hints */
+#define EPS 0.001 /* Small number for comparisons */
+
+/************************************/
+/* Adobe Type 1 CharString commands */
+/************************************/
+#define HSTEM 1
+#define VSTEM 3
+#define VMOVETO 4
+#define RLINETO 5
+#define HLINETO 6
+#define VLINETO 7
+#define RRCURVETO 8
+#define CLOSEPATH 9
+#define CALLSUBR 10
+#define RETURN 11
+#define ESCAPE 12
+#define HSBW 13
+#define ENDCHAR 14
+#define RMOVETO 21
+#define HMOVETO 22
+#define VHCURVETO 30
+#define HVCURVETO 31
+
+/*******************************************/
+/* Adobe Type 1 CharString Escape commands */
+/*******************************************/
+#define DOTSECTION 0
+#define VSTEM3 1
+#define HSTEM3 2
+#define SEAC 6
+#define SBW 7
+#define DIV 12
+#define CALLOTHERSUBR 16
+#define POP 17
+#define SETCURRENTPOINT 33
+
+/*****************/
+/* Useful macros */
+/*****************/
+
+#define FABS(x) fabs(x)
+
+#define CEIL(x) ceil(x)
+
+#define FLOOR(x) floor(x)
+
+#define ROUND(x) FLOOR((x) + 0.5)
+
+#define ODD(x) (((int)(x)) & 01)
+
+int currentchar = -1; /* for error reporting */
+
+#define CC IfTrace1(TRUE, "'%03o ", currentchar)
+
+#define Error {errflag = TRUE; return;}
+
+#define Error0(errmsg) { CC; IfTrace0(TRUE, errmsg); Error;}
+
+#define Error01(errmsg) { CC; IfTrace0(TRUE, errmsg); errflag = TRUE; return -1.0;}
+
+#define Error1(errmsg,arg) { CC; IfTrace1(TRUE, errmsg, arg); Error;}
+
+/********************/
+/* global variables */
+/********************/
+struct stem { /* representation of a STEM hint */
+ int vertical; /* TRUE if vertical, FALSE otherwise */
+ DOUBLE x, dx; /* interval of vertical stem */
+ DOUBLE y, dy; /* interval of horizontal stem */
+ struct segment *lbhint, *lbrevhint; /* left or bottom hint adjustment */
+ struct segment *rthint, *rtrevhint; /* right or top hint adjustment */
+};
+
+static DOUBLE escapementX, escapementY;
+static DOUBLE sidebearingX, sidebearingY;
+static DOUBLE accentoffsetX, accentoffsetY;
+
+static struct segment *path;
+static int errflag;
+
+/*************************************************/
+/* Global variables to hold Type1Char parameters */
+/*************************************************/
+static psfont *Environment;
+static struct XYspace *CharSpace;
+static psobj *CharStringP, *SubrsP, *OtherSubrsP;
+static int *ModeP;
+
+/************************/
+/* Forward declarations */
+/************************/
+#ifdef WIN32
+/* Unfortunately, there is such a function in the Win32 API */
+#define Escape Type1Escape
+#endif
+static void ComputeAlignmentZones(void);
+static void InitStems(void);
+static void FinitStems(void);
+static void ComputeStem(int stemno);
+static struct segment *Applyhint(struct segment *p,int stemnumber,int half);
+static struct segment *Applyrevhint(struct segment *p,int stemnumber,int half);
+static struct segment *FindStems(DOUBLE x,DOUBLE y,DOUBLE dx,DOUBLE dy);
+static void ClearStack(void);
+static void Push(DOUBLE Num);
+static void ClearCallStack(void);
+static void PushCall(psobj *CurrStrP,int CurrIndex,unsigned short CurrKey);
+static void PopCall(psobj **CurrStrPP ,int *CurrIndexP,unsigned short *CurrKeyP);
+static void ClearPSFakeStack(void);
+static void PSFakePush(DOUBLE Num);
+static DOUBLE PSFakePop(void);
+static struct segment *CenterStem(DOUBLE edge1,DOUBLE edge2);
+static unsigned char Decrypt(unsigned char cipher);
+static int DoRead(int *CodeP);
+static void StartDecrypt(void);
+static void Decode(int Code);
+static void DoCommand(int Code);
+static void Escape(int Code);
+static void HStem(DOUBLE y,DOUBLE dy);
+static void VStem(DOUBLE x,DOUBLE dx);
+static void RLineTo(DOUBLE dx,DOUBLE dy);
+static void RRCurveTo(DOUBLE dx1,DOUBLE dy1,DOUBLE dx2,DOUBLE dy2,DOUBLE dx3,DOUBLE dy3);
+static void DoClosePath(void);
+static void CallSubr(int subrno);
+static void Return(void);
+static void EndChar(void);
+static void RMoveTo(DOUBLE dx,DOUBLE dy);
+static void DotSection(void);
+static void Seac(DOUBLE asb,DOUBLE adx,DOUBLE ady,unsigned char bchar,unsigned char achar);
+static void Sbw(DOUBLE sbx,DOUBLE sby,DOUBLE wx,DOUBLE wy);
+static DOUBLE Div(DOUBLE num1,DOUBLE num2);
+static void FlxProc(DOUBLE c1x2,DOUBLE c1y2,DOUBLE c3x0,DOUBLE c3y0,DOUBLE c3x1,DOUBLE c3y1,DOUBLE c3x2,DOUBLE c3y2,DOUBLE c4x0,DOUBLE c4y0,DOUBLE c4x1,DOUBLE c4y1,DOUBLE c4x2,DOUBLE c4y2,DOUBLE epY,DOUBLE epX,int idmin);
+static void FlxProc1(void);
+static void FlxProc2(void);
+static void HintReplace(void);
+static void CallOtherSubr(int othersubrno);
+static void SetCurrentPoint(DOUBLE x,DOUBLE y);
+
+/*****************************************/
+/* statics for Flex procedures (FlxProc) */
+/*****************************************/
+static struct segment *FlxOldPath; /* save path before Flex feature */
+
+/******************************************************/
+/* statics for Font level hints (Blues) (see blues.h) */
+/******************************************************/
+static struct blues_struct *blues; /* the blues structure */
+static struct alignmentzone alignmentzones[MAXALIGNMENTZONES];
+int numalignmentzones; /* total number of alignment zones */
+
+/****************************************************************/
+/* Subroutines for the Font level hints (Alignment zones, etc.) */
+/****************************************************************/
+
+/******************************************/
+/* Fill in the alignment zone structures. */
+/******************************************/
+static void ComputeAlignmentZones(void)
+{
+ int i;
+ DOUBLE dummy, bluezonepixels, familyzonepixels;
+ struct segment *p;
+
+ numalignmentzones = 0; /* initialize total # of zones */
+
+ /* do the BlueValues zones */
+ for (i = 0; i < blues->numBlueValues; i +=2, ++numalignmentzones) {
+ /* the 0th & 1st numbers in BlueValues are for a bottom zone */
+ /* the rest are topzones */
+ if (i == 0) /* bottom zone */
+ alignmentzones[numalignmentzones].topzone = FALSE;
+ else /* top zone */
+ alignmentzones[numalignmentzones].topzone = TRUE;
+ if (i < blues->numFamilyBlues) { /* we must consider FamilyBlues */
+ p = ILoc(CharSpace,0,blues->BlueValues[i] - blues->BlueValues[i+1]);
+ QueryLoc(p, IDENTITY, &dummy, &bluezonepixels);
+ Destroy(p);
+ p = ILoc(CharSpace,0,blues->FamilyBlues[i]-blues->FamilyBlues[i+1]);
+ QueryLoc(p, IDENTITY, &dummy, &familyzonepixels);
+ Destroy(p);
+ /* is the difference in size of the zones less than 1 pixel? */
+ if (FABS(bluezonepixels - familyzonepixels) < 1.0) {
+ /* use the Family zones */
+ alignmentzones[numalignmentzones].bottomy =
+ blues->FamilyBlues[i];
+ alignmentzones[numalignmentzones].topy =
+ blues->FamilyBlues[i+1];
+ continue;
+ }
+ }
+ /* use this font's Blue zones */
+ alignmentzones[numalignmentzones].bottomy = blues->BlueValues[i];
+ alignmentzones[numalignmentzones].topy = blues->BlueValues[i+1];
+ }
+
+ /* do the OtherBlues zones */
+ for (i = 0; i < blues->numOtherBlues; i +=2, ++numalignmentzones) {
+ /* all of the OtherBlues zones are bottom zones */
+ alignmentzones[numalignmentzones].topzone = FALSE;
+ if (i < blues->numFamilyOtherBlues) {/* consider FamilyOtherBlues */
+ p = ILoc(CharSpace,0,blues->OtherBlues[i] - blues->OtherBlues[i+1]);
+ QueryLoc(p, IDENTITY, &dummy, &bluezonepixels);
+ Destroy(p);
+ p = ILoc(CharSpace,0,blues->FamilyOtherBlues[i] -
+ blues->FamilyOtherBlues[i+1]);
+ QueryLoc(p, IDENTITY, &dummy, &familyzonepixels);
+ Destroy(p);
+ /* is the difference in size of the zones less than 1 pixel? */
+ if (FABS(bluezonepixels - familyzonepixels) < 1.0) {
+ /* use the Family zones */
+ alignmentzones[numalignmentzones].bottomy =
+ blues->FamilyOtherBlues[i];
+ alignmentzones[numalignmentzones].topy =
+ blues->FamilyOtherBlues[i+1];
+ continue;
+ }
+ }
+ /* use this font's Blue zones (as opposed to the Family Blues */
+ alignmentzones[numalignmentzones].bottomy = blues->OtherBlues[i];
+ alignmentzones[numalignmentzones].topy = blues->OtherBlues[i+1];
+ }
+}
+
+/**********************************************************************/
+/* Subroutines and statics for handling of the VSTEM and HSTEM hints. */
+/**********************************************************************/
+int InDotSection; /* DotSection flag */
+struct stem stems[MAXSTEMS]; /* All STEM hints */
+int numstems; /* Number of STEM hints */
+int currstartstem; /* The current starting stem. */
+int oldvert, oldhor; /* Remember hint in effect */
+int oldhorhalf, oldverthalf; /* Remember which half of the stem */
+DOUBLE wsoffsetX, wsoffsetY; /* White space offset - for VSTEM3,HSTEM3 */
+int wsset; /* Flag for whether we've set wsoffsetX,Y */
+
+static void InitStems(void) /* Initialize the STEM hint data structures */
+{
+ InDotSection = FALSE;
+ currstartstem = numstems = 0;
+ oldvert = oldhor = -1;
+}
+
+static void FinitStems(void) /* Terminate the STEM hint data structures */
+{
+ int i;
+
+ for (i = 0; i < numstems; i++) {
+ Destroy(stems[i].lbhint);
+ Destroy(stems[i].lbrevhint);
+ Destroy(stems[i].rthint);
+ Destroy(stems[i].rtrevhint);
+ }
+}
+
+/*******************************************************************/
+/* Compute the dislocation that a stemhint should cause for points */
+/* inside the stem. */
+/*******************************************************************/
+static void ComputeStem(int stemno)
+{
+ int verticalondevice, idealwidth;
+ DOUBLE stemstart, stemwidth;
+ struct segment *p;
+ int i;
+ DOUBLE stembottom, stemtop, flatposition;
+ DOUBLE Xpixels, Ypixels;
+ DOUBLE unitpixels, onepixel;
+ int suppressovershoot, enforceovershoot;
+ DOUBLE stemshift, flatpospixels, overshoot;
+ DOUBLE widthdiff; /* Number of character space units to adjust width */
+ DOUBLE lbhintvalue, rthintvalue;
+ DOUBLE cxx, cyx, cxy, cyy; /* Transformation matrix */
+ int rotated; /* TRUE if character is on the side, FALSE if upright */
+
+ /************************************************/
+ /* DETERMINE ORIENTATION OF CHARACTER ON DEVICE */
+ /************************************************/
+
+ QuerySpace(CharSpace, &cxx, &cyx, &cxy, &cyy); /* Transformation matrix */
+
+ if (FABS(cxx) < 0.00001 || FABS(cyy) < 0.00001)
+ rotated = TRUE; /* Char is on side (90 or 270 degrees), possibly oblique. */
+ else if (FABS(cyx) < 0.00001 || FABS(cxy) < 0.00001)
+ rotated = FALSE; /* Char is upright (0 or 180 degrees), possibly oblique. */
+ else {
+ stems[stemno].lbhint = NULL; /* Char is at non-axial angle, ignore hints. */
+ stems[stemno].lbrevhint = NULL;
+ stems[stemno].rthint = NULL;
+ stems[stemno].rtrevhint = NULL;
+ return;
+ }
+
+ /* Determine orientation of stem */
+
+ if (stems[stemno].vertical) {
+ verticalondevice = !rotated;
+ stemstart = stems[stemno].x;
+ stemwidth = stems[stemno].dx;
+ } else {
+ verticalondevice = rotated;
+ stemstart = stems[stemno].y;
+ stemwidth = stems[stemno].dy;
+ }
+
+ /* Determine how many pixels (non-negative) correspond to 1 character space
+ unit (unitpixels), and how many character space units (non-negative)
+ correspond to one pixel (onepixel). */
+
+ if (stems[stemno].vertical)
+ p = ILoc(CharSpace, 1, 0);
+ else
+ p = ILoc(CharSpace, 0, 1);
+ QueryLoc(p, IDENTITY, &Xpixels, &Ypixels);
+ Destroy(p);
+ if (verticalondevice)
+ unitpixels = FABS(Xpixels);
+ else
+ unitpixels = FABS(Ypixels);
+
+ onepixel = 1.0 / unitpixels;
+
+ /**********************/
+ /* ADJUST STEM WIDTHS */
+ /**********************/
+
+ widthdiff = 0.0;
+
+ /* Find standard stem with smallest width difference from this stem */
+ if (stems[stemno].vertical) { /* vertical stem */
+ if (blues->StdVW != 0) /* there is an entry for StdVW */
+ widthdiff = blues->StdVW - stemwidth;
+ for (i = 0; i < blues->numStemSnapV; ++i) { /* now look at StemSnapV */
+ if (blues->StemSnapV[i] - stemwidth < widthdiff)
+ /* this standard width is the best match so far for this stem */
+ widthdiff = blues->StemSnapV[i] - stemwidth;
+ }
+ } else { /* horizontal stem */
+ if (blues->StdHW != 0) /* there is an entry for StdHW */
+ widthdiff = blues->StdHW - stemwidth;
+ for (i = 0; i < blues->numStemSnapH; ++i) { /* now look at StemSnapH */
+ if (blues->StemSnapH[i] - stemwidth < widthdiff)
+ /* this standard width is the best match so far for this stem */
+ widthdiff = blues->StemSnapH[i] - stemwidth;
+ }
+ }
+
+ /* Only expand or contract stems if they differ by less than 1 pixel from
+ the closest standard width, otherwise make the width difference = 0. */
+ if (FABS(widthdiff) > onepixel)
+ widthdiff = 0.0;
+
+ /* Expand or contract stem to the nearest integral number of pixels. */
+ idealwidth = ROUND((stemwidth + widthdiff) * unitpixels);
+ /* Ensure that all stems are at least one pixel wide. */
+ if (idealwidth == 0)
+ idealwidth = 1;
+ /* Apply ForceBold to vertical stems. */
+ if (blues->ForceBold && stems[stemno].vertical)
+ /* Force this vertical stem to be at least DEFAULTBOLDSTEMWIDTH wide. */
+ if (idealwidth < DEFAULTBOLDSTEMWIDTH)
+ idealwidth = DEFAULTBOLDSTEMWIDTH;
+ /* Now compute the number of character space units necessary */
+ widthdiff = idealwidth * onepixel - stemwidth;
+
+ /*********************************************************************/
+ /* ALIGNMENT ZONES AND OVERSHOOT SUPPRESSION - HORIZONTAL STEMS ONLY */
+ /*********************************************************************/
+
+ stemshift = 0.0;
+
+ if (!stems[stemno].vertical) {
+
+ /* Get bottom and top boundaries of the stem. */
+ stembottom = stemstart;
+ stemtop = stemstart + stemwidth;
+
+ /* Find out if this stem intersects an alignment zone (the BlueFuzz */
+ /* entry in the Private dictionary specifies the number of character */
+ /* units to extend (in both directions) the effect of an alignment */
+ /* zone on a horizontal stem. The default value of BlueFuzz is 1. */
+ for (i = 0; i < numalignmentzones; ++i) {
+ if (alignmentzones[i].topzone) {
+ if (stemtop >= alignmentzones[i].bottomy &&
+ stemtop <= alignmentzones[i].topy + blues->BlueFuzz) {
+ break; /* We found a top-zone */
+ }
+ } else {
+ if (stembottom <= alignmentzones[i].topy &&
+ stembottom >= alignmentzones[i].bottomy - blues->BlueFuzz) {
+ break; /* We found a bottom-zone */
+ }
+ }
+ }
+
+ if (i < numalignmentzones) { /* We found an intersecting zone (number i). */
+ suppressovershoot = FALSE;
+ enforceovershoot = FALSE;
+
+ /* When 1 character space unit is rendered smaller than BlueScale
+ device units (pixels), we must SUPPRESS overshoots. Otherwise,
+ if the top (or bottom) of this stem is more than BlueShift character
+ space units away from the flat position, we must ENFORCE overshoot. */
+
+ if (unitpixels < blues->BlueScale)
+ suppressovershoot = TRUE;
+ else
+ if (alignmentzones[i].topzone) {
+ if (stemtop >= alignmentzones[i].bottomy + blues->BlueShift)
+ enforceovershoot = TRUE;
+ } else
+ if (stembottom <= alignmentzones[i].topy - blues->BlueShift)
+ enforceovershoot = TRUE;
+
+ /*************************************************/
+ /* ALIGN THE FLAT POSITION OF THE ALIGNMENT ZONE */
+ /*************************************************/
+
+ /* Compute the position of the alignment zone's flat position in
+ device space and the amount of shift needed to align it on a
+ pixel boundary. Move all stems this amount. */
+
+ if (alignmentzones[i].topzone)
+ flatposition = alignmentzones[i].bottomy;
+ else
+ flatposition = alignmentzones[i].topy;
+
+ /* Find the flat position in pixels */
+ flatpospixels = flatposition * unitpixels;
+
+ /* Find the stem shift necessary to align the flat
+ position on a pixel boundary, and use this shift for all stems */
+ stemshift = (ROUND(flatpospixels) - flatpospixels) * onepixel;
+
+ /************************************************/
+ /* HANDLE OVERSHOOT ENFORCEMENT AND SUPPRESSION */
+ /************************************************/
+
+ /* Compute overshoot amount (non-negative) */
+ if (alignmentzones[i].topzone)
+ overshoot = stemtop - flatposition;
+ else
+ overshoot = flatposition - stembottom;
+
+ if (overshoot > 0.0) {
+ /* ENFORCE overshoot by shifting the entire stem (if necessary) so that
+ it falls at least one pixel beyond the flat position. */
+
+ if (enforceovershoot)
+ if (overshoot < onepixel) {
+ if (alignmentzones[i].topzone)
+ stemshift += onepixel - overshoot;
+ else
+ stemshift -= onepixel - overshoot;
+ }
+
+ /* SUPPRESS overshoot by aligning the stem to the alignment zone's
+ flat position. */
+
+ if (suppressovershoot) {
+ if (alignmentzones[i].topzone)
+ stemshift -= overshoot;
+ else
+ stemshift += overshoot;
+ }
+ }
+
+ /************************************************************/
+ /* COMPUTE HINT VALUES FOR EACH SIDE OF THE HORIZONTAL STEM */
+ /************************************************************/
+
+ /* If the stem was aligned by a topzone, we expand or contract the stem
+ only at the bottom - since the stem top was aligned by the zone.
+ If the stem was aligned by a bottomzone, we expand or contract the stem
+ only at the top - since the stem bottom was aligned by the zone. */
+ if (alignmentzones[i].topzone) {
+ lbhintvalue = stemshift - widthdiff; /* bottom */
+ rthintvalue = stemshift; /* top */
+ } else {
+ lbhintvalue = stemshift; /* bottom */
+ rthintvalue = stemshift + widthdiff; /* top */
+ }
+
+ stems[stemno].lbhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, lbhintvalue));
+ stems[stemno].lbrevhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, -lbhintvalue));
+ stems[stemno].rthint = (struct segment *)Permanent(Loc(CharSpace, 0.0, rthintvalue));
+ stems[stemno].rtrevhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, -rthintvalue));
+
+ return;
+
+ } /* endif (i < numalignmentzones) */
+
+ /* We didn't find any alignment zones intersecting this stem, so
+ proceed with normal stem alignment below. */
+
+ } /* endif (!stems[stemno].vertical) */
+
+ /* Align stem with pixel boundaries on device */
+ stemstart = stemstart - widthdiff / 2;
+ stemshift = ROUND(stemstart * unitpixels) * onepixel - stemstart;
+
+ /* Adjust the boundaries of the stem */
+ lbhintvalue = stemshift - widthdiff / 2; /* left or bottom */
+ rthintvalue = stemshift + widthdiff / 2; /* right or top */
+
+ if (stems[stemno].vertical) {
+ stems[stemno].lbhint = (struct segment *)Permanent(Loc(CharSpace, lbhintvalue, 0.0));
+ stems[stemno].lbrevhint = (struct segment *)Permanent(Loc(CharSpace, -lbhintvalue, 0.0));
+ stems[stemno].rthint = (struct segment *)Permanent(Loc(CharSpace, rthintvalue, 0.0));
+ stems[stemno].rtrevhint = (struct segment *)Permanent(Loc(CharSpace, -rthintvalue, 0.0));
+ } else {
+ stems[stemno].lbhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, lbhintvalue));
+ stems[stemno].lbrevhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, -lbhintvalue));
+ stems[stemno].rthint = (struct segment *)Permanent(Loc(CharSpace, 0.0, rthintvalue));
+ stems[stemno].rtrevhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, -rthintvalue));
+ }
+}
+
+#define LEFT 1
+#define RIGHT 2
+#define BOTTOM 3
+#define TOP 4
+
+/*********************************************************************/
+/* Adjust a point using the given stem hint. Use the left/bottom */
+/* hint value or the right/top hint value depending on where the */
+/* point lies in the stem. */
+/*********************************************************************/
+static struct segment *Applyhint(struct segment *p, int stemnumber, int half)
+{
+ if (half == LEFT || half == BOTTOM)
+ return Join(p, stems[stemnumber].lbhint); /* left or bottom hint */
+ else
+ return Join(p, stems[stemnumber].rthint); /* right or top hint */
+}
+
+/*********************************************************************/
+/* Adjust a point using the given reverse hint. Use the left/bottom */
+/* hint value or the right/top hint value depending on where the */
+/* point lies in the stem. */
+/*********************************************************************/
+static struct segment *Applyrevhint(struct segment *p, int stemnumber, int half)
+{
+ if (half == LEFT || half == BOTTOM)
+ return Join(p, stems[stemnumber].lbrevhint); /* left or bottom hint */
+ else
+ return Join(p, stems[stemnumber].rtrevhint); /* right or top hint */
+}
+
+/***********************************************************************/
+/* Find the vertical and horizontal stems that the current point */
+/* (x, y) may be involved in. At most one horizontal and one vertical */
+/* stem can apply to a single point, since there are no overlaps */
+/* allowed. */
+/* The actual hintvalue is returned as a location. */
+/* Hints are ignored inside a DotSection. */
+/***********************************************************************/
+static struct segment *FindStems(DOUBLE x, DOUBLE y, DOUBLE dx, DOUBLE dy)
+{
+ int i;
+ int newvert, newhor;
+ struct segment *p;
+ int newhorhalf, newverthalf;
+
+ if (InDotSection) return(NULL);
+
+ newvert = newhor = -1;
+ newhorhalf = newverthalf = -1;
+
+ for (i = currstartstem; i < numstems; i++) {
+ if (stems[i].vertical) { /* VSTEM hint */
+ if ((x >= stems[i].x - EPS) &&
+ (x <= stems[i].x+stems[i].dx + EPS)) {
+ newvert = i;
+ if (dy != 0.0) {
+ if (dy < 0) newverthalf = LEFT;
+ else newverthalf = RIGHT;
+ } else {
+ if (x < stems[i].x+stems[i].dx / 2) newverthalf = LEFT;
+ else newverthalf = RIGHT;
+ }
+ }
+ } else { /* HSTEM hint */
+ if ((y >= stems[i].y - EPS) &&
+ (y <= stems[i].y+stems[i].dy + EPS)) {
+ newhor = i;
+ if (dx != 0.0) {
+ if (dx < 0) newhorhalf = TOP;
+ else newhorhalf = BOTTOM;
+ } else {
+ if (y < stems[i].y+stems[i].dy / 2) newhorhalf = BOTTOM;
+ else newhorhalf = TOP;
+ }
+ }
+ }
+ }
+
+ p = NULL;
+
+ if (newvert == -1 && oldvert == -1) ; /* Outside of any hints */
+ else if (newvert == oldvert &&
+ newverthalf == oldverthalf); /* No hint change */
+ else if (oldvert == -1) { /* New vertical hint in effect */
+ p = Applyhint(p, newvert, newverthalf);
+ } else if (newvert == -1) { /* Old vertical hint no longer in effect */
+ p = Applyrevhint(p, oldvert, oldverthalf);
+ } else { /* New vertical hint in effect, old hint no longer in effect */
+ p = Applyrevhint(p, oldvert, oldverthalf);
+ p = Applyhint(p, newvert, newverthalf);
+ }
+
+ if (newhor == -1 && oldhor == -1) ; /* Outside of any hints */
+ else if (newhor == oldhor &&
+ newhorhalf == oldhorhalf) ; /* No hint change */
+ else if (oldhor == -1) { /* New horizontal hint in effect */
+ p = Applyhint(p, newhor, newhorhalf);
+ } else if (newhor == -1) { /* Old horizontal hint no longer in effect */
+ p = Applyrevhint(p, oldhor, oldhorhalf);
+ }
+ else { /* New horizontal hint in effect, old hint no longer in effect */
+ p = Applyrevhint(p, oldhor, oldhorhalf);
+ p = Applyhint(p, newhor, newhorhalf);
+ }
+
+ oldvert = newvert; oldverthalf = newverthalf;
+ oldhor = newhor; oldhorhalf = newhorhalf;
+
+ return p;
+}
+
+/******************************************************/
+/* Subroutines and statics for the Type1Char routines */
+/******************************************************/
+
+static int strindex; /* index into PostScript string being interpreted */
+static DOUBLE currx, curry; /* accumulated x and y values for hints */
+
+struct callstackentry {
+ psobj *currstrP; /* current CharStringP */
+ int currindex; /* current strindex */
+ unsigned short currkey; /* current decryption key */
+ };
+
+static DOUBLE Stack[MAXSTACK];
+static int Top;
+static struct callstackentry CallStack[MAXCALLSTACK];
+static int CallTop;
+static DOUBLE PSFakeStack[MAXPSFAKESTACK];
+static int PSFakeTop;
+
+static void ClearStack(void)
+{
+ Top = -1;
+}
+
+static void Push(DOUBLE Num)
+{
+ if (++Top < MAXSTACK) Stack[Top] = Num;
+ else Error0("Push: Stack full\n");
+}
+
+static void ClearCallStack(void)
+{
+ CallTop = -1;
+}
+
+static void PushCall(psobj *CurrStrP, int CurrIndex, unsigned short CurrKey)
+{
+ if (++CallTop < MAXCALLSTACK) {
+ CallStack[CallTop].currstrP = CurrStrP; /* save CharString pointer */
+ CallStack[CallTop].currindex = CurrIndex; /* save CharString index */
+ CallStack[CallTop].currkey = CurrKey; /* save decryption key */
+ }
+ else Error0("PushCall: Stack full\n");
+}
+
+static void PopCall(psobj **CurrStrPP, int *CurrIndexP, unsigned short *CurrKeyP)
+{
+ if (CallTop >= 0) {
+ *CurrStrPP = CallStack[CallTop].currstrP; /* restore CharString pointer */
+ *CurrIndexP = CallStack[CallTop].currindex; /* restore CharString index */
+ *CurrKeyP = CallStack[CallTop--].currkey; /* restore decryption key */
+ }
+ else Error0("PopCall: Stack empty\n");
+}
+
+static void ClearPSFakeStack(void)
+{
+ PSFakeTop = -1;
+}
+
+/* PSFakePush: Pushes a number onto the fake PostScript stack */
+static void PSFakePush(DOUBLE Num)
+{
+ if (++PSFakeTop < MAXPSFAKESTACK) PSFakeStack[PSFakeTop] = Num;
+ else Error0("PSFakePush: Stack full\n");
+}
+
+/* PSFakePop: Removes a number from the top of the fake PostScript stack */
+static DOUBLE PSFakePop (void)
+{
+ if (PSFakeTop >= 0) return(PSFakeStack[PSFakeTop--]);
+ else Error01("PSFakePop : Stack empty\n");
+ /*NOTREACHED*/
+}
+
+/***********************************************************************/
+/* Center a stem on the pixel grid -- used by HStem3 and VStem3 */
+/***********************************************************************/
+static struct segment *CenterStem(DOUBLE edge1, DOUBLE edge2)
+{
+ int idealwidth, verticalondevice;
+ DOUBLE leftx, lefty, rightx, righty, center, width;
+ DOUBLE widthx, widthy;
+ DOUBLE shift, shiftx, shifty;
+ DOUBLE Xpixels, Ypixels;
+ struct segment *p;
+
+ p = Loc(CharSpace, edge1, 0.0);
+ QueryLoc(p, IDENTITY, &leftx, &lefty);
+
+ p = Join(p, Loc(CharSpace, edge2, 0.0));
+ QueryLoc(p, IDENTITY, &rightx, &righty);
+ Destroy(p);
+
+ widthx = FABS(rightx - leftx);
+ widthy = FABS(righty - lefty);
+
+ if (widthy <= EPS) { /* verticalondevice hint */
+ verticalondevice = TRUE;
+ center = (rightx + leftx) / 2.0;
+ width = widthx;
+ }
+ else if (widthx <= EPS) { /* horizontal hint */
+ verticalondevice = FALSE;
+ center = (righty + lefty) / 2.0;
+ width = widthy;
+ }
+ else { /* neither horizontal nor verticalondevice and not oblique */
+ return (NULL);
+ }
+
+ idealwidth = ROUND(width);
+ if (idealwidth == 0) idealwidth = 1;
+ if (ODD(idealwidth)) { /* is ideal width odd? */
+ /* center stem over pixel */
+ shift = FLOOR(center) + 0.5 - center;
+ }
+ else {
+ /* align stem on pixel boundary */
+ shift = ROUND(center) - center;
+ }
+
+ if (verticalondevice) {
+ shiftx = shift;
+ shifty = 0.0;
+ } else {
+ shifty = shift;
+ shiftx = 0.0;
+ }
+
+ p = Loc(IDENTITY, shiftx, shifty);
+ QueryLoc(p, CharSpace, &Xpixels, &Ypixels);
+ wsoffsetX = Xpixels; wsoffsetY = Ypixels;
+ currx += wsoffsetX; curry += wsoffsetY;
+
+ return (p);
+}
+
+/*-----------------------------------------------------------------------
+ Decrypt - From Adobe Type 1 book page 63, with some modifications
+-----------------------------------------------------------------------*/
+#define KEY 4330 /* Initial key (seed) for CharStrings decryption */
+#define C1 52845 /* Multiplier for pseudo-random number generator */
+#define C2 22719 /* Constant for pseudo-random number generator */
+
+static unsigned short r; /* Pseudo-random sequence of keys */
+
+static unsigned char Decrypt(unsigned char cipher)
+{
+ unsigned char plain;
+
+ plain = cipher ^ (r >> 8);
+ r = (cipher + r) * C1 + C2;
+ return plain;
+}
+
+/* Get the next byte from the codestring being interpreted */
+static int DoRead(int *CodeP)
+{
+ if (strindex >= CharStringP->len) return(FALSE); /* end of string */
+ *CodeP = Decrypt((unsigned char) CharStringP->data.stringP[strindex++]);
+ return(TRUE);
+}
+
+/* Strip blues->lenIV bytes from CharString and update encryption key */
+/* (the lenIV entry in the Private dictionary specifies the number of */
+/* random bytes at the beginning of each CharString; default is 4) */
+static void StartDecrypt(void)
+{
+ int Code;
+
+ r = KEY; /* Initial key (seed) for CharStrings decryption */
+ for (strindex = 0; strindex < blues->lenIV;)
+ if (!DoRead(&Code)) /* Read a byte and update decryption key */
+ Error0("StartDecrypt: Premature end of CharString\n");
+}
+
+static void Decode(int Code)
+{
+ int Code1, Code2, Code3, Code4;
+
+ if (Code <= 31) /* Code is [0,31] */
+ DoCommand(Code);
+ else if (Code <= 246) /* Code is [32,246] */
+ Push((DOUBLE)(Code - 139));
+ else if (Code <= 250) { /* Code is [247,250] */
+ if (!DoRead(&Code2)) goto ended;
+ Push((DOUBLE)(((Code - 247) << 8) + Code2 + 108));
+ }
+ else if (Code <= 254) { /* Code is [251,254] */
+ if (!DoRead(&Code2)) goto ended;
+ Push((DOUBLE)( -((Code - 251) << 8) - Code2 - 108));
+ }
+ else { /* Code is 255 */
+ if (!DoRead(&Code1)) goto ended;
+ if (!DoRead(&Code2)) goto ended;
+ if (!DoRead(&Code3)) goto ended;
+ if (!DoRead(&Code4)) goto ended;
+ Push((DOUBLE)((((((Code1<<8) + Code2)<<8) + Code3)<<8) + Code4));
+ }
+ return;
+
+ended: Error0("Decode: Premature end of Type 1 CharString");
+}
+
+/* Interpret a command code */
+static void DoCommand(int Code)
+{
+ switch(Code) {
+ case HSTEM: /* |- y dy HSTEM |- */
+ /* Vertical range of a horizontal stem zone */
+ if (Top < 1) Error0("DoCommand: Stack low\n");
+ HStem(Stack[0], Stack[1]);
+ ClearStack();
+ break;
+ case VSTEM: /* |- x dx VSTEM |- */
+ /* Horizontal range of a vertical stem zone */
+ if (Top < 1) Error0("DoCommand: Stack low\n");
+ VStem(Stack[0], Stack[1]);
+ ClearStack();
+ break;
+ case VMOVETO: /* |- dy VMOVETO |- */
+ /* Vertical MOVETO, equivalent to 0 dy RMOVETO */
+ if (Top < 0) Error0("DoCommand: Stack low\n");
+ RMoveTo(0.0, Stack[0]);
+ ClearStack();
+ break;
+ case RLINETO: /* |- dx dy RLINETO |- */
+ /* Like RLINETO in PostScript */
+ if (Top < 1) Error0("DoCommand: Stack low\n");
+ RLineTo(Stack[0], Stack[1]);
+ ClearStack();
+ break;
+ case HLINETO: /* |- dx HLINETO |- */
+ /* Horizontal LINETO, equivalent to dx 0 RLINETO */
+ if (Top < 0) Error0("DoCommand: Stack low\n");
+ RLineTo(Stack[0], 0.0);
+ ClearStack();
+ break;
+ case VLINETO: /* |- dy VLINETO |- */
+ /* Vertical LINETO, equivalent to 0 dy RLINETO */
+ if (Top < 0) Error0("DoCommand: Stack low\n");
+ RLineTo(0.0, Stack[0]);
+ ClearStack();
+ break;
+ case RRCURVETO:
+ /* |- dx1 dy1 dx2 dy2 dx3 dy3 RRCURVETO |- */
+ /* Relative RCURVETO, equivalent to dx1 dy1 */
+ /* (dx1+dx2) (dy1+dy2) (dx1+dx2+dx3) */
+ /* (dy1+dy2+dy3) RCURVETO in PostScript */
+ if (Top < 5) Error0("DoCommand: Stack low\n");
+ RRCurveTo(Stack[0], Stack[1], Stack[2], Stack[3],
+ Stack[4], Stack[5]);
+ ClearStack();
+ break;
+ case CLOSEPATH: /* - CLOSEPATH |- */
+ /* Closes a subpath without repositioning the */
+ /* current point */
+ DoClosePath();
+ ClearStack();
+ break;
+ case CALLSUBR: /* subr# CALLSUBR - */
+ /* Calls a CharString subroutine with index */
+ /* subr# from the Subrs array */
+ if (Top < 0) Error0("DoCommand: Stack low\n");
+ CallSubr((int)Stack[Top--]);
+ break;
+ case RETURN: /* - RETURN - */
+ /* Returns from a Subrs array CharString */
+ /* subroutine called with CALLSUBR */
+ Return();
+ break;
+ case ESCAPE: /* ESCAPE to two-byte command code */
+ if (!DoRead(&Code)) Error0("DoCommand: ESCAPE is last byte\n");
+ Escape(Code);
+ break;
+ case HSBW: /* |- sbx wx HSBW |- */
+ /* Set the left sidebearing point to (sbx,0), */
+ /* set the character width vector to (wx,0). */
+ /* Equivalent to sbx 0 wx 0 SBW. Space */
+ /* character should have sbx = 0 */
+ if (Top < 1) Error0("DoCommand: Stack low\n");
+ Sbw(Stack[0], 0.0, Stack[1], 0.0);
+ ClearStack();
+ break;
+ case ENDCHAR: /* - ENDCHAR |- */
+ /* Finishes a CharString outline */
+ EndChar();
+ ClearStack();
+ break;
+ case RMOVETO: /* |- dx dy RMOVETO |- */
+ /* Behaves like RMOVETO in PostScript */
+ if (Top < 1) Error0("DoCommand: Stack low\n");
+ RMoveTo(Stack[0], Stack[1]);
+ ClearStack();
+ break;
+ case HMOVETO: /* |- dx HMOVETO |- */
+ /* Horizontal MOVETO. Equivalent to dx 0 RMOVETO */
+ if (Top < 0) Error0("DoCommand: Stack low\n");
+ RMoveTo(Stack[0], 0.0);
+ ClearStack();
+ break;
+ case VHCURVETO: /* |- dy1 dx2 dy2 dx3 VHCURVETO |- */
+ /* Vertical-Horizontal CURVETO, equivalent to */
+ /* 0 dy1 dx2 dy2 dx3 0 RRCURVETO */
+ if (Top < 3) Error0("DoCommand: Stack low\n");
+ RRCurveTo(0.0, Stack[0], Stack[1], Stack[2],
+ Stack[3], 0.0);
+ ClearStack();
+ break;
+ case HVCURVETO: /* |- dx1 dx2 dy2 dy3 HVCURVETO |- */
+ /* Horizontal-Vertical CURVETO, equivalent to */
+ /* dx1 0 dx2 dy2 0 dy3 RRCURVETO */
+ if (Top < 3) Error0("DoCommand: Stack low\n");
+ RRCurveTo(Stack[0], 0.0, Stack[1], Stack[2], 0.0, Stack[3]);
+ ClearStack();
+ break;
+ default: /* Unassigned command code */
+ ClearStack();
+ Error1("DoCommand: Unassigned code %d\n", Code);
+ }
+}
+
+static void Escape(int Code)
+{
+ int i, Num;
+ struct segment *p;
+
+ switch(Code) {
+ case DOTSECTION: /* - DOTSECTION |- */
+ /* Brackets an outline section for the dots in */
+ /* letters such as "i", "j", and "!". */
+ DotSection();
+ ClearStack();
+ break;
+ case VSTEM3: /* |- x0 dx0 x1 dx1 x2 dx2 VSTEM3 |- */
+ /* Declares the horizontal ranges of three */
+ /* vertical stem zones between x0 and x0+dx0, */
+ /* x1 and x1+dx1, and x2 and x2+dx2. */
+ if (Top < 5) Error0("DoCommand: Stack low\n");
+ if (!wsset && ProcessHints) {
+ /* Shift the whole character so that the middle stem is centered. */
+ p = CenterStem(Stack[2] + sidebearingX, Stack[3]);
+ path = Join(path, p);
+ wsset = 1;
+ }
+
+ VStem(Stack[0], Stack[1]);
+ VStem(Stack[2], Stack[3]);
+ VStem(Stack[4], Stack[5]);
+ ClearStack();
+ break;
+ case HSTEM3: /* |- y0 dy0 y1 dy1 y2 dy2 HSTEM3 |- */
+ /* Declares the vertical ranges of three hori- */
+ /* zontal stem zones between y0 and y0+dy0, */
+ /* y1 and y1+dy1, and y2 and y2+dy2. */
+ if (Top < 5) Error0("DoCommand: Stack low\n");
+ HStem(Stack[0], Stack[1]);
+ HStem(Stack[2], Stack[3]);
+ HStem(Stack[4], Stack[5]);
+ ClearStack();
+ break;
+ case SEAC: /* |- asb adx ady bchar achar SEAC |- */
+ /* Standard Encoding Accented Character. */
+ if (Top < 4) Error0("DoCommand: Stack low\n");
+ Seac(Stack[0], Stack[1], Stack[2],
+ (unsigned char) Stack[3],
+ (unsigned char) Stack[4]);
+ ClearStack();
+ break;
+ case SBW: /* |- sbx sby wx wy SBW |- */
+ /* Set the left sidebearing point to (sbx,sby), */
+ /* set the character width vector to (wx,wy). */
+ if (Top < 3) Error0("DoCommand: Stack low\n");
+ Sbw(Stack[0], Stack[1], Stack[2], Stack[3]);
+ ClearStack();
+ break;
+ case DIV: /* num1 num2 DIV quotient */
+ /* Behaves like DIV in the PostScript language */
+ if (Top < 1) Error0("DoCommand: Stack low\n");
+ Stack[Top-1] = Div(Stack[Top-1], Stack[Top]);
+ Top--;
+ break;
+ case CALLOTHERSUBR:
+ /* arg1 ... argn n othersubr# CALLOTHERSUBR - */
+ /* Make calls on the PostScript interpreter */
+ if (Top < 1) Error0("DoCommand: Stack low\n");
+ Num = Stack[Top-1];
+ if (Top < Num+1) Error0("DoCommand: Stack low\n");
+ for (i = 0; i < Num; i++) PSFakePush(Stack[Top - i - 2]);
+ Top -= Num + 2;
+ CallOtherSubr((int)Stack[Top + Num + 2]);
+ break;
+ case POP: /* - POP number */
+ /* Removes a number from the top of the */
+ /* PostScript interpreter stack and pushes it */
+ /* onto the Type 1 BuildChar operand stack */
+ Push(PSFakePop());
+ break;
+ case SETCURRENTPOINT: /* |- x y SETCURRENTPOINT |- */
+ /* Sets the current point to (x,y) in absolute */
+ /* character space coordinates without per- */
+ /* forming a CharString MOVETO command */
+ if (Top < 1) Error0("DoCommand: Stack low\n");
+ SetCurrentPoint(Stack[0], Stack[1]);
+ ClearStack();
+ break;
+ default: /* Unassigned escape code command */
+ ClearStack();
+ Error1("Escape: Unassigned code %d\n", Code);
+ }
+}
+
+/* |- y dy HSTEM |- */
+/* Declares the vertical range of a horizontal stem zone */
+/* between coordinates y and y + dy */
+/* y is relative to the left sidebearing point */
+static void HStem(DOUBLE y, DOUBLE dy)
+{
+ IfTrace2((FontDebug), "Hstem %f %f\n", y, dy);
+ if (ProcessHints) {
+ if (numstems >= MAXSTEMS) Error0("HStem: Too many hints\n");
+ if (dy < 0.0) {y += dy; dy = -dy;}
+ stems[numstems].vertical = FALSE;
+ stems[numstems].x = 0.0;
+ stems[numstems].y = sidebearingY + y + wsoffsetY;
+ stems[numstems].dx = 0.0;
+ stems[numstems].dy = dy;
+ ComputeStem(numstems);
+ numstems++;
+ }
+}
+
+/* |- x dx VSTEM |- */
+/* Declares the horizontal range of a vertical stem zone */
+/* between coordinates x and x + dx */
+/* x is relative to the left sidebearing point */
+static void VStem(DOUBLE x, DOUBLE dx)
+{
+ IfTrace2((FontDebug), "Vstem %f %f\n", x, dx);
+ if (ProcessHints) {
+ if (numstems >= MAXSTEMS) Error0("VStem: Too many hints\n");
+ if (dx < 0.0) {x += dx; dx = -dx;}
+ stems[numstems].vertical = TRUE;
+ stems[numstems].x = sidebearingX + x + wsoffsetX;
+ stems[numstems].y = 0.0;
+ stems[numstems].dx = dx;
+ stems[numstems].dy = 0.0;
+ ComputeStem(numstems);
+ numstems++;
+ }
+}
+
+/* |- dx dy RLINETO |- */
+/* Behaves like RLINETO in PostScript */
+static void RLineTo(DOUBLE dx, DOUBLE dy)
+{
+ struct segment *B;
+
+ IfTrace2((FontDebug), "RLineTo %f %f\n", dx, dy);
+
+ B = Loc(CharSpace, dx, dy);
+
+ if (ProcessHints) {
+ currx += dx;
+ curry += dy;
+ /* B = Join(B, FindStems(currx, curry)); */
+ B = Join(B, FindStems(currx, curry, dx, dy));
+ }
+
+ path = Join(path, Line(B));
+}
+
+/* |- dx1 dy1 dx2 dy2 dx3 dy3 RRCURVETO |- */
+/* Relative RCURVETO, equivalent to dx1 dy1 */
+/* (dx1+dx2) (dy1+dy2) (dx1+dx2+dx3) */
+/* (dy1+dy2+dy3) RCURVETO in PostScript */
+static void RRCurveTo(DOUBLE dx1, DOUBLE dy1, DOUBLE dx2, DOUBLE dy2, DOUBLE dx3, DOUBLE dy3)
+{
+ struct segment *B, *C, *D;
+
+ IfTrace4((FontDebug), "RRCurveTo %f %f %f %f ", dx1, dy1, dx2, dy2);
+ IfTrace2((FontDebug), "%f %f\n", dx3, dy3);
+
+ B = Loc(CharSpace, dx1, dy1);
+ C = Loc(CharSpace, dx2, dy2);
+ D = Loc(CharSpace, dx3, dy3);
+
+ if (ProcessHints) {
+ /* For a Bezier curve, we apply the full hint value to
+ the Bezier C point (and thereby D point). */
+ currx += dx1 + dx2 + dx3;
+ curry += dy1 + dy2 + dy3;
+ /* C = Join(C, FindStems(currx, curry)); */
+ C = Join(C, FindStems(currx, curry, dx3, dy3));
+ }
+
+ /* Since XIMAGER is not completely relative, */
+ /* we need to add up the delta values */
+
+ C = Join(C, (struct segment *)Dup((struct xobject *)B));
+ D = Join(D, (struct segment *)Dup((struct xobject *)C));
+
+ path = Join(path, (struct segment *)Bezier(B, C, D));
+}
+
+/* - CLOSEPATH |- */
+/* Closes a subpath WITHOUT repositioning the */
+/* current point */
+static void DoClosePath(void)
+{
+ struct segment *CurrentPoint;
+
+ IfTrace0((FontDebug), "DoClosePath\n");
+ CurrentPoint = Phantom(path);
+ path = ClosePath(path);
+ path = Join(Snap(path), CurrentPoint);
+}
+
+/* subr# CALLSUBR - */
+/* Calls a CharString subroutine with index */
+/* subr# from the Subrs array */
+static void CallSubr(int subrno)
+{
+ IfTrace1((FontDebug), "CallSubr %d\n", subrno);
+ if ((subrno < 0) || (subrno >= SubrsP->len))
+ Error0("CallSubr: subrno out of range\n");
+ PushCall(CharStringP, strindex, r);
+ CharStringP = &SubrsP->data.arrayP[subrno];
+ StartDecrypt();
+}
+
+/* - RETURN - */
+/* Returns from a Subrs array CharString */
+/* subroutine called with CALLSUBR */
+static void Return(void)
+{
+ IfTrace0((FontDebug), "Return\n");
+ PopCall(&CharStringP, &strindex, &r);
+}
+
+/* - ENDCHAR |- */
+/* Finishes a CharString outline */
+/* Executes SETCHACHEDEVICE using a bounding box */
+/* it computes directly from the character outline */
+/* and using the width information acquired from a previous */
+/* HSBW or SBW. It then calls a special version of FILL */
+/* or STROKE depending on the value of PaintType in the */
+/* font dictionary */
+static void EndChar(void)
+{
+ IfTrace0((FontDebug), "EndChar\n");
+
+ /* There is no need to compute and set bounding box for
+ the cache, since XIMAGER does that on the fly. */
+
+ /* Perform a Closepath just in case the command was left out */
+ path = ClosePath(path);
+
+ /* Set character width */
+ path = Join(Snap(path), Loc(CharSpace, escapementX, escapementY));
+
+}
+
+/* |- dx dy RMOVETO |- */
+/* Behaves like RMOVETO in PostScript */
+static void RMoveTo(DOUBLE dx, DOUBLE dy)
+{
+ struct segment *B;
+
+ IfTrace2((FontDebug), "RMoveTo %f %f\n", dx, dy);
+
+ B = Loc(CharSpace, dx, dy);
+
+ if (ProcessHints) {
+ currx += dx;
+ curry += dy;
+ /* B = Join(B, FindStems(currx, curry)); */
+ B = Join(B, FindStems(currx, curry, 0.0, 0.0));
+ }
+
+ path = Join(path, B);
+}
+
+/* - DOTSECTION |- */
+/* Brackets an outline section for the dots in */
+/* letters such as "i", "j", and "!". */
+static void DotSection(void)
+{
+ IfTrace0((FontDebug), "DotSection\n");
+ InDotSection = !InDotSection;
+}
+
+/* |- asb adx ady bchar achar SEAC |- */
+/* Standard Encoding Accented Character. */
+static void Seac(DOUBLE asb, DOUBLE adx, DOUBLE ady,
+ unsigned char bchar, unsigned char achar)
+{
+ int Code;
+ struct segment *mypath;
+
+ IfTrace4((FontDebug), "SEAC %f %f %f %d ", asb, adx, ady, bchar);
+ IfTrace1((FontDebug), "%d\n", achar);
+
+ /* Move adx - asb, ady over and up from base char's sbpoint. */
+ /* (We use adx - asb to counteract the accents sb shift.) */
+ /* The variables accentoffsetX/Y modify sidebearingX/Y in Sbw(). */
+ /* Note that these incorporate the base character's sidebearing shift by */
+ /* using the current sidebearingX, Y values. */
+ accentoffsetX = sidebearingX + adx - asb;
+ accentoffsetY = sidebearingY + ady;
+
+ /* Set path = NULL to avoid complaints from Sbw(). */
+ path = NULL;
+
+ /* Go find the CharString for the accent's code via an upcall */
+ CharStringP = GetType1CharString(Environment, achar);
+ if (CharStringP == NULL) {
+ Error1("Invalid accent ('%03o) in SEAC\n", achar);
+ return;
+ }
+ StartDecrypt();
+
+ ClearStack();
+ ClearPSFakeStack();
+ ClearCallStack();
+
+ for (;;) {
+ if (!DoRead(&Code)) break;
+ Decode(Code);
+ if (errflag) return;
+ }
+ /* Copy snapped path to mypath and set path to NULL as above. */
+ mypath = Snap(path);
+ path = NULL;
+
+ /* We must reset these to null now. */
+ accentoffsetX = accentoffsetY = 0;
+
+ /* go find the CharString for the base char's code via an upcall */
+ CharStringP = GetType1CharString(Environment, bchar);
+ StartDecrypt();
+
+ ClearStack();
+ ClearPSFakeStack();
+ ClearCallStack();
+
+ FinitStems();
+ InitStems();
+
+ for (;;) {
+ if (!DoRead(&Code)) break;
+ Decode(Code);
+ if (errflag) return;
+ }
+ path = Join(mypath, path);
+}
+
+
+/* |- sbx sby wx wy SBW |- */
+/* Set the left sidebearing point to (sbx,sby), */
+/* set the character width vector to (wx,wy). */
+static void Sbw(DOUBLE sbx, DOUBLE sby, DOUBLE wx, DOUBLE wy)
+{
+ IfTrace4((FontDebug), "SBW %f %f %f %f\n", sbx, sby, wx, wy);
+
+ escapementX = wx; /* Character width vector */
+ escapementY = wy;
+
+ /* Sidebearing values are sbx, sby args, plus accent offset from Seac(). */
+ sidebearingX = sbx + accentoffsetX;
+ sidebearingY = sby + accentoffsetY;
+
+ path = Join(path, Loc(CharSpace, sidebearingX, sidebearingY));
+ if (ProcessHints) {currx = sidebearingX; curry = sidebearingY;}
+}
+
+ /* num1 num2 DIV quotient */
+/* Behaves like DIV in the PostScript language */
+static DOUBLE Div(DOUBLE num1, DOUBLE num2)
+{
+ IfTrace2((FontDebug), "Div %f %f\n", num1, num2);
+ return(num1 / num2);
+}
+
+/*
+ The following four subroutines (FlxProc, FlxProc1, FlxProc2, and
+ HintReplace) are C versions of the OtherSubrs Programs, which were
+ were published in the Adobe Type 1 Font Format book.
+
+ The Flex outline fragment is described by
+ c1: (x0, y0) = c3: (x0, yshrink(y0)) or (xshrink(x0), y0)
+ " (x1, y1) = " (x1, yshrink(y1)) or (xshrink(x1), y1)
+ " (x2, y2) - reference point
+ c2: (x0, y0) = c4: (x0, yshrink(y0)) or (xshrink(x0), y0)
+ " (x1, y1) = " (x1, yshrink(y1)) or (xshrink(x1), y1)
+ " (x2, y2) = " (x2, y2), rightmost endpoint
+ c3: (x0, y0) - control point, 1st Bezier curve
+ " (x1, y1) - control point, -"-
+ " (x2, y2) - end point, -"-
+ c4: (x0, y0) - control point, 2nd Bezier curve
+ " (x1, y1) - control point, -"-
+ " (x2, y2) - end point, -"-
+ ep: (epY, epX) - final endpoint (should be same as c4: (x2, y2))
+ idmin - minimum Flex height (1/100 pixel) at which to render curves
+*/
+
+#define dtransform(dxusr,dyusr,dxdev,dydev) { \
+ register struct segment *point = Loc(CharSpace, dxusr, dyusr); \
+ QueryLoc(point, IDENTITY, dxdev, dydev); \
+ Destroy(point); \
+}
+
+#define itransform(xdev,ydev,xusr,yusr) { \
+ register struct segment *point = Loc(IDENTITY, xdev, ydev); \
+ QueryLoc(point, CharSpace, xusr, yusr); \
+ Destroy(point); \
+}
+
+#define transform(xusr,yusr,xdev,ydev) dtransform(xusr,yusr,xdev,ydev)
+
+#define PaintType (0)
+
+#define lineto(x,y) { \
+ struct segment *CurrentPoint; \
+ DOUBLE CurrentX, CurrentY; \
+ CurrentPoint = Phantom(path); \
+ QueryLoc(CurrentPoint, CharSpace, &CurrentX, &CurrentY); \
+ Destroy(CurrentPoint); \
+ RLineTo(x - CurrentX, y - CurrentY); \
+}
+
+#define curveto(x0,y0,x1,y1,x2,y2) { \
+ struct segment *CurrentPoint; \
+ DOUBLE CurrentX, CurrentY; \
+ CurrentPoint = Phantom(path); \
+ QueryLoc(CurrentPoint, CharSpace, &CurrentX, &CurrentY); \
+ Destroy(CurrentPoint); \
+ RRCurveTo(x0 - CurrentX, y0 - CurrentY, x1 - x0, y1 - y0, x2 - x1, y2 - y1); \
+}
+
+#define xshrink(x) ((x - c4x2) * shrink +c4x2)
+#define yshrink(y) ((y - c4y2) * shrink +c4y2)
+
+#define PickCoords(flag) \
+ if (flag) { /* Pick "shrunk" coordinates */ \
+ x0 = c1x0; y0 = c1y0; \
+ x1 = c1x1; y1 = c1y1; \
+ x2 = c1x2; y2 = c1y2; \
+ x3 = c2x0; y3 = c2y0; \
+ x4 = c2x1; y4 = c2y1; \
+ x5 = c2x2; y5 = c2y2; \
+ } else { /* Pick original coordinates */ \
+ x0 = c3x0; y0 = c3y0; \
+ x1 = c3x1; y1 = c3y1; \
+ x2 = c3x2; y2 = c3y2; \
+ x3 = c4x0; y3 = c4y0; \
+ x4 = c4x1; y4 = c4y1; \
+ x5 = c4x2; y5 = c4y2; \
+ }
+
+/* FlxProc() = OtherSubrs[0]; Main part of Flex */
+/* Calling sequence: 'idmin epX epY 3 0 callothersubr' */
+/* Computes Flex values, and renders the Flex path, */
+/* and returns (leaves) ending coordinates on stack */
+static void FlxProc(DOUBLE c1x2, DOUBLE c1y2,
+ DOUBLE c3x0, DOUBLE c3y0, DOUBLE c3x1, DOUBLE c3y1, DOUBLE c3x2, DOUBLE c3y2,
+ DOUBLE c4x0, DOUBLE c4y0, DOUBLE c4x1, DOUBLE c4y1, DOUBLE c4x2, DOUBLE c4y2,
+ DOUBLE epY, DOUBLE epX, int idmin)
+{
+ DOUBLE dmin;
+ DOUBLE c1x0, c1y0, c1x1, c1y1;
+ DOUBLE c2x0, c2y0, c2x1, c2y1, c2x2, c2y2;
+ char yflag;
+ DOUBLE x0, y0, x1, y1, x2, y2, x3, y3, x4, y4, x5, y5;
+ DOUBLE cxx, cyx, cxy, cyy; /* Transformation matrix */
+ int flipXY;
+ DOUBLE x, y;
+ DOUBLE erosion = 1; /* Device parameter */
+ /* Erosion may have different value specified in 'internaldict' */
+ DOUBLE shrink;
+ DOUBLE dX, dY;
+ char erode;
+ DOUBLE eShift;
+ DOUBLE cx, cy;
+ DOUBLE ex, ey;
+
+ Destroy(path);
+ path = FlxOldPath; /* Restore previous path (stored in FlxProc1) */
+
+ if (ProcessHints) {
+ dmin = ABS(idmin) / 100.0; /* Minimum Flex height in pixels */
+
+ c2x2 = c4x2; c2y2 = c4y2; /* Point c2 = c4 */
+
+ yflag = FABS(c1y2 - c3y2) > FABS(c1x2 - c3x2); /* Flex horizontal? */
+
+ QuerySpace(CharSpace, &cxx, &cyx, &cxy, &cyy); /* Transformation matrix */
+
+ if (FABS(cxx) < 0.00001 || FABS(cyy) < 0.00001)
+ flipXY = -1; /* Char on side */
+ else if (FABS(cyx) < 0.00001 || FABS(cxy) < 0.00001)
+ flipXY = 1; /* Char upright */
+ else
+ flipXY = 0; /* Char at angle */
+
+ if (yflag) { /* Flex horizontal */
+ if (flipXY == 0 || c3y2 == c4y2) { /* Char at angle or Flex height = 0 */
+ PickCoords(FALSE); /* Pick original control points */
+ } else {
+ shrink = FABS((c1y2 - c4y2) / (c3y2 - c4y2)); /* Slope */
+
+ c1x0 = c3x0; c1y0 = yshrink(c3y0);
+ c1x1 = c3x1; c1y1 = yshrink(c3y1);
+ c2x0 = c4x0; c2y0 = yshrink(c4y0);
+ c2x1 = c4x1; c2y1 = yshrink(c4y1);
+
+ dtransform(0.0, ROUND(c3y2-c1y2), &x, &y); /* Flex height in pixels */
+ dY = FABS((flipXY == 1) ? y : x);
+ PickCoords(dY < dmin); /* If Flex small, pick 'shrunk' control points */
+
+ if (FABS(y2 - c1y2) > 0.001) { /* Flex 'non-zero'? */
+ transform(c1x2, c1y2, &x, &y);
+
+ if (flipXY == 1) {
+ cx = x; cy = y;
+ } else {
+ cx = y; cy = x;
+ }
+
+ dtransform(0.0, ROUND(y2-c1y2), &x, &y);
+ dY = (flipXY == 1) ? y : x;
+ if (ROUND(dY) != 0)
+ dY = ROUND(dY);
+ else
+ dY = (dY < 0) ? -1 : 1;
+
+ erode = PaintType != 2 && erosion >= 0.5;
+ if (erode)
+ cy -= 0.5;
+ ey = cy + dY;
+ ey = CEIL(ey) - ey + FLOOR(ey);
+ if (erode)
+ ey += 0.5;
+
+ if (flipXY == 1) {
+ itransform(cx, ey, &x, &y);
+ } else {
+ itransform(ey, cx, &x, &y);
+ }
+
+ eShift = y - y2;
+ y1 += eShift;
+ y2 += eShift;
+ y3 += eShift;
+ }
+ }
+ } else { /* Flex vertical */
+ if (flipXY == 0 || c3x2 == c4x2) { /* Char at angle or Flex height = 0 */
+ PickCoords(FALSE); /* Pick original control points */
+ } else {
+ shrink = FABS((c1x2 - c4x2) / (c3x2 - c4x2)); /* Slope */
+
+ c1x0 = xshrink(c3x0); c1y0 = c3y0;
+ c1x1 = xshrink(c3x1); c1y1 = c3y1;
+ c2x0 = xshrink(c4x0); c2y0 = c4y0;
+ c2x1 = xshrink(c4x1); c2y1 = c4y1;
+
+ dtransform(ROUND(c3x2 - c1x2), 0.0, &x, &y); /* Flex height in pixels */
+ dX = FABS((flipXY == -1) ? y : x);
+ PickCoords(dX < dmin); /* If Flex small, pick 'shrunk' control points */
+
+ if (FABS(x2 - c1x2) > 0.001) {
+ transform(c1x2, c1y2, &x, &y);
+ if (flipXY == -1) {
+ cx = y; cy = x;
+ } else {
+ cx = x; cy = y;
+ }
+
+ dtransform(ROUND(x2-c1x2), 0.0, &x, &y);
+ dX = (flipXY == -1) ? y : x;
+ if (ROUND(dX) != 0)
+ dX = ROUND(dX);
+ else
+ dX = (dX < 0) ? -1 : 1;
+
+ erode = PaintType != 2 && erosion >= 0.5;
+ if (erode)
+ cx -= 0.5;
+ ex = cx + dX;
+ ex = CEIL(ex) - ex + FLOOR(ex);
+ if (erode)
+ ex += 0.5;
+
+ if (flipXY == -1) {
+ itransform(cy, ex, &x, &y);
+ } else {
+ itransform(ex, cy, &x, &y);
+ }
+
+ eShift = x - x2;
+ x1 += eShift;
+ x2 += eShift;
+ x3 += eShift;
+ }
+ }
+ }
+
+ if (x2 == x5 || y2 == y5) {
+ lineto(x5, y5);
+ } else {
+ curveto(x0, y0, x1, y1, x2, y2);
+ curveto(x3, y3, x4, y4, x5, y5);
+ }
+ } else { /* ProcessHints is off */
+ PickCoords(FALSE); /* Pick original control points */
+ curveto(x0, y0, x1, y1, x2, y2);
+ curveto(x3, y3, x4, y4, x5, y5);
+ }
+
+ PSFakePush(epY);
+ PSFakePush(epX);
+}
+
+/* FlxProc1() = OtherSubrs[1]; Part of Flex */
+/* Calling sequence: '0 1 callothersubr' */
+/* Saves and clears path, then restores currentpoint */
+static void FlxProc1(void)
+{
+ struct segment *CurrentPoint;
+
+ CurrentPoint = Phantom(path);
+
+ FlxOldPath = path;
+ path = CurrentPoint;
+}
+
+/* FlxProc2() = OtherSubrs[2]; Part of Flex */
+/* Calling sequence: '0 2 callothersubr' */
+/* Returns currentpoint on stack */
+static void FlxProc2(void)
+{
+ struct segment *CurrentPoint;
+ DOUBLE CurrentX, CurrentY;
+
+ CurrentPoint = Phantom(path);
+ QueryLoc(CurrentPoint, CharSpace, &CurrentX, &CurrentY);
+ Destroy(CurrentPoint);
+
+ /* Push CurrentPoint on fake PostScript stack */
+ PSFakePush(CurrentX);
+ PSFakePush(CurrentY);
+}
+
+/* HintReplace() = OtherSubrs[3]; Hint Replacement */
+/* Calling sequence: 'subr# 1 3 callothersubr pop callsubr' */
+/* Reinitializes stem hint structure */
+static void HintReplace(void)
+{
+ /* Effectively retire the current stems, but keep them around for */
+ /* revhint use in case we are in a stem when we replace hints. */
+ currstartstem = numstems;
+
+ /* 'subr#' is left on PostScript stack (for 'pop callsubr') */
+}
+
+/* arg1 ... argn n othersubr# CALLOTHERSUBR - */
+/* Make calls on the PostScript interpreter (or call equivalent C code) */
+/* NOTE: The n arguments have been pushed on the fake PostScript stack */
+static void CallOtherSubr(int othersubrno)
+{
+ IfTrace1((FontDebug), "CallOtherSubr %d\n", othersubrno);
+
+ switch(othersubrno) {
+ case 0: /* OtherSubrs[0]; Main part of Flex */
+ if (PSFakeTop < 16) Error0("CallOtherSubr: PSFakeStack low");
+ ClearPSFakeStack();
+ FlxProc(
+ PSFakeStack[0], PSFakeStack[1], PSFakeStack[2], PSFakeStack[3],
+ PSFakeStack[4], PSFakeStack[5], PSFakeStack[6], PSFakeStack[7],
+ PSFakeStack[8], PSFakeStack[9], PSFakeStack[10], PSFakeStack[11],
+ PSFakeStack[12], PSFakeStack[13], PSFakeStack[14], PSFakeStack[15],
+ (int) PSFakeStack[16]
+ );
+ break;
+ case 1: /* OtherSubrs[1]; Part of Flex */
+ FlxProc1();
+ break;
+ case 2: /* OtherSubrs[2]; Part of Flex */
+ FlxProc2();
+ break;
+ case 3: /* OtherSubrs[3]; Hint Replacement */
+ HintReplace();
+ break;
+ default: { /* call OtherSubrs[4] or higher if PostScript is present */
+ }
+ }
+}
+
+/* |- x y SETCURRENTPOINT |- */
+/* Sets the current point to (x,y) in absolute */
+/* character space coordinates without per- */
+/* forming a CharString MOVETO command */
+static void SetCurrentPoint(DOUBLE x, DOUBLE y)
+{
+ IfTrace2((FontDebug), "SetCurrentPoint %f %f\n", x, y);
+
+ currx = x;
+ curry = y;
+}
+
+/* The Type1Char routine for use by PostScript. */
+/************************************************/
+struct xobject *Type1Char(
+ psfont *FontP,
+ struct XYspace *S,
+ psobj *charstrP,
+ psobj *subrsP,
+ psobj *osubrsP,
+ struct blues_struct *bluesP, /* FontID's ptr to the blues struct */
+ int *modeP)
+{
+ int Code;
+
+ path = NULL;
+ errflag = FALSE;
+
+ /* Make parameters available to all Type1 routines */
+ Environment = FontP;
+ CharSpace = S; /* used when creating path elements */
+ CharStringP = charstrP;
+ SubrsP = subrsP;
+ OtherSubrsP = osubrsP;
+ ModeP = modeP;
+
+ blues = bluesP;
+
+ /* compute the alignment zones */
+ ComputeAlignmentZones();
+
+ StartDecrypt();
+
+ ClearStack();
+ ClearPSFakeStack();
+ ClearCallStack();
+
+ InitStems();
+
+ currx = curry = 0;
+ escapementX = escapementY = 0;
+ sidebearingX = sidebearingY = 0;
+ accentoffsetX = accentoffsetY = 0;
+ wsoffsetX = wsoffsetY = 0; /* No shift to preserve whitspace. */
+ wsset = 0; /* wsoffsetX,Y haven't been set yet. */
+
+ for (;;) {
+ if (!DoRead(&Code)) break;
+ Decode(Code);
+ if (errflag) break;
+ }
+
+ FinitStems();
+
+
+ /* Clean up if an error has occurred */
+ if (errflag) {
+ if (path != NULL) {
+ Destroy(path); /* Reclaim storage */
+ path = NULL; /* Indicate that character could not be built */
+ }
+ }
+
+ return((struct xobject *) path);
+}
+
diff --git a/fonts/utilities/ps2pk/types.h b/fonts/utilities/ps2pk/types.h
new file mode 100644
index 0000000000..f9e78c2f14
--- /dev/null
+++ b/fonts/utilities/ps2pk/types.h
@@ -0,0 +1,33 @@
+/* File: types.h
+ * Purpose: define basic types so that program is portable to non 32 bits
+ * platforms
+ * Author: Piet Tutelaers
+ * (see README for license)
+ */
+
+#ifndef __PS2PK_TYPES__
+#define __PS2PK_TYPES__
+
+#ifdef HAVE_CONFIG_H
+#include "c-auto.h"
+#endif
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#ifdef KPATHSEA
+#include <kpathsea/kpathsea.h>
+#endif /* KPATHSEA */
+
+typedef unsigned short USHORT; /* 16 bits */
+typedef short SHORT; /* 16 bits */
+typedef double DOUBLE; /* 64 bits */
+
+typedef char *encoding[256];
+extern void getenc(char **, char **, encoding, int [256]);
+
+#endif /* __PS2PK_TYPES__ */
diff --git a/fonts/utilities/ps2pk/usenet b/fonts/utilities/ps2pk/usenet
new file mode 100644
index 0000000000..14dd5523f7
--- /dev/null
+++ b/fonts/utilities/ps2pk/usenet
@@ -0,0 +1,64 @@
+Path: tuegate.tue.nl!rw6.urc.tue.nl!rcpt
+From: rcpt@rw6.urc.tue.nl (Piet Tutelaers)
+Newsgroups: comp.text.tex
+Subject: Re: ps2mf
+Message-ID: <rcpt.714861633@rw6.urc.tue.nl>
+Date: 26 Aug 92 20:40:33 GMT
+References: <memo.585707@cix.compulink.co.uk> <ILH.92Aug20112742@winnie-the-pooh.lcs.mit.edu> <1992Aug22.112526.13957@cnix.uucp> <4847@news.duke.edu>
+Sender: root@tuegate.tue.nl
+Reply-To: rcpt@urc.tue.nl
+Lines: 52
+
+jbrehm@acpub.duke.edu (John Brehm) writes:
+
+>I need to convert some postscript fonts for use with the emTeX dvihplj
+>drivers, but at sizes that differ from the standard 10pt. I can
+>easily generate fonts of arbitrary sizes with ps2pk (great tool!),
+>but how do I produce the right .tfm files? That is, if I include
+>the line:
+> \font\opt12=optima at 12pt
+>I get the error message (from LaTeX):
+> ! Font \opt=optima not loadable: Bad metric (TFM) file.
+
+>Any thoughts?
+
+I see that my ps2pk.README does not explain this clearly. So here is a try
+to correct that.
+
+1) Get the latest afm2tfm coming with dvips. You need at least version 7.0
+of afm2tfm othewise the checksums of TFM files generated by afm2tfm and PK
+files generated by ps2pk will be different. Try ftp.urc.tue.nl:pub/tex or
+labrea.stanford.edu for the latest sources. MSDOS binaries are (or will
+become) available in :pub/tex/emtex/dvips.zip.
+
+2) You should have VPtoVF a fonttool coming with emTeX: converts a Virtual
+Property Font format (.vpl: ASCII) to Virtual Font format (.vf: binary).
+
+3) It is possible to name your TeX font `optima' but real TeX-ers
+prefer `popr', a name that can be used on MSDOS (and that can be found
+from grep-ing in the file adobe coming with dvips). You will need:
+ 1) emtex\tfm\popr.tfm
+ 2) emtex\vf\popr.vf
+ 3) emtex\tfm\rpopr.tfm
+ 4) emtex\pixel.lj\360dpi\rpopr.pk (360=12/10*300)
+
+4) To generate them:
+ afm2tfm Optima.afm -v popr.vpl rpopr.tfm
+ vptovf popr.vpl popr.vf popr.tfm
+ (delete popr.vpl if you like)
+ ps2pk -X360 -v Optima.pfb rpopr.360pk
+
+5) To use them install all TFM, VF and PK fonts on their proper place.
+Check that they will be located there and use now within plain TeX
+(especially check that emtex\lj.cnf contains a line telling dvihplj where
+to find its VF fonts. I have no MSDOS machine nearby, so I can't tell what
+exact line you need):
+ \font\opt12=popr at 12pt
+
+The bunch of files are necessary to map PostScript fonts to TeX (virtual
+magic).
+
+Hope this brings some light,
+
+--Piet
+
diff --git a/fonts/utilities/ps2pk/util.c b/fonts/utilities/ps2pk/util.c
new file mode 100644
index 0000000000..3c7b82ca9d
--- /dev/null
+++ b/fonts/utilities/ps2pk/util.c
@@ -0,0 +1,178 @@
+/* $XConsortium: util.c,v 1.6 92/03/26 16:42:26 eswu Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/* Author: Katherine A. Hitchcock IBM Almaden Research Laboratory */
+
+#include "types.h"
+#include <stdio.h>
+#include "util.h"
+#include "fontmisc.h"
+
+static char *vm_base = NULL; /* Start of virtual memory area */
+ char *vm_next = NULL; /* Pointer to first free byte */
+ int32_t vm_free = 0; /* Count of free bytes */
+ int32_t vm_size = 0; /* Total size of memory */
+
+/*
+ * Initialize memory.
+ */
+
+boolean vm_init(void)
+{
+ vm_next = vm_base = (char *) Xalloc(MAX_STRING_LEN);
+
+ if (vm_base != NULL) {
+ vm_free = MAX_STRING_LEN;
+ vm_size = MAX_STRING_LEN;
+ tokenMaxP = vm_next_byte() + MAX_STRING_LEN;
+ return(TRUE);
+ }
+ else
+ return(FALSE);
+}
+
+char *vm_alloc(unsigned int bytes)
+{
+ char *answer;
+
+ /* Align returned bytes to 64-bit boundary */
+ bytes = (bytes + 7) & ~7;
+
+ /* take space from what is left otherwise allocate another CHUNK */
+ if (bytes > vm_free)
+ if (!vm_init()) return NULL;
+ if (bytes <= vm_free) {
+ answer = vm_next;
+ vm_free -= bytes;
+ vm_next += bytes;
+ return answer;
+ }
+ else {
+ printf("Trying to allocate %d bytes (%d maximum)\n", bytes, MAX_STRING_LEN);
+ return NULL;
+ }
+}
+
+/*
+ * Format an Integer object
+ */
+void objFormatInteger(psobj *objP, int value)
+{
+ if (objP != NULL) {
+ objP->type = OBJ_INTEGER;
+ objP->len = 0;
+ objP->data.integer = value;
+ }
+}
+
+/*
+ * Format a Real object
+ */
+void objFormatReal(psobj *objP, float value)
+{
+ if (objP != NULL) {
+ objP->type = OBJ_REAL;
+ objP->len = 0;
+ objP->data.real = value;
+ }
+}
+
+/*
+ * Format a Boolean object
+ */
+void objFormatBoolean(psobj *objP, boolean value)
+{
+ if (objP != NULL) {
+ objP->type = OBJ_BOOLEAN;
+ objP->len = 0;
+ objP->data.boolean = value;
+ }
+}
+
+/*
+ * Format an Encoding object
+ */
+void objFormatEncoding(psobj *objP, int length, psobj *valueP)
+{
+ if (objP != NULL) {
+ objP->type = OBJ_ENCODING;
+ objP->len = length;
+ objP->data.arrayP = valueP;
+ }
+}
+
+/*
+ * Format an Array object
+ */
+void objFormatArray(psobj *objP, int length, psobj *valueP)
+{
+ if (objP != NULL) {
+ objP->type = OBJ_ARRAY;
+ objP->len = length;
+ objP->data.arrayP = valueP;
+ }
+}
+
+
+/*
+ * Format a String object
+ */
+void objFormatString(psobj *objP, int length, char *valueP)
+{
+ if (objP != NULL) {
+ objP->type = OBJ_STRING;
+ objP->len = length;
+ objP->data.valueP = valueP;
+ }
+}
+
+/*
+ * Format a Name object
+ */
+void objFormatName(psobj *objP, int length, const char *valueP)
+{
+ if (objP != NULL) {
+ objP->type = OBJ_NAME;
+ objP->len = length;
+ objP->data.nameP = valueP;
+ }
+}
+
+/*
+ * Format a File object
+ */
+void objFormatFile(psobj *objP, FILE *valueP)
+{
+ if (objP != NULL) {
+ objP->type = OBJ_FILE;
+ objP->len = 0;
+ objP->data.fileP = valueP;
+ }
+}
+
diff --git a/fonts/utilities/ps2pk/util.h b/fonts/utilities/ps2pk/util.h
new file mode 100644
index 0000000000..f38f9519d7
--- /dev/null
+++ b/fonts/utilities/ps2pk/util.h
@@ -0,0 +1,209 @@
+/* $XConsortium: util.h,v 1.3 92/03/26 16:42:29 eswu Exp $ */
+/* Copyright International Business Machines,Corp. 1991
+ * All Rights Reserved
+ *
+ * License to use, copy, modify, and distribute this software
+ * and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation,
+ * and that the name of IBM not be used in advertising or
+ * publicity pertaining to distribution of the software without
+ * specific, written prior permission.
+ *
+ * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+ * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
+ * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
+ * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
+ * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
+ * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
+ * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+#ifndef UTIL_H
+#define UTIL_H
+#include "types.h"
+
+#ifndef KPATHSEA
+#ifndef boolean
+typedef int boolean;
+#endif
+#endif
+
+#ifndef TRUE
+#define TRUE (1)
+#endif
+
+#ifndef FALSE
+#define FALSE (0)
+#endif
+
+/***================================================================***/
+/* Portable definitions for 2's complement machines.
+ * NOTE: These really should be based on PostScript types,
+ * for example, sizeof(ps_integer), or sizeof(ps_unsigned)
+ */
+#define MAX_INT32 (~(uint32_t)(0))
+/* This code is portable, assuming K&R C and 2's complement arithmetic */
+#define MAX_INTEGER \
+ ((int32_t)((((uint32_t) 1)<<(sizeof(uint32_t)*8-1))-1))
+#define MIN_INTEGER ((-MAX_INTEGER)-1)
+
+#define MAX_ARRAY_CNT (65535)
+#define MAX_DICT_CNT (65535)
+#define MAX_STRING_LEN (65535)
+#define MAX_NAME_LEN (128)
+
+/* this is the size of memory allocated for reading fonts */
+
+#define VM_SIZE (50*1024)
+/***================================================================***/
+
+#ifndef MIN
+#define MIN(a,b) (((a)<(b)) ? a : b )
+#endif
+
+/***================================================================***/
+/* Routines for managing virtual memory */
+/***================================================================***/
+extern boolean vm_init(void);
+extern int32_t vm_free;
+extern int32_t vm_size;
+extern char *vm_next;
+extern char *vm_alloc(unsigned int bytes);
+/***================================================================***/
+/* Macros for managing virtual memory */
+/***================================================================***/
+#define vm_next_byte() (vm_next)
+#define vm_free_bytes() (vm_free)
+#define vm_avail(B) (B <= vm_free)
+
+
+
+/***================================================================***/
+/* Types of PostScript objects */
+/***================================================================***/
+#define OBJ_INTEGER (0)
+#define OBJ_REAL (1)
+#define OBJ_BOOLEAN (2)
+#define OBJ_ARRAY (3)
+#define OBJ_STRING (4)
+#define OBJ_NAME (5)
+#define OBJ_FILE (6)
+#define OBJ_ENCODING (7)
+
+/***================================================================***/
+/* Value of PostScript objects */
+/***================================================================***/
+typedef union ps_value {
+ char *valueP; /* value pointer for unspecified type */
+ int value; /* value for unspecified type */
+ int integer; /* when type is OBJ_INTEGER */
+ float real; /* when type is OBJ_REAL */
+ int boolean; /* when type is OBJ_BOOLEAN */
+ struct ps_obj *arrayP; /* when type is OBJ_ARRAY */
+ unsigned char *stringP; /* when type is OBJ_STRING */
+ const char *nameP; /* when type is OBJ_NAME */
+ FILE *fileP; /* when type is OBJ_FILE */
+} psvalue;
+
+/***================================================================***/
+/* Definition of a PostScript object */
+/***================================================================***/
+typedef struct ps_obj {
+ char type;
+ char unused;
+ unsigned short len;
+ union ps_value data;
+} psobj;
+
+/***================================================================***/
+/* Definition of a PostScript Dictionary Entry */
+/***================================================================***/
+typedef struct ps_dict {
+ psobj key;
+ psobj value;
+} psdict;
+
+/***================================================================***/
+/* Macros for testing type of PostScript objects */
+/***================================================================***/
+#define objIsInteger(o) ((o).type == OBJ_INTEGER)
+#define objIsReal(o) ((o).type == OBJ_REAL)
+#define objIsBoolean(o) ((o).type == OBJ_BOOLEAN)
+#define objIsArray(o) ((o).type == OBJ_ARRAY)
+#define objIsString(o) ((o).type == OBJ_STRING)
+#define objIsName(o) ((o).type == OBJ_NAME)
+#define objIsFile(o) ((o).type == OBJ_FILE)
+
+/***================================================================***/
+/* Macros for setting type of PostScript objects */
+/***================================================================***/
+#define objSetInteger(o) ((o).type = OBJ_INTEGER)
+#define objSetReal(o) ((o).type = OBJ_REAL)
+#define objSetBoolean(o) ((o).type = OBJ_BOOLEAN)
+#define objSetArray(o) ((o).type = OBJ_ARRAY)
+#define objSetString(o) ((o).type = OBJ_STRING)
+#define objSetName(o) ((o).type = OBJ_NAME)
+#define objSetFile(o) ((o).type = OBJ_FILE)
+
+/***================================================================***/
+/* Macros for testing type of PostScript objects (pointer access) */
+/***================================================================***/
+#define objPIsInteger(o) ((o)->type == OBJ_INTEGER)
+#define objPIsReal(o) ((o)->type == OBJ_REAL)
+#define objPIsBoolean(o) ((o)->type == OBJ_BOOLEAN)
+#define objPIsArray(o) ((o)->type == OBJ_ARRAY)
+#define objPIsString(o) ((o)->type == OBJ_STRING)
+#define objPIsName(o) ((o)->type == OBJ_NAME)
+#define objPIsFile(o) ((o)->type == OBJ_FILE)
+
+/***================================================================***/
+/* Macros for setting type of PostScript objects (pointer access) */
+/***================================================================***/
+#define objPSetInteger(o) ((o)->type = OBJ_INTEGER)
+#define objPSetReal(o) ((o)->type = OBJ_REAL)
+#define objPSetBoolean(o) ((o)->type = OBJ_BOOLEAN)
+#define objPSetArray(o) ((o)->type = OBJ_ARRAY)
+#define objPSetString(o) ((o)->type = OBJ_STRING)
+#define objPSetName(o) ((o)->type = OBJ_NAME)
+#define objPSetFile(o) ((o)->type = OBJ_FILE)
+
+extern void objFormatInteger(psobj *,int);
+extern void objFormatReal(psobj *, float);
+extern void objFormatBoolean(psobj *, boolean);
+extern void objFormatEncoding(psobj *, int, psobj *);
+extern void objFormatArray(psobj *, int, psobj *);
+extern void objFormatString(psobj *, int, char *);
+extern void objFormatName(psobj *, int, const char *);
+extern void objFormatFile(psobj *, FILE *);
+
+extern void *Xalloc(size_t);
+extern void Xfree(void *);
+extern intptr_t MakeAtom(const char *, unsigned int, int);
+extern void QueryFontLib(char *, const char *, void *, int *);
+
+/*
+ * -------------------------------------------------------------------------
+ * Globals shared -- (everyone else KEEP YOUR MITTS OFF THEM!)
+ * -------------------------------------------------------------------------
+ */
+
+/* These variables are set by the caller */
+extern char *tokenStartP; /* Pointer to token buffer in VM */
+extern char *tokenMaxP; /* Pointer to end of VM we may use + 1 */
+
+/* These variables are set by P_TOKEN */
+extern int tokenLength; /* Characters in token */
+extern boolean tokenTooLong; /* Token too long for space available */
+extern int tokenType; /* Type of token identified */
+extern psvalue tokenValue; /* Token value */
+
+#endif