summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-17 21:41:51 +0000
committerKarl Berry <karl@freefriends.org>2006-01-17 21:41:51 +0000
commit487ca4806cc046076293cf6cc5fbba0db282bac7 (patch)
tree847b412ab5158dd7bdd7ed7e5a4cc3fbca94be32 /Build/source/texk/kpathsea
parenta3d3111bfe26b8e5f5bc6049dfb2a4ca2edc7881 (diff)
texk 1
git-svn-id: svn://tug.org/texlive/trunk@1485 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r--Build/source/texk/kpathsea/AUTHORS11
-rw-r--r--Build/source/texk/kpathsea/BUGS565
-rw-r--r--Build/source/texk/kpathsea/ChangeLog6070
-rw-r--r--Build/source/texk/kpathsea/HIER88
-rw-r--r--Build/source/texk/kpathsea/INSTALL849
-rw-r--r--Build/source/texk/kpathsea/Makefile.in287
-rw-r--r--Build/source/texk/kpathsea/NEWS316
-rw-r--r--Build/source/texk/kpathsea/PROJECTS23
-rw-r--r--Build/source/texk/kpathsea/README19
-rw-r--r--Build/source/texk/kpathsea/README.CONFIGURE193
-rw-r--r--Build/source/texk/kpathsea/absolute.c74
-rw-r--r--Build/source/texk/kpathsea/absolute.h34
-rw-r--r--Build/source/texk/kpathsea/access.c93
-rw-r--r--Build/source/texk/kpathsea/acconfig.h67
-rw-r--r--Build/source/texk/kpathsea/atou.c32
-rw-r--r--Build/source/texk/kpathsea/bugs.texi900
-rw-r--r--Build/source/texk/kpathsea/c-auto.in170
-rw-r--r--Build/source/texk/kpathsea/c-ctype.h90
-rw-r--r--Build/source/texk/kpathsea/c-dir.h55
-rw-r--r--Build/source/texk/kpathsea/c-errno.h30
-rw-r--r--Build/source/texk/kpathsea/c-fopen.h75
-rw-r--r--Build/source/texk/kpathsea/c-limits.h39
-rw-r--r--Build/source/texk/kpathsea/c-memstr.h86
-rw-r--r--Build/source/texk/kpathsea/c-minmax.h87
-rw-r--r--Build/source/texk/kpathsea/c-namemx.h39
-rw-r--r--Build/source/texk/kpathsea/c-pathch.h110
-rw-r--r--Build/source/texk/kpathsea/c-pathmx.h45
-rw-r--r--Build/source/texk/kpathsea/c-proto.h183
-rw-r--r--Build/source/texk/kpathsea/c-stat.h63
-rw-r--r--Build/source/texk/kpathsea/c-std.h105
-rw-r--r--Build/source/texk/kpathsea/c-unistd.h56
-rw-r--r--Build/source/texk/kpathsea/c-vararg.h64
-rw-r--r--Build/source/texk/kpathsea/cnf.c251
-rw-r--r--Build/source/texk/kpathsea/cnf.h33
-rw-r--r--Build/source/texk/kpathsea/common.ac116
-rw-r--r--Build/source/texk/kpathsea/concat.c38
-rw-r--r--Build/source/texk/kpathsea/concat3.c34
-rw-r--r--Build/source/texk/kpathsea/concatn.c73
-rw-r--r--Build/source/texk/kpathsea/concatn.h36
-rw-r--r--Build/source/texk/kpathsea/config.h131
-rwxr-xr-xBuild/source/texk/kpathsea/configure7231
-rw-r--r--Build/source/texk/kpathsea/configure.in11
-rw-r--r--Build/source/texk/kpathsea/db.c704
-rw-r--r--Build/source/texk/kpathsea/db.h49
-rw-r--r--Build/source/texk/kpathsea/debug.c54
-rw-r--r--Build/source/texk/kpathsea/debug.h100
-rw-r--r--Build/source/texk/kpathsea/default.h34
-rw-r--r--Build/source/texk/kpathsea/depend.mak1307
-rw-r--r--Build/source/texk/kpathsea/depend.mk615
-rw-r--r--Build/source/texk/kpathsea/dir.c130
-rw-r--r--Build/source/texk/kpathsea/elt-dirs.c504
-rw-r--r--Build/source/texk/kpathsea/expand.c359
-rw-r--r--Build/source/texk/kpathsea/expand.h45
-rw-r--r--Build/source/texk/kpathsea/extend-fname.c36
-rw-r--r--Build/source/texk/kpathsea/file-p.c39
-rw-r--r--Build/source/texk/kpathsea/find-suffix.c47
-rw-r--r--Build/source/texk/kpathsea/fn.c122
-rw-r--r--Build/source/texk/kpathsea/fn.h70
-rw-r--r--Build/source/texk/kpathsea/fontmap.c200
-rw-r--r--Build/source/texk/kpathsea/fontmap.h33
-rw-r--r--Build/source/texk/kpathsea/getopt.c1004
-rw-r--r--Build/source/texk/kpathsea/getopt.h153
-rw-r--r--Build/source/texk/kpathsea/getopt1.c190
-rw-r--r--Build/source/texk/kpathsea/hash.c252
-rw-r--r--Build/source/texk/kpathsea/hash.h76
-rw-r--r--Build/source/texk/kpathsea/hier.texi102
-rw-r--r--Build/source/texk/kpathsea/install.texi1235
-rw-r--r--Build/source/texk/kpathsea/kdefault.c124
-rw-r--r--Build/source/texk/kpathsea/kpathsea.cps820
-rw-r--r--Build/source/texk/kpathsea/kpathsea.h51
-rw-r--r--Build/source/texk/kpathsea/kpathsea.info4647
-rw-r--r--Build/source/texk/kpathsea/kpathsea.rc36
-rw-r--r--Build/source/texk/kpathsea/kpathsea.texi2254
-rw-r--r--Build/source/texk/kpathsea/kpathsea.version3
-rw-r--r--Build/source/texk/kpathsea/kpseaccess.man63
-rw-r--r--Build/source/texk/kpathsea/kpsecheck.c360
-rw-r--r--Build/source/texk/kpathsea/kpsecheck.rc34
-rw-r--r--Build/source/texk/kpathsea/kpsereadlink.man32
-rw-r--r--Build/source/texk/kpathsea/kpsestat.c128
-rw-r--r--Build/source/texk/kpathsea/kpsestat.man53
-rw-r--r--Build/source/texk/kpathsea/kpsewhich.c457
-rw-r--r--Build/source/texk/kpathsea/kpsewhich.man160
-rw-r--r--Build/source/texk/kpathsea/kpsewhich.rc34
-rw-r--r--Build/source/texk/kpathsea/lib.h184
-rw-r--r--Build/source/texk/kpathsea/line.c68
-rw-r--r--Build/source/texk/kpathsea/line.h34
-rw-r--r--Build/source/texk/kpathsea/magstep.c105
-rw-r--r--Build/source/texk/kpathsea/magstep.h48
-rw-r--r--Build/source/texk/kpathsea/make-suffix.c53
-rw-r--r--Build/source/texk/kpathsea/mktex.cnf15
-rwxr-xr-xBuild/source/texk/kpathsea/mktex.opt120
-rwxr-xr-xBuild/source/texk/kpathsea/mktexdir54
-rw-r--r--Build/source/texk/kpathsea/mktexdir.opt10
-rwxr-xr-xBuild/source/texk/kpathsea/mktexlsr150
-rw-r--r--Build/source/texk/kpathsea/mktexlsr.man46
-rwxr-xr-xBuild/source/texk/kpathsea/mktexmf139
-rw-r--r--Build/source/texk/kpathsea/mktexmf.man59
-rwxr-xr-xBuild/source/texk/kpathsea/mktexnam216
-rw-r--r--Build/source/texk/kpathsea/mktexnam.opt106
-rwxr-xr-xBuild/source/texk/kpathsea/mktexpk264
-rw-r--r--Build/source/texk/kpathsea/mktexpk.man122
-rwxr-xr-xBuild/source/texk/kpathsea/mktextfm152
-rw-r--r--Build/source/texk/kpathsea/mktextfm.man68
-rwxr-xr-xBuild/source/texk/kpathsea/mktexupd56
-rw-r--r--Build/source/texk/kpathsea/path-elt.c148
-rw-r--r--Build/source/texk/kpathsea/pathsearch.c644
-rw-r--r--Build/source/texk/kpathsea/pathsearch.h95
-rw-r--r--Build/source/texk/kpathsea/proginit.c79
-rw-r--r--Build/source/texk/kpathsea/proginit.h37
-rw-r--r--Build/source/texk/kpathsea/progname.c633
-rw-r--r--Build/source/texk/kpathsea/progname.h55
-rw-r--r--Build/source/texk/kpathsea/putenv.c110
-rw-r--r--Build/source/texk/kpathsea/readable.c108
-rw-r--r--Build/source/texk/kpathsea/readable.h34
-rw-r--r--Build/source/texk/kpathsea/readlink.c80
-rw-r--r--Build/source/texk/kpathsea/remote.c92
-rw-r--r--Build/source/texk/kpathsea/remote.h29
-rw-r--r--Build/source/texk/kpathsea/rm-suffix.c45
-rw-r--r--Build/source/texk/kpathsea/stamp-auto.in1
-rw-r--r--Build/source/texk/kpathsea/str-list.c120
-rw-r--r--Build/source/texk/kpathsea/str-list.h60
-rw-r--r--Build/source/texk/kpathsea/str-llist.c96
-rw-r--r--Build/source/texk/kpathsea/str-llist.h58
-rw-r--r--Build/source/texk/kpathsea/strcasecmp.c86
-rw-r--r--Build/source/texk/kpathsea/strstr.c125
-rw-r--r--Build/source/texk/kpathsea/strtol.c297
-rw-r--r--Build/source/texk/kpathsea/systypes.h32
-rw-r--r--Build/source/texk/kpathsea/tex-file.c949
-rw-r--r--Build/source/texk/kpathsea/tex-file.h202
-rw-r--r--Build/source/texk/kpathsea/tex-glyph.c392
-rw-r--r--Build/source/texk/kpathsea/tex-glyph.h81
-rw-r--r--Build/source/texk/kpathsea/tex-hush.c46
-rw-r--r--Build/source/texk/kpathsea/tex-hush.h31
-rw-r--r--Build/source/texk/kpathsea/tex-make.c595
-rw-r--r--Build/source/texk/kpathsea/tex-make.h42
-rw-r--r--Build/source/texk/kpathsea/texmf.in559
-rw-r--r--Build/source/texk/kpathsea/texmf.in-teTeX559
-rw-r--r--Build/source/texk/kpathsea/tilde.c167
-rw-r--r--Build/source/texk/kpathsea/tilde.h33
-rw-r--r--Build/source/texk/kpathsea/truncate.c59
-rw-r--r--Build/source/texk/kpathsea/truncate.h32
-rw-r--r--Build/source/texk/kpathsea/types.h55
-rw-r--r--Build/source/texk/kpathsea/unixtex.ftp151
-rw-r--r--Build/source/texk/kpathsea/unixtex.texi286
-rw-r--r--Build/source/texk/kpathsea/uppercasify.c38
-rw-r--r--Build/source/texk/kpathsea/variable.c273
-rw-r--r--Build/source/texk/kpathsea/variable.h44
-rw-r--r--Build/source/texk/kpathsea/version.c36
-rw-r--r--Build/source/texk/kpathsea/win32.mak359
-rw-r--r--Build/source/texk/kpathsea/win32hash.c760
-rw-r--r--Build/source/texk/kpathsea/withenable.ac103
-rw-r--r--Build/source/texk/kpathsea/xbasename.c48
-rw-r--r--Build/source/texk/kpathsea/xcalloc.c38
-rw-r--r--Build/source/texk/kpathsea/xdirname.c121
-rw-r--r--Build/source/texk/kpathsea/xfopen.c50
-rw-r--r--Build/source/texk/kpathsea/xfseek.c30
-rw-r--r--Build/source/texk/kpathsea/xftell.c33
-rw-r--r--Build/source/texk/kpathsea/xgetcwd.c150
-rw-r--r--Build/source/texk/kpathsea/xmalloc.c37
-rw-r--r--Build/source/texk/kpathsea/xopendir.c51
-rw-r--r--Build/source/texk/kpathsea/xopendir.h32
-rw-r--r--Build/source/texk/kpathsea/xputenv.c120
-rw-r--r--Build/source/texk/kpathsea/xrealloc.c47
-rw-r--r--Build/source/texk/kpathsea/xstat.c58
-rw-r--r--Build/source/texk/kpathsea/xstat.h44
-rw-r--r--Build/source/texk/kpathsea/xstrdup.c32
-rw-r--r--Build/source/texk/kpathsea/xt.ac13
167 files changed, 47477 insertions, 0 deletions
diff --git a/Build/source/texk/kpathsea/AUTHORS b/Build/source/texk/kpathsea/AUTHORS
new file mode 100644
index 00000000000..6c6a9b16fd8
--- /dev/null
+++ b/Build/source/texk/kpathsea/AUTHORS
@@ -0,0 +1,11 @@
+Karl Berry wrote all files not otherwise marked, with help from Kathryn
+Hargreaves on some of the original versions.
+
+Thomas Esser originated most of the MakeTeX... scripts. Subsequent changes
+were made by Olaf Weber and Thomas Esser.
+
+The brace expansion code in expand.c was written by Olaf Weber, replacing
+the original code borrowed from bash.
+
+The implementation of the link trick in pathsearch.c is taken from GNU
+find, implemented by David MacKenzie from Matthew Farwell's suggestion.
diff --git a/Build/source/texk/kpathsea/BUGS b/Build/source/texk/kpathsea/BUGS
new file mode 100644
index 00000000000..42e61e01865
--- /dev/null
+++ b/Build/source/texk/kpathsea/BUGS
@@ -0,0 +1,565 @@
+Contents:
+
+ 0.1 Reporting bugs
+ 0.1.1 Bug checklist
+ 0.1.2 Mailing lists
+ 0.1.3 Debugging
+ 0.1.4 Logging
+ 0.1.5 Common problems
+ 0.1.5.1 Unable to find files
+ 0.1.5.2 Slow path searching
+ 0.1.5.3 Unable to generate fonts
+ 0.1.5.4 TeX or Metafont failing
+ 0.1.5.5 Empty Makefiles
+ 0.1.5.6 `XtStrings'
+ 0.1.5.7 `dlopen'
+ 0.1.5.8 `ShellWidgetClass'
+ 0.1.5.9 Pointer combination warnings
+
+
+0.1 Reporting bugs
+==================
+
+If you have problems or suggestions, please report them to
+<tex-k@mail.tug.org> using the bug checklist below.
+
+ Please report bugs in the documentation; not only factual errors or
+inconsistent behavior, but unclear or incomplete explanations, typos,
+wrong fonts, ...
+
+0.1.1 Bug checklist
+-------------------
+
+Before reporting a bug, please check below to be sure it isn't already
+known (*note Common problems::).
+
+ Bug reports should be sent via electronic mail to
+<tex-k@mail.tug.org>, or by postal mail to 135 Center Hill Road /
+Plymouth, MA 02360 / USA.
+
+ The general principle is that a good bug report includes all the
+information necessary for reproduction. Therefore, to enable
+investigation, your report should include the following:
+
+ * The version number(s) of the program(s) involved, and of Kpathsea
+ itself. You can get the former by giving a sole option `--version'
+ to the program, and the latter by running `kpsewhich --version'.
+ The `NEWS' and `ChangeLog' files also contain the version number.
+
+ * The hardware, operating system (including version number),
+ compiler, and `make' program you are using (the output of `uname
+ -a' is a start on the first two, though often incomplete). If the
+ bug involves the X window system, include X version and supplier
+ information as well (examples: X11R6 from MIT; X11R4 from HP;
+ OpenWindows 3.3 bundled with SunOS 4.1.4).
+
+ * Any options you gave to `configure'. This is recorded in the
+ `config.status' files.
+
+ If you are reporting a bug in `configure' itself, it's probably
+ system-dependent, and it will be unlikely the maintainers can do
+ anything useful if you merely report that thus-and-such is broken.
+ Therefore, you need to do some additional work: for some bugs, you
+ can look in the file `config.log' where the test that failed should
+ appear, along with the compiler invocation and source program in
+ question. You can then compile it yourself by hand, and discover
+ why the test failed. Other `configure' bugs do not involve the
+ compiler; in that case, the only recourse is to inspect the
+ `configure' shell script itself, or the Autoconf macros that
+ generated `configure'.
+
+ * The log of all debugging output, if the bug is in path searching.
+ You can get this by setting the environment variable
+ `KPATHSEA_DEBUG' to `-1' before running the program. Please look
+ at the log yourself to make sure the behavior is really a bug
+ before reporting it; perhaps "old" environment variable settings
+ are causing files not to be found, for example.
+
+ * The contents of any input files necessary to reproduce the bug.
+ For bugs in DVI-reading programs, for example, this generally
+ means a DVI file (and any EPS or other files it uses)--TeX source
+ files are helpful, but the DVI file is necessary, because that's
+ the actual program input.
+
+ GNU `shar', available from `ftp://prep.ai.mit.edu/pub/gnu' is a
+ convenient way of packaging multiple (possibly binary) files for
+ electronic mail. If you feel your input files are too big to send
+ by email, you can ftp them to `ftp://ftp.tug.org/incoming' (that
+ directory is writable, but not readable).
+
+ * If you are sending a patch (do so if you can!), please do so in
+ the form of a context diff (`diff -c') against the original
+ distribution source. Any other form of diff is either not as
+ complete or harder for me to understand. Please also include a
+ `ChangeLog' entry.
+
+ * If the bug involved is an actual crash (i.e., core dump), it is
+ easy and useful to include a stack trace from a debugger (I
+ recommend the GNU debugger GDB, available from
+ `ftp://prep.ai.mit.edu/pub/gnu'). If the cause is apparent (a
+ `NULL' value being dereferenced, for example), please send the
+ details along. If the program involved is TeX or Metafont, and
+ the crash is happening at apparently-sound code, however, the bug
+ may well be in the compiler, rather than in the program or the
+ library (*note TeX or Metafont failing: TeX or Metafont failing.).
+
+ * Any additional information that will be helpful in reproducing,
+ diagnosing, or fixing the bug.
+
+0.1.2 Mailing lists
+-------------------
+
+Web2c and Kpathsea in general are discussed on the mailing list
+<tex-k@mail.tug.org>. To join, email <tex-k-request@mail.tug.org> with
+a line consisting of
+
+ subscribe YOU@YOUR.PREFERRED.EMAIL.ADDRESS
+
+in the body of the message.
+
+ You do not need to join to submit a report, nor will it affect whether
+you get a response. There is no Usenet newsgroup equivalent (if you can
+be the one to set this up, email `tex-k-request'). Traffic on the list
+is fairly light, and is mainly bug reports and enhancement requests to
+the software. The best way to decide if you want to join or not is
+read some of the archives from `ftp://ftp.tug.org/mail/archives/tex-k/'.
+
+ Be aware that large data files are sometimes included in bug reports.
+If this is a problem for you, do not join the list.
+
+ If you only want announcements of new releases, not bug reports and
+discussion, join <tex-archive@math.utah.edu> (via mail to
+<tex-archive-request@math.utah.edu>).
+
+ If you are looking for general TeX help, such as how to use LaTeX,
+please use the mailing list <info-tex@shsu.edu> mailing list, which is
+gatewayed to the `comp.text.tex' Usenet newsgroup (or post to the
+newsgroup; the gateway is bidirectional).
+
+0.1.3 Debugging
+---------------
+
+Kpathsea provides a number of runtime debugging options, detailed below
+by their names and corresponding numeric values. When the files you
+expect aren't being found, the thing to do is enable these options and
+examine the output.
+
+ You can set these with some runtime argument (e.g., `-d') to the
+program; in that case, you should use the numeric values described in
+the program's documentation (which, for Dvipsk and Xdvik, are different
+than those below). It's best to give the `-d' (or whatever) option
+first, for maximal output. Dvipsk and Xdvik have additional
+program-specific debugging options as well.
+
+ You can also set the environment variable `KPATHSEA_DEBUG'; in this
+case, you should use the numbers below. If you run the program under a
+debugger and set the variable `kpathsea_debug', also use the numbers
+below.
+
+ In any case, by far the simplest value to use is `-1', which will
+turn on all debugging output. This is usually better than guessing
+which particular values will yield the output you need.
+
+ Debugging output always goes to standard error, so you can redirect it
+easily. For example, in Bourne-compatible shells:
+ dvips -d -1 ... 2>/tmp/debug
+
+ It is sometimes helpful to run the standalone Kpsewhich utility
+(*note Invoking kpsewhich::), instead of the original program.
+
+ In any case, you can _not_ use the _names_ below; you must always use
+somebody's numbers. (Sorry.) To set more than one option, just sum
+the corresponding numbers.
+
+`KPSE_DEBUG_STAT (1)'
+ Report `stat'(2) calls. This is useful for verifying that your
+ directory structure is not forcing Kpathsea to do many additional
+ file tests (*note Slow path searching::, and *note Subdirectory
+ expansion::). If you are using an up-to-date `ls-R' database
+ (*note Filename database::), this should produce no output unless a
+ nonexistent file that must exist is searched for.
+
+`KPSE_DEBUG_HASH (2)'
+ Report lookups in all hash tables: `ls-R' and `aliases' (*note
+ Filename database::); font aliases (*note Fontmap::); and config
+ file values (*note Config files::). Useful when expected values
+ are not being found, e.g.., file searches are looking at the disk
+ instead of using `ls-R'.
+
+`KPSE_DEBUG_FOPEN (4)'
+ Report file openings and closings. Especially useful when your
+ system's file table is full, for seeing which files have been
+ opened but never closed. In case you want to set breakpoints in a
+ debugger: this works by redefining `fopen' (`fclose') to be
+ `kpse_fopen_trace' (`kpse_fclose_trace').
+
+`KPSE_DEBUG_PATHS (8)'
+ Report general path information for each file type Kpathsea is
+ asked to search. This is useful when you are trying to track down
+ how a particular path got defined--from `texmf.cnf', `config.ps',
+ an environment variable, the compile-time default, etc. This is
+ the contents of the `kpse_format_info_type' structure defined in
+ `tex-file.h'.
+
+`KPSE_DEBUG_EXPAND (16)'
+ Report the directory list corresponding to each path element
+ Kpathsea searches. This is only relevant when Kpathsea searches
+ the disk, since `ls-R' searches don't look through directory lists
+ in this way.
+
+`KPSE_DEBUG_SEARCH (32)'
+ Report on each file search: the name of the file searched for, the
+ path searched in, whether or not the file must exist (when drivers
+ search for `cmr10.vf', it need not exist), and whether or not we
+ are collecting all occurrences of the file in the path (as with,
+ e.g., `texmf.cnf' and `texfonts.map'), or just the first (as with
+ most lookups). This can help you correlate what Kpathsea is doing
+ with what is in your input file.
+
+`KPSE_DEBUG_VARS (64)'
+ Report the value of each variable Kpathsea looks up. This is
+ useful for verifying that variables do indeed obtain their correct
+ values.
+
+`GSFTOPK_DEBUG (128)'
+ Activates debugging printout specific to `gsftopk' program.
+
+`MAKETEX_DEBUG (512)'
+ If you use the optional `mktex' programs instead of the
+ traditional shell scripts, this will report the name of the site
+ file (`mktex.cnf' by default) which is read, directories created by
+ `mktexdir', the full path of the `ls-R' database built by
+ `mktexlsr', font map searches, `MT_FEATURES' in effect, parameters
+ from `mktexnam', filenames added by `mktexupd', and some
+ subsidiary commands run by the programs.
+
+`MAKETEX_FINE_DEBUG (1024)'
+ When the optional `mktex' programs are used, this will print
+ additional debugging info from functions internal to these
+ programs.
+
+ Debugging output from Kpathsea is always written to standard error,
+and begins with the string `kdebug:'. (Except for hash table buckets,
+which just start with the number, but you can only get that output
+running under a debugger. See comments at the `hash_summary_only'
+variable in `kpathsea/db.c'.)
+
+0.1.4 Logging
+-------------
+
+Kpathsea can record the time and filename found for each successful
+search. This may be useful in finding good candidates for deletion when
+your filesystem is full, or in discovering usage patterns at your site.
+
+ To do this, define the environment or config file variable
+`TEXMFLOG'. The value is the name of the file to append the
+information to. The file is created if it doesn't exist, and appended
+to if it does.
+
+ Each successful search turns into one line in the log file: two words
+separated by a space. The first word is the time of the search, as the
+integer number of seconds since "the epoch", i.e., UTC midnight 1
+January 1970 (more precisely, the result of the `time' system call).
+The second word is the filename.
+
+ For example, after `setenv TEXMFLOG /tmp/log', running Dvips on
+`story.dvi' appends the following lines:
+
+ 774455887 /usr/local/share/texmf/dvips/config.ps
+ 774455887 /usr/local/share/texmf/dvips/psfonts.map
+ 774455888 /usr/local/share/texmf/dvips/texc.pro
+ 774455888 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmbx10.600pk
+ 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmsl10.600pk
+ 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk
+ 774455889 /usr/local/share/texmf/dvips/texc.pro
+
+Only filenames that are absolute are recorded, to preserve some
+semblance of privacy.
+
+0.1.5 Common problems
+---------------------
+
+Here are some common problems with configuration, compilation, linking,
+execution, ...
+
+0.1.5.1 Unable to find files
+............................
+
+If a program complains it cannot find fonts (or other input files), any
+of several things might be wrong. In any case, you may find the
+debugging options helpful. *Note Debugging::.
+
+ * Perhaps you simply haven't installed all the necessary files; the
+ basic fonts and input files are distributed separately from the
+ programs. *Note unixtex.ftp::.
+
+ * You have (perhaps unknowingly) told Kpathsea to use search paths
+ that don't reflect where the files actually are. One common cause
+ is having environment variables set from a previous installation,
+ thus overriding what you carefully set in `texmf.cnf' (*note
+ Supported file formats::). System `/etc/profile' or other files
+ such may be the culprit.
+
+ * Your files reside in a directory that is only pointed to via a
+ symbolic link, in a leaf directory and is not listed in `ls-R'.
+
+ Unfortunately, Kpathsea's subdirectory searching has an
+ irremediable deficiency: If a directory D being searched for
+ subdirectories contains plain files and symbolic links to other
+ directories, but no true subdirectories, D will be considered a
+ leaf directory, i.e., the symbolic links will not be followed.
+ *Note Subdirectory expansion::.
+
+ You can work around this problem by creating an empty dummy
+ subdirectory in D. Then D will no longer be a leaf, and the
+ symlinks will be followed.
+
+ The directory immediately followed by the `//' in the path
+ specification, however, is always searched for subdirectories,
+ even if it is a leaf. Presumably you would not have asked for the
+ directory to be searched for subdirectories if you didn't want it
+ to be.
+
+ * If the fonts (or whatever) don't already exist, `mktexpk' (or
+ `mktexmf' or `mktextfm') will try to create them. If these rather
+ complicated shell scripts fail, you'll eventually get an error
+ message saying something like `Can't find font FONTNAME'. The best
+ solution is to fix (or at least report) the bug in `mktexpk'; the
+ workaround is to generate the necessary fonts by hand with
+ Metafont, or to grab them from a CTAN site (*note unixtex.ftp::).
+
+ * There is a bug in the library. *Note Reporting bugs::.
+
+0.1.5.2 Slow path searching
+...........................
+
+If your program takes an excessively long time to find fonts or other
+input files, but does eventually succeed, here are some possible
+culprits:
+
+ * Most likely, you just have a lot of directories to search, and that
+ takes a noticeable time. The solution is to create and maintain a
+ separate `ls-R' file that lists all the files in your main TeX
+ hierarchy. *Note Filename database::. Kpathsea always uses `ls-R'
+ if it's present; there's no need to recompile or reconfigure any
+ of the programs.
+
+ * Your recursively-searched directories (e.g.,
+ `/usr/local/share/texmf/fonts//'), contain a mixture of files and
+ directories. This prevents Kpathsea from using a useful
+ optimization (*note Subdirectory expansion::).
+
+ It is best to have only directories (and perhaps a `README') in the
+ upper levels of the directory structure, and it's very important
+ to have _only_ files, and no subdirectories, in the leaf
+ directories where the dozens of TFM, PK, or whatever files reside.
+
+ In any case, you may find the debugging options helpful in determining
+precisely when the disk or network is being pounded. *Note Debugging::.
+
+0.1.5.3 Unable to generate fonts
+................................
+
+Metafont outputs fonts in bitmap format, tuned for a particular device
+at a particular resolution, in order to allow for the highest-possible
+quality of output. Some DVI-to-whatever programs, such as Dvips, try
+to generate these on the fly when they are needed, but this generation
+may fail in several cases.
+
+ If `mktexpk' runs, but fails with this error:
+ mktexpk: Can't guess mode for NNN dpi devices.
+ mktexpk: Use a config file to specify the mode, or update me.
+ you need to ensure the resolution and mode match; just specifying the
+resolution, as in `-D 360', is not enough.
+
+ You can specify the mode name with the `-mode' option on the Dvips
+command line, or in a Dvips configuration file (*note Config files:
+(dvips)Config files.), such as `config.ps' in your document directory,
+`~/.dvipsrc' in your home directory, or in a system directory (again
+named `config.ps'). (Other drivers use other files, naturally.)
+
+ For example, if you need 360dpi fonts, you could include this in a
+configuration file:
+ D 360
+ M lqmed
+
+ If Metafont runs, but generates fonts at the wrong resolution or for
+the wrong device, most likely `mktexpk''s built-in guess for the mode
+is wrong, and you should override it as above.
+
+ See `ftp://ftp.tug.org/tex/modes.mf' for a list of resolutions and
+mode names for most devices (additional submissions are welcome).
+
+ If Metafont runs but generates fonts at a resolution of 2602dpi (and
+prints out the name of each character as well as just a character
+number, and maybe tries to display the characters), then your Metafont
+base file probably hasn't been made properly. (It's using the default
+`proof' mode, instead of an actual device mode.) To make a proper
+`plain.base', assuming the local mode definitions are contained in a
+file `modes.mf', run the following command (assuming Unix):
+
+ inimf "plain; input modes; dump"
+
+Then copy the `plain.base' file from the current directory to where the
+base files are stored on your system (`/usr/local/share/texmf/web2c' by
+default), and make a link (either hard or soft) from `plain.base' to
+`mf.base' in that directory. *Note inimf invocation: (web2c)inimf
+invocation.
+
+ If `mf' is a command not found at all by `mktexpk', then you need to
+install Metafont (*note unixtex.ftp::).
+
+0.1.5.4 TeX or Metafont failing
+...............................
+
+If TeX or Metafont get a segmentation fault or otherwise fail while
+running a normal input file, the problem is usually a compiler bug
+(unlikely as that may sound). Even if the trip and trap tests are
+passed, problems may lurk. Optimization occasionally causes trouble in
+programs other than TeX and Metafont themselves, too.
+
+ Insufficient swap space may also cause core dumps or other erratic
+behavior.
+
+ For a workaround, if you enabled any optimization flags, it's best to
+omit optimization entirely. In any case, the way to find the facts is
+to run the program under the debugger and see where it's failing.
+
+ Also, if you have trouble with a system C compiler, I advise trying
+the GNU C compiler. And vice versa, unfortunately; but in that case I
+also recommend reporting a bug to the GCC mailing list; see *Note Bugs:
+(gcc)Bugs.
+
+ To report compiler bugs effectively requires perseverance and
+perspicacity: you must find the miscompiled line, and that usually
+involves delving backwards in time from the point of error, checking
+through TeX's (or whatever program's) data structures. Things are not
+helped by all-too-common bugs in the debugger itself. Good luck.
+
+ One known cause of trouble is the way arrays are handled. Some of the
+Pascal arrays have a lower index other than 0, and the C code will take
+the pointer to the allocated memory, subtract the lower index, and use
+the resulting pointer for the array. While this trick often works, ANSI
+C doesn't guarantee that it will. It it known to fail on HP-UX 10
+mchines when the native compiler is used, unless the `+u' compiler
+switch was specified. Using GCC will work on this platform as well.
+
+0.1.5.5 Empty Makefiles
+.......................
+
+On some systems (NetBSD, FreeBSD, AIX 4.1, and Mach10), `configure' may
+fail to properly create the Makefiles. Instead, you get an error which
+looks something like this:
+
+ prompt$ ./configure
+ ...
+ creating Makefile
+ sed: 1: "\\@^ac_include make/pat ...": \ can not be used as a string delimiter
+
+ So far as I know, the bug here is in `/bin/sh' on these systems. I
+don't have access to a machine running any of them, so if someone can
+find a workaround that avoids the quoting bug, I'd be most grateful.
+(Search for `ac_include' in the `configure' script to get to the
+problematic code.)
+
+ It should work to run `bash configure', instead of using `/bin/sh'.
+You can get Bash from `ftp://prep.ai.mit.edu/pub/gnu' and mirrors.
+
+ Another possible cause (reported for NeXT) is a bug in the `sed'
+command. In that case the error may look like this:
+
+ Unrecognized command: \@^ac_include make/paths.make@r make/paths.make
+
+ In this case, installing GNU `sed' should solve the problem. You can
+get GNU `sed' from the same places as Bash.
+
+0.1.5.6 `XtStrings'
+...................
+
+You may find that linking X programs results in an error from the linker
+that `XtStrings' is undefined, something like this:
+
+ gcc -o virmf ...
+ .../x11.c:130: undefined reference to `XtStrings'
+
+ This generally happens because of a mismatch between the X include
+files with which you compiled and the X libraries with which you linked;
+often, the include files are from MIT and the libraries from Sun.
+
+ The solution is to use the same X distribution for compilation and
+linking. Probably `configure' was unable to guess the proper
+directories from your installation. You can use the `configure'
+options `--x-includes=PATH' and `--x-libraries=PATH' to explicitly
+specify them.
+
+0.1.5.7 `dlopen'
+................
+
+(This section adapted from the file `dlsym.c' in the X distribution.)
+
+ The `Xlib' library uses the standard C function `wcstombs'. Under
+SunOS 4.1, `wcstombs' uses the `dlsym' interface defined in `libdl.so'.
+Unfortunately, the SunOS 4.1 distribution does not include a static
+`libdl.a' library.
+
+ As a result, if you try to link an X program statically under SunOS,
+you may get undefined references to `dlopen', `dlsym', and `dlclose'.
+One workaround is to include these definitions when you link:
+
+ void *dlopen() { return 0; }
+ void *dlsym() { return 0; }
+ int dlclose() { return -1; }
+
+These are contained in the `dlsym.c' file in the MIT X distribution.
+
+0.1.5.8 `ShellWidgetClass'
+..........................
+
+(This section adapted from the comp.sys.sun.admin FAQ.)
+
+ If you are linking with Sun's OpenWindows libraries in SunOS 4.1.x,
+you may get undefined symbols `_get_wmShellWidgetClass' and
+`_get_applicationShellWidgetClass' when linking. This problem does not
+arise using the standard MIT X libraries under SunOS.
+
+ The cause is bugs in the `Xmu' shared library as shipped from Sun.
+There are several fixes:
+
+ * Install the free MIT distribution from `ftp.x.org' and mirrors.
+
+ * Get the OpenWindows patches listed below.
+
+ * Statically link the `Xmu' library into the executable.
+
+ * Avoid using `Xmu' at all. If you are compiling Metafont, see *Note
+ Online Metafont graphics: (web2c)Online Metafont graphics. If you
+ are compiling Xdvi, see the `-DNOTOOL' option in `xdvik/INSTALL'.
+
+ * Ignore the errors. The binary runs fine regardless.
+
+
+ Here is the information for getting the two patches:
+
+ Patch ID: 100512-02
+ Bug ID's: 1086793, 1086912, 1074766
+ Description: 4.1.x OpenWindows 3.0 `libXt' jumbo patch
+
+ Patch ID: 100573-03
+ Bug ID: 1087332
+ Description: 4.1.x OpenWindows 3.0 undefined symbols when using shared `libXmu'.
+
+ The way to statically link with `libXmu' depends on whether you are
+using a Sun compiler (e.g., `cc') or `gcc'. If the latter, alter the
+`x_libs' Make variable to include
+
+ -static -lXmu -dynamic
+
+ If you are using the Sun compiler, use `-Bstatic' and `-Bdynamic'.
+
+0.1.5.9 Pointer combination warnings
+....................................
+
+When compiling with old C compilers, you may get some warnings about
+"illegal pointer combinations". These are spurious; just ignore them.
+I decline to clutter up the source with casts to get rid of them.
+
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
new file mode 100644
index 00000000000..93377e1da05
--- /dev/null
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -0,0 +1,6070 @@
+2005-08-13 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpsewhich.c: Update copyright message.
+
+2005-08-03 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * README: Change references to COPYING and COPYING.LIB to GPL and
+ LGPL.
+
+ * kpathsea.texi: Change references to COPYING and COPYING.LIB to
+ GPL and LGPL.
+
+ * readlink.c: Correct license banner.
+
+2005-07-27 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in: Add comment to start of kpathsea.h.
+
+ * absolute.h, acconfig.h, c-ctype.h, c-dir.h, c-errno.h,
+ c-fopen.h, c-limits.h, c-memstr.h, c-minmax.h, c-namemx.h,
+ c-pathch.h, c-pathmx.h, c-proto.h, c-stat.h, c-std.h, c-unistd.h,
+ c-vararg.h, cnf.h, concatn.h, config.h, db.h, debug.h, default.h,
+ expand.h, fn.h, fontmap.h, getopt.h, hash.h, lib.h, line.h,
+ magstep.h, pathsearch.h, proginit.h, progname.h, readable.h,
+ str-list.h, str-llist.h, systypes.h, tex-file.h, tex-glyph.h,
+ tex-hush.h, tex-make.h, tilde.h, truncate.h, types.h, variable.h,
+ xopendir.h, xstat.h: Update copyright, license to LGPL 2.1.
+
+2005-07-26 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * access.c, readlink.c: Update copyright, license text.
+
+ * atou.c, absolute.c, cnf.c, concat.c, concat3.c, concatn.c, db.c,
+ debug.c, dir.c, elt-dirs.c, expand.c, extend-fname.c, file-p.c,
+ find-suffix.c, fn.c, fontmap.c, getopt.c, getopt1.c, hash.c,
+ kdefault.c, kpsestat.c, kpsewhich.c, line.c, magstep.c,
+ make-suffix.c, path-elt.c, pathsearch.c, proginit.c, progname.c,
+ readable.c, rm-suffix.c, str-list.c, str-llist.c, strcasecmp.c,
+ strstr.c, strtol.c, tex-file.c, tex-glyph.c, tex-hush.c,
+ tex-make.c, tilde.c, truncate.c, uppercasify.c, variable.c,
+ version.c, xbasename.c, xcalloc.c, xdirname.c, xfopen.c, xfseek.c,
+ xftell.c, xgetcwd.c, xopendir.c, xrealloc.c, xstat.c, xstrdup.c:
+ Update copyright, license to LGLP 2.1.
+
+ * xmalloc.c, xrealloc.c: Update copyright, license to LGPL 2.1.
+ Don't include stdio.h directly, it comes via config.h.
+
+2005-07-25 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Increase trie_size. Remove inaccurate comment about
+ its limits.
+
+ * common.ac: Remove the check for SMART_PUTENV, the xputenv code
+ has been rewritten not to need this.
+
+ * tex-file.c (kpse_init_format): Add uppercase versions of the
+ .ttf and .ttc suffixes for truetype fonts. Dont require a
+ recognized suffix.
+
+ * types.h: Don't #define true if it is already defined. From Karl
+ Berry.
+
+ * mktexmf: Additional change for generating cbgreek from Thomas.
+
+2005-07-12 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexmf: Patterns for cbgreek weren't inclusive enough. From
+ Thomas.
+
+2005-07-10 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-file.c (kpse_init_format): Revive .otf extension for
+ kpse_opentype_format, requested by Akira Kakuto
+ <kakuto@fsci.fuk.kindai.ac.jp>.
+
+ * tex-make.c (maketex): Print the name of the failing command
+ instead of always mktexpk. From Karl berry
+ <karl@freefriends.org>.
+
+ * acconfig.h: Remove SMART_PUTENV code.
+
+ * xputenv.c (xputenv): Replace with code that doesn't depend on
+ the SMART_PUTENV check.
+ (common.ac): Remove SMART_PUTENV check code.
+
+2005-06-29 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-make.c: Metafont doesn't like literals larger than anout
+ 4000, so try to avoid them when specifying magnifications. From
+ Werner Fink <werner@suse.de>.
+
+ * hash.h [KPSE_DEBUG]: Add KPSEDLL to declaration of
+ kpse_debug_hash_lookup_int. From Jan Nieuwenhuizen
+ <janneke@gnu.org>.
+
+2005-06-26 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * xt.ac: Fully quote the arguments of AC_ARG_WITH. From Peter
+ Breitenlohner.
+
+ * withenable.ac: Fully quote arguments of AC_ARG_WITH. From Peter
+ Breitenlohner.
+
+ * configure.in: Syntax changes to match autoconf2.5x. From Peter
+ Breitenlohner. Version to 3.5.5.
+
+ * common.ac: Fully quote AC_CONFIG_HEADERS. From Peter
+ Breitenlohner.
+
+ * Makefile.in: Replace ac_include with kpse_include. From Peter
+ Breitenlohner.
+
+2005-06-22 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * common.ac: Add KPSE_STRUCT_ST_MTIM check.
+
+ * expand.c: Update some comments.
+
+ * pathsearch.c: Update some comments.
+
+ * tex-file.c (init_path): Translate ';' to ':' in values we get
+ from the environment if the latter is our env_sep.
+
+ * cnf.c (do_line): Always translate ';' to ':' in config values if
+ the latter is the env_sep.
+
+ * kpathsea.texi: Remove ALLOW_SEMICOLON_IN_FILENAMES comment.
+
+2005-06-21 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr: Re-export PATH after changing it. Some shells require
+ this. Reported by Albert Chin <china@thewrittenword.com>.
+
+ * tex-file.c (kpse_find_file): Call kpse_expand() to do tilde and
+ variable expansion, which kpse_path_search_list() doesn't do, but
+ kpse_path_search() did. Re-enabling this was requested by several
+ people, including Oliver Grewe <olligrewe@nexgo.de>.
+
+ * mktexpk, bugs.texi: From Karl Berry: "Try to be more informative
+ when mktexpk can't guess the mode; reported by Knuth in tex-k
+ mail, 26 Apr 2005 18:07:20 -0400."
+
+2005-04-10 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tilde.c (kpse_tilde_expand): Slightly simplify code.
+
+ * tilde.c (kpse_tilde_expand): Account for the possibility that
+ we're fed an argument starting with "!!~". Problem reported by
+ DEK.
+
+2005-03-07 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * install.texi: Document texmfvar and USE_TEXMFVAR. From Thomas.
+
+ * mktexdir: Break out of loop on failure of mkdir. Last-minute
+ change for teTeX 3.0 from Thomas.
+
+2005-02-06 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpsereadlink.man: Correct banner: READLINK -> KPSEREADLINK.
+
+2005-02-05 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in (texmf.sed): With TEXMFSYSVAR and TEXMFSYSCONFIG
+ added, there's even more potential damage to clean up.
+ (uninstall-data): Try to cleanly uninstall the info document.
+
+ * texmf.in: Add TEXMFSYSVAR, TEXMFSYSCONFIG for teTeX 3.0. From
+ Thomas.
+
+2005-01-25 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexmf: Don't redirect output of cd, Ultrix doesn't like that.
+
+2005-01-21 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in: Change POSTINSTALL to POST_INSTALL.
+
+ * mktex.opt: Add texmfvar to list of allowed feature options.
+
+ * mktexlsr: Make getting the list of directories from $TEXMFDBS
+ more robust. From Thomas.
+
+ * kpsereadlink.man, kpsestat.man, kpsewhich.man, mktexlsr.man,
+ mktexmf.man, mktextfm.man, mktexpk.man, kpseaccess.man: Man page
+ corrections from Eric S. Raymond <esr@thyrsus.com>.
+
+2005-01-07 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexpk: Add guess ultre for 1200 dpi. This is a fairly neutral
+ mode, also useful for pdftex. From Karl Berry.
+
+ * mktexlsr: Make sorting the texmf trees more robust. From
+ Thomas.
+
+2004-12-29 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * configure.in: Version 3.5.4.
+
+ * mktexlsr: Remove duplicate trees. From Thomas.
+
+ * mktexdir: Remove superfluous cd. From Thomas.
+
+ * withenable.ac: Sync with Thomas' version, removes
+ --enabled-multiplatform code.
+
+2004-12-28 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in (texmf.sed): New variables were added named TEXMF*.
+ The cleanup code needed additional fixes for this. From Thomas
+ Esser.
+
+ * mktexnam.opt: Improve comment.
+
+ * mktexnam: Handle texmfvar option, which directs all writes into
+ the system trees to the TEXMFVAR tree, with the usual caveats.
+
+ * mktexnam.opt: Add texmfvar option.
+
+ * texmf.in: Changes to bring it close to teTeX 3.0.
+
+2004-12-20 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: For XeTeX: TEXINPUTS.xetex, TEXINPUTS.xelatex,
+ OTFFONTS.
+
+2004-12-19 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * xt.ac: Mark --with-x-toolkit as obsolete.
+
+ * Makefile.in [KPATHSEA_CC]: Don't quote $(CC), as it prevents
+ libtool from functioning properly if $(CC) contains options in
+ addition to the compiler name. From Harald Koenig
+ <koenig@science-computing.de>.
+
+ * mktexpk: Add guesses for dpi 360 and 720. From Frank Küster
+ <frank@kuesterei.ch> (Debian maintainer).
+
+ * mktexlsr: Write all regular progress messages to stderr, instead
+ of some to stdout.
+
+ * mktexdir: Handle directories with spaces in the names.
+
+ * mktexupd: If we've called mktexlsr, there is no need to do
+ anything else, so exit immediately. From Thomas.
+
+2004-11-28 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Add default entries for $progname and $engine, so we
+ don't expand these to empty if the file is used by pre 3.5.3
+ implementations.
+
+ * mktexmf: Extend the pattern for the cbgreek fonts. From Hartmut
+ Henkel <hartmut_henkel@gmx.de>.
+
+2004-10-05 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Add TEXINPUTS.lamed (Aleph's version of lambda) and
+ TEXINPUTS.uft8mex (utf8 variation of mex).
+
+2004-08-24 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktex.opt: Correct syntax error. Reported by Staszek
+ Wawrykiewicz <staw@gust.org.pl>.
+
+2004-08-23 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: The TEXINPUTS.pdftexinfo entry in obsolete, and will
+ be removed in the future. Alert by Vladimir Volovich
+ <vvv@vsu.ru>.
+
+ * tex-file.c (kpse_find_file): Make debug message conditional
+ KPSE_DEBUG_SEARCH being set.
+
+ * kpsewhich.c: Remove spurious space in usage message.
+
+ * tex-file.c (kpse_find_file): Add debug message to clarify what
+ the library is doing when. From Karl Berry <karl@tug.org>.
+
+ * tex-file.c: Add TEXFONTS to the environment variables for all
+ kinds of font-related stuff. This means you can, if you want to,
+ just dump all font-related files in a single directory and set a
+ single variable to point to it. It doesn't have a default.
+ Suggested by Karl Berry, Hans Hagen, Akira Kakuto.
+
+
+2004-08-17 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr, mktex.opt: Use "test ... || test ..." instead of
+ "test ... -o ...".
+
+2004-08-06 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * xdirname.c: Cygwin also understands UNC names. From Jan
+ Nieuwenhuizen <janneke@gnu.org>.
+
+ * config.h: Do not define DOSISH for Cygwin. After Jan
+ Nieuwenhuizen <janneke@gnu.org>.
+
+ * mktex.opt: Refine the test of $COMPSEC a bit, to accomodate
+ Cygwin. After Jan Nieuwenhuizen <janneke@gnu.org>.
+
+ * mktexlsr: Refine the test for $COMSPEC a bit, to accomodate
+ Cygwin. After Jan Nieuwenhuizen <janneke@gnu.org>.
+
+ * Makefile.in: Define MAKE_KPSE_DLL when compiling the library to
+ support ugly windows declspec stuff. From Jan Nieuwenhuizen
+ <janneke@gnu.org>.
+
+ * c-proto.h: Clean up the defines for KPSEDLL a bit. From Jan
+ Nieuwenhuizen <janneke@gnu.org>.
+
+ * getopt.h: Clean up defines for KPSEDLL a bit. From Jan
+ Nieuwenhuizen <janneke@gnu.org>.
+
+2004-08-01 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Undoing some simplifications of the search paths, in
+ particular the texmf/{engine1,engine2,...} style paths are back to
+ accomodate older texmf trees.
+
+2004-07-23 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Adapt TRFONTS to Linux groff path, which is the most
+ useful variant these days.
+
+2004-07-21 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in (uninstall-exec): Add removal rules for libkpathsea
+ and the programs other than kpsewhich.
+
+ * kpathsea.texi: Push copyright to bottom of page.
+
+ * texmf.in: Add paths for pdfxtex, pdfxlatex. After Peter
+ Breitenlohner <peb@mppmu.mpg.de>.
+
+ * texmf.in: Updates/simplifications to paths, from Thomas.
+
+2004-07-19 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * db.c (kpse_db_search_list): Add cast to suppress warning about
+ discarding "const".
+
+2004-07-03 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * common.ac: No m4 quoting needed in the KPSE_CROSS_BUILD_VAR
+ calls.
+
+ * common.ac: Add some invocations of KPSE_CROSS_BUILD_VAR matching
+ usage in ../make/cross.mk.
+
+ * mktextfm: Use the same code as mktexpk for ignoring metafont
+ errors, to ensure that mktextfm and mktexpk ignore identical sets
+ of metafont errors.
+
+2004-06-28 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.texi: Use @copying, so the license ends up in the HTML
+ output. Use @ifnottex instead of @ifinfo, so that makeinfo --html
+ works without further effort. From Karl Berry.
+
+ * install.texi: Name of bash manual is now "bash". From Karl
+ Berry.
+
+2004-06-22 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * c-memstr.h [HAVE_STRINGS_H]: Include strings.h if it is
+ available, as opposed to just doing if HAVE_STRING_H is not
+ defined. Otherwise we give conflicting information whether
+ certain old-style functions like index, rindex are defined.
+ * common.ac: Also check for strings.h.
+
+ * c-memstr.h: Add definitions for index and rindex in terms of
+ strchr and strrchr, as we've got some old code in TeX-live that
+ needs this on some platforms.
+
+2004-06-15 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * install.texi: Karl Berry pointed out that GNU fileutils is now
+ GNU coreutils.
+
+2004-06-14 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.texi: Make it more obvious that applications will often
+ just want to use <kpathsea/kpathsea.h> rather than pick and choose
+ headers.
+
+2004-06-11 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpsewhich.c: Update copyright dates.
+
+2004-05-28 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr: Rename readlink to kpsereadlink to avoid name clash.
+
+ * Makefile.in: Rename readlink to kpsereadlink to avoid name
+ clash.
+
+2004-05-26 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-file.c: Make .fmt the only "true" suffix for format files,
+ and add all other suffixes to the list of alternates. In the next
+ version, these alternates will be dropped entirely.
+
+2004-05-11 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in (mostlyclean): access -> kpseaccess. From Thomas.
+
+2004-05-08 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr: Widen the matches for the lsR-pattern, so we omit the
+ temporary directory we used.
+
+2004-05-07 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Use $engine in some paths.
+
+ * kpathsea.texi: Date is May 2004.
+
+ * kpathsea.texi: Document --engine.
+
+ * kpsewhich.man: Document -engine.
+
+ * kpsewhich.c: Implement -engine option.
+
+2004-04-24 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * cnf.c (read_all_cnf): Fix memory leak.
+
+ * mktexupd: Fix logic error. Found by Thomas Esser.
+
+ * tex-file.c (kpse_init_fallback_resolutions): Fix memory leak.
+
+2004-04-23 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * db.c (kpse_db_search_list): Allow matches like base/plain.tex
+ when a db is used. This was a regression introduced by the switch
+ to kpse_db_search_list. Like the original code, this only works
+ with '/' used for dirsep. Reported by Wlodzimierz Bzyl
+ <matwb@univ.gda.pl>.
+
+2004-04-17 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpsewhich.c (lookup): Partial implementation of -all option.
+ Works only in combination with the -path option.
+ * tex-file.c: Add to list of suffixes that may be used for format
+ files.
+
+ * kpathsea.texi: Document -var-value option kpsewhich.
+
+ * kpsewhich.man: Document -var-value.
+
+ * kpsewhich.c: Add -var-value option. Change loop that checks for
+ a kpse_file_format_type to check kpse_format_fmt last.
+
+ * texmf.in: Add TEXINPUTS.aleph, TEXINPUTS.alambda.
+
+2004-04-01 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexpk: Use dpdfezzz if given 8000 for BDPI. Apparently this
+ is what -Ppdf ends up giving the script.
+
+2004-03-26 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in (install): access -> kpseaccess
+
+2004-03-23 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * db.c (kpse_init_db): Look for both "ls-R" and "ls-r" files.
+ Same contents, but when working cross-platform the all-lowercase
+ name is easier to work with.
+
+ * tex-file.c: Add .afmt as recognized suffix to kpse_fmt_format
+ (for Aleph). Add ls-r as recognized suffix to kpse_db_format.
+
+ * mktexlsr: Allow both ls-R and ls-r as names for an existing
+ directory tree index file. Always create ls-R.
+
+ * mktexupd: Check for both ls-R and ls-r.
+
+ * pathsearch.h (kpse_all_path_search_list): New function. Like
+ kpse_path_search_list, with must_exist true, but returns a list of
+ filenames instead of the first hit.
+
+ * pathsearch.c (kpse_all_path_search_list): New function. Like
+ kpse_path_search_list, with must_exist true, but returns a list of
+ filenames instead of the first hit.
+
+ * tex-make.c [WIN32] (maketex): Code to print error message for
+ ERROR_BROKEN_PIPE didn't match the format.
+
+ * mktexpk: Allow 'angle(0,0)' errors without aborting. From
+ Andreas Degert <ad@papyrus-gmbh.de>.
+
+ * unixtex.texi: Update from Karl Berry.
+
+2004-03-21 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * withenable.ac: Make the warnings more obvious if the search for
+ the texmf tree fails. Also try to fall back on kpsewhich if we
+ fail to find anything. A simplified version of code proposed by
+ Stefan Ulrich <stefan.ulrich@zen.co.uk> for xdvik.
+
+2004-03-16 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Add file_line_error_style variable, default to false.
+
+2004-02-26 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-make.c (maketex): Clean up unused variables.
+
+ * texmf.in: Update link in comment for TEXFONTMAPS.
+
+2004-02-25 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexnam: Use kpseaccess instead of access.
+
+ * mktexlsr: Use kpseaccess instead of access.
+
+ * Makefile.in: Rename the access executable to kpseaccess, as the
+ old name tended to interfere.
+
+ * kpseaccess.man: Formerly known as access.man.
+
+ * mktexlsr: Only check for magic string in ls-R file if the file
+ size is larger than 0. Assume that a 0-length ls-R can be
+ overwritten without penalty.
+
+ * mktexlsr: Use a more accurate method to ensure that directory
+ names, and only directory names, start with ./ in the ls-R file.
+
+2004-02-16 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-file.c: Rename kpse_script_format to
+ kpse_texmfscripts_format.
+
+ * tex-file.h: Rename kpse_script_format to
+ kpse_texmfscripts_format.
+
+2004-02-15 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexpk: psfonts.map and ps2pk.map now found through the map
+ format.
+
+ * kpsewhich.c (find_format): psfonts.map and pdftex.map are no
+ longer special case, pdftex.cfg is a special case now.
+
+ * kpathsea.texi: Update for new formats (misc fonts, web, cweb,
+ enc, cmap, sfd, opentype fonts, pdftex config, lig files,
+ texmfscripts).
+
+ * tex-file.c: Add kpse_lig_format and kpse_script_format.
+
+ * tex-file.h: Add kpse_lig_format and kpse_script_format.
+
+ * texmf.in: Add LIGFONTS and TEXMFSCRIPTS.
+
+2004-02-10 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * db.c (kpse_db_search_list): An absolute or explicit relative
+ name that makes it here would not be found anyway, so test for it
+ and skip.
+
+ * pathsearch.c (search_list): If we're given only absolute or
+ relative filenames, then there is no need to dig into the database
+ or filesystem.
+ (dir_list_search_list): Skip any absolute filenames that make it here.
+
+2004-02-08 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in (stamp-paths): Add TEXMFDIST. Suggested by Thomas.
+
+ * texmf.in: Add TEXMFDIST, suggested by Thomas.
+
+2004-01-09 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-file.c: Add kpse_pdftex_config_format. From Thomas.
+
+ * tex-file.h: Add kpse_pdftex_config_format. From Thomas.
+
+2004-01-04 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Modifications to several paths suggested by Thomas.
+
+2003-12-17 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-make.c (kpse_make_tex): Allow '+' is font names as well.
+ Reported by Hartmut Henkel <hartmut_henkel@gmx.de>.
+
+2003-12-14 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * progname.c: Set "progname" in the environment.
+
+ * tex-file.h: Add new formats: kpse_enc_format, kpse_cmap_format,
+ kpse_sfd_format, kpse_opentype_format. Requested by Thomas.
+
+ * tex-file.c: Add new formats: kpse_enc_format, kpse_cmap_format,
+ kpse_sfd_format, kpse_opentype_format. Requested by Thomas.
+
+2003-02-27 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexmf: csso12[0-5][0-9] are from CJK package; unsupported by
+ mktexmf. Fix by Werner Lemberg <wl@gnu.org>.
+
+2003-02-19 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.texi: Version 3.5.2.
+
+ * configure.in: Version 3.5.2.
+
+ * cnf.c (do_line): KISS: Use IS_ENV_SEP(':') to check whether we
+ might want to replace ';' with ':' in paths instead of trying to
+ figure whether 'unix' should have been defined.
+
+ * db.c (kpse_db_search_list): Change fix to prevent "re-use" of
+ aliases for the sake of clearer code.
+
+ * db.c: Set aliases to NULL after freeing it, so we don't try to
+ realloc the same value as well. Reported by Thomas Esser
+ <te@dbs.uni-hannover.de>.
+
+2003-02-17 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * configure.in: Version 3.5.1.
+
+ * kpathsea.texi: Version 3.5.1.
+
+2003-02-15 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.texi: Version 3.5.0.
+
+ * configure.in: Version 3.5.0.
+
+ * kpathsea.version: removed.
+
+ * Makefile.in (dist): Remove kpathsea.version.
+
+ * common.ac: From klibtool to libtool. Based on patches from
+ Albert Chin-A-Young <china@thewrittenword.com>.
+
+ * Makefile.in: From klibtool to libtool. Based on patches from
+ Albert Chin-A-Young <china@thewrittenword.com>.
+
+ * texmf.in: Add TEXINPUTS.olatex path.
+
+ * tex-file.c: Add additional suffixes for formats.
+
+ * withenable.ac: When texmfmain is derived from ${prefix}, don't
+ expand ${prefix}.
+
+2003-02-11 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * pathsearch.c (search_list): Add some grotty code for the
+ searches of absolute pathnames. (Grotty: if _any_ of the given
+ pathnames is absolute or explicit relative, _and_ it is found, we
+ stop searching then and there.) Found by Peter Breitenlohner
+ <peb@mppmu.mpg.de>.
+
+2003-02-07 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.version: Version 3.4.6
+
+ * kpathsea.texi: Version 3.4.6.
+
+ * configure.in: Version 3.4.6.
+
+ * texmf.in: Additions for e-Omega.
+
+ * tex-file.c (kpse_find_file): Use kpse_path_search_list for
+ search.
+
+ * pathsearch.h (kpse_path_search_list): New function.
+
+ * pathsearch.c (dir_list_search_list): New function.
+ (search_list): New function.
+ (kpse_path_search_list): New function: search for a list of names,
+ look for all names in the list in each directory before moving to
+ the next directory.
+
+ * db.h (kpse_db_search_list): New function.
+
+ * db.c (kpse_db_search_list): New function.
+
+2003-01-31 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * lib.h: Add include of c-proto.h. Suggested by Peter
+ Breitenlohner.
+
+2003-01-29 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.version: Version 3.4.5.
+
+ * kpathsea.texi: Version 3.4.5.
+
+ * configure.in: Version 3.4.5.
+
+2003-01-24 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * config.h [KPATHSEA]: 33 -> 34.
+ [DEV_NULL]: Added, "/dev/null" on unix, "NUL" on DOSISH.
+
+ * texmf.in [TEXCONFIG]: Remove "." from path for security reasons.
+
+2003-01-16 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.texi: Version 3.4.4.
+
+ * configure.in: Version 3.4.4.
+
+ * kpathsea.version: Version 3.4.4.
+
+ * unixtex.texi: Updates.
+
+2003-01-14 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Uncomment definitions for VARTEXMF, HOMETEXMF. Change
+ TEXMF itself to be same as teTeX. Move '//' outside braces in
+ XDVIINPUTS and DVIPDFMINPUTS -- not strictly needed, but
+ consistent with how we do it everywhere else. Comment out (but
+ otherwise retain) KPSE_DOT.
+
+2003-01-11 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.version: Version 3.4.3.
+
+ * kpathsea.texi: Version 3.4.3.
+
+ * configure.in: Version 3.4.3.
+
+2003-01-08 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Add TEXPSHEADERS.dvipdfm, from Thomas.
+
+2002-12-25 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-file.c (kpse_init_format): Add ".web" to the suffixes
+ recognized for cweb.
+
+2002-12-23 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * dir.c (dir_links): Argh. Error while merging stuff from
+ Fabrice.
+
+ * kpathsea.version: Version 3.4.2.
+
+ * configure.in: Version 3.4.2.
+
+ * kpathsea.texi: Version 3.4.2.
+
+ * tex-make.c (maketex) [WIN32]: Add program calling
+ implementation. From Fabrice Popineau
+ <Fabrice.Popineau@supelec.fr>.
+
+ * Makefile.in: Test for kpathsea.info explicitly in current
+ directory. Some makes prepend the source dir path otherwise, which
+ would cause installation of the info files to fail. From Thomas
+ Esser <te@dbs.uni-hannover.de>.
+
+2002-12-20 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * configure.in: Version 3.4.1.
+
+ * kpathsea.texi: Version 3.4.1.
+
+ * kpathsea.version: Version 3.4.1.
+
+ * tex-file.c (add_suffixes): Removed function.
+ (SUFFIXES, ALT_SUFFIXES): Use kpse_set_suffixes instead of
+ add_suffixes.
+
+ * tex-make.c (kpse_make_tex): On second thought, we should not get
+ dirseps in these names, ever.
+
+2002-12-17 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-make.c (maketex): Be sure to set ret to NULL if there's
+ nothing to return. From Akira Kakuto
+ <kakuto@fsci.fuk.kindai.ac.jp>.
+
+2002-12-15 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-file.c: Properly terminate MKTEXPK_ARGS with a NULL.
+ Spotted by Akira Kakuto <kakuto@fsci.fuk.kindai.ac.jp>.
+
+2002-12-14 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.texi: Version 3.4.0.
+
+ * kpathsea.version: Version 3.4.0.
+
+ * configure.in: Version 3.4.0.
+
+ * texmf.in: Typo in TEXINPUTS.pdfemex-pl.
+
+ * xbasename.c (xbasename): Remove redundant call to strlen. From
+ Fabrice.
+
+ * tex-make.c (misstex): Update to print command line correctly.
+ (maketex): Handle argv style array for command. For unix case, call
+ fork and exec directly instead of using popen.
+ (kpse_make_tex): Handle argv style array for defining a command. Be
+ very restrictive about what a name passed may contain -- this may
+ well break somethings.
+
+ * tex-file.h (kpse_format_info): Instead of having programs args
+ be a single string, use an argv style array.
+
+ * tex-file.c (init_maketex): Change to store command line as an
+ array of arguments.
+ [MKTEXPK_ARGS]: Define list of strings instead of single string.
+ (kpse_init_format): Update debugging code to match new
+ kpse_format_info structure.
+
+ * progname.c [WIN32]: Updates from Fabrice.
+
+ * pathsearch.h: Typo in comment.
+
+ * pathsearch.c: Typo in comment.
+
+ * kpsewhich.c: Correct copyright notice.
+
+ * hash.c (hash_normalized): New function.
+ (hash_insert_normalized): New function.
+ [MONOCASE_FILENAMES]: Normalize to lower case, not upper case, because
+ that's what in the ls-R files we distribute.
+
+ * fontmap.c (map_file_parse): Use hash_insert_normalized. Again,
+ we assume the contents of font maps are already normalized.
+
+ * expand.c (kpse_expand_kpse_dot): Typo in comment.
+ (brace_expand): Clarify the comment.
+
+ * dir.c (dir_p) [WIN32]: safe_beg_of_path -> kpse_normalize_path.
+ From Fabrice.
+ (dir_links) [WIN32]: Changes to code that stores and retrieves
+ integers from pointers.
+
+ * db.c (db_build): Call hash_insert_normalized -- names from the
+ ls-R file should be normalized already.
+ (alias_build): Call hash_insert_normalized -- names from the alias
+ file should be normalized already.
+ (kpse_db_insert): Note that we call hash_insert here deliberately.
+
+ * hash.h (hash_insert_normalized): New function.
+
+ * concat.c (concat): Start strcat at the end of the previous
+ strcpy.
+
+ * absolute.c (kpse_absolute_p) [WIN32]: Remove explicit test for
+ UNC names, they're already covered by the test for names starting
+ with IS_DIR_SEP.
+ [TEST] (main): Added, from Fabrice.
+
+2002-11-13 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.version: To 3.3.11.
+
+ * kpathsea.texi: To 3.3.11.
+
+ * configure.in: To 3.3.11.
+
+2002-11-12 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * cnf.c (do_line): First check whether len-1 exists, then access
+ it, rather than the other way round. Spotted by Joern Clausen
+ <joern@techfak.uni-bielefeld.de>.
+
+ * texmf.in: obj_tab_size.context is now redundant. From Thomas.
+
+ * mktextfm: Use the same detection mechanism for mf-nowin as
+ mktexpk. From Thomas.
+
+2002-11-11 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.version: Version 3.3.10.
+
+ * kpathsea.texi: Version 3.3.10.
+
+ * configure.in: Version 3.3.10.
+
+ * texmf.in: Disable parse_first_line by default (sorry). Enlarge
+ a number of constants in general, as opposed to defining lots of
+ context-specific versions.
+
+ * progname.c (remove_dots): We did not correctly handle paths with
+ ../.. in them. There is still one corner case left, if the path
+ would try to go to the "parent" of the root directory.
+
+ * mktextfm: Test for mf-nowin in a shubshell. Otherwise error
+ messages could end up being printed if mf-nowin does not exist.
+
+ * mktexpk: Test for mf-nowin in a subshell.
+
+2002-10-25 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kdefault.c (kpse_expand_default): Simplify the life of the
+ callers by always returning allocated memory, so the returned
+ string can be freed. John W. Eaton <jwe@bevo.che.wisc.edu>
+ requested this.
+
+2002-10-22 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * withenable.ac: Correct handling of mktexfmt option.
+
+ * tex-file.c: Add .oft to regcognized suffixes for tex_format.
+
+ * mktexupd: Correct Thomas' email address.
+
+ * mktextfm: Correct Thomas' email address.
+
+ * mktexpk: Correct Thomas' email address.
+
+ * mktexnam.opt: Correct Thomas' email address.
+
+ * mktexnam: Correct Thomas' email address.
+
+ * mktexmf: Correct Thomas' email address.
+
+ * mktexlsr: Correct Thomas' email address.
+
+ * mktexdir.opt: Correct Thomas' email address.
+
+ * mktexdir: Correct Thomas' email address.
+
+ * mktex.opt: Correct Thomas' email address.
+
+ * kpathsea.version: Update to 3.3.9.
+
+ * kpathsea.texi: Update to 3.3.9.
+
+ * configure.in: Update to 3.3.9.
+
+ * common.ac: Correct handling of mktexmft option.
+
+2002-10-16 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-make.c (kpse_make_tex): Move the test for problematic
+ filenames so we only do this when we're actually willing to make a
+ new file.
+
+2002-10-11 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.texi: Update date/version to 3.3.8.
+
+ * NEWS: Update for 3.3.8.
+
+ * configure.in: Version 3.3.8.
+
+ * kpathsea.version: Version 3.3.8.
+
+ * Makefile.in: Remove install rules for mktexfmt, as it is not a
+ separate file.
+
+2002-10-06 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Expand main_memory (again).
+
+ * xstat.c: Remove lstat() declaration.
+
+ * variable.c (kpse_var_value): Check for NAME.progname in the
+ environment before checking for NAME_progname. Both can occur,
+ even on UNIX systems.
+
+ * tex-file.c (init_path): We need to check PATH.progname,
+ PATH_programe, and PATH in the environment. PATH.progname is the
+ "logical" way to set the name on Windows systems, and can even
+ occur on UNIX systems if env(1) is used to set the environment
+ variables.
+
+ * withenable.ac: Add --with-mktexfmt-default option. After
+ Fabrice Popineau. He used --with-mkfmt-default, but this was
+ changed to match the other options.
+
+ * texmf.in: Add XDVIINPUTS, TEXINPUTS.pdfamstex. Modiy definition
+ of TEXMFLOCAL to match Thomas', add MKTEXFMT. All part of the
+ TeXlive merge.
+
+ * tex-make.c (kpse_make_tex): Complain if a number of problematic
+ characters are found in the requested font name -- this works in
+ combination with a check in maketex() to prevent misuse of the
+ system() call that starts the mktex* scripts.
+
+ * tex-file.c (kpse_init_format): Support for mktexfmt, from
+ Fabrice Popineau.
+
+ * mktexupd: Delete CR characters at the end-of-line before doing
+ the compare. Yet another hack for windows/unix cross-platform
+ support.
+
+ * mktextfm: TeXlive merge: support for mf-nowin.
+
+ * mktexpk: TeXlive merge: considerably reorganized to support use
+ of mf-nowin.
+
+ * mktexnam: Additional definitions for the LH fonts. TeXlive
+ merge.
+
+ * mktexmf: Additional definitions for the LH fonts. TeXlive
+ merge.
+
+ * common.ac: Add support for MAKE_TEX_FMT. From Fabrice Popineau.
+
+ * acconfig.h [MAKE_TEX_FMT_BY_DEFAULT] Added. After Fabrice
+ Popineau.
+
+2002-07-16 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpsewhich.c (find_format): Remove special case for pdftex.cfg.
+ Not needed.
+
+ * kpsewhich.c (find_format): Hard-code format types for pdftex.cnf
+ and pdftex.map.
+
+2002-07-08 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktex.opt: Limit permissions on $TEMPDIR.
+
+ * mktexlsr: Limit permissions on tmp directory.
+
+2002-06-04 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Remove setting of src_specials: it will be ignored
+ anyway as we'll only allow it to be set from the command line.
+
+2002-05-28 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexdir: Guard $KPSE_DOT with quotes. From Emmanuel_Thomé
+ <thome@lix.polytechnique.fr>.
+
+2002-04-01 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr: Strip a trailing CR before testing the first line of
+ an ls-R file. Needed for interoperability with Windows (sigh).
+
+ * tex-make.c (maketex): Use a literal "r" in the popen command, as
+ (under UNIX) it tends not to understand "rb", and we're generating
+ text anyway.
+
+2001-11-27 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.texi: Version 3.3.7.
+
+ * configure.in: Version 3.3.7.
+
+2001-11-25 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * types.h: Define boolean as int whenever we can. This makes the
+ option-handling code correct (where pointer to int and pointer to
+ boolean need to be the same type).
+
+ * install.texi: Update totals to (hopefully) more accurate values.
+
+2001-11-19 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * line.c (read_line): Add prototype.
+
+2001-11-18 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.version: Version 3.3.6.
+
+ * kpathsea.texi: Version 3.3.6.
+
+ * configure.in: Version 3.3.6.
+
+ * xgetcwd.c: Changes to keep C++ compilers from choking.
+
+ * xdirname.c: Changes to keep C++ compilers from choking.
+
+ * variable.c: Changes to keep C++ compilers from choking.
+
+ * str-list.c: Changes to keep C++ compilers from choking.
+
+ * readable.c: Add pathsearch.h to included headers, for
+ kpse_normalize_path.
+
+ * pathsearch.c: Changes to keep C++ compilers from choking.
+
+ * path-elt.c: Changes to keep C++ compilers from choking.
+
+ * make-suffix.c: Changes to keep C++ compilers from choking.
+
+ * line.c: Changes to keep C++ compilers from choking.
+
+ * kpsewhich.c: Changes to keep C++ compilers from choking.
+
+ * kdefault.c: Changes to keep C++ compilers from choking.
+
+ * fontmap.c: Changes to keep C++ compilers from choking.
+
+ * fn.h (fn_grow): Second argument is a const_string, not a generic
+ address.
+
+ * fn.c (fn_grow): Second argument is a const_string, not generic
+ address.
+
+ * expand.c: Add a few casts to ensure a C++ compiler wouldn't
+ choke.
+
+ * dir.c (dir_links): Replace a conditional expression with an
+ if-then version.
+
+ * db.c: Add a few casts, rename 'try', all to ensure a C++
+ compiler wouldn't choke.
+
+ * cnf.c: Add a few casts, rename 'try', all to ensure a C++
+ compiler wouldn't choke.
+
+ * c-proto.h: Addtional P*H and P*C macros for functions with up to
+ 17 arguments.
+
+2001-11-14 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * readlink.c (main): Add prototype.
+
+ * kpsewhich.c (main): Add prototype.
+
+ * kpsestat.c (main): Add protype.
+
+ * c-pathch.h [WIN32] (IS_UNC_NAME): An unc name can be //<digit>
+ as well as //<letter>.
+
+ * access.c (main): Prototype.
+
+2001-11-10 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.version: Version 3.3.5.
+
+ * kpathsea.texi: Version, date.
+
+ * configure.in: Version 3.3.5.
+
+ * texmf.in: Additional entries for mex-pl, platex-pl, pdfplatex,
+ pdfmex-pl, pdfemex, pdfemex-pl. As usual, ConTeXt wants more
+ space.
+
+ * mktexnam: First set defaults, then modify for explicit
+ destination, not the reverse. From Thomas.
+
+ * mktex.opt: Preserve return code over trap. From Thomas.
+
+ * kpsewhich.man: Typo.
+
+2001-10-30 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * configure.in: To 3.3.4.
+
+ * kpathsea.version: To 3.3.4.
+
+ * mktexnam.opt: Robustness fix for handling of NAME. Minor
+ changes in the handling of the defaults when a name isn't found in
+ the supplier or typeface maps.
+
+ * tex-file.c: Add ".ch" as alternate suffix for kpse_web_format
+ and kpse_cweb_format.
+
+ * readable.c [main]: Call kpse_normalize_path.
+
+ * progname.c [WIN32]: Update from Fabrice.
+
+ * pathsearch.h [WIN32]: Remove prototype for safe_beg_of_path.
+ Add prototype for kpse_normalize_path.
+
+ * pathsearch.c (path_search) [WIN32]: Remove call to
+ safe_beg_of_path.
+ (path_search): Add call to kpse_normalize_path.
+
+ * expand.c (kpse_path_expand): Don't strip devices and such here,
+ as we're doing that in kpse_element_dirs anyway.
+
+ * elt-dirs.c [WIN32]: Remove safe_beg_of_path.
+ (kpse_normalize_path): Replaces safe_beg_of_path, but is defined on
+ all architectures.
+
+ * dir.c [WIN32]: Remove safe_beg_of_path prototype here.
+
+ * common.ac: Test whether libm exists. If it does, we
+ unconditionally link with it, which is probably wrong.
+
+ * cnf.c [__NetBSD__]: Define unix.
+
+ * c-pathch.h [IS_UNC_NAME]: Define on all architectures.
+
+ * Makefile.in (distdir): Add *.ftp to destination directory.
+
+2001-09-26 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Add support for Web and Cweb files (kpse_web_format,
+ kpse_cweb_format). Requested by Wlodek Bzyl.
+
+ * tex-file.h, tex-file.c: Add support for Web and Cweb files
+ (kpse_web_format, kpse_cweb_format). Requested by Wlodek Bzyl.
+
+2001-07-23 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * common.ac [kb_cv_func_putenv_malloc]: Add declaration for
+ malloc, which testing on IA64 revealed to be missing.
+
+2000-08-25 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr: Changed the fix for NeXT.
+
+2000-08-05 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.texi: Bump version, date.
+
+ * kpathsea.version: Bump version.
+
+ * configure.in: Update for 3.3.3.
+
+ * NEWS: Update for 3.3.3.
+
+ * mktexlsr: On NeXT, 'rm -rf ' will recursively remove the current
+ directory. This is bad if you're in / and are root.
+
+2000-05-25 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * lib.h [MONOCASE_FILENAMES]: Parenthesis was omitted in
+ FILESTRNCASEEQ. Found by Fabrice.
+
+2000-04-26 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * unixtex.texi: Added notes that web2c is bare-bones, and that the
+ texk/texklib packages may contain older components.
+
+2000-04-21 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * progname.c: Add P?C macros to functions that lacked them.
+
+ * lib.h [STREQ,STRNEQ,FILESTRCASEEQ,FILESTRNCASEEQ]: If any
+ argument is NULL, compare unequal.
+
+2000-04-13 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-hush.c (kpse_tex_hush): Check for "all" and "none" first,
+ then look for more specific switches. This fixes the most common
+ case of problems due to non-reentrancy of kpse_path_element.
+
+ * kpathsea.texi: Correct example of brace expansion. Document
+ TEX_HUSH = none. Found by Tijs Michels <M.H.M.Michels@kub.nl>.
+
+ * texmf.in: Document the use of TEX_HUSH = none.
+
+2000-04-03 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Add variable for src_specials. Increase arrays for
+ context (again).
+
+ * xopendir.c [WIN32]: Only define xclosedir.
+
+ * kpsewhich.man: Spelling correction.
+
+ * getopt.h [WIN32]: For definition of __STDC__ to 1.
+
+2000-04-02 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * xopendir.c [WIN32]: Define neither xopendir nor xclosedir. From
+ Han The Thanh <thanh@informatics.muni.cz>.
+
+ * xputenv.c (xputenv): The WIN32 conditional code is also valid
+ for DJGPP. From Fabrice.
+
+ * xmalloc.c (xmalloc): Allocate 1 byte if passed size 0.
+
+ * xdirname.c (xdirname): Changes for Win32 from Fabrice.
+
+ * tex-file.h: Prototype for kpse_set_suffixes. From Fabrice.
+
+ * tex-file.c (kpse_set_suffixes): New function, added by Fabrice.
+
+ * readable.c: Win32-related changes from Fabrice.
+
+ * progname.c [WIN32]: Various changes from Fabrice.
+
+ * pathsearch.h [WIN32]: Declare safe_beg_of_path. From Fabrice.
+
+ * pathsearch.c (path_search [WIN32]): Use safe_beg_of_path. From
+ Fabrice.
+
+ * kpsestat.c: Remove WIN32 define. From Fabrice.
+
+ * hash.c [MONOCASE_FILENAMES]: Change for the WIN32 case from
+ Fabrice.
+
+ * getopt.h [WIN32]: Changes from Fabrice.
+
+ * getopt.c [WIN32 && ! __CYGWIN32__]: Ensure getpid is not defined
+ before defining it. From Fabrice.
+
+ * lib.h: Update dir_links prototype, from Fabrice.
+
+ * elt-dirs.c: Win32 related changes from Fabrice.
+
+ * dir.c: Various Win32-related changes from Fabrice.
+
+ * config.h: Various changes for the DOS famility of systems. From
+ Fabrice.
+
+ * c-stat.h [WIN32]: Use oldnames.h instead of kpathsea/win32lib.h.
+ From Fabrice.
+
+ * c-proto.h [WIN32]: _DLL -> KPSE_DLL, from Fabrice Popineau.
+
+ * c-memstr.h: Move closer to just the ANSI string functions, if
+ necessary defined in terms of the BSD functions. After Thomas
+ Esser <te@informatik.uni-hannover.de>.
+
+ [FOPEN_RBIN_MODE, FOPEN_WBIN_MODE, FOPEN_ABIN_MODE]: Specify
+ binary I/O mode on all systems, not just those where it makes a
+ difference.
+ [VMCMS]: Remove as it isn't used.
+ [SET_BINARY]: Change defines which select it. From Fabrice
+ Popineau. <popineau@esemetz.ese-metz.fr>
+
+ * c-ctype.h [WIN32]: On Windows, get isascii from oldnames.h.
+ After Fabrice Popineau <popineau@esemetz.ese-metz.fr>.
+
+ * access.c: Replace WIN32 code with generic code.
+
+2000-01-31 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr: Fix possible symlink exploit. By Thomas Esser
+ <te@informatik.uni-hannover.de>.
+
+1999-06-28 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktextfm: Get rid of error message if hbf2gf cannot be found.
+ From Thomas.
+
+ * tex-glyph.c: Test whether glyph_file is NULL before
+ dereferencing it. Suggested by Julian Gilbey
+ <J.D.Gilbey@qmw.ac.uk>.
+
+ * texmf.in: Improved comments about VARTEXMF, along lines
+ suggested by Thomas Esser.
+ Increased font_mem_size, as requested by Thomas.
+
+ * pathsearch.c (path_search): Print a message if we're debugging
+ the search and we're not pounding the disk because an ls-R file
+ exists but must_exist=0. This to highlight the most confusing
+ case where disk searches do not happen.
+
+ * mktextfm.man: Cleanup of synopsis.
+
+ * mktex.opt: More robust handling of TEMPDIR, after Luc Van Eycken
+ <Luc.VanEycken@esat.kuleuven.ac.be>.
+
+ * kpsestat.man: Remove comment about unclear message.
+
+ * kpsestat.c (main): Print a more understandable message when the
+ stat call fails.
+
+1999-06-20 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * pathsearch.c (log_search): If TEXMFLOG is defined, then the
+ kpathsea library would write a space to stderr for every file
+ logged. Fix from Charles Karney <karney@pppl.gov>.
+
+1999-05-29 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * configure.in: Update version number to 3.3.1.
+
+ * kpathsea.version: Update version number to 3.3.1.
+
+ * kpathsea.texi: Update version info.
+
+ * mktexnam, mktexmf: Fix the LH patterns to be more specific.
+ From Thomas.
+
+ * unixtex.texi: Remove node on tape distributions.
+
+ * texmf.in: Add platex, add comment about TEXMFDBS.
+
+ * tex-file.c (kpse_find_file): Fix off-by-one in tests for suffix
+ length.
+
+ * pathsearch.c (log_search): Fix problem with debugging output.
+
+ * mktextfm: Order of options to hbf2gf turns out to matter.
+
+ * mktexpk: Updates from Thomas: don't remove generated fonts
+ because of bad pos errors; better handling of type1 fonts.
+
+ * mktexnam: Updates from Thomas for Czech fonts. Consult fontmaps
+ if a fonts fell into unknown/unknown.
+
+ * mktexmf: Updates from Thomas for Czech fonts.
+
+ * mktexdir: Small fix from Julian Gilbey.
+
+ * cnf.c: Apple's MacOsX is also unix-like.
+
+ * access.c: Parametrise the help string as in readlink.c.
+
+ * Makefile.in: Use INSTALL_DATA, not INSTALL_SCRIPT, for the *.opt
+ files.
+
+ * AUTHORS: Update accounts for MakeTeX scripts and expand.c.
+
+ * c-memstr.h: Don't declare strstr if strstr is already a define.
+ Suggested by Paul Vojta <vojta@math.berkeley.edu>.
+
+ * readlink.c: Corrected a bug in the help string (wrong program
+ name), reported by several people.
+
+1999-03-26 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpathsea.version: Set MINOR to 3.
+
+ * configure.in: Bumped KPSEVERSION to 3.3.
+
+1999-03-23 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: More changes from Thomas, add MISCFONTS for
+ kpse_miscfonts_format.
+
+ * tex-file.c: Implement kpse_miscfonts_format.
+
+ * tex-file.h: New format: kpse_miscfonts_format, to be used for
+ small sets of fonts for which no real type has been defined.
+
+ * mktextfm: Add support for hbf fonts. (From Werner Lemberg.)
+
+ * withenable.ac: Remove implementation of some --with-* options.
+
+ * common.ac: Move implementation of some --with-* options here
+ from withenable.ac, so the latter can be included elsewhere with
+ kpathsea's acconfig.h or derivatives being seen.
+
+1999-03-17 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Size increases for context, requested by Hans Hagen.
+
+ * texmf.in: Update from Thomas.
+
+ * Makefile.in: TEXMF_CNF -> VARTEXMF
+
+ * mktexmf: Small fix to a case statement from Berthold Höllmann
+ <bhoel@starship.python.net>.
+
+1999-03-15 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * win32lib.h: Patch from Fabrice.
+
+ * variable.c (kpse_var_value, expand): Handle the VAR_progname
+ construct. After Julian Gilbey <jdg@maths.qmw.ac.uk>.
+
+ * tex-file.c: Fixes to the code that forces an update of the
+ paths. After Julian Gilbey <jdg@maths.qmw.ac.uk>.
+
+ * mktexmf: Changes to support CB font family. From Kimon
+ Kontovasilis <kimon@cyclades.nrcps.ariadne-t.gr>.
+
+ * kpathsea.texi: Update address info of TUG.
+
+ * config.h: Remove outdated comment, explicitly include
+ kpathsea/c-auto.h.
+
+ * cnf.c (do_line): Correct comment, remove unused code.
+ (read_all_cnf): Strip trailing whitespace.
+ (kpse_cnf_get): Fix memory leak.
+ After Julian Gilbey <jdg@maths.qmw.ac.uk>.
+
+ * acconfig.h: We no longer use this for all kpathsea using
+ programs, just kpathsea itself. Thus the WEB2CVERSION macro goes,
+ as does other stuff that belongs to web2c or xdvik.
+
+ * Makefile.in: Allow the c-auto.h file to be installed.
+
+1999-02-18 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktex.opt: Document nomfdrivers option.
+
+ * mktextfm: Implement nomfdrivers option.
+
+ * mktexpk: Implement nomfdrivers option.
+
+ * install.texi: Document new option: nomfdrivers.
+
+ * kpsewhich.man: Document how search parts are determined.
+
+ * mktexlsr: Really skip empty components. From Thomas.
+
+ * tex-file.c (kpse_reset_program_name): Don't free the old paths,
+ they may not have been allocated on the heap.
+
+1999-02-16 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-file.c (kpse_reset_program_name): Ensure that when the
+ program name changes, the various paths will indeed be updated.
+
+1999-02-14 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexupd: Fix test whether argument is a directory name. From
+ Thomas.
+
+ * mktexlsr: Skip empty components.
+
+ * mktexnam.opt: This file is supposed to be sourced, not executed,
+ so remove the #!. From Thomas.
+
+ * mktexdir.opt: This file is supposed to be sourced, not executed,
+ so remove the #!. From Thomas.
+
+ * mktex.opt: This file is supposed to be sourced, not executed, so
+ remove the #!. From Thomas.
+
+ * config.h: Make sure c-auto.h is included before win32lib.h,
+ which needs definitions from the former.
+
+1999-02-06 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * win32lib.h: Add pragma warning, for the S_* defines, only define
+ them if they are not defined already.
+
+ * pathsearch.h (kpse_all_path_search): Add KPSEDLL, from Fabrice.
+
+ * debug.h (fclose): Add KPSEDLL, from Fabrice.
+
+ * config.h [WIN32]: Remove pragma warning. From Fabrice.
+
+1999-02-04 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * withenable.ac: Rename AR_OPTS to ARFLAGS.
+
+ * texmf.in: Cleanup of semicolon/comma. Remove the double slash
+ between 'fonts' and its subdirs. Sites using pseudo-TDS will have
+ to add these by hand from now on.
+
+ * tex-file.c (init_path, add_suffixes): Remove __cdecl, from
+ Fabrice.
+
+ * mktexmf: Special cases for 30 and 36 points, as requested by the
+ sauter mainainer Jeroen Nijhof <J.H.B.Nijhof@aston.ac.uk>.
+
+ * kpsewhich.c (main): Remove __cdecl, from Fabrice.
+
+ * kpsestat.c (main): Remove __cdecl, from Fabrice.
+
+ * install.texi: The +u flag is no longer recommended for HP-UX.
+
+ * getopt.h [!WIN32]: Remove define of __cdecl, from Fabrice.
+
+ * elt-dirs.c (safe_beg_of_path): Change return type to unsigned
+ int, because other functions expect this.
+
+ * concatn.c (concatn): Remove __cdecl, from Fabrice.
+
+ * common.ac: sinclude from ../texk now, from Thomas.
+
+ * c-proto.h [!WIN32]: Removed define of __cdecl, from Fabrice.
+
+ * access.c (main): Removed __cdecl, from Fabrice.
+
+1999-01-27 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * xputenv.c (xputenv) [WIN32]: Don't free old value, ever.
+
+ * win32lib.h: Fixes by Fabrice.
+
+ * win32lib.c: Fixes by Fabrice.
+
+ * version.c (kpathsea_version_string, kpse_bug_address): Add
+ KPSEDLL, by Fabrice.
+
+ * variable.h (kpse_var_value, kpse_var_expand): Add KPSEDLL, by
+ Fabrice.
+
+ * texmf.in: Change path separators back to commas, use semicolon
+ instead of colon, correct TEXINPUTS for the pdfeTeX family,
+ TEXPSHEADERS for the pdfTeX family. By Thomas Esser.
+
+ * tex-make.h (kpse_make_tex_discard_errors): Add KPSEDLL, by
+ Fabrice.
+
+ * tex-make.c (maketex): Add cast to shup up a compiler. From
+ Fabrice.
+
+ * tex-hush.h (kpse_tex_hush): Add KPSEDLL, by Fabrice.
+
+ * tex-glyph.h (kpse_find_glyph, kpse_bitmap_tolerance): Add
+ KPSEDLL, by Fabrice.
+
+ * tex-glyph.c (try_resolution): Add casts to quiet a compiler.
+ From Fabrice.
+
+ * tex-file.h (kpse_fallback_resolutions_string, kpse_format_info,
+ kpse_set_program_enabled, kpse_maketex_option, kpse_init_format,
+ kpse_find_file, kpse_open_file, kpse_reset_program_name): Add
+ KPSEDLL, by Fabrice.
+
+ * tex-file.c (init_path, add_suffixes): Add __cdecl, by Fabrice.
+ (kpse_init_format): Correct definition of "other ... files" to take
+ different path separators into account. After Fabrice.
+
+ * str-list.c (str_list_concat_elements): Make loop indices
+ unsigned to quiet compilers. By Fabrice.
+
+ * readable.h (kpse_readable_file): Add KPSEDLL, by Fabrice.
+
+ * readable.c [WIN32] (kpse_readable_file): Many changes by
+ Fabrice.
+
+ * progname.h (program_invocation_name,
+ program_invocation_short_name, kpse_program_name,
+ kpse_set_program_name, kpse_set_progname): Add KPSEDLL, by
+ Fabrice.
+
+ * progname.c: Remove my_dirname function, which returns in its own
+ file renamed to xdirname. From Fabrice.
+ (kpse_set_program_name) [WIN32]: Close handle. By Fabrice.
+
+ * proginit.h (kpse_init_prog): Add KPSEDLL, by Fabrice.
+
+ * pathsearch.h (kpse_path_element, kpse_element_dirs,
+ kpse_path_search): Add KPSEDLL, by Fabrice.
+
+ * pathsearch.c (path_search): We now strip devices in the caller.
+ From Fabrice.
+
+ * magstep.h (kpse_magstep_fix): Add KPSEDLL, by Fabrice.
+
+ * magstep.c (magstep, kpse_magstep_fix): Casts to quiet an unruly
+ compiler. Added by Fabrice.
+
+ * line.h (read_line): Add KPSEDLL, by Fabrice.
+
+ * lib.h (concat, concat3, xstrdup, uppercasify, atou, same_file_p,
+ xbasename, find_suffix, remove_suffix, make_suffix, make_prefix,
+ extend_filename, xputenv, xputenv_int, xgetcwd,dir_p, dir_links,
+ xfopen, xfclose, xfseek, xftell, xmalloc, xrealloc, xcalloc): Add
+ KPSEDLL, by Fabrice.
+ (xdirname): New function, by Fabrice.
+
+ * kpsewhich.c (read_command_line): Add KPSEDLL to external
+ functions, by Fabrice.
+ (main): Add __cdecl, by Fabrice.
+
+ * kpsestat.c (main): Add __cdecl, by Fabrice.
+
+ * hash.h (hash_table_type, hash_insert, hash_remove, hash_lookup):
+ Add KPSEDLL, by Fabrice.
+
+ * hash.c [WIN32]: Different implementation of TRANSFORM, for speed
+ reasons. From Fabrice.
+
+ * getopt.h: Changes for KPSEDLL, by Fabrice.
+
+ * fn.h (fn_init, fn_copy0, fn_free, fn_1grow, fn_grow,
+ fn_str_grow, fn_shrink_to): Add KPSEDLL, by Fabrice.
+
+ * expand.h (kpse_expand, kpse_brace_expand, kpse_path_expand): Add
+ KPSEDLL, by Fabrice.
+
+ * elt-dirs.c (safe_beg_of_path): New function by Fabrice. Used to
+ strip device from a path before feeding it to expand_elt.
+ (kpse_element_dirs): Call safe_beg_of_path.
+
+ * debug.h (kpathsea_debug, fopen): Add KPSEDLL, by Fabrice.
+
+ * db.h (kpse_db_insert): Add KPSEDLL, by Fabrice.
+
+ * config.h [WIN32]: Add pragma to quiet some warnings. From
+ Fabrice.
+
+ * concatn.h (concatn): Add KPSEDLL. From Fabrice.
+
+ * concatn.c (concatn): Add __cdecl. From Fabrice.
+
+ * cnf.h (kpse_cnf_get): Add KPSEDLL. From Fabrice.
+
+ * c-std.h: Don't include math.h if we're seen be a C++ compiler.
+ From Fabrice.
+
+ * c-proto.h [WIN32]: Instead of defining DllImport, define
+ KPSEDLL. This change makes building shared libraries on windows
+ systems work better. From Fabrice.
+
+ * c-pathch.h [WIN32]: IS_UNC_NAME macro added by Fabrice.
+
+ * access.c (main): Add __cdecl, from Fabrice.
+
+ * absolute.h (kpse_absolute_p): Add KPSEDLL, from Fabrice.
+
+ * Makefile.in: Account for the addition of xdirname.c.
+
+1999-01-24 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Add support for pdfeTeX.
+
+ * mktexpk: Correct typo: ps_topk -> ps_to_pk.
+
+ * mktexnam: New version from Thomas.
+
+ * mktexmf: Update for cs* fonts from Thomas.
+
+ * kpathsea.texi: Update section on brace expansion. Decided to
+ keep the comma.
+
+ * db.c (kpse_db_insert): Replace basename with xbasename.
+
+1999-01-19 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpsestat.c (main): Replace use of S_IFMT with an octal literal.
+
+1999-01-14 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Remove open_any, add openout_any, openin_any.
+
+ * str-list.h: Add prototype for str_list_concat_elements.
+
+1999-01-10 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktextfm: Implement --foo=bar style options. From Thomas.
+
+ * mktexpk: Implement --foo=bar options, by Thomas. Changes for
+ new version of gsftopk. Changes to handle ttf2pk. From Thomas.
+
+ * xt.ac: Remove AC_PATH_XTRA here.
+
+ * withenable.ac: Changes to aid cross-compiling. Minor fixes.
+
+ * unixtex.texi: Correct tug email address. Minor corrections.
+
+ * texmf.in: Minor changes, additions for context. From Thomas.
+
+ * tex-file.h: Use size in declaration of kpse_format_info. From
+ Fabrice.
+
+ * tex-file.c (kpse_maketex_option): Initialise fmt on entry. Test
+ whether a fmt had been specified.
+ (kpse_init_format): Put $TEXMF into the 'other files' formats, from
+ Thomas.
+
+ * str-list.c (str_list_concat_elements): New function, part of
+ replacement for bash-derived code.
+
+ * progname.c (my_subdir): New implementation from Fabrice.
+
+ * mktexnam: Account for new release of lh fonts. Don't do subdirs
+ if we're using $KPSE_DOT as the destination directory.
+
+ * mktexupd: Handle empty elements gracefully.
+
+ * mktexmf: Account for new release of lh fonts.
+
+ * mktexlsr: Minor fixes from Thomas.
+
+ * mktexdir: Allow for creating more directories, fixes from
+ Thomas.
+
+ * mktex.opt: Add defaults for DPI and MAG.
+
+ * kpsewhich.man: Various minor corrections.
+
+ * kpsewhich.c: Begin implementing -all option. (incomplete)
+
+ * kpathsea.texi: Correct copyright, tug email address.
+
+ * install.texi: Account for new texklib.tar.gz file. Several
+ minor corrections.
+
+ * expand.c: Remove bash-derived code.
+
+ * elt-dirs.c (do_subdir): Correct code to test whether we descend
+ into subdirectories.
+
+ * db.c: Add kpathsea/c-stat.h to includes.
+ (db_build): Correct test of '0' to 0.
+
+ * common.ac: Check for more functions in AC_CHECK_FUNCS, from
+ Thomas.
+
+ * cnf.c: do_line: Remove premature optimization.
+
+ * c-proto.h: Add P8H, P8C, P9H, P9C.
+
+ * c-memstr.h: Revision by Thomas Esser.
+
+ * c-ctype.h: Add ISBLANK macro.
+
+ * acconfig.h: Add define guard for c-auto.h.
+
+ * Makefile.in: Change ../make/*.make to ../make/*.mk.
+ Correct texmf.sed.
+ Prevent substitution of $(texmf) in texmf.cnf in some
+ cases.
+ Replace semicolons with colons in paths.h.
+
+1998-09-15 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr: Trap more signals, make script hold up better under
+ 'sh -e', from Werner Fink <werner@suse.de>.
+
+ * mktex.opt: Trap more signals, suggested by several people,
+ particularly Thomas Gellekum.
+
+1998-08-03 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * progname.c (selfdir): Interpret empty PATH element as "."
+
+1998-07-26 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-glyph.c (kpse_find_glyph): Memory management problem: we
+ were deallocating a string prematurely.
+ (try_fontmap): Test !ret before, not after, bumping the loop variable.
+ Both reported by Werner Lemberg <a7971428@unet.univie.ac.at>.
+
+Sun Jun 21 14:43:44 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr: Test for the presence of the magic string in ls-R, to
+ prevent accidentally overwriting ls-R files that are not ours.
+ Change the code to ensure ./ in front of directory names in the
+ presence of different output from different versions of ls.
+
+Mon May 4 19:42:44 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in (objects): Add xbasename.lo.
+
+ * Rename basename.c to xbasename.c.
+
+ * tilde.c (kpse_tilde_epxand): Handle a bare ~ gracefully.
+
+ * basename.c: Rename basename to xbasename and make its
+ compilation unconditional.
+
+ * common.ac: Remove check for basename.
+
+ * acconfig.h: Remove HAVE_BASENAME.
+
+ * lib.h: Remove conditional declaration of basename, add
+ unconditional declaration of xbasename.
+
+ * progname.c (kpse_set_program_name): Replace call of basename
+ with xbasename.
+
+Fri Apr 24 21:15:15 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * install.texi: Doc fix; mention the library files for etex,
+ pdftex, omega.
+
+ * pathsearch.c (kpse_path_search): Fix memory leak found by "John
+ W. Eaton" <jwe@bevo.che.wisc.edu>.
+
+Tue Apr 7 19:46:07 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * kpsewhich.c (find_format): Correct an off-by-one error by using
+ the found value instead of a faulty comparison.
+
+Mon Mar 16 19:25:15 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * configure.in (KPSEVERSION): version 3.2.
+
+ * mktex.opt: Set MT_MKTEXNAM_OPT, MT_MKTEXDIR_OPT here.
+
+ * mktexnam: Move setting of MT_MKTEXNAM_OPT to mktex.opt.
+
+Sun Mar 15 19:55:30 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * c-proto.h: Add P7H and P7C macros.
+
+Sat Mar 14 00:10:20 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * win32lib.h: Patch from Fabrice.
+
+ * c-dir.h [WIN32]: Patch from Fabrice.
+
+Fri Mar 13 23:23:33 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Added XDVIINPUTS and TEX4HTINPUTS.
+
+Thu Mar 12 08:04:50 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * win32lib.c: New version from Fabrice Popineau.
+
+Wed Mar 11 19:55:10 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * install.texi: Correction for description of dosnames behaviour
+ on MS-DOS. From Eli Zaretskii.
+
+Mon Mar 9 07:22:23 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexlsr: exit 0 if we succeeded.
+
+ * withenable.ac: Remove double slashes from texmfmain variable.
+ Strictly speaking, it is a user fault when this occurs, but...
+ From Thomas Esser.
+
+Sun Mar 8 18:23:33 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-file.c: omkocp, omkofm -> mkocp, mkofm.
+
+ * texmf.in: OMKOFM, OMKOCP -> MKOFM, MKOCP.
+
+ * withenable.ac: omkofm, omkocp -> mkofm, mkocp.
+
+Thu Mar 5 15:32:48 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * texmf.in: Add OMKOCP and OMKOFM analogous to MKTEXPK.
+
+ * c-fopen.h [DOS]: Don't open files read-write if read suffices.
+
+Wed Mar 4 23:55:35 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * withenable.ac: Add options for enabling/disabling
+ omkocp/omkofm. From John Plaice.
+
+ * tex-file.c (init_format): Support omkocp and omkofm instead of
+ MakeOmegaOCP and MakeOmegaOFM programs. From John Plaice.
+ (kpse_maketex_option): Some changes to handle ofm/ocp as well.
+
+Tue Mar 3 09:02:09 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * tex-make.c (kpse_make_tex): Make same exception for AMIGA as for
+ WIN32 and MSDOS. From Andreas Scherer.
+
+ * PROJECTS: Update mail address.
+
+ * mktex.opt: Print message if VARTEXMF is not defined, then
+ default to '$KPSE_DOT'.
+
+ * mktexnam: Remove use of "shell !" from tests involving varfonts
+ feature. Simplify the code a bit.
+
+Fri Feb 27 19:55:11 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * withenable.ac: Replace use of -a in test with && and second
+ test. From Thomas Esser <te@informatik.uni-hannover.de>.
+
+Tue Feb 24 13:16:56 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in: Corrections for building/installing outside source
+ dir. From Vladimir Volovich <vvv@vvv.vsu.ru>.
+
+ * mktexnam.opt: Correction MT_PKNAME -> MT_PKBASE to get dosnames
+ feature to work. From Eli Zaretskii.
+
+Mon Feb 23 10:17:22 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktex.opt, mktexlsr: Use test ... || test ... instead of test
+ ... -o ... .
+
+ * mktexnam.opt: Remove use of MT_PKPART, MT_MFPART, and MT_TFMPART
+ variables, since they're no longer defined.
+
+ * expand.c (kpse_expand_kpse_dot [MSDOS]): A very ugly hack to
+ deal with a very broken feature on some MSDOS systems. After Eli
+ Zaretskii.
+
+Fri Feb 20 17:18:19 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * Makefile.in (texmf.sed): Remove VARTEXMF.
+
+ * install.texi: Update for changes to varfonts.
+
+ * kpathsea.texi: Remove references to format numbers.
+
+ * kpsewhich.c (read_command_line): Remove printing of and support
+ for format numbers.
+
+ * mktex.opt: Remove VARTEXMF and related stuff, set dosnames for
+ DOS.
+
+ * mktexnam: Remove use of VARTEXMF, introduce SYSTEXMF, change
+ semantics of varfonts.
+
+ * mktexnam.opt: Remove reference to VARTEXMF, move setting of
+ dosnames for DOS to mktex.opt.
+
+ * mktexpk: Boilerplate tests.
+
+ * mktexupd: Boilerplate tests.
+
+ * progname.c: Move kpse_reset_program_name to tex-file.c. This
+ move means progname.o doesn't use a common object from tex-file.o
+ anymore. The NeXT linker would omit tex-file.o, then complain
+ about an undefined symbol. Thanks to Gregor Hoffleit
+ <flight@thefly.mathi.uni-heidelberg.de> and Melissa O'Neill
+ <oneill@cs.sfu.ca> for their help solving this.
+
+ * progname.h: Move kpse_reset_progname to tex-file.h.
+
+ * tex-file.c: Move kpse_reset_program_name here from progname.c.
+
+ * tex-file.h: Move kpse_reset_program_name here from progname.h.
+
+ * texmf.in: Remove VARTEXMF, add SYSTEXMF.
+
+ * withenable.ac: Boilerplating, a correction of the default case
+ of the --enable-multiplatform test.
+
+Mon Feb 16 09:46:47 1998 Olaf Weber <olaf@infovore.xs4all.nl>
+
+ * mktexpk: Dropped a $ in the wrong place, which made chmod look
+ for a non-existent file.
+
+ * Makefile.in (texmf.sed): Include the substitution for @web2c@ in
+ TEXMFCNF.
+
+ * Makefile.in (texmf.sed): Remove traling / from VARTEXMF
+ substitution.
+ (stamp-paths): Replace @ with % as sed delimiter. The @ causes
+ problems because it used in afs filenames. Spotted by Matthias
+ Clasen.
+
+ * bugs.texi: Since the NeXT(step) problem is likely to be solved
+ now, make description of bug less definite.
+
+ * common.ac: Remove check for readlink.
+
+ * kpathsea.texi: Document changes to search algorithm.
+
+ * mktexlsr: Use % not @ as sed delimiter.
+
+ * mktexmf: Correct permissions problem.
+
+ * mktexnam: Use % not @ as sed delimiter.
+
+ * mktexpk: Use % not @ as sed delimiter. Correct permissions
+ problem. Set permissions before the file is moved into place.
+
+ * mktextfm: Use % not @ as sed delimiter. Correct permissions
+ problem. Set permissions before the file is moved into place.
+
+ * mktexupd: Use % not @ as delimiter for sed.
+
+ * readlink.c (main): Use S_ISLNK instead of HAVE_READLINK to test
+ whether readlink is a known function.
+
+ * tex-file.c (kpse_init_format): Make changes corresponding to the
+ movement of kpse_tfm_format.
+ (kpse_find_file): Reorganize searches; fold code of search #3 into
+ #1 and #2; fold #5 into #2. We now have two searches, plus an
+ attempt to create missing files.
+
+ * tex-file.h: Move kpse_tfm_format before kpse_ofm_format. Might
+ as well put it near the front then, because it is an often-used
+ format.
+
+ * texmf.in: VARTEXFONTS uses @vartexfonts@ so it can be filled in
+ from the Makefile. OFMFONTS changed to explicitly use TFMFONTS.
+ TEXMCNF uses @web2c@ rather than @web2cdir@.
+
+ * withenable.ac: Do not force default for --enable-multiplatform,
+ so that we can inherit one from a script that calls us.
+
+Tue Feb 10 17:59:26 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * withenable.ac: Don't abort configure run if the main texmf tree
+ isn't found.
+
+ * acconfig.h: Add EPSFWIN to the undefs.
+
+ * install.texi: Update section on the handling of options by
+ mktexpk.
+
+ * mktex.opt: Comment on the duplication of the ls_R_magic string.
+
+ * mktexlsr: Copy code from mktex.opt to mktexlsr, so the latter
+ can run without the need to find the former.
+
+ * mktextfm, mktexpk: Replace positional options with normal option
+ handling.
+
+ * mktextfm.man, mktexpk.man: Update documentation for the new
+ option handling.
+
+ * tex-file.c: Update the MKTEXPK_ARGS string for the new
+ option-handling of mktexpk.
+
+ * tex-make.c (kpse_make_tex): We pass the raw / to mktexpk in the
+ --mfmode switch when appropriate; remove unset_mode variable.
+ Update comments to reflect new situation.
+
+ * kpathsea.texi: Note that empty path components are now ignored
+ in stead of expanded to cwd.
+
+ * line.c: Add prototype and clean up headers.
+
+ * mktex.opt, mktexlsr, mktexmf, mktexnam, mktexpk, mktextfm,
+ mktexdir, mktexupd: Make "caching" of some variables and file
+ names in the environment possible. Provide defaults in case the
+ 'web2c files' format doesn't work for finding files. Suggested by
+ Thomas Esser.
+
+ * withenable.ac: Give a better message when the main texmf tree
+ isn't found.
+
+Sat Feb 7 01:00:49 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * elt-dirs.c (kpse_element_dirs): Return NULL, not the cwd, if
+ we're given an empty string.
+
+ * mktex.opt: Determine VARTEXFONTS here.
+
+ * mktexnam: Move determination of VARTEXFONTS to mktex.opt.
+
+Fri Feb 6 17:59:59 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * config.h: Update definition of KPATHSEA to 32.
+
+ * expand.c (kpse_path_expand): Do not recursively expand a leading
+ //, as in pathsearch.c.
+
+ * kpsewhich.man: Update for --epxand-braces option.
+
+ * texmf.in: Put texmf.local before texmf in the TEXMFCNF path.
+
+ * withenable.ac: Make code for finding texmfmain more robust.
+
+Wed Feb 4 20:39:10 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * readable.c: Correct typo: '#elsif' -> '#elif'.
+
+Tue Feb 3 17:08:34 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * kpathsea.texi: Update for changes to kpsewhich.
+
+Mon Feb 2 21:12:06 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * xputenv.c: Undid last patch from Fabrice -- it was a "fix" that
+ suppresses warnings on his compiler, and engenders them on mine.
+
+Sun Feb 1 16:08:49 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * lib.h [!DOSISH]: Correct definition of FILESTRNCASEEQ.
+
+ * mktexmf: Correct call to mktexnam.
+
+ * kpsewhich.c: New option --expand-braces.
+ (expand_path): Removed.
+ (main): Add code for --expand-braces, account for new definition of
+ kpse_path_expand.
+
+ * expand.h: Rename kpse_path_expand to kpse_brace_expand. Add new
+ kpse_path_expand.
+
+ * expand.c (kpse_path_expand): New implementation, based on
+ path_expand from kpsesewhich.c.
+ (kpse_brace_expand): The old kpse_path_expand. Change calls to
+ kpse_brace_expand to kpse_brace_expand_element.
+ (kpse_brace_expand_element): The old kpse_brace_expand, but with
+ static linkage. Changes calls to kpse_brace_expand to
+ kpse_brace_expand_element.
+
+ * tex-file.c (init_path): Replace kpse_path_expand with
+ kpse_brace_expand.
+
+ * texmf.in: Correct input variables for mltex variants. Add pdftex
+ to TEXPSHEADERS path.
+
+Thu Jan 29 16:15:44 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * Makefile.in: Update for readlink.
+
+ * common.ac: Test for readlink function.
+
+ * access.c, kpsestat.c: No need to explicitly include c-auto.h.
+
+ * mktex.opt: Adapt to new way of finding the script. Do the
+ actual lookup for mktexnam, mktexdir, and mktexupd here. Make a
+ bit more robust.
+
+ * mktexlsr: Make file handling more robust, use kpsewhich to find
+ supporting scripts like mktex.opt and mktexnam, use readlink to
+ trace symlinks.
+
+ * mktexupd, mktexpk, mktextfm, mktexmf, mktexdir, mktexnam: Make
+ file handling more robust, use kpsewhich to find supporting
+ scripts like mktex.opt and mktexnam, simplify somewhat.
+
+ * mktexnam.opt: Make handling of names more robust.
+
+ * readlink.c, readlink.man: New files.
+
+ * withenable.ac: Add --enable-multiplatform option. Attempt to
+ find the texmf directory, and complain if we fail to do so.
+
+ * Makefile.in (texmf.sed): Remove sed for dbtex, dbfonts, change
+ VARTEXFONTS to comply with texmf.in, and update comment.
+
+ * c-vararg.h: Comment update from Peter Breitenlohner.
+
+Wed Jan 28 20:36:56 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * Makefile.in: Keep c-auto.h out of kpathsea.h.
+
+ * c-stat.h [WIN32]: Modification from Fabrice.
+
+ * dir.c [WIN32]: Extensive modifications from Fabrice.
+
+ * kpsestat.c, kpsewhich.c: Replace exit with return from main.
+ From Fabrice.
+
+ * readable.c [WIN32]: Separate definition of READABLE. From
+ Fabrice Popineau.
+
+ * texmf.in: Remove almost all @var@ stuff, and just assume TDS for
+ all.
+
+ * win32lib.h: Modifications from Fabrice.
+
+ * xputenv.c (xputenv): Minor fix from Fabrice.
+
+ * win32lib.c: New file from Fabrice Popineau. Replacement
+ functions for Win32.
+
+Sun Jan 25 20:02:21 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.in: Increase buf_size to 50000 (from 10000).
+
+ * tex-file.c (kpse_find_file): In the first search, postpone
+ pounding the disk until all possible suffixes have been tried.
+
+ * line.c (read_line): Accept any of NL, CR, and CRLF as
+ end-of-line.
+
+Fri Jan 23 14:45:19 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * access.c: Use return instead of exit to get rid of some compiler
+ warnings. From Fabrice.
+
+ * c-fopen.h: Changes for CYGWIN32.
+
+ * c-proto.h: Patch from Fabrice Popineau for Win32.
+
+ * kpathsea.texi: Document kpse_web2c_format,
+ kpse_program_text_format, kpse_program_binary_format.
+
+ * mktex.opt, mktexdir, mktexlsr, mktexmf, mktexnam, mktexpk,
+ mktextfm, mktexupd: Use -expand-path instead of -expand-var where
+ possible. This makes the handling of !! more robust.
+
+ * tex-file.c (kpse_find_file): Handle other cases than precisely
+ one extension in search number 3.
+ (kpse_init_format): Add kpse_web2c_format, kpse_program_text_format,
+ kpse_program_binary_format.
+
+ * tex-file.h: Add kpse_web2c_format, kpse_program_text_format,
+ kpse_program_binary_format.
+
+ * tex-hush.c: Test the "path element" h, not the whole hush.
+
+ * texmf.in: Add a definition for WEB2C. Add some Omega-related
+ parameters, from John Plaice.
+
+Tue Jan 13 19:46:58 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * mktexpk, mktextfm: Only move $NAME.log file if it exists and is
+ not empty.
+
+Mon Jan 12 06:22:59 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * kpathsea.texi: Fixes from Gerd Neugebauer <gerd@uni-koblenz.de>.
+
+Sun Jan 11 18:26:56 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * mktexupd: Two changes: absence of the current tree in the ls-R
+ path is not an error; create an ls-R file if the current tree is
+ in the ls-R path and the file doesn't yet exist.
+
+Sat Jan 10 09:55:47 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * tex-hush.c: A null pointer could be fed to strcmp.
+
+Fri Jan 9 21:08:45 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * mktexnam: Add $COMSPEC test, and use $SEP for path separator when
+ splitting paths. From Eli Zaretskii.
+
+ * mktexlsr: Correct usage for determining absolute paths. From
+ Eli Zaretskii.
+
+ * common.ac: Correct code in HAVE_PROTOTYPES test.
+
+Sun Jan 4 15:59:08 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * Manual pages for access, kpsestat, kpsewhich, mktexlsr, mktexpk,
+ mktexmf, mktextfm.
+
+ * Makefile.in: Changes for manual pages.
+
+Thu Jan 1 10:11:49 1998 Olaf Weber <infovore@xs4all.nl>
+
+ * mktex.opt: Remove definition of $SEP; it is now needed before
+ this script is sourced.
+
+ * mktexlsr: If necessary, add location of script to PATH.
+
+ * mktexupd: Put $SEP definition in script itself.
+
+ * xputenv.c (xputenv): Move some declarations into the "not
+ SMART_PUTENV" block to prevent "unused" warnings.
+
+Tue Dec 30 17:55:45 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * install.texi, bugs.texi: Add comment about the need to use
+ special compiler options in HP-UX.
+
+ * mktexpk: Use nonstopmode for mf, in case of failure move log
+ file to working directory.
+
+ * mktextfm: Use nonstopmode for mf, in case of failure move log
+ files to working directory.
+
+ * mktexlsr: Add comment about use in cron scripts, use SEP
+ variable for path separator.
+
+ * mktexupd: Check for both new and old magic string in ls-R files,
+ use SEP variable for path separator.
+
+ * mktex.opt: Pick the correct path separator for MS-DOS and UNIX.
+ Add a more appropriate magic string for ls-R files, but keep the
+ old one around for compatibility.
+
+ * Makefile.in (install-exec): Add check for original mktexlsr.
+
+Thu Dec 18 20:33:56 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * tex-file.c (init_path): Rewrite test whether we're initializing
+ the kpse_cnf_format paths.
+
+ * tex-file.c (kpse_init_format): Initialise the binmode fields.
+ (kpse_open_file): Use binmode field.
+
+ * tex-file.h: Add binmode field to kpse_format_info_type.
+
+ * kpsewhich.c: Correct option string.
+
+ * tex-file.c (kpse_open_file): Assume kpse_truetype_format and
+ kpse_type42_format are for binary files.
+
+Tue Dec 16 19:13:14 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.in: Don't make PKFONTS.xdvi a special case. Let all
+ programs look in modeless. If a program shouldn't look there,
+ give it a special PKFONTS line.
+
+Mon Dec 15 18:58:01 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.in: Add TTFONTS and T42FONTS.
+
+ * Makefile.in (stamp-paths): The regular expression for variables
+ had to be amended for T42FONTS.
+
+ * tex-file.c (kpse_init_format): Add kpse_truetype_format and
+ kpse_type42_format.
+
+ * tex-file.h: Add kpse_truetype_format and kpse_type42_format to
+ kpse_file_format_type.
+
+Sat Dec 13 11:24:23 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * xputenv.c (xputenv [WIN32]): This system deletes an environment
+ variable if it is set to "", with consequences for the code that
+ reclaims the space. From Fabrice Popineau.
+
+Fri Dec 12 10:44:02 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * acconfig.h: Add HAVE_PROTOTYPES.
+
+ * c-proto.h, c-vararg.h: Test for HAVE_PROTOTYPES.
+
+ * common.ac: Add explicit test for prototypes, instead of relying
+ on __STDC__.
+
+ * hash.c, hash.h (hash_remove): New function.
+
+ * install.texi: Rewritten passage on font destinations, corrected
+ reference to Triptrap node in web2c.
+
+ * mktexpk, mktextfm: When mv fails, try cp. Matters on MS-DOS.
+
+ * progname.c (selfdir): Test whether we are a directory, rather
+ than whether we are not a link or file.
+
+ * texmf.in: Change openout_any to paranoid.
+
+Tue Dec 9 19:08:04 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * mktexpk: Restored test-and-move, which turns out not to be a
+ no-op for fonts generated with gsftopk.
+
+Thu Dec 4 12:53:52 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.in: Add TEXINPUTS.mltex and TEXINPUTS.mllatex.
+
+Tue Dec 2 12:58:04 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * Makefile.in (distclean): Add stamp-paths. From Sebastian Rahtz
+ <s.rahtz@elsevier.co.uk>.
+
+ * progname.c (kpse_set_program_name [!HAVE_PROGRAM_INVOCATION_NAME
+ && !WIN32 && !__DJGPP__]): Remember to set
+ program_invocation_name.
+
+ * getopt.c: A few changes for WIN32. From Fabrice Popineau.
+
+Mon Dec 1 19:08:07 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * kpathsea.texi: Updated for absence of alternate TeX suffixes.
+
+ * kpsewhich.c: Don't complain about unkown suffixes: it's all
+ kpse_tex_format to us.
+
+ * tex-file.c: Remove the interminable list of alternate TeX
+ suffixes.
+
+ * Makefile.in ($(library).h): Take win32lib.h into account: it
+ should not be included by this file, as config.h will do so if
+ needed.
+
+ * progname.c (kpse_set_program_name [WIN32, __DJGPP__]): Changes
+ from Fabrice Popineau.
+
+ * win32lib.h: New file. From Fabrice Popineau.
+
+ * config.h: Include <kpathsea/win32lib.h> instead of
+ "../win32/win32-compat.h". From Fabrice Popineau.
+
+ * access.c: Include <kpathsea/config.h>. From Fabrice Popineau.
+
+ * absolute.c (kpse_absolute_p [WIN32]): Filenames starting with \\
+ are absolute on this platform. From Fabrice Popineau.
+
+ * tex-glyph.c (try_format): Oops, kpse_format_info[format].suffix
+ is now a list of strings.
+
+Sun Nov 30 13:23:54 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.in, mktex.opt, mktexdir, mktexdir.opt, mktexlsr, mktexmf,
+ mktexnam, mktexnam.opt, mktexpk, mktextfm, mktexupd: Add a
+ MKTEXSCRIPT variable, which is the directory where supporting
+ scripts are found. Defaults to $TEXMFMAIN/web2c if not defined.
+
+ * Makefile.in, bugs.texi, db.h, install.texi, kpathsea.texi,
+ kpsewhich.c, proginit.c, tex-file.c, tex-file.h, tex-glyph.c,
+ tex-make.c, tex-make.h, texmf.in, withenable.ac, mktex.opt,
+ mktexdir, mktexdir.opt, mktexlsr, mktexmf, mktexnam, mktexnam.opt,
+ mktexpk, mktextfm, mktexupd: Changes for the great renaming...
+
+Sat Nov 29 13:10:42 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * The great renaming of the MakeTeX* scripts.
+ MakeTeXPK -> mktexpk
+ MakeTeXTFM -> mktextfm
+ MakeTeXMF -> mktexmf
+ MakeTeXls-R -> mktexlsr
+
+ MakeTeX.site -> mktex.cnf
+ MakeTeXcommon -> mktex.opt
+ MakeTeXmkdir -> mktexdir
+ MakeTeXmkdir.opt -> mktexdir.opt
+ MakeTeXnames -> mktexnam
+ MakeTeXnames.opt -> mktexnam.opt
+ MakeTeXupdate -> mktexupd
+
+ * Makefile.in (install-exec): Adapted for removal MakeTeX.cnf.
+
+ * MakeTeX.cnf: Removed.
+
+ * MakeTeXcommon: Fold MakeTeX.cnf into MakeTeXcommon.
+
+ * tex-file.c (kpse_init_format): Add kpse_fmt_format add ".efmt"
+ and ".efm" to additional suffixes.
+
+ * db.c [DB_HASH_SIZE]: From 7603 increased to 15991.
+
+ * tex-file.c: Yet more suffixes for kpse_tex_format.
+
+Tue Nov 25 18:19:17 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * progname.c (kpse_set_program_name): Ensure that
+ kpse_program_name doesn't get an .exe suffix. The
+ program_invocation*name variables retain it.
+
+Mon Nov 24 22:03:12 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * MakeTeXls-R: When creating the ls-R file from scratch, derive
+ its permissions from the $db_dir, not from the current dir.
+
+Sun Nov 23 13:17:16 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.in: Update to use : instead of , in braces.
+
+ * kpathsea.texi: Document use of path separator in brace
+ expansion, note that the comma is deprecated.
+
+ * path-elt.c (element): Dont split within braces.
+
+ * expand.c (expand_amble): Break text in pieces at ENV_SEP as well
+ as commas.
+
+Sat Nov 22 19:35:30 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * tex-file.c: Correction of description "PostScript header/font"
+ to "PostScript header".
+
+ * db.c (kpse_db_insert): Add cast for const correctness.
+
+ * kpathsea.texi: Document kpse_set_program_name; updates.
+
+ * kpsewhich.c: Many changes to support multiple standard suffixes.
+
+ * progname.c (kpse_set_program_name): Add a few casts for const
+ correctness.
+
+ * tex-file.c: Many changes to support lists of standard suffixes.
+
+ * tex-file.h: kpse_format_info_type: change type of suffix from
+ const_string to const_string*.
+
+Fri Nov 21 15:17:35 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * c-proto.h: Restored AA macro, needed by revised web2c.
+
+Thu Nov 20 14:23:33 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * MakeTeXPK: Removed a test-and-move that is always a no-op.
+
+ * MakeTeXnames: A shell on FreeBSD didn't like the ${foo:=`bar`}
+ construct.
+
+Wed Nov 19 17:24:08 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * MakeTeXls-R, MakeTeXMF, MakeTeXPK: Make temporary names fit into
+ the 8.3 pattern. After Eli Zaretskii.
+
+ * MakeTeXTFM: Make temporary names fit into the 8.3 pattern.
+ Allow a second optional argument. Update usage message. After
+ Eli Zaretskii.
+
+ * MakeTeXcommon: Make temporary names fit into the 8.3 pattern.
+ Do a 'cd /' before we cd to $KPSE_DOT, for MS-DOS' sake. After
+ Eli Zaretskii.
+
+ * MakeTeXnames: If $DEST starts with "letter-colon-slash", it
+ still indicates an absolute path. After Eli Zaretskii.
+
+ * MakeTeXnames.opt: Enable dosnames if we find COMSPEC set in the
+ environment. This is apparently the canonical test for this kind
+ of thing. After Eli Zaretskii.
+
+ * Makefile.in: Numerous small changes to make building on MS-DOS
+ easier. In particular to the rule for texmf.sed.
+
+ * install.texi: Add table headers. After Eli Zaretskii.
+
+ * tex-file.c (kpse_open_file): Open kpse_tex_ps_header_format and
+ kpse_pict_format files in binary mode. After Eli Zaretskii.
+
+Tue Nov 18 11:50:35 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * install.texi, README, Makefile.in: Changed the name of CONFIGURE
+ to README.CONFIGURE.
+
+ * Makefile.in (mostlyclean): delete klibtool.version.
+
+Sat Nov 15 21:13:46 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * MakeTeXPK: Use quotes to ensure that test "$mf_bdpi" != $BDPI
+ has a first argument. This occurs only in pathological
+ circumstances, but is nevertheless annoying.
+
+ * texmf.in: Add TEXINPUTS.foo for omega and lambda.
+
+Fri Nov 14 16:35:46 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.in: Add TEXINPUTS.foo definitions for e-TeX and PDFTeX.
+
+ * tex-file.h: Add kpse_find_ofm and kpse_find_ovf macros.
+
+ * tex-file.c (kpse_find_file): Add a search for Omega.
+
+Thu Nov 13 22:43:06 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * progname.c (expand_symlinks): Don't call fclose on a NULL
+ pointer. After Gary Jennejohn <garyj@peedub.muc.de>.
+
+Wed Nov 12 16:20:02 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * kpsewhich.c: Use kpse_set_program_name instead of
+ kpse_set_progname.
+
+ * tex-file.c, cnf.c: Use kpse_program_name instead of
+ program_invocation_short_name.
+
+ * progname.h (kpse_set_program_name, kpse_reset_program_name): New
+ functions.
+ (kpse_program_name): New global.
+
+ * progname.c (kpse_set_program_name): New function, to replace
+ kpse_set_progname. This fixes the problem the we may want to
+ pretend to be a different program, but need the name by which we
+ were called because that is the one for an executable is
+ guaranteed to exist. The pretend-name is stored in
+ kpse_program_name.
+ (kpse_reset_program_name): To reset kpse_program_name to a
+ different value. It makes a half-hearted attempt to clear the
+ search path information, so that the new name is used there as
+ well.
+
+Mon Nov 10 13:14:01 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * configure.in (KPSEVERSION): version 3.1.
+
+Thu Nov 6 20:25:49 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.in: Corrected comment on size of max_print_line: it must
+ at least be 60.
+
+Tue Nov 4 19:08:37 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * Makefile.in (install-data): Handle a split kpathsea.info.
+
+ * common.ac: Add a test to ensure that autoconf 2.12.1 -- the one
+ with our own hacks -- is used.
+
+Wed Oct 29 11:49:46 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * c-fopen.h [!DOSISH]: Guard against redefining O_BINARY. From
+ Andreas Scherer <andreas.scherer@pobox.com>.
+
+Mon Oct 27 17:25:19 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * install.texi: Update for new MakeTeX* scripts.
+
+ * MakeTeXnames: Handling of empty namepart.
+
+Fri Oct 24 14:23:58 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * getopt.[hc]: Changes for WIN32, which are likely to be a pain if
+ these files are ever updated wholesale. After Fabrice Popineau.
+
+Thu Oct 23 11:16:26 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * MakeTeXnames: Corrected bug in assignemnt to stdfontpath.
+
+Wed Oct 22 17:36:57 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * MakeTeXmkdir: Added a bit of boilerplate to the use of
+ MT_APPEND_MASK.
+
+ * Makefile.in: It's acconfig.h, not c-auto.h, that we do not want
+ to install.
+
+ * lib.h: Remove kpathsea/config.h from the includes. Note that
+ lib.h is itself included by config.h.
+
+ * Makefile.in: Change generation of kpathsea.h to put config.h
+ first.
+
+Tue Oct 21 23:15:28 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * MakeTeX.site, MakeTeX.cnf: Remove MT_FILE_PERMS, MT_DIR_PERMS.
+
+ * MakeTeXmkdir: Use kpsestat to obtain suitable directory
+ permissions.
+
+ * MakeTeXnames, MakeTeXnames.opt: Include code that infers
+ destination directories from where the sources are found. Make
+ use of fontmaps an option, move that part of the code to
+ MakeTeXnames.opt.
+
+ * MakeTeXls-R: Use kpsestat to obtain suitable file permissions;
+ this means we no longer use unset. Use access rather than test to
+ determine whether we can write the ls-R database.
+
+ * MakeTeXTFM, MakeTeXMF, MakeTeXPK: Use kpsestat to obtain
+ suitable file permissions.
+
+ * Makefile.in: Minor changes, because of the new files and
+ renaming.
+
+ * MakeTeXnames.opt, MakeTeXmkdir.opt: renamed from
+ MakeTeXnames.cnf and MakeTeXmkdir.cnf respectively. Now
+ MakeTeX.cnf contains the standard configuration, and MakeTeX.site
+ the local adjustments.
+
+ * kpsestat.c, access.c: New files.
+
+Mon Oct 20 07:22:33 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * common.ac, Makefile.in, acconfig.in, config.h, install.texi,
+ kpathsea.texi: Rename texmf.cnf.in to texmf.in / c-auto.h.in to
+
+ * Renamed texmf.cnf.in to texmf.in.
+
+ * bugs.texi: Add descriptions of GSFTOPK_DEBUG, MAKETEX_DEBUG, and
+ MAKETEX_FINE_DEBUG. From Fabrice Popineau.
+
+ * c-fopen.h [WIN32]: Use setmode in stead of _setmode. From
+ Fabrice Popineau.
+
+ * c-pathch.h, absolute.c [NAME_BEGINS_WITH_DEVICE]: Corrected
+ definition. From Fabrice Popineau.
+
+ * c-proto.h: Cosmetic change in definition DllImport. From
+ Fabrice Popineau.
+
+ * debug.h [WIN32 && _DEBUG]: Extra debugging code for WIN32. From
+ Fabrice Popineau.
+
+ * install.texi: Extend description of the dosnames feature. After
+ Fabrice Popineau.
+
+ * lib.h: Add kpathsea/config.h to the includes. New macro STRNEQ.
+ From Fabrice Popineau.
+
+ * progname.c (kpse_set_progname [WIN32]): New environment variable
+ KPSE_DEBUG_OUTPUT. If defined, it names a file to which stderr
+ will be redirected. From Fabrice Popineau.
+
+ * tex-make.c: Various cosmetic changes for WIN32/MS-DOS. From
+ Fabrice Popineau.
+
+Fri Oct 17 10:41:08 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * db.c (kpse_db_insert): Remove dubious cast of result of basename.
+
+ * progname.c (kpse_set_progname [!HAVE_PROGRAM_INVOCATION_NAME]):
+ Removed dubious cast of basename.
+
+ * tex-file.c (kpse_find_file): Reorganize searches, so that
+ foo.bar.tex is found before foo.bar.
+
+ * tex-make.c (maketex) [MSDOS]: Redirect stderr to the null device
+ without using the shell (which requires users to install a port of
+ a Unixy shell, since stock DOS shells don't allow redirecting
+ stderr).
+ (kpse_make_tex) [MSDOS]: Don't use the shell to redirect stderr.
+ From Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * readable.c (READABLE) [__DJGPP__]: Use `access' instead of
+ `stat', since `stat' is expensive on MS-DOS. Eli Zaretskii
+ <eliz@is.elta.co.il>.
+
+ * pathsearch.c (search) [__DJGPP__]: Make `stat' work in the
+ fastest possible way, since it can be very expensive on MS-DOS.
+ (main): Use ENV_SEP_STRING instead of explicit ":".
+ From Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * path-elt.c (main): Use ENV_SEP_STRING instead of explicit ":".
+ From Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * kpsewhich.c (path_expand): Handle file names with device
+ letters.
+ (read_command_line): Use ENV_SEP_STRING instead of explicit ":".
+ After Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * kdefault.c (main): Use ENV_SEP_STRING instead of explicit ":"
+ (which is only true on Unix). From Eli Zaretskii
+ <eliz@is.elta.co.il>.
+
+ * cnf.c (do_line) [__DJGPP__]: Don't convert semi-colons to
+ colons, even though DJGPP defines `unix'. From Eli Zaretskii
+ <eliz@is.elta.co.il>.
+
+ * absolute.c (kpse_absolute_p) [DOSISH]: Don't assume the drive
+ letter is alphanumeric. From Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * xgetcwd.c (xgetcwd) [DOSISH]: Prepend drive letter before path.
+ From Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * progname.c (kpse_set_progname) [__DJGPP__]: Compute the long
+ file name of the program given its 8+3 alias.
+ (kpse_set_progname) Compute SELFAUTOLOC before removing the
+ ".exe" suffix, if any, because `selfdir' might look along the PATH
+ for the file.
+ After Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * config.h (DOSISH): Move the definition to the top, so we could
+ define MONOCASE_FILENAMES right there.
+ [__DJGPP__]: Include DJGPP-specific headers.
+ [DOSISH]: Let DJGPP use ST_NLINK_TRICK, since it supports it.
+ From Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * lib.h (FILESTRNCASEEQ): New macro, for partial compares of
+ filenames. From Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * c-fopen.h (FOPEN_RBIN_MODE, FOPEN_WBIN_MODE): Let MS-DOS use
+ these also.
+ (FOPEN_ABIN_MODE): New macro, defines how to open a binary file for
+ appending.
+ (SET_BINARY): New macro, switches an already open file to binary
+ mode (required for stdin/stdout on MS-DOS/MS-Windows).
+ From Eli Zaretskii <eliz@is.elta.co.il>.
+
+ * c-pathch.h (NAME_BEGINS_WITH_DEVICE): Don't assume the drive
+ letter is A-Z only (DOS allows 6 characters beyond Z). After Eli
+ Zaretskii <eliz@is.elta.co.il>.
+
+Thu Oct 16 10:22:42 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * configure.in: Update stamp-auto after creating c-auto.h. From
+ Peter Breitenlohner.
+
+ * Makefile.in: Don't rewrite paths.h if it was not changed. After
+ Peter Breitenlohner.
+
+Wed Oct 15 15:33:43 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * xputenv.c (xputenv): Don't do anything if the old and new values
+ of the environment variables are identical, because some libraries
+ (DJGPP) will will optimize away such no-ops, and therefore freeing
+ the old value will lead to disaster. Free new_item if it was
+ copied by the library `putenv'. From Eli Zaretskii
+ <eliz@is.elta.co.il>
+
+ * tex-file.c (kpse_open_file): Open
+ kpse_{pk,base,fmt,mem,type1}_format files in binary mode.
+
+ * install.texi: Remove description of the feature that (say)
+ MAKETEXPK in the environment can be used to provide a
+ specification of the argument list of MakeTeXPK. Reason: the
+ feature isn't implemented.
+
+Tue Oct 14 17:08:22 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * xgetcwd.c: Rename DO_NOT_USE_GETCWD to GETCWD_FORKS.
+ * common.ac: Add a test for GETCWD_FORKS.
+ * acconfig.h: Include GETCWD_FORKS.
+
+Mon Oct 13 19:42:58 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * path-elt.c (element): Always return a new string rather than a
+ part of the path, as the returned string may be modified.
+
+ * tex-file.c (remove_dbonly): Replaced hard-coded ':' with
+ ENV_SEP. From Fabrice Popineau.
+
+ * common.ac, configure.in: Move definition of KPSEVERSION from
+ common.ac to configure.in.
+
+ * common.ac: Check for presence of getcwd.
+
+ * xgetcwd.c: Use getcwd in preference to getwd, unless
+ DO_NOT_USE_GETCWD is defined.
+
+ * MakeTeX.cnf: Made varfonts the default.
+
+ * elt-dirs.c, path-elt.c, tilde.c, variable.c: Print (nil) instead
+ of (null), so we can distinguish *printf being fed a null pointer.
+
+ * tex-file.c: remove_dbonly: Corrected off-by-one error in
+ allocation.
+
+Sat Oct 11 13:48:33 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * elt-dirs.c (main) [TEST, AMIGA]: Changed test code for Amiga.
+ From Andreas Scherer <Scherer@physik.rwth-aachen.de>.
+
+Mon Oct 6 16:36:50 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * install.texi: Document --enable-maintainer-mode switch.
+
+Sat Oct 4 19:27:22 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * MakeTeXnames.cnf: Add "strip" feature for backwards
+ compatibility with 7.0.
+ * Use a new set of MakeTeX* scripts, from Thomas Esser.
+
+Fri Oct 3 09:54:47 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * kpsewhich.c (path_expand): Don't scribble in the datastructures
+ of the system to get rid of trailing slash, use "%.*s" format of
+ printf instead.
+
+ * Makefile.in (texmf.sed, paths.h): Take the changes to texmf.cnf.in
+ into account.
+ * texmf.cnf.in: Redo variable definitions for the sake of clarity.
+
+ * hash.c (hash_create): Make ret static to work around a gcc
+ optimizer bug on the Alpha.
+
+ * elt-dirs.c (do_subdir,expand_elt): Cleanup by Greg Hudson
+ <ghudson@MIT.EDU>, which might fix the '//' in path problem on the
+ Amiga as well.
+
+ * xrealloc.c: Get prototype for realloc from config.h, give
+ prototype for xmalloc, prototype xrealloc itself. After Fabrice
+ Popineau.
+
+ * xmalloc.c: Give xmalloc a prototype, get prototype for malloc
+ from config.h. After Fabrice Popineau.
+
+ * tex-file.c [TEX_SUFFIXES]: Brought into sync with tex.ch.
+
+ * install.texi: Extend comments on shared library support.
+
+Thu Oct 2 00:14:57 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.cnf.in [buf_size]: Increased from 3000 to 10000.
+
+ * tex-file.h (enum kpse_src_type): removed trailing comma. From
+ Ezra Peisach <epeisach@auriga.rose.brandeis.edu>.
+
+ * c-proto.h [AA]: Obsolete due to changes to web2c.y; removed.
+
+ * bugs.texi: Document KPSE_DEBUG_VARS.
+ * debug.h [KPSE_DEBUG_VARS]: New #define for debugging. From
+ Nicolai Langfeldt <janl@math.uio.no>.
+ * variable.c (kpse_var_value): Add code to report how variables
+ were expanded. From Nicolai Langfeldt <janl@math.uio.no>.
+
+ * progname.c (selfdir) [!AMIGA]: Directories were mistaken for
+ executables. From Matthias Clasen
+ <mclasen@sun2.mathematik.uni-freiburg.de>
+
+ * tex-file.c (remove_dbonly): New function that strips the !! from
+ path specifications. Called when creating the path for
+ kpse_db_format. From Thomas Esser <te@informatik.uni-hannover.de>
+
+ * install.texi: The default installation directory is not always
+ /usr/local, as configure will pick the location of an existing tex
+ installation.
+
+Wed Oct 1 13:43:18 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * texmf.cnf.in: Various definitions have changed to take advantage
+ of the new brace expansion code. The various intermediate
+ variables (fontdir, web2cdir, ...) have been removed because you
+ could burn yourself severely by accidentally setting these
+ undocumented variables -- this happened with some versions of make
+ during compilation.
+
+Tue Sep 30 16:14:48 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * kpathsea.texi: Document changes in brace expansion.
+ * expand.c (array_concat): reversed the order concatenation, which
+ result in more usable brace expansion.
+ (kpse_expand_kpse_dot): new function.
+ (kpse_path_expand): call kpse_expand_kpse_dot to expand relative
+ components using KPSE_DOT, if the latter is defined.
+
+ * common.ac: Define the version string.
+ * version.c: Replaced version string with a define.
+ * acconfig.h: Added defines for version strings.
+ * Makefile.in: Let version = @KPSEVERSION@.
+ * common.ac: Introduce KPSEVERSION for version.
+
+ * tex-file.c (kpse_maketex_option): choose proper mf and tfm
+ formats rather than tex.
+
+Mon Sep 29 22:47:23 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * db.c (match): Repaired several off-by-one bugs.
+
+Wed Sep 17 21:09:56 1997 Olaf Weber <infovore@xs4all.nl>
+
+ * withenable.ac: Added the --enable-maintainer-mode option.
+
+Tue Aug 5 17:26:16 1997 Karl Berry <karl@cs.umb.edu>
+
+ * config.h (KPATHSEA): Define for the sake of kpathsea code
+ getting merged back into original distributions.
+
+Sun Aug 3 17:14:47 1997 Karl Berry <karl@cs.umb.edu>
+
+ * install.texi: simple.tex doesn't exist in LaTeX 2e; it's sample2e.
+ From: "Jonathan I. Kamens" <jik@cam.ov.com> and others.
+
+ * db.c (kpse_db_search): Preprocessor # commands must start in
+ column 1 for DEC OSF/1 2.0 cc.
+ From: Andrew Komornicki <komornic@maxwell.mps.nsf.gov>.
+
+ * common.ac (program_inv_name): Correct usage of AC_TRY_LINK.
+ From: "John W. Eaton" <jwe@bevo.che.wisc.edu>.
+
+ * Makefile.in (.SUFFIXES): Put before the .c.lo rule for the sake
+ of FreeBSD 2.1.7 make.
+ From: Hiroto Kagotani <kagotani@in.it.okayama-u.ac.jp>.
+
+Thu Apr 17 17:35:37 1997 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (paths.h): Replace $web2cdir too,
+ for the sake of DEFAULT_TEXMFCNF.
+ From: M G Berberich <berberic@forwiss.uni-passau.de>.
+
+Tue Apr 1 17:48:18 1997 Karl Berry <karl@cs.umb.edu>
+
+ * fontmap.c: Doc fix.
+ * kpsewhich.c (find_format): Try the long name if the file format
+ has no suffix, e.g., `dvips config'.
+ From: "Tomasz J. Cholewo" <tjchol01@mecca.spd.louisville.edu>
+
+Sun Mar 23 16:44:21 1997 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_find_file): Don't assert that `name' is empty,
+ only NULL, so \input\relax doesn't crash.
+ From: "Tomasz J. Cholewo" <T.Cholewo@ieee.org>.
+
+Fri Mar 21 16:09:47 1997 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK, MakeTeXcommon: Support a redirect option to MTPK,
+ from Thomas via Paul V.
+
+ * progname.c (selfdir) [AMIGA]: Fix from Andreas.
+
+Sun Feb 16 15:49:07 1997 Karl Berry <karl@cs.umb.edu>
+
+ * withenable.ac: `enableval' should have been `withval',
+ and value must be quoted.
+
+ * MakeTeXTFM: Exit if mf fails, a la MakeTeXPK.
+ From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>.
+
+Thu Feb 13 16:08:30 1997 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (latex2*_inputs): Put $dbtex/generic before the
+ ``other'' latex version.
+ From: Olaf Weber <Olaf.Weber@cwi.nl>.
+
+ * progname.c (selfdir): Protect against argv0 being dir/exename,
+ not found in PATH. Happens under Solaris.
+ From: Ross Alexander <r.alexander@auckland.ac.nz> (and many others).
+
+Sun Feb 09 15:27:15 1997 Fabrice POPINEAU <popineau@ese-metz.fr>
+
+ * progname.c (kpse_set_progname): Added braces around Win32 code,
+ because of variables declaration.
+
+Fri Feb 7 11:53:09 1997 Karl Berry <karl@cs.umb.edu>
+
+ * Version 3.0.
+
+ * MakeTeXMF: Syntax problems with dc*. Fix from Thomas.
+
+ * MakeTeX*: sed command to strip off all but the first of multiple
+ trees in $TEXMF was faulty.
+
+ * c-pathch.h (ENV_SEP, ENV_SEP_STRING) [AMIGA]: Change to ;
+ for Andreas. Then Amiga binaries may be able to share
+ the same texmf.cnf with Unix and NT.
+
+ * texmf.cnf.in (main_memory): Decrease back to 263,000.
+ It's not worth allocating 7MB on everyone's machine just
+ to do xy-pic samples. Add a comment about it.
+
+Thu Feb 6 10:27:50 1997 Karl Berry <karl@cs.umb.edu>
+
+ * db.c (kpse_db_search): If an alias exists on disk, and the
+ original entry in ls-R doesn't, use the alias. Idea, sample code
+ from Fabrice.
+
+ * cnf.c (do_line): Add awful kludge to translate ; to :
+ when reading texmf.cnf values under Unix. The idea is
+ to be able to write a single texmf.cnf that will work
+ under both NT and Unix.
+
+ * db.c: Doc fixes.
+
+ * MakeTeXcommon: Set ps_to_pk.
+ * MakeTeXPK: Use ps_to_pk instead of hardwiring gsftopk.
+ * MakeTeX.site: Include ps_to_pk comment.
+
+ * texmf.cnf.in (TEXMFCNF): Include SELFAUTOLOC (at the front).
+ * progname.c (kpse_set_progname): Include SELFAUTOLOC for the real
+ directory. It may be useful. Suggested by Andreas.
+
+ * MakeTeXcommon: Add case for fc.
+ * MakeTeX.site: Add comment for fc.
+ * MakeTeXMF: Add case for fc, generated like Sauter.
+ From Francois and Thomas.
+
+ * progname.c [WIN32]: SELFAUTODIR fix from Fabrice.
+
+ * kpathsea.h: Do not #include <kpathsea.h> (infinite loop).
+ From Fabrice and Richard.
+
+Tue Feb 4 13:20:09 1997 Karl Berry <karl@cs.umb.edu>
+
+ * tilde.c: xstrdup the result from getenv,
+ since we end up freeing it with a path element of `~'.
+
+ * MakeTeX.site: Include RCS id.
+
+ * MakeTeX.site: Replace sample dc assignment with ec.
+
+ * MakeTeXMF: Handle ec, use exbase for tc.
+
+ * MakeTeXcommon (ecfontdir,tcfontdir): New variables.
+
+Tue Feb 04 15:11:29 1997 Fabrice POPINEAU <popineau@ese-metz.fr>
+
+ * progname.c: argv[0] under Win95 is set to the short
+ filename of the executable run. Changed the way
+ program_invocatio_name is retrieved : used the SearchPath() win32
+ call, next FindFirstFile() to get the long filename. The selfdir
+ stuff is not used any more for win32.
+
+Mon Feb 3 18:01:02 1997 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c (read_command_line): Check for -1, not EOF,
+ per new getopt.
+
+Sun Feb 2 16:06:42 1997 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (PKFONTS.xdvi): Replace `gsftopk,ps2pk' by `modeless'.
+ * MakeTeXPK (mode): Use `modeless' instead of `gsftopk'.
+
+ * tex-file.c: Look for TEXINDEXSTYLE before INDEXSTYLE.
+
+Sat Feb 1 16:31:39 1997 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in: Doc fix.
+
+ * progname.c (my_dirname): Check for device separators at the
+ beginning fo the string. From Andreas.
+
+ * c-pathch.h (IS_DIR_SEP) [AMIGA]: New definition from Andreas.
+ (NAME_BEGINS_WITH_DEVICE): Remove.
+
+ * tex-make.c (maketex) [AMIGA]: Have to call system instead of popen
+ due to different interface. From Andreas.
+
+ * progname.c (selfdir): Check self, not ret, for exiting the loop.
+ (remove_dots): Missing indirection on ret.
+ From Fabrice.
+
+Tue Jan 21 08:26:17 1997 Karl Berry <karl@cs.umb.edu>
+
+ * elt-dirs.c: Doc fixes.
+
+ * db.c (match): Don't return false just because the path element
+ ended in /.
+ Bug from: Richard Walker <Richard.Walker@cs.anu.edu.au>.
+
+ * expand.c (kpse_path_expand): Do variable expansion before
+ splitting on path elements.
+ Bug from: Richard Walker <Richard.Walker@cs.anu.edu.au>.
+
+ * tilde.c [TEST]: Function name changed.
+ From: Richard Walker <Richard.Walker@cs.anu.edu.au>.
+
+ * texmf.cnf.in (MAILCAPLIBDIR): Rename from MAILCAPDIR.
+ From Ulrik.
+
+Tue Jan 21 09:34:20 1997 Fabrice POPINEAU <popineau@ese-metz.fr>
+
+ * c-pathch.h: NAME_BEGINS_WITH_DEVICE(string) new macro testing
+ for the presence of a device name in front of the string.
+
+ * progname.c (remove dots): stop before device name if
+ present. When building the filename, do not add leading DIR_SEP if
+ there is a device.
+
+ * pathsearch.c (path_search): avoid searching the whole disk
+ adapted for win32.
+
+ * db.c: support aliases file along with db files. An alias file is
+ named with ALIAS_NAME and the hashtable size is
+ ALIAS_HASH_SIZE. When a name looked for has an alias, the alias is
+ searched instead of the original name. The format of the aliases
+ file is "real_name alias_name", one pair per line. Currently only
+ for WIN32.
+
+Mon Jan 20 12:01:14 1997 Karl Berry <karl@cs.umb.edu>
+
+ * progname.c: Amiga patch from Andreas.
+
+Sun Jan 19 14:29:00 1997 Karl Berry <karl@cs.umb.edu>
+
+ * pathsearch.c (path_search): Strip off all but one of leading /'s.
+ We never want to search the whole disk.
+
+ * progname.c: Expand symlinks off the final filename, not the
+ directory name.
+
+Sat Jan 18 14:39:00 1997 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (param_size): Increase to 500 for the chemical
+ formula macro package. From Thomas.
+
+ * progname.c (expand_symlinks, ReadSymLink, CopyFirst, StripFirst,
+ StripLast): New functions to expand symbolic links for SELFAUTO*.
+ Noted by Thomas.
+
+ * texmf.cnf.in (PKFONTS.xdvi): Fix tpyo.
+ Document that memory changes
+ (trie_size): Increase to 64000.
+
+Fri Jan 17 13:08:08 1997 Karl Berry <karl@cs.umb.edu>
+
+ * progname.c (remove_dots): Don't free the constant null string.
+ From Andreas.
+
+ * texmf.cnf.in (dbfontdir): Change to dbfonts (the commented-out one).
+
+Thu Jan 16 10:13:19 1997 Karl Berry <karl@cs.umb.edu>
+
+ * cnf.c (kpse_cnf_get): Avoid recursive init, due to new
+ $TETEXDIR and other variables in default TEXMFCNF value.
+
+ * getopt*, strtol.c: New versions from /gd/gnu/lib.
+
+ * c-std.h (ALLOC_RETURN_TYPE): Only define if we're going to use it.
+
+ * acconfig.h (EDITOR): Oops, %s not +%s.
+ From: tim@maths.tcd.ie.
+
+ * progname.c (kpse_set_progname): One more my_dirname call
+ to get the parent and the grandparent in the environment variables.
+
+ * texmf.cnf.in (texdir): Rename from tex, to avoid clash with
+ TEX used by makempx -- win32 doesn't distinguish case on envvars.
+ From Fabrice.
+ (WEB2CDIR): Lowercase, so it doesn't end up in paths.h, just
+ for cleanliness.
+
+ * progname.c (kpse_set_progname): Pass program_invocation_name
+ to selfdir instead of progname, just in case we
+ HAVE_PROGRAM_INVOCATION_NAME and it's something different.
+ From Fabrice.
+
+ * tex-file.c (kpse_open_file): ocp, ofm and ovf should use
+ FOPEN_RBIN_MODE. From Fabrice and John Plaice.
+
+ * progname.c [AMIGA]: Fix syntax errors, remove_dots not necessary.
+ From Andreas Scherer.
+
+ * MakeTeXupdate: MakeTeXls-R isn't in the conf dir anymore, just
+ in the regular path.
+ From Thomas.
+
+Sun Jan 12 17:22:35 1997 Karl Berry <karl@cs.umb.edu>
+
+ * cnf.c (read_all_cnf): Do not test unallocated memory on empty
+ lines; crashed on Alphas.
+
+ * progname.c (dirname): Rename to my_dirname to avoid clash on Alphas.
+
+Sat Jan 11 16:28:54 1997 Karl Berry <karl@cs.umb.edu>
+
+ * c-std.h (calloc, malloc, realloc) [!STDC_HEADERS]: Only declare
+ in this case.
+
+Tue Jan 7 17:44:01 1997 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK: Doc fix.
+
+ * texmf.cnf.in (KPSE_DOT): Define.
+
+ * c-memstr.h: Doc fix.
+
+Wed Jan 1 16:58:02 1997 Karl Berry <karl@cs.umb.edu>
+
+ * pathsearch.h (kpse_filename_component): Declare this.
+ * path-elt.c: Define it.
+ * progname.c (remove_dots): New function to remove . and ..
+ filename components. Subsumes slashify, it turns out.
+
+ * Makefile.in (install-exec): Install MakeTeXls-R in $(scriptdir).
+
+Mon Dec 30 16:22:42 1996 Karl Berry <karl@cs.umb.edu>
+
+ * progname.c (kpse_set_progname): Strip off .exe if present.
+
+ * cnf.c: Doc fix.
+
+ * progname.c (slashify): New function, to translate \ into / for WIN32.
+ (selfdir): Call it.
+
+ * lib.h (FILE{STR,CHAR}CASEEQ) [MONOCASE_FILENAMES]: Define these,
+ continuing yesterday's changes.
+ From Fabrice.
+
+Sun Dec 29 13:26:09 1996 Karl Berry <karl@cs.umb.edu>
+
+ * db.c (match, elt_in_db),
+ * elt-dirs.c (cached),
+ * hash.c (hash_lookup),
+ * kpsewhich.c (find_format, TRY_SUFFIX),
+ * tex-file.c,
+ * cnf.c (do_line): Compare filenames with FILESTRCASEEQ or
+ FILECHARCASEEQ to support monocase filesystems.
+ * hash.c (hash) [MONOCASE_FILENAMES]: Transform keys to uppercase.
+ From Fabrice.
+
+ * basename.c (basename): Consider device separators;
+ if given 'e:foo.tex', should return 'foo.tex'.
+ From: Fabrice POPINEAU <popineau@esemetz.ese-metz.fr>.
+
+ * types.h (boolean): Protect with #ifndef HAVE_BOOLEAN, for NeXT.
+ From: Raf Schietekat <flexus!rfschtkt@colds.ruca.ua.ac.be>
+
+Sat Dec 28 07:18:48 1996 Karl Berry <karl@cs.umb.edu>
+
+ * progname.c [AMIGA]: Add code for this case from Andreas S.
+
+Fri Dec 27 17:38:43 1996 Karl Berry <karl@cs.umb.edu>
+
+ * progname.c (S_IX{USR,GRP,OTH}): Define if not defined, for the NeXT.
+ From: Gregor Hoffleit <flight@mathi.uni-heidelberg.de>.
+
+ * texmf.cnf.in (TEXMFCNF): Rewrite using /.'s etc. From Thomas.
+
+Sun Dec 15 06:21:22 1996 Karl Berry <karl@cs.umb.edu>
+
+ * common.ac (AC_CHECK_FUNCS): Add getwd.
+
+ * lib.h (xgetcwd): Declare.
+ * Makefile.in (objects): Add xgetcwd.lo.
+ * xgetcwd.c: New file from xdvik.
+
+ * texmf.cnf.in (TEXMFCNF): Add $SELFAUTODIR:$SELFAUTOPARENT.
+ * progname.c (selfdir, dirname, etc.): New functions.
+ (kpse_set_progname): Set SELFAUTODIR and SELFAUTOPARENT.
+
+Sat Dec 14 14:41:39 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h (kpse_src_type): New types kpse_tex{doc,source}_format.
+ * tex-file.c (TEXDOC_ENVS, TEXSOURCE_ENVS): New envvars.
+ (kpse_init_format): Handle them.
+ * texmf.cnf.in (TEXDOCS, TEXSOURCES): New values.
+ * kpathsea.texi: Document them.
+
+Fri Dec 13 16:46:00 1996 Karl Berry <karl@cs.umb.edu>
+
+ * expand.h: Doc fix.
+
+Thu Dec 12 17:25:25 1996 Karl Berry <karl@cs.umb.edu>
+
+ * xputenv.c [WIN32]: Work around putenv ("FOO=") unsetting
+ FOO under NT. From Fabrice.
+
+Mon Dec 9 23:27:45 MET 1996 Thomas Esser <te@informatik.uni-hannover.de>
+
+ * kpsewhich.c: add option -show-path to display the search path for a
+ given file type.
+
+Mon Dec 9 17:23:32 1996 Karl Berry <karl@cs.umb.edu>
+
+ * readable.c (READABLE): Check !S_ISDIR instead of S_ISREG,
+ to allow fifo's.
+ Suggestion from: Krzysio Leszczynski <chris@camk.edu.pl>.
+
+ * tex-file.c (kpse_open_file): Open VF files in binary mode.
+ From Fabrice.
+
+ * types.h (boolean) [WIN32]: Remove this case, Fabrice
+ has found another solution.
+
+ * elt-dirs.c (expand_elt): Do not check for a device separator.
+ From Fabrice.
+
+ * texmf.cnf.in (OTPINPUTS, OCPINPUTS): These use a subdirectory omega/.
+ From John P.
+
+Sun Dec 8 17:15:43 1996 Karl Berry <karl@cs.umb.edu>
+
+ * c-proto.h (DllImport): Define here.
+ * config.h (DllImport): Instead of here.
+ * kpsewhich.c: Other DllImport changes.
+ * line.c [WIN32]: Include <malloc.h>.
+ * tex-file.c: Oops, had FOPEN_RBIN_MODE vs. R reversed.
+ * tex-make.c (kpse_make_tex_discard_errors): Add Dllimport.
+ * types.h (boolean): Bizarre WIN32 definition.
+ From: Fabrice POPINEAU <popineau@esemetz.ese-metz.fr>.
+
+Sat Dec 7 22:12:26 MET 1996 Thomas Esser <te@informatik.uni-hannover.de>
+
+ * MakeTeXnames: Ensure that cmr1234 will be mapped to
+ jknappen/sauter while cmr12 will still be mapped to public/cm.
+
+Fri Dec 6 15:08:35 1996 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (OFMFONTS, etc.): New definitions for Omega.
+ * tex-file.h (kpse_file_format_type): Define kpse_ocp_format, etc.
+ * acconfig.h (MAKE_OMEGA_{OFM,OCP}_BY_DEFAULT): Include these.
+ * tex-file.c (kpse_init_format): New cases for the Omega types.
+ (OCP_ENVS, etc.): New environment variable lists.
+ From: John Plaice <plaice@iad.ift.ulaval.ca>.
+
+ * texmf.cnf.in: Use fonts//<format> consistently,
+ instead of fonts/<format>.
+
+ * lib.h (itoa): Remove, it seems we don't use this function any more.
+ * itoa.c: Remove.
+ * acconfig.h (HAVE_ITOA): Remove this.
+ * Makefile.in (objects): Remove.
+
+ * cnf.c (do_line): Oops, tested prog after freeing it,
+ should have tested prog2.
+ From: Fabrice POPINEAU <popineau@esemetz.ese-metz.fr>.
+
+Tue Dec 3 14:57:52 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (objects): Remove strtol.lo, that's generated by
+ configure.
+ From: Gregor Hoffleit <flight@mathi.uni-heidelberg.de>.
+
+Mon Dec 2 09:05:54 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXcommon: Set KPSE_DOT before the trap. From Thomas.
+
+Tue Dec 3 18:02:08 1996 Ulrik Vieth <vieth@thphy.uni-duesseldorf.de>
+
+ * texmf.cnf.in (TRFONTS): Set this to /usr/lib/font/devpost
+ indepent of $prefix.
+
+Mon Dec 9 00:28:58 1996 Ulrik Vieth <vieth@thphy.uni-duesseldorf.de>
+
+ * MakeTeXcommon: Use `basename $0` in usage and version messages
+ for consistency with other programs and scripts.
+ Also accept -help, -version in addition to --help, --version.
+
+ * MakeTeX{MF,PK,TFM,ls-R,mkdir,names,update}:
+ Use `basename $0` in usage messages for consistency.
+
+Tue Dec 3 18:02:08 1996 Ulrik Vieth <vieth@thphy.uni-duesseldorf.de>
+
+ * texmf.cnf.in (TRFONTS): Set this to /usr/lib/font/devpost
+ indepent of $prefix.
+
+Thu Nov 28 16:33:35 1996 Karl Berry <karl@cs.umb.edu>
+
+ * common.ac (AC_ISC_POSIX): Remove this; it causes warnings from
+ Autoconf that make no sense, isn't cached, and is probably of
+ dubious value today.
+ * configure.in: Move the klibtool stuff to common.ac, so the
+ program configure.in's can find it.
+
+Wed Nov 27 14:43:41 1996 Karl Berry <karl@cs.umb.edu>
+
+ * configure.in: Doc fix.
+ * acconfig.h (HAVE_BASENAME, etc.): #undef these symbols so
+ Autoheader can replace them; we use a non-standard macro to test
+ for them, since they're part of the possibly-shared library.
+
+Mon Nov 25 14:04:42 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (texmf.sed): Replace all $(texmf) with `$TEXMF'
+ except on the TEXMF line itself.
+
+Sun Nov 24 10:06:35 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (texmf.sed): Insert missing quote.
+ (distdir): Use doc instead of listing all the targets (we were
+ missing unixtex.ftp).
+
+ * kpsewhich.c (read_command_line): Print the integer equivalent of
+ each format.
+
+Sat Nov 23 15:38:31 1996 Karl Berry <karl@cs.umb.edu>
+
+ * xt.ac (with_x): Remove spurious ;;.
+
+Fri Nov 22 18:00:41 1996 Karl Berry <karl@cs.umb.edu>
+
+ * cnf.c (do_line): Let var.prog lines work if we're running prog.exe.
+ This happens with --enable-shared.
+ From Ulrik.
+
+Mon Nov 18 16:10:48 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_troff_font_format): Change to DEFAULT_TRFONTS
+ to make texmf.cnf.in change.
+
+Fri Nov 15 14:13:36 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (texmf.sed): Get $TEXMF back into the paths.
+ Noted by Andreas Scherer.
+ (distdir): Add klibtool.version to the distribution.
+ From Ulrik.
+ (install-exec): Use INSTALL_SCRIPT for scripts.
+
+Mon Nov 11 16:16:50 1996 Karl Berry <karl@cs.umb.edu>
+
+ * various .c: Print (nil) instead of (null) so we can possibly
+ detect printf of a null pointer.
+
+Sun Nov 10 16:22:43 1996 Karl Berry <karl@cs.umb.edu>
+
+ * xt.ac: New file so web2c and xdvi treat --with-x-toolkit uniformly.
+ From Ulrik.
+
+Thu Oct 31 15:38:48 1996 Karl Berry <karl@cs.umb.edu>
+
+ * expand.c (kpse_path_expand): Do brace expansion first.
+ (kpse_brace_expand): Expand each element of the brace expansion, so
+ {~a,~b} expands. Suggested by Thomas.
+
+Fri Oct 25 16:51:14 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (install-data): Install an empty dir file if none exists.
+ (mostlyclean: Remove PROF etc. subdirs here.
+
+Tue Oct 22 13:56:20 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in ($(library).h): Make the modtime of the file the
+ same as the latest other .h; otherwise, we think kpathsea always
+ has to be remade.
+
+Sun Oct 20 18:06:36 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (distdir): No need to distribute copying.texi.
+
+Mon Oct 14 11:32:51 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Changes for NT from: Fabrice POPINEAU <popineau@esemetz.ese-metz.fr>.
+
+ * xputenv.c (putenv) [WIN32]: #include <stdlib.h> instead of declaring.
+
+ * tex-file.c (kpse_open_file): Use FOPEN_RBIN_MODE for tfm and gf
+ formats.
+
+ * xopendir.h [!WIN32]: Conditionalize whole file.
+ * xopendir.c (xopendir) [!WIN32]: Conditionalize defn.
+
+ * kpsewhich.c (DllImport) [_WIN32]: Define.
+ (path_sep): Use ENV_SEP_STRING.
+
+ * progname.h,
+ * lib.h,
+ * debug.h (kpathsea_debug),
+ * concatn.h (concatn): Give DllImport kludge.
+
+ * config.h (DOSISH) [WIN32]: #define.
+ Also include <windows.h>, etc.
+
+ * c-std.h (getenv, popen, pclose) [WIN32]: Conditionalize decls.
+ * c-fopen.h [WIN32]: Use rb and wb.
+ * c-limits.h [HAVE_SYS_PARAM_H]: Conditionalize #ifdef.
+ * common.ac: Check for <sys/param.h>
+ * c-stat.h [WIN32]: #include <io.h> and #define stat _stat.
+
+Sat Oct 12 11:10:45 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_find_file): Include a suffix in what we pass to
+ kpse_fontmap_lookup.
+
+ * Makefile.in (paths.h): Remove extra $ when replacing $VARFONTS.
+
+Tue Oct 8 16:40:07 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-glyph.c (try_fontmap): Do not return the first alias if it
+ itself is an alias. Also, if a particular alias succeeds,
+ return that.
+
+Sun Oct 6 17:52:58 1996 Karl Berry <karl@cs.umb.edu>
+
+ * version.c: Doc fix.
+
+Sat Oct 5 17:06:54 1996 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c (-must-exist): New option.
+ (must_exist): New global.
+
+ * Makefile.in (install-data): Call install-info.
+ * kpathsea.texi, *.texi: Use @url, @email, and @dircategory/@direntry.
+
+Sat Sep 21 19:02:17 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXnames.cnf: Doc fix.
+
+ * texmf.cnf.in (latex{2e,209}_inputs): Replace spurious `latex2e'.
+ (TEXINPUTS.fontinst): New definition, including AFM files.
+ (MFINPUTS, TFMFONTS, PKFONTS): Use $VARFONTS.
+ From Thomas.
+
+Sat Sep 7 16:00:53 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXupdate,
+ * MakeTeXnames,
+ * MakeTeXmkdir,
+ * MakeTeXls-R,
+ * MakeTeXTFM,
+ * MakeTeXPK,
+ * MakeTeXMF (version): Call kpsewhich in MakeTeXcommon, not here.
+
+ * version.c: Doc fix.
+
+ * kpsewhich.c (read_command_line): Improve formatting of --help
+ message.
+
+Fri Sep 6 19:16:20 1996 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c (read_command_line): Print the bug reporting address.
+ * version.c (kpse_bug_address): New global.
+
+Thu Sep 5 19:08:04 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in: Doc fix.
+
+ * configure.in: Include ../acklibtool.m4 here.
+ * common.ac: Not here. Move calls to kb_*LIBTOOL* functions, too.
+
+Sun Sep 1 17:34:17 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (.c.lo): Put filename right after $(CC), for Klibtool.
+ (KPATHSEA_CC): Do not include ALL_CFLAGS here.
+ (paths.h): Instead of deleting definitions with lowercase variable
+ names, don't include them in the first place.
+
+Sat Aug 31 16:15:33 1996 Karl Berry <karl@cs.umb.edu>
+
+ * common.ac: Call kb_KLIBTOOL_REPLACE_FUNCS and kb_PROG_LIBTOOL
+ instead of the AM_* versions.
+ Also, include acklibtool.m4 instead of aclibtool.m4.
+
+ * Makefile.in (liblobjs): Change to use @LTLIBOBJS@.
+
+Sat Aug 17 17:22:18 1996 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (PKFONTS*, GFFONTS): Need another / to match TDS.
+
+Sat Aug 10 15:46:46 1996 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (TFMFONTS, VFFONTS): Update with trailing // for TDS.
+
+ * MakeTeXupdate,
+ * MakeTeXnames.cnf,
+ * MakeTeXnames,
+ * MakeTeXTFM,
+ * MakeTeXMF,
+ * MakeTeXmkdir,
+ * MakeTeXls-R,
+ * MakeTeXPK: Change --expand to -expand-var.
+
+ * tex-glyph.c (try_fontmap): Return the real name of the first
+ alias as the font name.
+ (kpse_find_glyph): Change call, free string if necessary, etc.
+ Basic idea from a patch sent by wls@astro.umd.edu.
+
+Fri Aug 9 15:42:40 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (paths.h): Substitute for dbtex, dbfonts, and prefix.
+ Also, do not define lowercase variables.
+
+Thu Aug 8 14:50:29 1996 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (TEXCONFIG, INDEXSTYLE): Use //, just in case there
+ are subdirectories. From Thomas.
+
+Tue Aug 6 13:59:03 1996 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c (lookup): Handle user_path case.
+
+Mon Aug 5 17:23:56 1996 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c: Rename -expand to -expand-var,
+ -path to -expand-path, and add new -path option to specify
+ explicit path for lookups.
+
+ * tex-file.h (kpse_ist_format): New format.
+ * tex-file.c (kpse_init_format): Initialize it.
+ (IST_ENVS): New #define.
+ * texmf.cnf.in (INDEXSTYLE): Set the default path.
+
+ * tilde.c (kpse_tilde_expand): If $HOME starts with //, only use
+ one of the slashes.
+
+Sat Aug 3 17:18:00 1996 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c (read_command_line): Change Usage: line to conform.
+
+Fri Aug 2 11:57:23 1996 Karl Berry <karl@cs.umb.edu>
+
+ * db.c (db_build): Test len > 0 before evaluating len - 1.
+ From: "Peter Henderson, Syrinx Speech Systems P/L, Tel: (+61-2)
+ 956-6540" <peterh@syrinx.com.au>.
+
+Sat Jul 27 14:35:17 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (paths.h): Change target name to
+ $(kpathsea_dir)/paths.h, for rdepend.make dependency.
+
+ * Makefile.in (liblobjs): New variable, gets @LIBTOOL_LIBOBJS@.
+ * common.ac (kbAC_LIBTOOL_REPLACE_FUNCS): Use this new macro instead
+ of AC_REPLACE_FUNCS.
+
+Fri Jul 26 15:51:55 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (KPATHSEA_CC): Include $(compile).
+ (.c.lo): Change suffix rule for libtool 0.5.
+ (install-exec): Use new variables INSTALL_LIBTOOL_*.
+
+Mon Jul 8 17:21:34 1996 Karl Berry <karl@laurie>
+
+ * unixtex.texi: Rename from obtain.texi.
+
+Fri Jun 7 19:10:52 1996 K. Berry <kb@cs.umb.edu>
+
+ * common.ac: Include ../kpathsea/withenable.ac.
+
+Thu Jun 6 16:34:43 1996 K. Berry <kb@cs.umb.edu>
+
+ * Makefile.in (kpsewhich): Use libtool commands etc. instead of
+ our shared lib stuff.
+ * common.ac: Replace our shared lib stuff with gm_PROG_LIBTOOL.
+ * withenable.ac: Remove --enable-shared stuff.
+
+Sat Jun 1 15:05:42 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeX*: Add RCS info for version strings.
+
+Thu May 30 13:46:46 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK: Doc fix; we're called with the base font name
+ (pplr8r), not the user font name (pplr).
+
+ * db.c (ignore_dir_p): Remove the dot_pos != dirname test,
+ since it's always true. It caused directory names containing .'s
+ (e.g., `dc-1.2') to be ignored.
+ From Thomas Esser and Frank Mittelbach.
+
+Sun May 26 16:06:41 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-make.c (kpse_make_tex): If called kpse_init_form, reassign
+ our local variable, too.
+
+Thu May 23 16:20:53 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXnames: Doc fix.
+
+Fri May 3 13:34:51 1996 Karl Berry <karl@cs.umb.edu>
+
+ * withenable.ac: Use AC_ARG_WITH instead of AC_ARG_ENABLE for
+ maketex*.
+
+ * tex-file.c (kpse_find_file): Oops, testing for kpse_pk_format
+ twice, when meant to test for kpse_gf_format.
+
+ * cnf.c (do_line): Allow whitespace in variable values.
+
+ * texmf.cnf.in: Finish adding easier support for !!. From Joachim.
+
+Wed May 1 16:30:56 1996 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (TEXCONFIG): Take $HOME back out again, we're going
+ to hardwire a seach for dvipsrc in $HOME.
+
+Mon Apr 29 14:02:03 1996 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (latex2e_inputs): Use just `latex', not `latex2e'.
+ From: David Carlisle <carlisle@cs.man.ac.uk>.
+ (TEXINPUTS, etc.): Also rewrite to make !! support easier to add.
+ From: Joachim Schrod <schrod@iti.informatik.th-darmstadt.de>.
+
+ * install.texi: Document ksh/ash/Ultrix sh lossage, in favor of
+ bash/bsh/sh5.
+
+Sun Apr 28 15:02:55 1996 Karl Berry <karl@cs.umb.edu>
+
+ * acconfig.h (ASM_NEEDS_UNDERSCORE): New define.
+ From: Peter Breitenlohner <peb@MPPMU.MPG.DE>.
+
+ * Makefile.in (sharedlib_version): Remove unused variable.
+
+Sat Apr 27 17:15:14 1996 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (hyph_size): Add this.
+
+Tue Apr 23 07:34:05 1996 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (MIMELIBDIR, MAILCAPDIR): Add these.
+ (MPXCOMMAND): And these.
+
+ * MakeTeX.site: New file, just an example.
+
+Mon Apr 22 17:31:27 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXnames.conf: Rename to MakeTeXnames.cnf.
+ * MakeTeXnames: Change call.
+ * Makefile.in (install-exec): Change install.
+
+Sun Apr 21 12:09:06 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h (kpse_set_program_enabled, kpse_maketex_option):
+ Declare new functions.
+ (kpse_src_type): Define new type.
+ * tex-file.c (kpse_set_program_enabled): New function, so we can
+ set this at all the various levels and get the overrides right.
+ (kpse_maketex_option): Handle MakeTeX options in a common place.
+ * proginit.c (kpse_init_prog): Call it, and remove the make_tex_pk
+ argument.
+ * proginit.h (kpse_init_prog): Likewise.
+ * kpsewhich.c (parse_options): New options -maketex and -nomaketex,
+ just calls kpse_maketex_option.
+
+ * Makefile.in ($(library).h): New target, made at dist time.
+
+Sat Apr 20 17:21:24 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_find_file): Do not pound the disk on the first
+ search if we might be trying the second.
+
+Tue Mar 12 15:21:16 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK: Restore check for mismatched mode and bdpi. From Thomas.
+
+Sun Mar 10 14:17:14 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXnames.conf: Rename VARFONTS to VARTEXFONTS.
+
+ * MakeTeXcommon (trap): Oops, cd $KPSE_DOT before testing $STDOUT.
+
+Sat Mar 9 17:57:02 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXcommon (trap): cd back to KPSE_DOT before removing
+ TEMPDIR, in case $TMPDIR is relative. Reported by Thomas.
+
+Fri Mar 8 11:41:22 1996 Karl Berry <karl@cs.umb.edu>
+
+ * db.c (kpse_db_search): Add debug statement with the result of
+ the match.
+
+ * tex-make.c (kpse_make_tex): Don't look for the arg spec here.
+ * tex-file.c (init_maketex): Do it here. Check for disbaling in
+ the config file, too.
+
+ * tex-make.c (misstex): Look for TEXMFOUTPUT in texmf.cnf.
+ * texmf.cnf.in (TEXMFOUTPUT): Define this.
+
+ * kpathsea.texi (Suppressing warnings): New node to describe TEX_HUSH.
+
+ * tex-file.c (kpse_init_format): Include the numeric value of the
+ format for use with kpsewhich --format.
+
+ * tex-hush.c: Support `all' to suppress everything.
+
+Thu Mar 7 11:24:51 1996 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c: Change --program to --progname, for compatibility
+ with TeX & co.
+
+ * texmf.cnf.in (TEXCONFIG): Remove ~ from default path, for
+ consistency with everything else.
+
+ * readable.c: Let's call it TEX_HUSH instead of KPSE_NOWARN_PERM,
+ so we can use it for checksum warnings, too. And for similarity
+ with xdvi.
+ * kpathsea.texi: Corresponding change.
+ * tex-hush.[ch]: New files.
+
+Wed Feb 28 15:16:32 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-make.c (misstex): Let the name missfont.log be configurable.
+ * texmf.cnf.in (MISSFONT_LOG): Add this definition.
+ * kpathsea.texi: Document this.
+
+Sun Feb 25 16:55:35 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c: Reverse order of alias & suffix searches, so we look
+ for the original TFM name before aliases.
+
+Sun Feb 18 16:24:50 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (xopenfile): Move this function to here and rename to
+ kpse_open_file.
+ * xopenfile.c: Remove this.
+ * Makefile.in (objects): Remove xopenfile.o.
+
+Thu Feb 15 12:57:56 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-make.c (maketex): Do not print the `kpathsea: Running ...'
+ message if we're discarding output.
+ (misstex): Do not log the missing file in missfont.log, either.
+
+Sat Feb 10 14:59:23 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (sharedlib): Add new command here $(shared_postlink)
+ so we can make the necessary symlink.
+ (shared_postlink): New variable
+
+Fri Feb 9 15:46:55 1996 Karl Berry <karl@cs.umb.edu>
+
+ * withenable.ac (maketex{mf,pk,tfm}-default): Move here from
+ web2c/withenable.ac.
+
+Wed Feb 7 16:52:08 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXnames.conf: Extract this new script from MakeTeXcommon, sigh.
+ * MakeTeX*: Other updates from Thomas --
+ - replace the exec 3>&1 1>&2 by trap/subshell construction. The
+ 3>&1 may cause the 'open fd bug' with bash.
+ - ts is a typo. tc are the text companion fonts
+ - replace >&3 by >$STDOUT where $STDOUT is a filename. Its content is
+ displayed by the trap command in MTcommon.
+ - added missing ;; in case/esac
+ - use : ${VAR=VAL} where possible
+ - added mt_min_args
+ - removed psfonts.map parsing (was only needed for ps2pk)
+ - removed >&2 where redirection stdout->stderr is active anyway
+ - removed </dev/null where redirection stdin<-/dev/null is active
+ anyway
+ - Oops: MakeTeXTFM still used old code: >$TEMPDIR/mtout.$$
+ - add line
+ trap 'test -f $STDOUT && cat $STDOUT; cd /; rm -rf $TEMPDIR; exit 0' 0 1 2 15
+ to MakeTeXcommon
+ - MT_FEATURES now in MakeTeXnames.conf since we need to read it
+ later than MakeTeXcommon
+
+Tue Feb 6 17:04:25 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h (kpse_file_format_type): Add afm and type1 support.
+ * tex-file.c: Likewise.
+ (kpse_init_format): In tex_ps_header_format, no longer need to
+ recognize .pfa and .pfb.
+ * texmf.cnf.in (AFMFONTS, T1FONTS): Likewise.
+ * Makefile.in (paths.h): Include 0-9 in the regexp for the sake of
+ T1FONTS.
+
+Sat Feb 3 15:45:00 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (DEFS): Move to common.make.
+
+Mon Jan 29 17:01:44 1996 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXls-R: Doc fix.
+
+Mon Jan 8 17:17:42 1996 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c: Doc fix.
+
+ * fontmap.c (MAP_NAME, MAP_HASH_SIZE): Conditionalize these #defines.
+
+Sun Jan 7 17:38:00 1996 Karl Berry <karl@cs.umb.edu>
+
+ * db.c (DB_HASH_SIZE, DB_NAME): Conditionalize these.
+
+ * MakeTeXcommon (dcfontdir, tsfontdir): Use supplier `jknappen'.
+
+Mon Jan 1 15:14:42 1996 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (distdir): Don't bother including freedom.texi.
+
+Fri Dec 29 17:17:08 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in: misc.make is now clean.make.
+
+Tue Dec 26 14:21:08 1995 Karl Berry <karl@cs.umb.edu>
+
+ * withenable.ac: New file with --enable option extracted from
+ common.ac, for the top level to include.
+
+ * acconfig.h (MAKE_TEX_PK_BY_DEFAULT): Add this.
+
+ * readable.c (kpse_readable_file): Omit warning if
+ KPSE_NOREAD_WARN is set to 1.
+
+Wed Dec 13 14:14:09 1995 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c: Call kpse_init_format when necessary in the
+ --format case.
+
+Mon Dec 11 14:42:13 1995 Karl Berry <karl@cs.umb.edu>
+
+ * common.ac: --disable-shared should not act like --enable-shared.
+ From Ulrik.
+
+Sun Dec 10 15:35:15 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h (kpse_mft_format): New format.
+ * tex-file.c (MFT_ENVS): New variable.
+ (kpse_init_format): Initialize it.
+ * texmf.cnf.in (MFTINPUTS): New variable.
+
+Fri Dec 8 08:54:58 1995 Karl Berry <karl@cs.umb.edu>
+
+ * xopenfile.c: Doc fix.
+
+Mon Dec 4 17:23:34 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (check): Extra $ missing.
+
+Sun Dec 3 13:42:54 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (TEX_SUFFIXES): Add .dtx.
+
+Sun Nov 19 16:19:37 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeX*: Use MakeTeXupdate, mkdir, etc. in $TEXMFCNF_DIR, not
+ along PATH. From John I.
+
+Sat Nov 18 17:03:46 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (TEX_SUFFIXES): Add .txi.
+
+Fri Nov 17 15:12:03 1995 Karl Berry <karl@cs.umb.edu>
+
+ * common.ac (kb_AC_SYS_SHAREDLIB): Add the kb_ prefix.
+
+ * Makefile.in ({un,}install-exec): Use sharedlibname and
+ staticlibname instead of `basename`.
+ Also, pass no arguments to $(shared_postinstall); let the Autoconf
+ macro set this completely.
+
+ * expand.c: Bash code remains under the GPL, per rms.
+
+Thu Nov 16 16:14:14 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (uninstall-exec): Needs same `basename` treatment as
+ install-exec. From Ulrik.
+
+ * config.h [AMIGA] (pclose): Must be #defined as 0, not just
+ empty. From Andreas Scherer.
+
+Tue Nov 14 14:04:57 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h (kpse_fallback_resolutions_string): New global.
+ * tex-file.c: Define it.
+ (kpse_init_fallback_resolutions): Use it instead of
+ DEFAULT_FONT_SIZES, if set.
+
+Mon Nov 13 10:43:11 1995 Kathy Hargreaves <karl@cs.umb.edu>
+
+ * find-suffix.c: Remove spurious + 1.
+
+Sun Nov 12 13:42:51 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c: Improve warning message if last resort sizes are not
+ sorted. Suggested by Kathy.
+
+ * texmf.cnf.in (trie_size, main_memory): Doc improvements from Wayne.
+
+Sat Nov 11 16:58:37 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXnames: Correct too many left quotes.
+
+ * tex-make.c (kpse_make_tex): Initialize the format if necessary.
+
+Mon Oct 30 16:49:05 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK (GFNAME): Do not assume $cmd produced $GFNAME. From Tim.
+
+ * texmf.cnf.in (trie_size): Increase to 32000 so common language
+ combinations will require no change. Suggested by Ulrik.
+
+ * MakeTeXls-R: Missing s in sed cmd.
+ * MakeTeXTFM (TFM_NAME): Should be TFMNAME.
+ * MakeTeXnames (FONTNAME): Missing `.
+ * MakeTeXcommon: If the caller requires no args (i.e.,
+ MakeTeXls-R), don't complain if given no.
+ Missing } in varfonts case.
+ All from Thomas.
+
+Sun Oct 22 17:02:25 1995 Karl Berry <karl@cs.umb.edu>
+
+ * c-std.h (hypot): Remove this declaration. It was only needed for
+ fontutils, and it conflicts under Linux 1.2.10. From Tim Murphy.
+
+Sat Oct 14 10:55:26 1995 Karl Berry <karl@cs.umb.edu>
+
+ * acconfig.h (EDITOR): Missing %. From Tim Murphy.
+
+Sat Oct 7 17:44:41 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (install-exec): Use basename to get the real name so
+ we don't install in $(libdir)/../kpathsea/etc.
+ From Ulrik.
+
+Sat Sep 30 12:16:05 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXls-R (db_file_tmp): Replace double slashes with single,
+ for the sake of NetBSD/FreeBSD. From Thomas.
+
+Fri Sep 29 11:29:08 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (tex-file.o): CPPFLAGS is now ALL_CPPFLAGS.
+
+Mon Sep 25 15:05:32 1995 Karl Berry <karl@cs.umb.edu>
+
+ * lib.h (FATAL_PERROR): Avoid using the formal parameter `s' since
+ cc gets confused with %s.
+
+ * MakeTeXls-R: Include subtleties from Thomas.
+ * MakeTeXcommon: Rename stickydir to appendonlydir.
+
+Sun Sep 24 13:15:51 1995 Karl Berry <karl@cs.umb.edu>
+
+ * cnf.c (kpse_cnf_get): Call kpse_init_db here.
+ * pathsearch.c (search): Instead of here.
+
+ * tex-file.c (init_format): The override path may be null, so use
+ MAYBE to print it.
+
+ * MakeTeXPK: Don't use unset, as Ultrix sh doesn't support it.
+
+Sat Sep 23 15:07:12 1995 Karl Berry <karl@cs.umb.edu>
+
+ * common.ac (basename strstr putenv): Use AC_REPLACE_FUNCS instead
+ of AC_CHECK_FUNCS. Add strtol and strcasecmp from web2c/lib and xdvik.
+ * Makefile.in (objects): Use @LIBOBJS@ instead of corresponding .o's.
+
+Fri Sep 22 13:34:51 1995 Karl Berry <karl@cs.umb.edu>
+
+ * acconfig.h (MAKE_TEX_*): #define as 0/1, instead of #undef,
+ since we now pass this as a default argument to init_maketex.
+
+ * tex-file.c (init_path): Look for environment variables PATH.prog
+ and PATH_prog before PATH.
+
+Thu Sep 21 13:53:38 1995 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c (USAGE): Avoid bare newline.
+
+ * xfseek.c, xftell.c: Add unprototypification.
+
+ * common.ac (library_cflags): AC_SUBST for this depending on
+ --enable-shared.
+ * Makefile.in (shared_cflags, sharedlib_cflags): Rewrite
+ accordingly, so the shared flags aren't always used.
+
+Wed Sep 20 17:06:53 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c: Add .ltx, .texi, and .texinfo as alternate suffices
+ for kpse_tex_format.
+
+Tue Sep 19 17:12:10 1995 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in: Changes for TDS.
+
+ * MakeTeX*: New scripts from Thomas.
+
+Sat Sep 16 17:30:46 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c: Do not print extra `kdebug:'s when printing the
+ alt_suffixes.
+
+ * expand.c: Incorporate brace expansion code from bash.
+ * texmf.cnf.in (PKFONTS.xdvi): Use it here, and document the
+ possibility for $TEXMF.
+
+Thu Sep 14 12:59:17 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_init_format): For any_glyph_format, do not
+ initialize a suffix.
+
+ * kpsewhich.c (main): Initialize all the formats.
+ (find_format): psfonts.map => dvips_config_format.
+
+Tue Sep 12 16:19:44 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeX{MF,TFM}: New scripts from te.
+ * Makefile.in (install-exec, distdir): Install and dist them.
+
+Sun Sep 10 15:11:07 1995 Karl Berry <karl@cs.umb.edu>
+
+ * pathsearch.c (search): Doc fix.
+
+ * tex-file.h (kpse_format_info_type): Add alt_suffix member.
+ * tex-file.c (init_format): Set it for PS headers and picts, and
+ print it if it exists.
+ * kpsewhich.c: Use the new alt suffixes and also the regular
+ suffixes to allow for -format names as well as numbers, and for
+ file format guessing.
+
+Sat Sep 9 14:27:48 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK: If the MODE and BDPI don't match, ignore the mode.
+ Suggested by Thomas.
+
+ * tex-file.[ch] (kpse_font_override_path): Remove this.
+ (kpse_format_info_type): Replace the `override_p' member with a
+ general `override_path'.
+ * proginit.c: Set the override path for both fonts and headers.
+
+ * acconfig.h (NOTOOL): Add this.
+
+Fri Sep 8 14:52:42 1995 Karl Berry <karl@cs.umb.edu>
+
+ * acconfig.h (HYPERXDVI): Don't need this after all, Autoconf's
+ default actions are better.
+
+Thu Sep 7 15:11:17 1995 Karl Berry <karl@cs.umb.edu>
+
+ * acconfig.h (HYPERXDVI): Define this.
+
+Mon Sep 4 17:14:25 1995 Karl Berry <karl@cs.umb.edu>
+
+ * debug.h (KPSE_LAST_DEBUG): Define this, for use with gsftopk.
+
+ * Makefile.in (objects): Add xopenfile.o.
+ * xopenfile.c: New file.
+ * lib.h (xopenfile): Declare it.
+
+Sat Sep 2 13:49:53 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h (kpse_file_format): Rename kpse_ps_header_format to
+ tex_ps_header_format.
+ * tex-file.c (TEX_PS_HEADER_ENVS): Rename likewise, etc.
+ * kpsewhich.c (suffixes): Likewise.
+ * texmf.cnf: Likewise.
+
+ * tex-file.c: Never set must_exist on the first search. Is this
+ really correct?
+
+Fri Sep 1 13:24:49 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-make.c (maketex): Give perror if the popen fails.
+
+ * db.c (db_dir_list): Keep track of the directories we found db's in.
+ (kpse_db_search): If no db directories are relevant to this path
+ elt, return NULL.
+ * db.h: Doc fix.
+ * pathsearch.c (path_search): Doc fix.
+
+ * Makefile.in (shared_ext, etc.): Move to common.make.
+
+Thu Aug 31 14:40:32 1995 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c: Install suffix rewrite from Yves.
+
+ * common.ac: Move AC_SYS_SHAREDLIB etc. here.
+
+ * acconfig.h (ASM_SCALED_FRACTION): Add this.
+
+Wed Aug 30 17:02:58 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_find_file): Call kpse_make_tex.
+ * tex-make.c (kpse_make_tex): Only call set_maketex_mag if we are
+ doing MakeTeX-PK or GF-ing.
+ From Greg.
+
+Tue Aug 29 13:58:59 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (texmf.sed): Depend on paths.make. Should we avoid
+ creating a new file unless it changes, a la c-auto.h?
+
+ * configure.in: Check for --enable-shared.
+
+Mon Aug 28 17:50:06 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in: Add sharedlib variables.
+
+Sun Aug 27 13:27:01 1995 Karl Berry <karl@cs.umb.edu>
+
+ * hash.c (hash_print): New option summary_only, and always print
+ the summary. Also, output to stderr, not stdout.
+ * hash.h: Change decl.
+
+ * db.c (kpse_init_db): Oops, have to make it external, so rename
+ again.
+ * db.h: Declare it.
+ * pathsearch.c (search): Call it.
+
+ * cnf.c (read_all_cnf): Rename from read_files.
+ * db.c (read_all_lsR): Rename from read_all_dbs.
+ * fontmap.c (read_all_maps): Rename from map_create.
+
+ * tex-file.h (kpse_db_format): Another new type.
+ * tex-file.c (kpse_init_path): Case for it.
+ (DB_ENVS): Envvar list.
+ * texmf.cnf.in (TEXMFDBS): Default path.
+ * kpsewhich.c (suffix): Add new element.
+
+Sat Aug 26 14:49:28 1995 Karl Berry <karl@cs.umb.edu>
+
+ * cnf.c (CNF_NAME): #define this.
+ * tex-file.c (kpse_init_path): Instead of setting the .program
+ element to texmf.cnf here.
+
+ * db.c (db_insert): Rename to kpse_db_insert.
+ * db.h: Change decl.
+ * tex-make.c (maketex): Change call.
+
+ * cnf.c, cnf.h, db.c, db.h, pathsearch.c: Remove references to
+ kpse_db_dir.
+ * pathsearch.c (first_search): New static.
+ (path_search): Do not do ls-R search if first_search.
+ (search): Do not log if first_search.
+
+ * pathsearch.c (path_search): Don't bother calling elt_in_db --
+ the match function in db.c will catch the irrelevant hits.
+ Pointed out by te.
+
+Fri Aug 25 14:01:24 1995 Karl Berry <karl@cs.umb.edu>
+
+ * cnf.c (kpse_cnf_get): Look for NAME.PROGRAM before NAME.
+ (do_line): Save NAME.PROGRAM separately from NAME.
+ * texmf.cnf.in: Put the usual definitions of TEXINPUTS and PKFONTS
+ first now, before the .prog variants.
+
+ * fontmap.c: Use ISSPACE instead of just checking for space and tab.
+
+Thu Aug 24 13:46:19 1995 Karl Berry <karl@cs.umb.edu>
+
+ * lib.h (strstr) [!HAVE_STRSTR]: Declare this.
+ * Makefile.in (objects): Add strstr.o.
+ * common.ac (AC_CHECK_FUNCS): Remove memmove; we seem to never use
+ this. And add strstr.
+
+ * fontmap.c (map_file_parse): Comments at the last % or @c, not at
+ the first %. Also, implement the include feature.
+ And thus, don't give up if the map file can't be opened.
+ (token): New routine, since we can no longer use strtok.
+
+ * tex-file.h (kpse_file_format_type): New format kpse_fontmap_format.
+ * tex-file.c (kpse_init_format): Initialize it.
+ (FONTMAP_ENVS): Define it.
+ * texmf.cnf.in (TEXFONTMAPS): Define the default.
+ * kpsewhich.c (suffix): Add .map.
+
+Tue Aug 22 13:28:46 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK.in: No >&/dev/null, source.map is now supplier.map.
+
+ * tex-file.c: Doc fix.
+
+Mon Aug 21 15:52:42 1995 Karl Berry <karl@cs.umb.edu>
+
+ * c-memstr.h (SYSV): OK, omit this definition in the never-ending
+ battle to appease the X headers.
+ From: neal@ctd.comsat.com (Neal Becker).
+
+Sun Aug 20 12:58:28 1995 Karl Berry <karl@cs.umb.edu>
+
+ * cnf.c (read_files): Concatenate consecutive lines that end in \.
+
+ * types.h (boolean) [__cplusplus]: Don't define true and false for C++.
+ From: Johannes Sixt <Johannes.Sixt@risc.uni-linz.ac.at>.
+
+ * db.c (db_build): Call absolute_p to determine if the possible
+ directory really is one.
+ Also, allow relative names in the ls-R file.
+
+ * kpsewhich.c: New options -path, -separator.
+ From: David Aspinall <da@dcs.ed.ac.uk>.
+
+ * MakeTeXPK.in: Unset DISPLAY and MFTERM.
+ From: Yves Arrouye <Yves.Arrouye@imag.fr>.
+
+ * db.c (ignored_dir_p): New function to ignore . directories.
+ (db_build): Call it, and do the ignoring. Report on how many
+ directories were ignored.
+
+ * Makefile.in (MakeTeXPK): Remove dcfontdir substitution.
+ * MakeTeXPK.in: Play redirection games so regular echo's will work.
+ (dcfontdir): Remove this; it's unused.
+ From: te@informatik.uni-hannover.de (Thomas Esser).
+
+ * pathsearch.c (path_search): Free more garbage.
+ From: John Eaton <jwe@che.utexas.edu>.
+
+Sat Aug 19 12:57:54 1995 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c (USAGE): Document -format and -program.
+
+ * tex-make.c (maketex): Give warning if MTPK output a string that
+ wasn't a filename. From Pierre.
+
+ * kpsewhich.c (read_command_line): Execute -expand right
+
+ * tilde.c (kpse_tilde_expand): If HOME is /, don't start path with //.
+ From: Andreas Schott <andreas@mpa-garching.mpg.de>.
+
+ * db.c (match): Make /// (or more) like //.
+ * elt-dirs.c (do_subdir): Likewise. Also, skip over as many
+ slashes as we found.
+
+ * variable.c (expanding_p, expanding, expansions, expansion_type):
+ New functions, variables, type.
+ (expand): Check for recursively expanded variables.
+ Reported by Nicolai Langfeldt <janl@math.uio.no>.
+
+ * cnf.c (kpse_cnf_get): Free temporary list after extracting the
+ first element (the one we return).
+
+Fri Aug 18 17:39:29 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK.in (1270): The guess here should be linohi, not linolo.
+ From pwa.
+
+ * kpsewhich.c (suffix): Update for new MetaPost stuff.
+ * tex-file.h: Doc fix.
+
+Mon Aug 14 17:49:05 1995 Karl Berry <karl@cs.umb.edu>
+
+ * debug.h: Define KPSE_DEBUG, not DEBUG.
+ * hash.c, hash.h, tex-file.c, elt-dirs.c, dir.c, db.c: Change
+ #ifdef's accordingly. From John I.
+
+Sun Aug 13 16:03:51 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h (kpse_file_format_type): Rename kpse_dvips_headers to
+ just kpse_ps_headers. xdvik uses this too, now.
+ * tex-file.c (kpse_init_format, KPSE_DVIPS_HEADER_ENVS): Likewise.
+ Also, look for the PSHEADERS envvar, not DVIPSHEADERS.
+ * texmf.cnf.in: Likewise.
+
+Thu Aug 10 19:31:14 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_init_fallback_resolutions): Complain if sizes
+ aren't sorted, and ignore offending sizes.
+ From: Manuel Fahndrich <manuel@CS.Berkeley.EDU>.
+
+Tue Aug 1 13:53:53 1995 Karl Berry <karl@cs.umb.edu>
+
+ * variable.[ch] (kpse_var_value): Use const_string.
+
+ * texmf.cnf.in (string_vacancies): Decrease to 25000. From Bernd.
+ (font_max): Add this. From Wayne.
+
+Mon Jul 31 15:47:01 1995 Karl Berry <karl@cs.umb.edu>
+
+ * db.h (KPSE_DB_DIR): Remove $.
+ * cnf.c (read_files): Call kpse_var_value instead of kpse_var_expand.
+
+ * tex-file.[ch]: Add mpsupport and troff_font formats.
+ * texmf.cnf.in: Likewise.
+
+Sat Jul 29 09:21:44 1995 Karl Berry <karl@cs.umb.edu>
+
+ * variable.h (kpse_var_value): Declare this.
+ * variable.c (kpse_var_value): New routine.
+
+ * tex-file.c: Check TEXMFINI for pool/fmt/base/mem lookups
+
+Tue Jul 25 11:22:25 1995 Karl Berry <karl@cs.umb.edu>
+
+ * concatn.c (concatn): Free the intermediate result, not the final
+ version.
+
+ * texmf.cnf.in (TEXMFLOG): Don't mention this, as we need to log
+ the finding of the .cnf file itself, thus it must be an
+ environment variable.
+
+Sat Jul 22 17:09:58 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (KPSE_{MEM,MP,MPPOOL}_ENVS): Define envvars.
+ * tex-file.h (kpse_file_format_type): Add kpse_{mem,mp,mppool}_formats.
+ * texmf.cnf.in (MPPOOL, MPMEMS, MPINPUTS): New variables.
+ Adapted from: vieth@xerxes.thphy.uni-duesseldorf.de (Ulrik Vieth).
+
+Fri Jul 21 15:26:42 1995 Karl Berry <karl@cs.umb.edu>
+
+ * *.c, *.h: The FSF has a new address.
+
+ * kpsewhich.c: Give error if no args.
+
+Wed Jul 19 17:34:26 1995 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in: Document limits on error_line et al.
+
+Mon Jul 17 13:09:05 1995 Karl Berry <karl@cs.umb.edu>
+
+ * acconfig.h (NO_FMTBASE_SHARE): Rename to NO_DUMP_SHARE.
+
+Sun Jul 16 14:17:16 1995 Karl Berry <karl@cs.umb.edu>
+
+ * acconfig.h (IPC, FUNNY_CORE_DUMP, NO_FMTBASE_SHARE): Include these.
+
+Sat Jul 15 12:45:51 1995 Karl Berry <karl@cs.umb.edu>
+
+ * acconfig.h (HAVE_ITOA): Remove extraneous #define.
+
+ * texmf.cnf.in (hash_extra): New TeX array variable, 0 by default.
+
+ * tex-file.c (KPSE_BIB_ENVS): Include TEXBIB.
+
+Thu Jul 13 15:04:52 1995 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (TEXPOOL, MFPOOL): Include . after all, now that we
+ use TEXPOOL to search for tcx files.
+
+Sun Jul 9 15:30:59 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_find_file): Don't go through the
+ mapped_name_list if it's null.
+
+Wed Jun 21 19:47:33 1995 Karl Berry <karl@cs.umb.edu>
+
+ * lib.h (FATAL5): Define this.
+
+Sat Jun 10 15:52:41 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_find_file): Use texfonts.map aliases for TFM
+ searches.
+ * tex-file.h: Doc fix.
+ * fontmap.c (kpse_fontmap_lookup): New name. Fault in the map
+ table as needed, instead of initializing. Make map_create static.
+ * fontname.h: New name; remove map_create.
+ * tex-glyph.c (try_fontmap): Just call kpse_fontmap_lookup, no
+ need to create it.
+
+ * fontmap.c (map_lookup): Don't let return value fall off the end
+ in the suffix-appending case.
+ From: "Heading, Anthony" <heading_anthony@jpmorgan.com>.
+
+Fri Jun 9 19:11:34 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tilde.c: Only assume PWD_H for looking up ~user, not for ~ or ~/.
+ * make-suffix.c: Use IS_DIR_SEP instead of assuming /.
+ * concatn.c: Free the in-between concatenations to avoid garbage.
+ * absolute.c [OS2]: Use same conventions as for DOS.
+ * c-std.h, c-pathch.h, c-fopen.h: Likewise.
+ From: rs@purple.in-ulm.de (Ralph Schleicher).
+
+Tue Jun 6 13:11:46 1995 Karl Berry <karl@cs.umb.edu>
+
+ * lib.h (itoa) [!HAVE_ITOA]: Define conditionally.
+ * itoa.c: Likewise.
+ * acconfig.h (HAVE_ITOA): Add this.
+
+ * c-pathch.h, c-fopen.h [DOS]: Changes from web2pc from Wayne.
+
+ * xputenv.c: Doc fix.
+
+ * truncate.c (kpse_truncate_filename): Check for a device separator.
+
+ * elt-dirs.c (main): Tests for Amiga.
+
+Mon Jun 5 13:12:10 1995 Karl Berry <karl@cs.umb.edu>
+
+ * absolute.c: Add Amiga support. From Andreas Scherer.
+ * c-pathch.h: Ditto.
+ * elt-dirs.c (dir_list_add): Ditto. Check for device separators, too.
+
+Sun Jun 4 11:29:18 1995 Karl Berry <karl@cs.umb.edu>
+
+ * c-proto.h (AA): New macro to throw away (or keep) any number of
+ arguments, used with an extra set of parens.
+
+ * Makefile.in (distdir): Put PROJECTS in the distribution.
+
+Sat Jun 3 11:53:45 1995 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (main_memory): Add definitions for TeX array sizes.
+
+ * config.h (progname.h): Include this.
+ * prog{init,name}.c, kpsewhich.c: No longer need to include it.
+ * lib.h (START_FATAL, FATAL_PERROR): Use program_invocation_name
+ in the error message.
+
+ * variable.h: Doc fix.
+
+Fri Jun 2 13:41:29 1995 Karl Berry <karl@cs.umb.edu>
+
+ * config.h (DOSISH) [DOS || OS2]: Define this.
+
+Tue May 30 15:43:56 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_find_file): Don't look for foo.sty.tex before
+ foo.sty. Suggested by worsch@ira.uka.de.
+
+Mon May 29 15:24:38 1995 Karl Berry <karl@cs.umb.edu>
+
+ * db.c (db_insert): If DOS, don't check that first character on a
+ line IS_DIR_SEP. From Sebastian.
+
+Sat May 27 13:51:47 1995 Karl Berry <karl@cs.umb.edu>
+
+ * pathsearch.c (log_search): Cast time_t arg to avoid printf warning.
+
+ * lib.h (atou): Declare it.
+ * Makefile.in (objects): Add atou.o.
+ * atou.c: New file.
+
+Sun May 21 10:58:31 1995 Karl Berry <karl@cs.umb.edu>
+
+ * xfopen.c: Assert non-null filenames.
+
+Mon May 15 17:40:27 1995 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c (USAGE): Add one-line description to the help message.
+
+Sun Apr 16 14:25:06 1995 Karl Berry <karl@cs.umb.edu>
+
+ * line.c (BLOCK_SIZE): Increase to 56, to avoid realloc's.
+
+Fri Apr 14 15:56:13 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (objects): Add xfseek and xftell, from fontutils.
+
+Mon Mar 13 20:05:02 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK.in: Don't egrep in a file that doesn't exist.
+
+Fri Mar 10 10:49:28 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_find_file): Abort if the name passed in is null
+ or empty.
+
+Thu Mar 9 15:23:07 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_init_format): Only do suffix searches for GF files.
+
+ * acconfig.h: Warn that this is not the right thing to edit to fix
+ configuration problems.
+
+Thu Mar 2 15:58:11 1995 Karl Berry <karl@cs.umb.edu>
+
+ * texmf.cnf.in (TEXFORMATS): Doc fix.
+
+Fri Feb 24 16:40:23 1995 Karl Berry <karl@cs.umb.edu>
+
+ * MakeTeXPK.in: `generate rootname' with no trailing punctuation
+ for the dc fonts.
+
+Mon Feb 20 15:23:05 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h (kpse_find_mf): New abbreviation.
+
+Sat Feb 11 13:06:23 1995 Karl Berry <karl@cs.umb.edu>
+
+ * putenv.c: Include c-auto.h instead of kpathsea/c-auto.h, so the
+ sed commands don't transform it into
+ $(kpathsea_srcdir)/c-auto.h. From Andreas.
+
+ * tex-make.c (maketex): Don't make a bad return from pclose a
+ fatal error. Reported most recently by Wayne Sullivan, also by
+ Andy Piper in the past.
+
+ * MakeTeXPK.in (sauterdir): Only try this if we have the right
+ b-foo.mf file. And correct $DESTDIR=... mistake.
+ From Nick Cropper <nickc@dcs.st-andrews.ac.uk>.
+
+Fri Feb 10 15:49:49 1995 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (INIT_MT): If the .program member has already been
+ set, don't reset it.
+
+Wed Jan 18 15:47:07 1995 Karl Berry <karl@cs.umb.edu>
+
+ * xopendir.c (xclosedir): Use CLOSEDIR_VOID, not VOID_CLOSEDIR.
+ From tim@maths.tcd.ie.
+
+ * db.c (db_insert): Don't assert db.size>0, since we may not have
+ called kpse_db_search. From te@informatik.uni-hannover.de.
+
+ * MakeTeXPK.in (dc fonts): Don't put a trailing period in the
+ filename. From Tor Lillqvist <tml@hemuli.tte.vtt.fi>.
+
+Sun Jan 8 12:14:47 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Version 2.6.
+
+Wed Jan 4 14:44:34 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (mostlyclean): Remove kpsewhich.
+
+Tue Jan 3 11:48:40 1995 Karl Berry <karl@cs.umb.edu>
+
+ * kpsewhich.c (long_options): Can't make this automatic.
+
+ * basename.c: Include <kpathsea/config.h> before testing
+ HAVE_BASENAME.
+
+ * Makefile.in (kpsewhich): Make the library before kpsewhich.o.
+ (paths.h): No need for the $(kpathsea_dir)/ any more, now make
+ depend gets rid of it.
+
+ * rm-suffix.c: Doc fix.
+
+ * kpsewhich.c: Extract the dpi from the filename if possible.
+
+Mon Jan 2 09:45:17 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (kpsexpand): Replace with kpsewhich.
+
+ * proginit.h: Doc fix.
+
+ * texmf.cnf.in (TEXMFCNF): Rename from TEXMF_CNF.
+ * tex-file.c (kpse_init_format): Likewise.
+
+Sun Jan 1 14:04:41 1995 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (MakeTeXPK): Substitute for web2cdir.
+ * MakeTeXPK.in: Use it for MakeTeXPK.site.
+ (install-data): Install texmf.cnf in web2cdir instead of texmf.
+ * texmf.cnf.in (TEXMF_CNF): Default path includes web2cdir.
+
+Sat Dec 31 14:26:48 1994 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (objects): No more @LIBOBJS@.
+ * common.ac: Use AC_CHECK_FUNCS for basename, not REPLACE_FUNCS.
+ The latter doesn't define HAVE_BASENAME.
+ * basename.c [!HAVE_BASENAME]: Conditionalize whole file.
+
+ * Makefile.in (uninstall-exec): Remove kpsexpand.
+ (MakeTeXPK): New target.
+ (install-exec): Install MTPK.
+ (install-library): New target to replace install-headers.
+ (install): Don't install-library by default.
+
+Fri Dec 30 15:53:04 1994 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (objects): Don't put @LIBOBJS@ on a line by itself.
+ From Joachim.
+
+Mon Dec 26 07:55:40 1994 Karl Berry <karl@cs.umb.edu>
+
+ * common.ac (AC_FUNC_CLOSEDIR_VOID): Call this. Reported by
+ Timothy Murphy <tim@maths.tcd.ie>.
+
+ * tex-file.c (init_path): If a variable is set to an empty value,
+ ignore it. Suggested by Stephen Gildea <gildea@x.org>.
+
+ * proginit.c: If passed a NULL mode, put / in the environment here.
+ * tex-make.c (kpse_make_tex): Don't do STREQ on NULL (though it
+ should never be NULL in the first place), and properly restore
+ MAKETEX_MODE if it was /.
+
+Tue Dec 20 09:57:21 1994 Karl Berry <karl@cs.umb.edu>
+
+ * install.texi: Mention how to do optimization.
+
+Mon Dec 19 13:18:04 1994 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h: Doc fix.
+
+Wed Dec 14 14:46:47 1994 Karl Berry <karl@cs.umb.edu>
+
+ * Version 2.5.
+
+ * pathsearch.c (log_search): Don't prepend the `kdebug:' to the
+ search result.
+
+Sat Dec 10 16:49:12 1994 Karl Berry <karl@cs.umb.edu>
+
+ * tex-make.c (set_maketex_mag): Make case of magstep -1 work
+ properly. From a bug report by
+ heiko@lotte.sax.de (Heiko Schlittermann).
+
+Mon Dec 5 11:58:08 1994 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in (objects): Add @LIBOBJS@.
+ * common.ac: Check for basename.
+
+ * db.c (db_insert): Include trailing / in directory part, and pass
+ the key and the value in the right order. From
+ te@informatik.uni-hannover.de.
+
+Sun Dec 4 14:26:44 1994 Karl Berry <karl@cs.umb.edu>
+
+ * kpsexpand.c: Add extra filename argument. From
+ ware@cis.ohio-state.edu.
+
+ * common.ac: Use AC_TRY_RUN to test for SMART_PUTENV, not
+ AC_TRY_LINK. From parkes@sierravista.com.
+
+ * acconfig.h: Use #undef instead of commented-out `/* #define'.
+
+Sun Nov 27 13:47:06 1994 Karl Berry <karl@cs.umb.edu>
+
+ * db.c (db_insert): Don't try to insert into an empty hash table.
+ From dc@cobi.gsfc.nasa.gov (and others).
+
+ * pathsearch.c (log_search): Call DEBUGF, not printf, for the
+ filenames. From John I.
+
+ * tex-make.c (kpse_make_tex): If MAKETEX_MODE is /, unset it and
+ reset it around the command expansion.
+ (maketex): Back to calling db_insert.
+
+Sat Nov 26 11:44:09 1994 Karl Berry <karl@cs.umb.edu>
+
+ * cnf.c (read_file): If expansion of $TEXMF (KPSE_DB_DIR) fails,
+ expand DEFAULT_TEXMF. From te@informatik.uni-hannover.de.
+
+Thu Nov 24 13:41:15 1994 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (KPSE_BST_ENVS): Do not look at TEXINPUTS.
+
+ * tex-file.h: Doc fix.
+
+Tue Nov 15 14:06:56 1994 Karl Berry <karl@cs.umb.edu>
+
+ * progname.c (kpse_set_progname): Use basename.
+
+Fri Nov 11 19:12:23 1994 Karl Berry <karl@cs.umb.edu>
+
+ * acconfig.h (HAVE_SIGIO): Add this.
+
+Tue Nov 8 19:14:12 1994 Karl Berry <karl@cs.umb.edu>
+
+ * tex-make.c (kpse_make_tex): Change argument name from
+ `basename', since now we have a fn by that name.
+ * magstep.c (kpse_magstep_fix): Initialize mdpi.
+ * basename.c (basename): Initalize base.
+
+Mon Nov 7 15:46:21 1994 Karl Berry <karl@cs.umb.edu>
+
+ * common.ac: Run autoupdate.
+ * c-dir.h: Change #if names and NLENGTH to new style.
+
+Fri Oct 28 21:28:02 1994 K. Berry (karl@terminus.cs.umb.edu)
+
+ * Version 2.4.
+
+ * tex-make.c (maketex): Don't call db_insert, that routine is
+ buggy. I'll fix it later. In the meantime, trying to get a
+ semi-stable release.
+
+Tue Oct 25 16:43:31 1994 Karl Berry <karl@cs.umb.edu>
+
+ * Version 2.3.
+
+ * progname.c (kpse_set_progname): Initialize kpathsea_debug from
+ the KPATHSEA_DEBUG envvar. From neal@ctd.comsat.com.
+
+Mon Oct 24 13:41:24 1994 Karl Berry <karl@cs.umb.edu>
+
+ * db.c (db_insert): New function.
+ * db.h: Declare it.
+ * tex-make.c (maketex): db_insert the result if we succeeded.
+
+ * basename.c: New file to define basename.
+ * lib.h (basename): Declare it.
+ * Makefile.in (objects): Include basename.o.
+
+ * tex-file.h (kpse_file_format_type): Add missing enum values for
+ base/fmt/pool files.
+ * tex-file.c (kpse_init_format): Add cases for these.
+ From te@informatik.uni-hannover.de.
+
+ * lib.h (WARNING, FATAL): Use fputs instead of fprintf.
+ * Many files: Use DEBUGF instead of printf ("kdebug".
+ * debug.h (DEBUGF) [DEBUG]: Define this.
+
+ * xputenv.c (xputenv): Initialize that static saved_env_items to
+ null, just for documentation's sake.
+
+Tue Oct 18 13:19:06 1994 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (KPSE_*_ENVS): Move environment variable list here.
+ * tex-file.h: Move them from here.
+
+ * tex-glyph.h: Doc fix.
+
+ * tex-file.c (kpse_find_file): Correct off-by-one in suffix
+ comparison. From toy@rtp.ericsson.se.
+
+Mon Oct 17 14:01:02 1994 Karl Berry <karl@cs.umb.edu>
+
+ * elt-dirs.c (do_subdir): Find a top-level subdir if it matches
+ the POST.
+
+ * db.c (kpse_db_search): Allow for the passed name including a
+ directory part, as in dpi600/cmr10.pk.
+ * tex-glyph.c (try_format): First search all specs with
+ must_exist=false.
+
+ * kpsexpand.c: New file, from te@informatik.uni-hannover.de.
+ * Makefile.in (kpsexpand): New target (a program).
+ (install-exec): Depend on, and install, kpsexpand.
+
+ * common.ac: Doc fix.
+
+ * cnf.c (do_line): Don't quit just because the variable is in the
+ environment. From te@informatik.uni-hannover.de.
+
+ * tex-glyph.c (PXL_BITMAP_SPEC): Remove this, we're not going to
+ support pxl1500.
+
+Sun Oct 16 20:46:26 1994 Karl Berry <karl@cs.umb.edu>
+
+ * kpathsea.texi: Make it clear that names of debugging bits can
+ never be used.
+
+Fri Oct 14 10:31:35 1994 Karl Berry <karl@cs.umb.edu>
+
+ * Version 2.2.
+
+ * hash.c (hash_lookup) [DEBUG]: Cast to long, not int.
+
+Thu Oct 13 15:39:34 1994 Karl Berry <karl@owl>
+
+ * db.c (db_build): Warn if ls-R contains nothing useful.
+
+ * debug.c (fopen, fclose) [DEBUG]: fflush stdout.
+ * dir.c (dir_links),
+ * hash.c (hash_lookup),
+ * tex-file.c (kpse_init_format),
+ * elt-dirs.c (kpse_element_dirs): Likewise.
+
+Thu Oct 13 09:02:56 1994 Karl Berry <karl@cs.umb.edu>
+
+ * hash.c (kpse_debug_hash_lookup_int) [DEBUG]: New global.
+ (hash_lookup): Use it.
+ * hash.h [DEBUG]: Declare it.
+ * dir.c (dir_links) [DEBUG]: Set it and reset it.
+
+ * tex-glyph.c (PXL_BITMAP_SPEC): Add this (pxlNNN/cmr10.pk) for
+ the Bitstream utilities. From abrahams@acm.org.
+ (try_format): Search for this.
+
+Tue Oct 11 15:15:49 1994 Karl Berry <karl@cs.umb.edu>
+
+ * db.c (db_build): Use kpse_db_dir instead of KPSE_DB_DIR. This
+ avoids one variable expansion, and te@informatik.uni-hannover.de
+ says otherwise TeX sometimes can't find ls-R.
+
+Sun Oct 9 17:18:23 1994 Karl Berry <karl@cs.umb.edu>
+
+ * kdefault.c: Rename from default.c.
+ * Makefile.in (objects): Likewise.
+
+Fri Oct 7 12:58:33 1994 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.c (kpse_init_format): Call INIT_MT for the any_glyph
+ case. From carson@lehman.com.
+
+Sun Oct 2 14:11:20 1994 Karl Berry <karl@cs.umb.edu>
+
+ * magstep.c: Doc fix.
+
+Sun Sep 25 17:11:40 1994 Karl Berry <karl@cs.umb.edu>
+
+ * Makefile.in: Include library.make.
+
+Thu Sep 22 15:34:40 1994 Karl Berry <karl@cs.umb.edu>
+
+ * tex-file.h (kpse_file_format_type): Don't make equal to the last
+ element index, make one more. From Eric Auborg.
+
+Thu Sep 15 19:24:30 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (distdir): Include install.texi in the distribution.
+
+Mon Sep 12 11:05:18 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Version 2.1.
+
+Sun Sep 11 15:03:18 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (install-data): Install texmf.cnf if it didn't exist.
+
+Sat Sep 10 13:28:29 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (texmf.sed, paths.h): Use tr 012 instead of \n.
+ From John Interrante.
+
+ * Makefile.in (distdir): Include the .aux and .cps files in the
+ distribution. Don't include paths.h (from John Interrante).
+
+ * kpathsea.texi: Fix overfull boxes and other TeX errors.
+
+Wed Sep 7 16:28:37 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Version 2.0.
+
+Tue Sep 6 10:33:18 1994 Karl Berry (karl@cs.umb.edu)
+
+ * dir.c (dir_links): Use %ld for ret, since it's now a long.
+
+Sat Sep 3 09:01:25 1994 Karl Berry (karl@cs.umb.edu)
+
+ * dir.c (dir_links): Use long instead of int for the cast and the
+ variable, to avoid warnings on the Alpha.
+
+ * c-std.h (SYSV, X_NOT_STDC_ENV): Don't define these here.
+ * c-memstr.h (SYSV): Define this.
+ (_XFUNCS_H_): And this.
+
+ * Makefile.in (distclean): Add texmf.cnf and texmf.sed.
+
+Thu Sep 1 14:22:48 1994 Karl Berry (karl@cs.umb.edu)
+
+ * xputenv.c (putenv): Declare this to avoid a warning.
+ * xstat.c (lstat): And this.
+
+ * common.ac (SMART_PUTENV): Use program to test for this. From
+ mike@cs.utah.edu.
+
+ * tex-glyph.c (try_fallback_resolutions): Quit early if there's no
+ resolutions in the list. From sanjoy@dope.caltech.edu.
+
+Tue Aug 30 14:26:48 1994 Karl Berry (karl@cs.umb.edu)
+
+ * acconfig.h (FOIL_X_WCHAR_T): New definition.
+
+ * c-std.h (hypot) [!hypot]: Conditionalize declaration.
+
+Fri Aug 26 09:00:24 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (install-data): Install headers into
+ $(includedir)/kpathsea, not just $(includedir). From john@wpi.edu.
+
+ * pathsearch.c (search): Show results of the search as well as the
+ start of it.
+
+Thu Aug 25 13:40:29 1994 Karl Berry (karl@cs.umb.edu)
+
+ * proginit.c (kpse_init_prog): Newline at end of fputs.
+
+ * pathsearch.c (search): Add debug statement.
+ * debug.h (KPSE_DEBUG_SEARCH): New bit.
+
+ * tex-file.h (kpse_format_info_type): Rename `font_override_p' from
+ `font_p'. Also `program_enabled' => `program_enabled_p'.
+ Also new member `suffix_search_only'.
+ * tex-file.c (kpse_find_file): Avoid searching for foo.tex.tex, etc.
+
+Tue Aug 16 09:29:59 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.c (maketex): Announce that we are running the script
+ before running it.
+
+Mon Aug 15 11:18:19 1994 Karl Berry (karl@cs.umb.edu)
+
+ * texmf.cnf.in (PKFONTS.xdvi): Write program-specific definition
+ to include gsftopk and ps2pk ``modes''.
+
+Sat Aug 13 16:34:43 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (lib): Rename to program to simplify rules.
+
+ * magstep.h: Doc fix.
+
+ * common.ac (AC_HAVE_FUNCS): Test for bcopy.
+
+Tue Aug 9 14:18:56 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.c (misstex): Prepend kpathsea: to the missfont.log
+ message.
+
+Mon Aug 8 17:53:58 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.c (set_maketex_mag): Rewrite to call kpse_magstep_fix.
+ * magstep.[ch]: New files.
+
+Fri Aug 5 14:07:51 1994 Karl Berry (karl@cs.umb.edu)
+
+ * db.c (match): Allow a trailing component in the filename.
+
+Tue Aug 2 08:55:21 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Change `debug:' to `kdebug:'.
+ * hash.c (hash_lookup): Print results of lookup if DEBUG_HASH.
+ * debug.h (KPSE_DEBUG_HASH): New bit, replacing DB_BUILD.
+ * db.c (db_build): Don't print the built hash table.
+
+ * db.c (match): Implement this. Petr Sojka and Zdenek Salvet(?)
+ supplied code for this, but I wound up writing my own.
+ * variable.c (expand): Do variable expansion on the value.
+
+ * texmf.cnf.in (TEXINPUTS): Put this after the .prog-specific entries.
+
+ * tex-file.c (kpse_pict_format): Remember to break after setting
+ the type.
+ (EXPAND_DEFAULT, init_path): Keep raw_path as pre-default expansion.
+
+Sun Jul 31 14:18:09 1994 Karl Berry (karl@cs.umb.edu)
+
+ * debug.c: Don't include debug.h, it's already in debug.h.
+
+ * Makefile.in (db.o,pathsearch.o): Don't need these special cases
+ since tossed db_dir from paths.make.
+ * db.h (DB_DIR): Change default to $TEXMF, rename to KPSE_DB_DIR.
+ (kpse_db_dir): New global variable (sigh).
+ * db.c (kpse_db_dir): Define.
+ * cnf.c: Include db.h for KPSE_DB_DIR.
+ (read_files): Set kpse_db_dir after all have been read.
+ * pathsearch.c (elt_in_db): Check if kpse_db_dir is null.
+ (path_search): Do not initialize db_dir.
+
+Sat Jul 30 06:12:12 1994 Karl Berry (karl@cs.umb.edu)
+
+ * c-dir.h [_POSIX_VERSION]: Remove this condition; just use DIRENT.
+
+Fri Jul 29 11:36:25 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-file.c (init_path): Look up cnf file value if no suffix.
+
+ * xstat.h (SAME_FILE_P): Move here.
+ * c-stat.h (SAME_FILE_P): From here.
+ * file-p.c: Change include.
+ * lib.h (dir_p, dir_links): Declare here.
+ * dir.h: Split into xopendir.h and c-dir.h; Sun 3 include files
+ get confused otherwise, according to john@minster.york.ac.uk.
+ * xopendir.c: Include xopendir.h.
+ * elt-dirs.c, dir.c: Change includes.
+
+Sun Jul 17 10:21:16 1994 Karl Berry (karl@cs.umb.edu)
+
+ * hash.c (hash_insert): Put new elements in at the end of the
+ list, instead of the beginning.
+ * hash.h: Document this.
+
+ * texmf.cnf.in (TEXMFROOT): Change to TEXMF.
+ * kpathsea.texi: Likewise.
+
+ * cnf.c (do_line): assert program_invocation_short_name.
+ * progname.c: Doc fix.
+
+ * absolute.[ch] (kpse_absolute_p): Take additional arg relative_ok.
+ * pathsearch.c (log_search): Call it (with false).
+ * tex-glyph.c: Change call.
+
+ * pathsearch.c (path_search): Initialize db_dir here.
+ (elt_in_db): Not here.
+
+Fri Jul 15 11:44:15 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-file.h: Doc fix.
+
+ * pathsearch.c (log_search): Pass in the whole str_list; anything
+ else is unreliable.
+
+ * proginit.[ch] (kpse_init_prog): Don't pass in argv0; we need it
+ earlier.
+
+Tue Jul 12 11:56:54 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-file.c (init_path): Use the first envvar that's *set*, not
+ the first in the list.
+
+ * tex-file.h (kpse_format_info_type): New member `type'.
+ * tex-file.c (kpse_init_format): Initialize it.
+
+ * pathsearch.c (log_search): New fn.
+ (search): Call it.
+
+Fri Jul 1 11:54:29 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-file.c: Doc fix.
+
+Mon Jun 27 10:18:59 1994 Karl Berry (karl@cs.umb.edu)
+
+ * db.c (db_build): Call kpse_var_expand on the db filename.
+ * pathsearch.c (elt_in_db): Likewise.
+
+ * tex-glyph.h (kpse_find_gf): By analogy with kpse_find_pk.
+
+Sat Jun 25 16:09:05 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c (try_format): Try both Unix and DOS bitmap specs,
+ instead of just one or the other.
+ (bitmap_name): No longer needed.
+
+Fri Jun 24 11:52:32 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-file.c (kpse_find_file): Don't try the suffix if it doesn't
+ exist.
+
+ * tex-file.h (kpse_find_{dvips_header,pict}): New definition.
+
+Thu Jun 23 16:57:58 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-file.h (kpse_{pict,dvips_header}_format): New consts.
+ (KPSE_{PICT,DVIPS_HEADER}_ENVS): Likewise.
+
+Tue Jun 21 11:53:09 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-file.c (kpse_find_file): Try the name as given if the name
+ concatenated with the suffix fails, for the sake of, e.g., EPS files.
+
+ * tex-file.h (kpse_find_tex): New definition.
+
+ * absolute.[ch]: Make arg const.
+
+ * tex-glyph.[ch]: (kpse_bitmap_tolerance): Move here from tex-make.
+
+ * c-proto.h (P6[CH]): New definitions.
+
+ * Makefile.in (objects): Add proginit.o.
+ * proginit.[ch]: New files.
+
+Mon Jun 20 14:55:57 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-file.c (kpse_init_format): Make override path not apply to
+ TFM and VF files.
+
+ * tex-glyph.c (kpse_find_glyph_format): Rename to kpse_find_glyph,
+ and don't call MakeTeXPK if the filename is absolute.
+ * tex-glyph.h: Likewise.
+
+Sun Jun 19 11:00:50 1994 Karl Berry (karl@cs.umb.edu)
+
+ * common.ac (HAVE_PROGRAM_INVOCATION_NAME): Test for this.
+ * acconfig.h: #undef this by default.
+ * progname.[ch]: New files.
+ * Makefile.in (objects): Add progname.o.
+ * cnf.c (do_line): Check for .<progname> qualification.
+
+Sat Jun 18 16:55:36 1994 Karl Berry (karl@cs.umb.edu)
+
+ * elt-dirs.c (kpse_element_dirs): Avoid stats in leaf directories
+ found via a non-null post.
+
+Fri Jun 17 14:25:08 1994 Karl Berry (karl@cs.umb.edu)
+
+ * elt-dirs.c (kpse_element_dirs) [DEBUG]: Print the directory
+ expansion of the path element.
+
+ * str-llist.h: Doc fix.
+
+ * elt-dirs.c (do_subdir): Ignore anything beginning with ., not
+ just `.' and `..'.
+
+Tue Jun 14 11:53:49 1994 Karl Berry (karl@cs.umb.edu)
+
+ * dir.c (dir_links): Cache the lookups.
+
+ * elt-dirs.c (kpse_element_dirs): Don't expand the argument.
+ * expand.h (kpse_path_expand): New routine.
+ * expand.c: Define it.
+ * pathsearch.h: Doc fix.
+
+ * db.c, tex-file.c [DEBUG]: Prefix output lines with `debug:'.
+
+ * tex-file.h (kpse_format_info_type): Add cnf_path to the struct.
+ * tex-file.c (kpse_init_path): Print the cnf_path.
+ (init_path): Set it, instead of a local variable.
+
+ * pathsearch.c (path_search): Use !! for no-disk-search instead of
+ %%, because now % is the comment char in cnf files.
+ * kpathsea.texi: Document this. Also change all `Kpathsearch' to
+ `kpathsea'.
+
+Mon Jun 13 10:15:49 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.h (kpse_set_maketex_mag): Remove.
+ * tex-make.c (kpse_set_maketex_mag): Make static, remove kpse_
+ prefix, and use KPATHSEA_DPI and MAKETEX_BASE_DPI instead of args.
+
+Sun Jun 12 13:49:15 1994 Karl Berry (karl@cs.umb.edu)
+
+ * db.c (db_build): Put a header on the hash table.
+
+ * tex-glyph.c (try_format): Set extension and path after
+ kpse_init_format, natch.
+
+Sat Jun 11 14:26:34 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (objects): Add cnf.o.
+ * variable.c (expand): Call kpse_cnf_get if no envvar value.
+
+Fri Jun 10 11:20:23 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.h: Remove spec type and variable.
+
+Thu Jun 9 13:42:21 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (objects): Remove init-path.o.
+ * tex-file.c (kpse_find_file): Rewrite to initialize the paths
+ only once, and keep all path info in a structure.
+ * tex-file.h: Vastly simplify.
+ * tex-glyph.h (kpse_font_file_type): Move here, since it's really
+ only for glyphs.
+ * tex-glyph.c: Corresponding changes.
+ * debug.h (KPSE_DEBUG_PATHS): New debug bit.
+
+ * default.h, str-list.h: Doc fix.
+
+Tue May 31 10:06:51 1994 Karl Berry (karl@cs.umb.edu)
+
+ * debug.c: Doc fix.
+
+Mon May 23 11:50:03 1994 Karl Berry (karl@cs.umb.edu)
+
+ * c-fopen.h (FOPEN_A_MODE): Define this.
+ * tex-make.c (misstex, maketex): Split up kpse_make_tex into
+ these, and create missfont.log if appropriate.
+
+Sun May 22 17:39:52 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.h: Doc fix.
+
+Wed May 11 13:25:58 1994 Karl Berry (karl@cs.umb.edu)
+
+ * configure.in (AC_OUTPUT): Use just `Makefile' instead of
+ `./Makefile', to avoid a bug in Autoconf (through 1.10).
+
+Sun Apr 17 16:18:00 1994 Karl Berry (karl@ra.cs.umb.edu)
+
+ * debug.h: Prefix macros with KPSE_.
+ * db.c, dir.c: Change calls.
+
+ * common.ac: Remove :: VPATH stuff; that made it in to Autoconf 1.8.
+
+ * Makefile.in (top_srcdir): Define this for configure to substitute.
+
+Thu Apr 7 17:52:05 1994 Karl Berry (karl@ra.cs.umb.edu)
+
+ * debug.[ch]: Implement fopen/fclose tracing.
+
+Thu Mar 31 07:25:49 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Version 1.8.
+
+Thu Mar 24 10:01:20 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c: Doc fix.
+
+ * pathsearch.c (path_search): Don't search the disk if there is
+ magic in the path spec.
+
+ * db.c: Doc fix.
+
+Wed Mar 16 13:50:17 1994 Karl Berry (karl@cs.umb.edu)
+
+ * readable.c (kpse_readable_file): Complain if errno == EPERM.
+
+Sun Mar 13 11:14:19 1994 Karl Berry (karl@cs.umb.edu)
+
+ * pathsearch.h (kpse_path_search): Take an extra arg must_exist.
+ * pathsearch.c (kpse_path_search, search, path_search): Likewise.
+ * tex-file.c (kpse_find_file): Change call.
+ * tex-file.h (kpse_find_*): Change these calls, too.
+
+ * hash.c (hash_create): Don't use xcalloc to init pointers to null.
+
+ * db.c (kpse_db_search): Don't free the pointer after incrementing it.
+ From Frank Jensen.
+
+Sat Mar 12 17:55:36 1994 Karl Berry (karl@cs.umb.edu)
+
+ * db.h (kpse_db_search): Returns a pointer.
+ * db.c (kpse_db_search): If db can't be built, return NULL, else a
+ pointer to the (possibly empty) list.
+ (db_build): Return whether we found the file.
+ * pathsearch.c (path_search): Change call.
+
+Thu Mar 10 07:45:13 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (install-info): New target.
+
+Fri Mar 4 08:06:16 1994 Karl Berry (karl@cs.umb.edu)
+
+ * hash.c (hash): Change hash function to spread out the values a
+ bit better.
+
+ * debug.h (DEBUG_DB_BUILD): New debug bit.
+ * db.c (db_build) [DEBUG]: If bit is set, print hash table.
+ * hash.h (hash_print): Declare.
+
+Thu Mar 3 08:52:01 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Version 1.7.
+
+Sun Feb 27 15:57:30 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (objects): Add db.o, hash.o.
+ * db.[ch]: New files.
+ * hash.[ch]: Also new files.
+ * pathsearch.c (path_search): Try db search.
+ * tex-glyph.c, fontmap.c: Use general hash functions.
+
+Sat Feb 26 13:15:53 1994 Karl Berry (karl@cs.umb.edu)
+
+ * fontmap.c: Doc fix.
+
+ * pathsearch.c (INIT_ALLOC): Increase to 75, what the heck.
+
+Fri Feb 25 08:30:50 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-file.[ch]: Decare args const.
+
+Thu Feb 24 07:55:43 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.h: Include tex-file.h, not init-path.h.
+
+ * init-path.h (KPSE_*_{ENVS,PATHS}, kpse_font_override_path): Move
+ to tex-font.h.
+ * tex-font.h (kpse_find_{file,tfm,vf}): Also declare these.
+ * tex-font.c (kpse_find_file): Define these.
+ (kpse_font_override_path): Move definition here.
+
+ * tex-file.*: Rename from tex-font.*.
+ * GNUmakefile: Corresponding changes.
+
+ * elt-dirs.c (do_subdir): Only append the / once we know it's a
+ directory.
+
+Wed Feb 23 16:41:31 1994 Karl Berry (karl@cs.umb.edu)
+
+ * elt-dirs.c (do_subdir): Don't tack POST on if it is exactly the
+ d_name, so we can find a/b with a path of a//b.
+
+ * c-vararg.h (PVAR3[CH]): New defines.
+
+ * init-path.h: Include KPSE_*_{ENVS,PATHS} here.
+ (kpse_init_path): Take an additional arg font_p.
+ * init-path.c (kpse_override_path): Rename kpse_font_override_path.
+ (kpse_init_path): Only use kpse_font_override_font if font_p.
+
+Mon Feb 21 15:38:53 1994 Karl Berry (karl@cs.umb.edu)
+
+ * common.ac (extrasub): Define to remove VPATH lines if srcdir = `.'.
+
+Thu Feb 3 06:19:49 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Version 1.6.
+
+ * fn.c (fn_copy0): Remember to allocate space for the null.
+ Thanks, simon.
+
+Wed Feb 2 09:57:47 1994 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.h (KPSE_BITMAP_TOLERANCE): Move to here from tex-glyph.c
+ (kpse_check_bitmap_tolerance): Declare.
+ * tex-make.c (kpse_check_bitmap_tolerance): Define.
+
+Tue Feb 1 10:42:03 1994 Karl Berry (karl@cs.umb.edu)
+
+ * c-std.h (*alloc) [! _MALLOC_INTERNAL]: Make decl conditional.
+
+ * c-std.h [HAVE_STDLIB_H]: Change #if for including <stdlib.h> to this.
+ * common.ac (AC_HAVE_HEADERS): Check for stdlib.h.
+
+ * Makefile.in (paths.h): Do all substitutions globally.
+
+ * absolute.c [DOS]: Include c-ctype.h.
+ * tex-glyph.c (KPATHSEA_BITMAP_NAME) [DOS]: Double the backslash.
+ * elt-dirs.c (do_subdir) [!UNIX_ST_LINK]: Avoid dangling else.
+ From Wayne.
+
+ * paths.h.in: Doc fix.
+
+ * xputenv.c (xputenv): Check entire variable name for being saved,
+ not just a prefix of it.
+
+Mon Jan 31 12:05:30 1994 Karl Berry (karl@cs.umb.edu)
+
+ * fn.c (fn_copy0): Allocate LEN if that's bigger than CHUNK_SIZE.
+ (CHUNK_SIZE): Increase to 75.
+
+Sat Jan 22 15:36:08 1994 Karl Berry (karl@cs.umb.edu)
+
+ * Version 1.5.
+
+ * common.ac (AC_HAVE_FUNCS): Check for memmove.
+
+ * paths.h.in (DEFAULT_MF_PATH): Don't search just public/, cause
+ we need ams/.
+
+Mon Jan 17 15:09:36 1994 Karl Berry (karl@cs.umb.edu)
+
+ * paths.h.in (DEFAULT_{FMT,BASE}_PATH): Include `.'.
+
+Sun Jan 16 14:50:02 1994 Karl Berry (karl@cs.umb.edu)
+
+ * paths.h.in (DEFAULT_PK_PATH): Search subdirs of pk.
+
+Mon Jan 10 16:40:35 1994 Karl Berry (karl@cs.umb.edu)
+
+ * xputenv.c (xputenv): Don't try to be smart about saving/freeing
+ stuff if SMART_PUTENV is defined.
+
+ * c-std.h (assert) [!HAVE_ASSERT_H]: Define as nothing, to avoid
+ undefined references to assert.
+
+Tue Dec 21 16:28:13 1993 Karl Berry (karl@cs.umb.edu)
+
+ * c-std.h (SYSV) [STDC_HEADERS]: Define, to get around old X
+ include files under hpux.
+
+Sun Dec 19 13:06:15 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (objects): Put tex-font.o first.
+
+Sat Dec 18 15:03:57 1993 Karl Berry (karl@cs.umb.edu)
+
+ * config.h (GCC_WCHAR_T, _GCC_WCHAR_T): Remove these; I have
+ another theory now for wchar_t, done in xdvi.h and x11.c.
+
+Sat Dec 18 14:41:15 1993 Karl Berry (karl@owl.hq.ileaf.com)
+
+ * c-memstr.h ([r]index) [STDC_HEADERS]: Conditionalize #define.
+
+Tue Dec 14 17:43:30 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (paths.h): Change substitutions accordingly.
+ * paths.h.in (DEFAULT_FMT_PATH): Variable is now fmtdir.
+ (DEFAULT_{BIB,BST}_PATH): Variable is now texmf_prefix.
+
+Sat Dec 11 13:21:43 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.c (ABS): New macro.
+ (kpse_set_maketex_mag): Use it, instead of fabs.
+
+Fri Dec 10 15:31:16 1993 Karl Berry (karl@cs.umb.edu)
+
+ * xmalloc.c, xrealloc.c: Use exit instead of abort, remove abort
+ decls, and reword error messages to be less cryptic. From
+ john@minster.york.ac.uk.
+
+ * dir.h: use `defined' instead of just `DIRENT || _POSIX_VERSION'.
+ How annoying. From kretschm@aitxu3.ait.physik.uni-tuebingen.de.
+
+ * xputenv.c (putenv): Remove declaration, as different systems do
+ it differently. From kayvan@satyr.sylvan.com.
+
+Thu Dec 9 09:12:33 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.c (kpse_set_maketex_mag): Allow off-by-1 when deciding
+ if a dpi is a magstep.
+
+Tue Dec 7 11:03:51 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.c (kpse_set_maketex_mag): New routine from dvips,
+ called by dvipsk and xdvik to ensure consistency.
+ (magstep): Subroutine of above, also from dvips.
+ * tex-make.h: Declare it.
+
+ * tex-doc.texi: Correct menu item (from maechler@stat.math.ethz.ch).
+
+Fri Dec 3 12:53:38 1993 Karl Berry (karl@cs.umb.edu)
+
+ * c-pathmx.h: Doc fix.
+
+Sat Nov 27 14:36:11 1993 Karl Berry (karl@cs.umb.edu)
+
+ * default.h: Doc fix.
+
+ * paths.h.in (texfontdir): This has been renamed to fontdir.
+
+Sun Nov 21 08:28:41 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (distdir): Include HIER in the distribution, until
+ we merge it into the manual.
+
+Sun Nov 7 14:54:47 1993 Karl Berry (karl@cs.umb.edu)
+
+ * c-namemx.h (NAME_MAX): Avoid use of pathconf.
+ * c-pathmx.h: Doc fix.
+
+Thu Nov 4 14:50:45 1993 Karl Berry (karl@cs.umb.edu)
+
+ * config.h (_GCC_WCHAR_T) [!GCC_WCHAR]: Conditionalize.
+
+ * c-std.h (EXIT_SUCCESS) [!EXIT_SUCCESS]: Move these defines
+ outside of !STDC_HEADERS, for the sake of SunOS 4.1.1. (From
+ vonbrand@inf.utfsm.cl.)
+
+Wed Nov 3 14:43:05 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Version 1.4.
+
+Wed Nov 3 07:05:48 1993 Karl Berry (karl@cs.umb.edu)
+
+ * paths.h.in (DEFAULT_{BASE,FMT}_PATH): Had these definitions reversed.
+
+Fri Oct 29 19:27:36 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c (try_fallback_resolutions): Initialize ret in all cases.
+
+Thu Oct 28 14:32:34 1993 Karl Berry (karl@cs.umb.edu)
+
+ * lib.h: Doc fix.
+
+ * common.h (AC_UNISTD_H): Replace this with unistd.h in the list
+ of HAVE_HEADERS.
+
+Tue Oct 26 13:59:33 1993 Karl Berry (karl@cs.umb.edu)
+
+ * str-llist.[ch]: New files.
+ * Makefile.in (objects): Add str_llist.o.
+ * elt-dirs.[ch]: Use str_llist_type throughout.
+ * pathsearch.c (dir_list_search): Take a str_llist_type, and float
+ a successful dir towards the top.
+ (path_search): Change call of kpse_element_dirs.
+
+Sun Oct 24 19:41:49 1993 Karl Berry (karl@cs.umb.edu)
+
+ * elt-dirs.c (do_optional): Remove this stub.
+ (expand_elt): Don't call it.
+
+Fri Oct 22 14:46:44 1993 Karl Berry (karl@cs.umb.edu)
+
+ * xmalloc.c, xrealloc.c, line.c, pathsearch.c: Doc fix.
+
+Tue Oct 19 12:11:32 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c (try_fallback_resolutions): New routine.
+ (kpse_find_glyph_format): Call it, instead of repeating (the now
+ pretty complicated) code.
+ * tex-font.c (kpse_init_fallback_resolutions): Pass the value of
+ any environment variable, not its name. From R.Kooijman@et.tudelft.nl.
+
+ * c-memstr.h (str[r]chr) [!str[r]chr]: Conditionalize. From
+ maarrrk@seidel.ece.ucsb.edu.
+
+Tue Oct 12 16:26:48 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.c: Doc fix.
+
+Thu Oct 7 13:13:57 1993 Karl Berry (karl@cs.umb.edu)
+
+ * xmalloc.c: Rewrite to not require <config.h>.
+ * xrealloc.c: Likewise.
+
+ * make-suffix.c (make_suffix): Declare variables const.
+ * remove-suffx.c (remove_suffix): Likewise. Also rename to
+ rm-suffix.c.
+ * xputenv.c (putenv): Declare with correct prototype.
+ * fontmap.c (internal routines): Likewise.
+ * line.c (xmalloc, xrealloc): Declare as void *.
+ (From john@minster.york.ac.uk.)
+
+Wed Oct 6 06:49:53 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Version 1.3.
+
+ * tilde.c (kpse_tilde_expand): Always return a malloc-ed value.
+ (From ken@cs.toronto.edu.)
+
+Sun Oct 3 14:11:33 1993 Karl Berry (karl@cs.umb.edu)
+
+ * config.h (_GCC_WCHAR_T): Define.
+
+Sat Oct 2 17:17:32 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (install-*): Don't reassign PATH, just invoke
+ mkdirchain explicitly.
+
+ * tex-glyph.c (KPATHSEA_BITMAP_NAME) [DOS]: Define what I think
+ will work for this ...
+
+ * paths.h.in: Doc fix.
+
+ * Makefile.in: Doc fix.
+
+ * tex-glyph.c (kpse_find_glyph_format): Unconditionally initialize
+ glyph_paths[*], since we might use them both in try_size. From
+ worsch@ira.uka.de.
+
+Fri Oct 1 12:02:11 1993 Karl Berry (karl@cs.umb.edu)
+
+ * expand.c: Doc fix.
+
+Wed Sep 29 15:21:49 1993 (karl@terminus.cs.umb.edu)
+
+ * Version 1.2.
+
+Sat Sep 25 14:12:00 1993 Karl Berry (karl@cs.umb.edu)
+
+ * pathsearch.c (path_search, absolute_search): Don't initialize
+ structs.
+
+Fri Sep 24 12:50:00 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c (try_size): Skip the simultaneous stuff.
+ (try_format): Set the envvar here.
+ (bitmap_name): Not here.
+ * pathsearch.c (kpse_*_multi_search): Delete.
+ Change most other routines to take only a single name again,
+ instead of a name list.
+ * pathsearch.h: Delete decls.
+
+ * tex-glyph.c (init-path.h): Don't need to include this.
+
+ * tex-glyph.c (kpse_find_glyph_format): Try the fallback
+ resolutions for the fallback font.
+
+ * Makefile.in (warn_more, MAKEINFO_FLAGS) [hayley]: Define these
+ for development and distribution.
+
+ * Makefile.in (dvi): Make analogous to info (including use of new
+ suffix rule).
+
+ * tex-glyph.c (kpse_find_glyph_format): Set KPATHSEA_NAME to the
+ fallback font if we get that far.
+
+Wed Sep 15 19:29:56 1993 Karl Berry (karl@cs.umb.edu)
+
+ * filefmt.h (KPSE_*_PATH): Pass NULL as first arg.
+
+ * xputenv.c (xputenv): Rewrite again to save the variable names,
+ not the old items.
+
+Mon Sep 13 06:55:29 1993 Karl Berry (karl@cs.umb.edu)
+
+ * concatn.h: Doc fix.
+
+Sun Sep 12 15:54:55 1993 Karl Berry (karl@cs.umb.edu)
+
+ * lib.h (XTALLOC): Parenthesize the cast.
+
+ * xputenv.c (xputenv): Rewrite to collect some of the garbage.
+
+Fri Sep 10 14:00:35 1993 Karl Berry (karl@cs.umb.edu)
+
+ * lib.h (ENVVAR_SET_DEFAULT): No longer needed.
+
+ * xputenv.c (xputenv_int): New routine.
+
+Thu Sep 9 14:58:00 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.c (MAKE_TEX_PK_SPEC): Change MAKETEX_DPI to
+ KPATHSEA_DPI.
+
+ * tex-glyph.c (try_fontmap): Use KPSE_GLYPH_PATH.
+ * filefmt.c (KPSE_GLYPH_{PATH,ENVS}): New macros.
+ (KPSE_{GF,PK}_ENVS): Use GLYPH_ENVS.
+
+ * tex-glyph.c (bitmap_name): Rewrite to use a variable spec,
+ introducing KPATHSEA_{BITMAP_NAME,FORMAT,DPI,NAME}.
+ (kpse_find_glyph_format): Set KPATHSEA_DPI instead of MAKETEX_DPI;
+ also set KPATHSEA_NAME.
+ (try_fontmap): Also set KPATHSEA_NAME here.
+ (try_size): Set KPATHSEA_DPI here.
+
+ * tex-glyph.c (try_name): Delete this routine.
+ (kpse_find_glyph_format): Try fallback resolutions here, call
+ try_resolution directly.
+ (try_fontmap): Call try_resolution directly.
+
+ * init-path.h: Need not include c-proto.h.
+
+Sun Aug 29 13:34:25 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-make.c: Doc fix.
+
+ * filefmt.h: Don't need c-proto.h or types.h.
+
+Fri Aug 27 10:36:46 1993 Karl Berry (karl@cs.umb.edu)
+
+ * c-vararg.h (PVAR2C): Take AP as an arg.
+
+ * init-path.[ch] (kpse_init_path): Take the current value as an
+ additional argument, separate from the default path, and always
+ expand_default.
+
+ * uppercasify.c (uppercasify): Don't discard upcased result!
+
+Thu Aug 26 10:36:28 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Version 1.1.
+
+Sun Aug 22 19:18:35 1993 Karl Berry (karl@cs.umb.edu)
+
+ * install-data (install-data): Replace nonexistent
+ $(kpath_includedir) with $(includedir), and define it. Also
+ remove c-auto.h.
+
+Thu Aug 5 09:03:22 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Version 1.0.
+
+Wed Aug 4 13:51:24 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c (kpse_find_glyph_format): Fill in the font_file
+ struct in the maketex case.
+
+ * Makefile.in (info): Just depend on kpathsea.info, and rely on
+ new suffix rule to do the work.
+
+Tue Aug 3 17:50:40 1993 Karl Berry (karl@fishbowl.hq.ileaf.com)
+
+ * tex-glyph.c (try_name): Don't free expanded_name if we're
+ returning it.
+
+Tue Aug 3 10:13:43 1993 Karl Berry (karl@owl.hq.ileaf.com)
+
+ * version.c (kpathsea_version_string): Do not declare const.
+
+ * line.h (read_line): Protoize decl.
+
+Tue Aug 3 09:10:07 1993 Karl Berry (karl@blood.hq.ileaf.com)
+
+ * c-memstr.h (bcmp, bcopy, bzero) [!HAVE_BCOPY]: Conditionalize.
+
+ * putenv.c: Include <kpathsea/c-auto.h>, and use const when
+ calling memcpy.
+
+Sun Aug 1 08:48:49 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Add new features to manual.
+
+ * Makefile.in (objects): Include putenv.o.
+ * putenv.c: New file from gdb.
+ * common.ac: Test for putenv.
+
+Sat Jul 31 11:54:31 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (distclean): Remove paths.h.
+
+ * Most files: changes for traditional C compatibility.
+
+ * filefmt.h: Add new KPSE_..._PATH's for the other formats.
+ * paths.h.in: Add defaults.
+ * Makefile.in (paths.h): sed the values in.
+
+Fri Jul 30 17:23:10 1993 Karl Berry (karl@cs.umb.edu)
+
+ * filefmt.h (KPSE_VF_PATH): Add empty parens.
+
+ * tex-paths.h*: Rename to just paths.h*.
+
+Tue Jul 27 09:00:58 1993 Karl Berry (karl@cs.umb.edu)
+
+ * filefmt.h: Include tex-paths.h, and use default paths in
+ KPSE_..._PATH macros.
+
+ * find-suffix.c: Correct logic.
+
+ * filefmt.h: Include init-path.h.
+
+Sat Jul 24 10:44:21 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c (kpse_find_glyph_format): Assign to it.
+ * tex-font.h (kpse_font_file_type): New member `source'.
+ (KPSE_FONT_FILE_SOURCE): Accessor macro.
+ (kpse_source_type): New type.
+
+Wed Jul 21 19:45:45 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (configclean): New target.
+
+Sun Jul 18 13:53:38 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tilde.[ch] (kpse_expand_tilde): Rename to kpse_tilde_expand.
+
+ * elt-dirs.c, pathsearch.c, tex-glyph.c: Replace calls to
+ kpse_expand_tilde with kpse_expand.
+ * expand.[ch]: New files.
+ * Makefile.in (objects): Add it.
+
+ * fn.[ch]: New files.
+ * elt-dirs.c (fn*): Moved to fn.c.
+ * tex-make.c, variable.c: Use the new routines.
+ * *obstack*: No longer needed.
+ * Makefile.in (objects): Appropriate changes.
+
+Sat Jul 17 13:25:25 1993 Karl Berry (karl@cs.umb.edu)
+
+ * concat.c: Doc fix.
+
+ * pathsearch.c (search, path_search): Expand variable references.
+
+ * itoa.c: New file.
+ * lib.h (itoa): Declare it.
+ * Makefile.in (objects): Add it.
+
+ * lib.h (ENVVAR_SET_DEFAULT): New macro.
+ * tex-glyph.c (kpse_find_glyph_format): Call it to set the dpi.
+
+Fri Jul 16 09:10:52 1993 Karl Berry (karl@cs.umb.edu)
+
+ * xputenv.c: New file.
+ * Makefile.in (objects): Add it.
+ * lib.h (xputenv): Declare it.
+
+ * c-obstack.h: New file.
+ * variable.[ch]: New files.
+ * Makefile.in (objects): Add it.
+
+ * uppercasify.c: New file.
+ * Makefile.in (objects): add it.
+ * lib.h (uppercasify): Declare it.
+
+Tue Jul 13 13:47:54 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c (kpse_find_glyph_format): Simplify path initialization.
+ * filefmt.h: New file; add abbrevs for GF and PK inits.
+
+ * Makefile.in (objects): Add obstack.o and tex-make.o.
+ * obstack.[ch]: New files from GNU.
+ * concatn.[ch], tex-make.[ch]: New files.
+ * init-path.c: Doc fix.
+
+ * elt-dirs.c: Doc fix.
+ * readable.[ch]: Doc fixes.
+
+Sun Jul 11 13:37:02 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-font.h (kpse_font_format_type): Rename to kpse_file_format_type,
+ and include the other file formats.
+ * tex-glyph.c: Change uses.
+
+Tue Jul 6 08:09:10 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-font.c (kpse_fallback_font): Initialize to NULL.
+
+Mon Jul 5 08:23:09 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c (try_size): Don't fill in FONT_FILE if it's null.
+
+ * tex-font.c (kpse_init_fallback_resolutions): Look for TEXSIZES
+ after the program-specific *SIZES var.
+
+ * tex-glyph.c (kpse_find_glyph_format): Use kpse_init_path.
+ * Makefile.in (objects): Add init_path.o.
+ * tex-font.[ch] (kpse_override_path): Move to init-path.[ch].
+ * init-path.[ch]: New files.
+ * c-vararg.h: New file.
+
+Sun Jul 4 11:26:17 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-font.c (kpse_init_fallback_resolutions): New routine.
+ * tex-font.h: Declare it, and companion return type.
+
+Fri Jul 2 10:43:11 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-glyph.c (kpse_find_glyph_format): Take first successful
+ fontmap entry.
+
+ * fontmap.c (map_file_parse): Take first % on line as starting the
+ comment, not the last.
+
+ * fontmap.c (map_insert): Always insert the new element.
+
+Thu Jul 1 19:21:35 1993 Karl Berry (karl@cs.umb.edu)
+
+ * fontmap.c (map_lookup): Return a list, not a single string.
+ (map_lookup_str): Likewise.
+ * fontmap.h (map_lookup): Change decl.
+ * tex-glyph.c (kpse_find_glyph_format): Change caller.
+
+Sat Jun 26 11:48:36 1993 Karl Berry (karl@cs.umb.edu)
+
+ * tex-font.h: Doc fix.
+
+Thu Jun 24 11:16:41 1993 Karl Berry (karl@cs.umb.edu)
+
+ * configure.in (MISSING_HEADERS): Toss in favor of HAVE_HEADERS. Sigh.
+ Also, move all this to an include file.
+ Change uses in several files.
+
+ * stat.h: Rename to c-stat.h, and change includers.
+
+ * Makefile.in (objects): Add tex-glyph.o.
+ * pathsearch.[ch] (kpse_*_multi_search): New routines.
+
+Sat Jun 19 11:37:18 1993 Karl Berry (karl@cs.umb.edu)
+
+ * str-list.c (str_list_free): New routine.
+
+Fri Jun 18 13:54:08 1993 Karl Berry (karl@cs.umb.edu)
+
+ * fontmap.c (map_create): Rewrite to use kpse_all_path_search.
+ Include const in various subroutines.
+
+Tue Jun 15 15:58:18 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Change <kpathsea/pathsrch.h> to pathsearch. Rename the files
+ themselves.
+
+ * elt-dirs.c (cache): Copy the key into our own storage, since it
+ comes from kpse_path_element and might get overwritten. Should we
+ copy all the values, too?
+
+Sun Jun 13 16:49:09 1993 Karl Berry (karl@cs.umb.edu)
+
+ * pathsearch.c (dir_list_search): Don't need to append the null
+ here; in fact, it's wrong, since then the final list might have
+ nulls in the middle.
+
+ * elt-dirs.c (dir_list_add): Correct check for new directory
+ already ending in /.
+
+Fri Jun 11 10:45:33 1993 Karl Berry (karl@cs.umb.edu)
+
+ * str-list.[ch]: New files.
+ * pathsrch.c: Use it for the dir_list routines.
+ * Many changes and new files throughout for new implementation
+ including TeX-font-lookup routines.
+
+Tue Jun 8 14:00:54 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Most files: Change `const string' (constant pointer) to `const
+ char *' (pointer to constant data). What a crock.
+
+Mon Jun 7 09:43:21 1993 Karl Berry (karl@cs.umb.edu)
+
+ * debug.[ch]: New files.
+ * config.h: Include debug.h.
+
+ * dir-p.c: Rename to dir.c.
+ (dir_links): New routine.
+
+ * c-std.h (assert.h) [!ASSERT_H_MISSING]: Include this.
+ * configure.in: Check for it with new macro AC_MISSING_HEADERS.
+
+Thu Jun 3 10:12:12 1993 Karl Berry (karl@cs.umb.edu)
+
+ * dirio.h (leaf_dir_p): No longer defined; rename to dir.h.
+ * xopendir.c, dir-p.c, pathsrch.c: Change include.
+
+Mon May 31 07:49:16 1993 Karl Berry (karl@cs.umb.edu)
+
+ * c-std.h (EXIT_{SUCCESS,FAILURE}): Define these if they're undefined.
+
+ * config.h: Use <kpathsea/...> instead "...".
+
+ * kpathlib.h: Had #ifndef protection messed up. Rename to lib.h.
+
+ * c-memstr.h (index, rindex) [!index, !rindex]: Make definitions
+ conditional.
+
+Tue May 25 10:07:00 1993 Karl Berry (karl@cs.umb.edu)
+
+ * c-{namemx,pathmx,pathch,...}.h: Doc fixes.
+
+ * c-systypes.h: New file.
+ * c-std.h: Include it.
+
+ * stat.h: New file.
+ * xstat.h: Include it.
+
+ * configure.in (AC_HAVE_HEADERS): Test for `pwd.h'.
+
+Sun May 23 19:06:22 1993 Karl Berry (karl@cs.umb.edu)
+
+ * pathsrch.[ch]: Doc fixes.
+
+Fri May 21 11:27:54 1993 Karl Berry (karl@cs.umb.edu)
+
+ * line.c (free): Declare.
+
+ * pathsrch.c, find-suffix.c: Change caller.
+ * c-pathch.h ({IS_,}{DIR,ENV}_SEP): Rename existing confusing
+ definitions to these. Suggested by rocky.
+
+Mon May 17 08:18:18 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Version 0.3.
+
+ * pathsrch.c (expand_default): Handle doubled colon and
+ nothing-but-colon cases.
+
+ * Write documentation, change Makefile accordingly.
+
+Thu May 13 16:32:34 1993 Karl Berry (karl@cs.umb.edu)
+
+ * c-std.h (popen) [VMS]: Make decl conditional, and include
+ <unixlib.h> and <unixio.h>.
+
+Mon May 10 07:12:50 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Version 0.2.
+
+ * version.c: Put in placeholder.
+
+Sun May 9 10:42:34 1993 Karl Berry (karl@cs.umb.edu)
+
+ * config.h (c-auto.h): Use <...> instead of "...".
+
+Tue May 4 14:54:41 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (info check dvi): New targets (that do nothing).
+
+Mon May 3 13:46:17 1993 Karl Berry (karl@claude.cs.umb.edu)
+
+ * Version 0.1.
+
+ * Use KPATHSEARCH_ prefix for various headers' cpp protections.
+
+Sun May 2 10:28:25 1993 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (dist): Depend on TAGS, and put it in the dist.
+
+ * Makefile.in (c-auto.h.in): Remove extra $(srcdir).
+
+Sun Apr 25 11:22:12 1993 Karl Berry (karl@cs.umb.edu)
+
+ * pathsrch.h: Include c-proto.h.
+
+ * make-suffix.c: New file.
+ * Makefile.in (objects): Add the .o.
+
+ * file-p.c: Use the SAME_FILE_P macro.
+
+ * fontmap.h: Include c-proto.h and types.h.
+
+ * lib.h: Rename to kpathlib.h.
+ * config.h: Include changed.
+
+ * c-proto.h, c-std.h: Doc fix.
+
+ * c-limits.h [LIMITS_H_MISSING]: Conditionalize include of c-std.h.
+
+ * xstat.h: Include c-std.h.
+
+ * Makefile.in (c-auto.h.in): Add unused warning to top.
+
+ * dirio.h: Include c-proto.h and types.h.
+
+Fri Apr 23 16:11:13 1993 Karl Berry (karl@cs.umb.edu)
+
+ * line.c: Don't include config.h, just declare xmalloc and
+ xrealloc explicitly.
+
+ * pathsrch.c: paths.h need not be included.
+
+ * Created.
diff --git a/Build/source/texk/kpathsea/HIER b/Build/source/texk/kpathsea/HIER
new file mode 100644
index 00000000000..bfcaf10b133
--- /dev/null
+++ b/Build/source/texk/kpathsea/HIER
@@ -0,0 +1,88 @@
+TeX directory structure
+=======================
+
+ This section describes the default installation hierarchy of the
+distribution. It conforms to both the GNU coding standards and the TeX
+directory structure (TDS) standard. For rationale and further
+explanation, please see those documents. The GNU standard is available
+as `ftp://prep.ai.mit.edu/pub/gnu/standards/standards.texi' and
+mirrors. The TDS document is available from `CTAN:/tex-archive/tds'
+(*note unixtex.ftp::.).
+
+ You can change the default paths in many ways (*note Changing search
+paths::.). One common desire is to put everything (binaries and all)
+under a single top-level directory such as `/usr/local/texmf' or
+`/opt/texmf'--in the terms used below, make PREFIX and TEXMF the same.
+For specific instructions on doing that, see *Note configure
+scenarios::.
+
+ Here is a skeleton of the default directory structure, extracted from
+the TDS document:
+
+ PREFIX/ installation root (`/usr/local' by default)
+ bin/ executables
+ man/ man pages
+ include/ C header files
+ info/ GNU info files
+ lib/ libraries (`libkpathsea.*')
+ share/ architecture-independent files
+ texmf/ TDS root
+ bibtex/ BibTeX input files
+ bib/ BibTeX databases
+ base/ base distribution (e.g., `xampl.bib')
+ misc/ single-file databases
+ PKG/ name of a package
+ bst/ BibTeX style files
+ base/ base distribution (e.g., `plain.bst', `acm.bst')
+ misc/ single-file styles
+ PKG/ name of a package
+ doc/ additional documentation
+ dvips/ `.pro', `.ps', `psfonts.map'
+ fonts/ font-related files
+ TYPE/ file type (e.g., `tfm', `pk')
+ MODE/ type of output device (types `pk' and `gf' only)
+ SUPPLIER/ name of a font supplier (e.g., `public')
+ TYPEFACE/ name of a typeface (e.g., `cm')
+ dpiNNN/ font resolution (types `pk' and `gf' only)
+ metafont/ Metafont (non-font) input files
+ base/ base distribution (e.g., `plain.mf')
+ misc/ single-file packages (e.g., `modes.mf')
+ PKG/ name of a package (e.g., `mfpic')
+ metapost/ MetaPost input files
+ base/ base distribution (e.g., `plain.mp')
+ misc/ single-file packages
+ PKG/ name of a package
+ support/ support files for MetaPost-related utilities (e.g., `trfonts.map')
+ mft/ `MFT' inputs (e.g., `plain.mft')
+ tex/ TeX input files
+ FORMAT/ name of a format (e.g., `plain')
+ base/ base distribution for FORMAT (e.g., `plain.tex')
+ misc/ single-file packages (e.g., `webmac.tex')
+ local/ local additions to or local configuration files for FORMAT
+ PKG/ name of a package (e.g., `graphics', `mfnfss')
+ generic/ format-independent packages
+ hyphen/ hyphenation patterns (e.g., `hyphen.tex')
+ images/ image input files (e.g., Encapsulated PostScript)
+ misc/ single-file format-independent packages (e.g., `null.tex').
+ PKG/ name of a package (e.g., `babel')
+ web2c/ implementation-dependent files (`.pool', `.fmt', `texmf.cnf', etc.)
+
+ Some concrete examples for most file types:
+
+ /usr/local/bin/tex
+ /usr/local/man/man1/xdvi.1
+ /usr/local/info/kpathsea.info
+ /usr/local/lib/libkpathsea.a
+ /usr/local/share/texmf/bibtex/bst/base/plain.bst
+ /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk
+ /usr/local/share/texmf/fonts/source/public/pandora/pnr10.mf
+ /usr/local/share/texmf/fonts/tfm/public/cm/cmr10.tfm
+ /usr/local/share/texmf/fonts/type1/adobe/utopia/putr.pfa
+ /usr/local/share/texmf/metafont/base/plain.mf
+ /usr/local/share/texmf/metapost/base/plain.mp
+ /usr/local/share/texmf/tex/plain/base/plain.tex
+ /usr/local/share/texmf/tex/generic/hyphen/hyphen.tex
+ /usr/local/share/texmf/web2c/tex.pool
+ /usr/local/share/texmf/web2c/tex.fmt
+ /usr/local/share/texmf/web2c/texmf.cnf
+
diff --git a/Build/source/texk/kpathsea/INSTALL b/Build/source/texk/kpathsea/INSTALL
new file mode 100644
index 00000000000..9b3e5621cb7
--- /dev/null
+++ b/Build/source/texk/kpathsea/INSTALL
@@ -0,0 +1,849 @@
+Contents:
+
+1 Installation
+ 1.1 Simple installation
+ 1.2 Custom installation
+ 1.2.1 Disk space
+ 1.2.2 Kpathsea application distributions
+ 1.2.3 Changing search paths
+ 1.2.3.1 Default path features
+ 1.2.3.2 Default path generation
+ 1.2.4 Running `configure'
+ 1.2.4.1 `configure' shells
+ 1.2.4.2 `configure' options
+ 1.2.4.3 `configure' environment
+ 1.2.4.4 `configure' scenarios
+ 1.2.4.5 Shared library
+ 1.2.5 Running `make'
+ 1.2.6 Installing files
+ 1.2.7 Cleaning up
+ 1.2.8 Filename database generation
+ 1.2.9 `mktex' scripts
+ 1.2.9.1 `mktex' configuration
+ 1.2.9.2 `mktex' script names
+ 1.2.9.3 `mktex' script arguments
+ 1.2.10 Installation testing
+ 1.3 Security
+
+
+1 Installation
+**************
+
+The procedure for Kpathsea (and Web2c, etc.) configuration and
+installation follows. If you encounter trouble, see *Note Common
+problems::, a copy of which is in the file `kpathsea/BUGS'.
+
+1.1 Simple installation
+=======================
+
+Installing TeX and friends for the first time can be a daunting
+experience. Thus, you may prefer to skip this whole thing and just get
+precompiled executables: see *Note unixtex.ftp::.
+
+ This section explains what to do if you wish to take the defaults for
+everything, and generally to install in the simplest possible way. Most
+steps here refer to corresponding subsection in the next section which
+explains how to override defaults and generally gives more details.
+
+ By default everything will be installed under `/usr/local' and the
+following discussion assumes this. However, if you already have TeX
+installed, its location is used to derive the directory under which
+everything is to be installed.
+
+ 1. Be sure you have enough disk space: approximately 8 megabytes for
+ the compressed archives, 15MB for sources, 50MB for compilation,
+ 40MB for the (initial) installed system (including library files).
+ *Note Disk space::.
+
+ 2. Retrieve these distribution archives:
+ `ftp://ftp.tug.org/tex/texk.tar.gz'
+ These are the sources, which you will be compiling.
+
+ `ftp://ftp.tug.org/tex/texklib.tar.gz'
+ This is a basic set of input files. You should unpack it in
+ the directory `/usr/local/share'; doing so will create a
+ `texmf' subdirectory there.
+
+ These archives are mirrored on the CTAN hosts, in the
+ `systems/web2c' directory.
+
+ *Note Kpathsea application distributions::.
+
+ 3. When using the default search paths, there is no need to edit any
+ distribution files. *Note Changing search paths::.
+
+ 4. At the top level of the distribution, run `sh configure'. (If you
+ have the GNU Bash shell installed, run `bash configure'.) *Note
+ Running configure::.
+
+ 5. `make'. *Note Running make::. If you are using a BSD 4.4 system
+ such as FreeBSD or NetBSD, you may have to use GNU make (often
+ installed in `/usr/local/bin'), not the BSD make.
+
+ 6. `make install'. *Note Installing files::.
+
+ 7. `make distclean'. *Note Cleaning up::.
+
+ 8. Set up a cron job to rebuild the filename database that makes
+ searching faster. This line will rebuild it every midnight:
+ 0 0 * * * cd /usr/local/share/texmf && /BINDIR/mktexlsr
+ *Note Filename database generation::, and *Note Filename
+ database::.
+
+ 9. If you're installing Dvips, you also need to set up configuration
+ files for your printers and make any additional PostScript fonts
+ available. *Note Installation: (dvips)Installation. If you have
+ any color printers, see *Note Color device configuration:
+ (dvips)Color device configuration.
+
+ 10. The first time you run a DVI driver, a bunch of PK fonts will be
+ built by Metafont via `mktexpk' (and added to the filename
+ database). This will take some time. Don't be alarmed; they will
+ created only this first time (unless something is wrong with your
+ path definitions).
+
+ By default, `mktexpk' will create these fonts in a hierarchy under
+ `/var/tmp/texfonts'; it simply assumes that `/var/tmp' exists and
+ is globally writable. If you need a different arrangement, see
+ *Note mktex configuration::.
+
+ *Note mktex scripts::.
+
+ 11. For some simple tests, try `tex story \\bye' and `latex sample2e'.
+ Then run `xdvi story' or `dvips sample2e' on the resulting DVI
+ files to preview/print the documents. *Note Installation
+ testing::.
+
+1.2 Custom installation
+=======================
+
+Most sites need to modify the default installation procedure in some
+way, perhaps merely changing the prefix from `/usr/local', perhaps
+adding extra compiler or loader options to work around `configure'
+bugs. This section explains how to override default choices. For
+additional distribution-specific information:
+ * `dviljk/INSTALL'.
+
+ * *Note Installation: (dvips)Installation.
+
+ * *Note Installation: (web2c)Installation.
+
+ * `xdvik/INSTALL'.
+
+ These instructions are for Unix systems. Other operating-system
+specific distributions have their own instructions. The code base
+itself supports Amiga, DOS, OS/2, and VMS.
+
+ Following are the same steps as in the previous section (which
+describes the simplest installation), but with much more detail.
+
+1.2.1 Disk space
+----------------
+
+Here is a table showing the disk space needed for each distribution
+(described in the next section). The `(totals)' line reflects the
+`texk' source distribution and `texklib'; the individual distributions
+don't enter into it. Sizes are in megabytes. All numbers are
+approximate.
+
+Distribution .tar.gz Unpacked Compiled Installed
+dviljk .9 3.8
+dvipsk .9 3.2
+xdvik .7 2.5
+web2c 1.3 5.0
+web 1.9 6.5 - -
+texk 7.5 32.1 95.3 33.5
+texklib 6.3 15.0 - 15.0
+(totals) 14.6 47.1 95.3 48.5
+
+1.2.2 Kpathsea application distributions
+----------------------------------------
+
+The archive `ftp://ftp.tug.org/tex/texk.tar.gz' contains all of the
+Kpathsea applications I maintain, and the library itself. For example,
+since NeXT does not generally support X11, you'd probably want to skip
+`xdvik' (or simply remove it after unpacking `texk.tar.gz'. If you are
+not interested in all of them, you can also retrieve them separately:
+
+`dviljk.tar.gz'
+ DVI to PCL, for LaserJet printers.
+
+`dvipsk.tar.gz'
+ DVI to PostScript, for previewers, printers, or PDF generation.
+
+`web2c.tar.gz'
+ The software needed to compile TeX and friends.
+
+`web.tar.gz'
+ The original WEB source files, also used in compilation.
+
+`xdvik.tar.gz'
+ DVI previewing under the X window system.
+
+
+ If you want to use the Babel LaTeX package for support of non-English
+typesetting, you may need to retrieve additional files. See the file
+`install.txt' in the Babel distribution.
+
+1.2.3 Changing search paths
+---------------------------
+
+If the search paths for your installation differ from the standard TeX
+directory structure (*note Introduction: (tds)Top.), edit the file
+`kpathsea/texmf.in' as desired, before running `configure'. For
+example, if you have all your fonts or macros in one big directory.
+
+ You may also wish to edit the file `mktex.cnf', either before or
+after installation, to control various aspects of `mktexpk' and
+friends. *Note mktex configuration::.
+
+ You do not need to edit `texmf.in' to change the default top-level or
+other installation _directories_ (only the paths). You can and should
+do that when you run `configure' (next step).
+
+ You also do not need to edit `texmf.in' if you are willing to rely on
+`texmf.cnf' at runtime to define the paths, and let the compile-time
+default paths be incorrect. Usually there is no harm in doing this.
+
+ The section below explains default generation in more detail.
+
+1.2.3.1 Default path features
+.............................
+
+The purpose of having all the different files described in the section
+above is to avoid having the same information in more than one place. If
+you change the installation directories or top-level prefix at
+`configure'-time, those changes will propagate through the whole
+sequence. And if you change the default paths in `texmf.in', those
+changes are propagated to the compile-time defaults.
+
+ The Make definitions are all repeated in several Makefile's; but
+changing the top-level `Makefile' should suffice, as it passes down all
+the variable definitions, thus overriding the submakes. (The
+definitions are repeated so you can run Make in the subdirectories, if
+you should have occasion to.)
+
+ By default, the bitmap font paths end with `/$MAKETEX_MODE', thus
+including the device name (usually a Metafont mode name such as
+`ljfour'). This distinguishes two different devices with the same
+resolution--a write/white from a write/black 300dpi printer, for
+example.
+
+ However, since most sites don't have this complication, Kpathsea
+(specifically, the `kpse_init_prog' function in `kpathsea/proginit.c')
+has a special case: if the mode has not been explicitly set by the user
+(or in a configuration file), it sets `MAKETEX_MODE' to `/'. This
+makes the default PK path, for example, expand into `.../pk//', so
+fonts will be found even if there is no subdirectory for the mode (if
+you arranged things that way because your site has only one printer,
+for example) or if the program is mode-independent (e.g., `pktype').
+
+ To make the paths independent of the mode, simply edit `texmf.in'
+before installation, or the installed `texmf.cnf', and remove the
+`$MAKETEX_MODE'.
+
+ *Note mktex script arguments::, for how this interacts with `mktexpk'.
+
+ *Note TeX directory structure: TeX directory structure, for a
+description of the default arrangement of the input files that comprise
+the TeX system. The file `kpathsea/HIER' is a copy of that section.
+
+1.2.3.2 Default path generation
+...............................
+
+This section describes how the default paths are constructed.
+
+ You may wish to ignore the whole mess and simply edit `texmf.cnf'
+after it is installed, perhaps even copying it into place beforehand so
+you can complete the installation, if it seems necessary.
+
+ To summarize the chain of events that go into defining the default
+paths:
+
+ 1. `configure' creates a `Makefile' from each `Makefile.in'.
+
+ 2. When Make runs in the `kpathsea' directory, it creates a file
+ `texmf.sed' that substitutes the Make value of `$(var)' for a
+ string `@var@'. The variables in question are the one that define
+ the installation directories.
+
+ 3. `texmf.sed' (together with a little extra magic--see
+ `kpathsea/Makefile') is applied to `texmf.in' to generate
+ `texmf.cnf'. This is the file that will eventually be installed
+ and used.
+
+ 4. The definitions in `texmf.cnf' are recast as C `#define''s in
+ `paths.h'. These values will be the compile-time defaults; they
+ are not used at runtime unless no `texmf.cnf' file can be found.
+
+ (That's a lie: the compile-time defaults are what any extra :'s in
+ `texmf.cnf' expand into; but the paths as distributed have no extra
+ :'s, and there's no particular reason for them to.)
+
+1.2.4 Running `configure'
+-------------------------
+
+Run `sh configure OPTIONS' (in the top-level directory, the one
+containing `kpathsea/'), possibly using a shell other than `sh' (*note
+configure shells::).
+
+ `configure' adapts the source distribution to the present system via
+`#define''s in `*/c-auto.h', which are created from the corresponding
+`c-auto.in'. It also creates a `Makefile' from the corresponding
+`Makefile.in', doing `@VAR@' and `ac_include' substitutions).
+
+ `configure' is the best place to control the configuration,
+compilation, and installed location of the software, either via
+command-line options, or by setting environment variables before
+invoking it. For example, you can disable `mktexpk' by default with
+the option `--disable-mktexpk'. *Note configure options::.
+
+1.2.4.1 `configure' shells
+..........................
+
+Considerable effort has gone into trying to ensure that the `configure'
+scripts can be run by most Bourne shell variants. If `sh' runs into
+trouble, your best bet is to use Bash, the GNU Bourne-again shell
+(*note Top: (bash)Top.).
+
+ Bourne shell variants for which problems have been reported in the
+past are:
+`ksh'
+ Old versions of the Korn shell may fail to handle the scripts.
+ The Korn shell may be installed as `/bin/sh' on AIX, in which case
+ `/bin/bsh' may serve instead.
+
+`ash'
+ Old versions of ash are unable to handle the scripts. Ash is
+ sometimes installed as `/bin/sh' on NetBSD, FreeBSD, and Linux
+ systems. `/bin/bash' should be available for those systems, but
+ might not be part of a default installation.
+
+`Ultrix /bin/sh'
+ `/bin/sh' under Ultrix is a DEC-grown shell that is notably
+ deficient in many ways. `/bin/sh5' may be necessary.
+
+1.2.4.2 `configure' options
+...........................
+
+For a complete list of all `configure' options, run `configure --help'
+or see *Note Running `configure' scripts: (autoconf)Invoking configure,
+(a copy is in the file `kpathsea/README.CONFIGURE'). The generic
+options are listed first in the `--help' output, and the
+package-specific options come last. The environment variables
+`configure' pays attention to are listed below.
+
+ Options particularly likely to be useful are `--prefix', `--datadir',
+and the like; see *Note configure scenarios::.
+
+ This section gives pointers to descriptions of the `--with' and
+`--enable' options to `configure' that Kpathsea-using programs accept.
+
+`--without-mktexmf-default'
+`--without-mktexpk-default'
+`--without-mktextfm-default'
+`--with-mktextex-default'
+ Enable or disable the dynamic generation programs. *Note mktex
+ configuration::.
+
+`--enable-shared'
+ Build Kpathsea as a shared library, and link against it. Also
+ build the usual static library. *Note Shared library::.
+
+`--disable-static'
+ Build only the shared library. Implies `--enable-shared'.
+
+`--enable-maintainer-mode'
+ Enables make targets that are useful for the maintainer and likely
+ to be a pain for anyone else; the makefiles created when this
+ option is enabled may not work at all for you. You have been
+ warned.
+
+1.2.4.3 `configure' environment
+...............................
+
+`configure' uses the value of the following environment variables in
+determining your system's characteristics, and substitutes for them in
+Makefile's:
+
+`CC'
+ The compiler to use: default is `gcc' if it's installed, otherwise
+ `cc'.
+
+`CFLAGS'
+ Options to give the compiler: default is `-g -O2' for `gcc', `-g'
+ otherwise. `CFLAGS' comes after any other options. You may need
+ to include `-w' here if your compilations commonly have useless
+ warnings (e.g., `NULL redefined'), or `configure' may fail to
+ detect the presence of header files (it takes the messages on
+ standard error to mean the header file doesn't exist).
+
+`CPPFLAGS'
+ Options to pass to the compiler preprocessor; this matters most for
+ configuration, not the actual source compilation. The `configure'
+ script often does only preprocessing (e.g., to check for the
+ existence of #include files), and `CFLAGS' is not used for this.
+ You may need to set this to something like
+ `-I/usr/local/include/wwwhatever' if you have the libwww library
+ installed for hyper-xdvik (see `xdvik/INSTALL').
+
+`DEFS'
+ Additional preprocessor options, but not used by `configure'.
+ Provided for enabling or disabling program features, as documented
+ in the various program-specific installation instructions. `DEFS'
+ comes before any compiler options included by the distribution
+ `Makefile's or by `configure'.
+
+`LDFLAGS'
+ Additional options to give to the loader. `LDFLAGS' comes before
+ any other linker options.
+
+`LIBS'
+ Additional libraries to link with.
+
+1.2.4.4 `configure' scenarios
+.............................
+
+Here are some common installation scenarios:
+
+ * Including X support in Metafont. This is disabled by default,
+ since many sites have no use for it, and it's a leading cause of
+ configuration problems.
+ configure --with-x
+
+ * Putting the binaries, TeX files, GNU info files, etc. into a single
+ TeX hierarchy, say `/here/texmf', requires overriding defaults in
+ `configure':
+ configure --prefix=/here/texmf --datadir=/here
+
+ * You can compile on multiple architectures simultaneously either by
+ building symbolic link trees with the `lndir' script from the X11
+ distribution, or with the `--srcdir' option:
+ configure --srcdir=SRCDIR
+
+ * If you are installing binaries for multiple architectures into a
+ single hierarchy, you will probably want to override the default
+ `bin' and `lib' directories, something like this:
+ configure --prefix=TEXMF --datadir=TEXMF \
+ --bindir=TEXMF/ARCH/bin --libdir=TEXMF/ARCH/lib
+ make texmf=TEXMF
+ (Unless you make provisions for architecture-specific files in
+ other ways, e.g., with Depot or an automounter.)
+
+ * To compile with optimization (to compile without debugging, remove
+ the `-g'):
+ env CFLAGS="-g -O" sh configure ...
+ For a potential problem if you optimize, see *Note TeX or Metafont
+ failing: TeX or Metafont failing.
+
+1.2.4.5 Shared library
+......................
+
+You can compile Kpathsea as a shared library on a few systems, by
+specifying the option `--enable-shared' when you run `configure'.
+
+ The main advantage in doing this is that the executables can then
+share the code, thus decreasing memory and disk space requirements.
+
+ On some systems, you can record the location of shared libraries in a
+binary, usually by giving certain options to the linker. Then
+individual users do not need to set their system's environment variable
+(e.g., `LD_LIBRARY_PATH') to find shared libraries. If you want to do
+this, you will need to add the necessary options to `LDFLAGS' yourself;
+for example, on Solaris, include something like `-R${prefix}/lib', on
+IRIX or Linux, use `-rpath${prefix}/lib'. (Unfortunately, making this
+happen by default is very difficult, because of interactions with an
+existing installed shared library.)
+
+ Currently, shared library support is implemented only on Linux, SunOS
+4 (Solaris 1), SunOS 5 (Solaris 2), IRIX 5, and IRIX 6. If you're
+interested and willing in adding support for other systems, please see
+the `configure' mode in the `klibtool' script, especially the
+host-specific case statement around line 250.
+
+1.2.5 Running `make'
+--------------------
+
+`make' (still in the top-level directory). This also creates the
+`texmf.cnf' and `paths.h' files that define the default search paths,
+and (by default) the `plain' and `latex' TeX formats.
+
+ You can override directory names and other values at `make'-time.
+`make/paths.make' lists the variables most commonly reset. For
+example, `make default_texsizes=600' changes the list of fallback
+resolutions.
+
+ You can also override each of `configure''s environment variables
+(*note configure environment::). The Make variables have the same
+names.
+
+ Finally, you can supply additional options via the following
+variables. (`configure' does not use these.)
+
+`XCPPFLAGS'
+`XDEFS'
+ Preprocessor options.
+
+`XCFLAGS'
+ Compiler options.
+
+`XLDFLAGS'
+ Loader options (included at beginning of link commands).
+
+`XLOADLIBES'
+ More loader options (included at end of link commands).
+
+`XMAKEARGS'
+ Additional Make arguments passed to all sub-`make''s. You may need
+ to include assignments to the other variables here via `XMAKEARGS';
+ for example: `make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"'.
+
+ It's generally a bad idea to use a different compiler (`CC') or
+libraries (`LIBS') for compilation than you did for configuration,
+since the values `configure' determined may then be incorrect.
+
+ Adding compiler options to change the "universe" you are using
+(typically BSD vs. system V) is generally a cause of trouble. It's
+best to use the native environment, whatever that is; `configure' and
+the software usually adapt best to that. In particular, under Solaris
+2.x, you should not use the BSD-compatibility library (`libucb') or
+include files (`ucbinclude').
+
+ If you want to use the Babel LaTeX package for support of non-English
+typesetting, you need to modify some files before making the LaTeX
+format. See the file `install.txt' in the Babel distribution.
+
+1.2.6 Installing files
+----------------------
+
+The basic command is the usual `make install'. For security issues,
+*note Security::.
+
+ The first time you install any manual in the GNU Info system, you
+should add a line (you choose where) to the file `dir' in your
+`$(infodir)' directory. Sample text for this is given near the top of
+the Texinfo source files (`kpathsea/kpathsea.texi',
+`dvipsk/dvips.texi', and `web2c/doc/web2c.texi'). If you have a recent
+version of the GNU Texinfo distribution installed
+(`ftp://prep.ai.mit.edu/pub/gnu/texinfo-3.9.tar.gz' or later), this
+should happen automatically.
+
+ On the offchance that this is your first Info installation, the `dir'
+file I use is included in the distribution as `etc/dir-example'.
+
+ You may wish to use one of the following targets, especially if you
+are installing on multiple architectures:
+ * `make install-exec' to install in architecture-dependent
+ directories, i.e., ones that depend on the `$(exec_prefix)' Make
+ variable. This includes links to binaries, libraries, etc., not
+ just "executables".
+
+ * `make install-data' to install in architecture-independent
+ directories, such as documentation, configuration files, pool
+ files, etc.
+
+ If you use the Andrew File System, the normal path (e.g., PREFIX/bin)
+only gets you to a read-only copy of the files, and you must specify a
+different path for installation. The best way to do this is by setting
+the `prefix' variable on the `make' command line. The sequence becomes
+something like this:
+ configure --prefix=/whatever
+ make
+ make install prefix=/afs/.SYSTEM.NAME/system/1.3/@sys/whatever
+ With AFS, you will definitely want to use relative filenames in
+`ls-R' (*note Filename database::), not absolute filenames. This is
+done by default, but check anyway.
+
+1.2.7 Cleaning up
+-----------------
+
+The basic command is `make distclean'. This removes all files created
+by the build.
+
+ Alternatively,
+ * `make mostlyclean' if you intend to compile on another
+ architecture. For Web2C, since the generated C files are portable,
+ they are not removed. If the `lex' vs. `flex' situation is going
+ to be different on the next machine, `rm web2c/lex.yy.c'.
+
+ * `make clean' to remove files created by compiling, but leave
+ configuration files and Makefiles.
+
+ * `make maintainer-clean' to remove everything that the Makefiles can
+ rebuild. This is more than `distclean' removes, and you should
+ only use it if you are thoroughly conversant with (and have the
+ necessary versions of) Autoconf.
+
+ * `make extraclean' to remove other junk, e.g., core files, log
+ files, patch rejects. This is independent of the other `clean'
+ targets.
+
+1.2.8 Filename database generation
+----------------------------------
+
+You will probably want to set up a `cron' entry on the appropriate
+machine(s) to rebuild the filename database nightly or so, as in:
+ 0 0 * * * cd TEXMF && /BINDIR/mktexlsr
+ *Note Filename database::.
+
+ Although the `mktex...' scripts make every effort to add
+newly-created files on the fly, it can't hurt to make sure you get a
+fresh version every so often.
+
+1.2.9 `mktex' scripts
+---------------------
+
+If Kpathsea cannot otherwise find a file, for some file types it is
+configured by default to invoke an external program to create it
+dynamically (*note mktex configuration::). This is most useful for
+fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as
+the Sauter and EC fonts), since any given document can use fonts never
+before referenced. Trying to build all fonts in advance is therefore
+impractical, if not impossible.
+
+ The script is passed the name of the file to create and possibly other
+arguments, as explained below. It must echo the full pathname of the
+file it created (and nothing else) to standard output; it can write
+diagnostics to standard error.
+
+1.2.9.1 `mktex' configuration
+.............................
+
+The following file types can run an external program to create missing
+files: `pk', `tfm', `mf', `tex'; the scripts are named `mktexpk',
+`mktextfm', `mktexmf', and `mktextex'.
+
+ In the absence of `configure' options specifying otherwise,
+everything but `mktextex' will be enabled by default. The `configure'
+options to change the defaults are:
+
+ --without-mktexmf-default
+ --without-mktexpk-default
+ --without-mktextfm-default
+ --with-mktextex-default
+
+ The `configure' setting is overridden if the environment variable or
+configuration file value named for the script is set; e.g., `MKTEXPK'
+(*note mktex script arguments::).
+
+ As distributed, all the scripts source a file `texmf/web2c/mktex.cnf'
+if it exists, so you can override various defaults. See `mktex.opt',
+for instance, which defines the default mode, resolution, some special
+directory names, etc. If you prefer not to change the distributed
+scripts, you can simply create `mktex.cnf' with the appropriate
+definitions (you do not need to create it if you have nothing to put in
+it). `mktex.cnf' has no special syntax; it's an arbitrary Bourne shell
+script. The distribution contains a sample `mktex.cnf' for you to copy
+and modify as you please (it is not installed anywhere).
+
+ In addition, you can configure a number of features with the
+`MT_FEATURES' variable, which you can define:
+ * in `mktex.opt', as just mentioned;
+
+ * by editing the file `mktex.opt', either before `make install' (in
+ the source hierarchy) or after (in the installed hierarchy);
+
+ * or in the environment.
+
+ If none of the options below are enabled, `mktexpk', `mktextfm', and
+`mktexmf' follow the following procedure to decide where fonts should
+be installed. Find the tree where the font's sources are, and test the
+permissions of the `fonts' directory of that tree to determine whether
+it is writable. If it is, put the files in the tree in appropriate
+locations. If it isn't writable, see whether the tree is a system tree
+(named in `SYSTEXMF'). If so, the `VARTEXFONTS' tree is used. In all
+other cases the working directory is used.
+
+ The `appendonlydir' option is enabled by default.
+
+`appendonlydir'
+ Tell `mktexdir' to create directories append-only, i.e., set their
+ sticky bit (*note Mode Structure: (coreutils)Mode Structure.).
+ This feature is silently ignored on non-Unix platforms (e.g.
+ Windows/NT and MS-DOS) which don't support similar functionality.
+ This feature is enabled by default.
+
+`dosnames'
+ Use 8.3 names; e.g., `dpi600/cmr10.pk' instead of `cmr10.600pk'.
+ Note that this feature only affects filenames that would otherwise
+ clash with other TeX-related filenames; `mktex' scripts do nothing
+ about filenames which exceed the 8+3 MS-DOS limits but remain
+ unique when truncated (by the OS) to these limits, and nether do
+ the scripts care about possible clashes with files which aren't
+ related with TeX. For example, `cmr10.600pk' would clash with
+ `cmr10.600gf' and is therefore changed when `dosnames' is in
+ effect, but `mf.pool' and `mp.base' don't clash with any
+ TeX-related files and are therefore unchanged.
+
+ This feature is turned on by default on MS-DOS. If you do not wish
+ `dosnames' to be set on an MS-DOS platform, you need to set the
+ `MT_FEATURES' environment variable to a value that doesn't include
+ `dosnames'. You can also change the default setting by editing
+ `mktex.opt', but only if you use the `mktex' shell scripts; the
+ emulation programs don't consult `mktex.opt'.
+
+`fontmaps'
+ Instead of deriving the location of a font in the destination tree
+ from the location of the sources, the aliases and directory names
+ from the Fontname distribution are used. (*note Introduction:
+ (fontname)Top.).
+
+`nomfdrivers'
+ Let mktexpk and mktextfm create metafont driver files in a
+ temporary directory. These will be used for just one metafont run
+ and not installed permanently.
+
+`nomode'
+ Omit the directory level for the mode name; this is fine as long as
+ you generate fonts for only one mode.
+
+`stripsupplier'
+ Omit the font supplier name directory level.
+
+`striptypeface'
+ Omit the font typeface name directory level.
+
+`strip'
+ Omit the font supplier and typeface name directory levels. This
+ feature is deprecated in favour of `stripsupplier' and
+ `striptypeface'.
+
+`varfonts'
+ When this option is enabled, fonts that would otherwise be written
+ in system texmf tree go to the `VARTEXFONTS' tree instead. The
+ default value in `kpathsea/Makefile.in' is `/var/tmp/texfonts'.
+ The `Linux File System Standard' recommends `/var/tex/fonts'.
+
+ The `varfonts' setting in `MT_FEATURES' is overridden by the
+ `USE_VARTEXFONTS' environment variable: if set to `1', the feature
+ is enabled, and if set to `0', the feature is disabled.
+
+`texmfvar'
+ Force generated files that would go into a system tree (as defined
+ by `SYSTEXMF') into `TEXMFVAR'. Starting with teTeX-3.0, the
+ variable `TEXMFVAR' is always set. The `varfonts' feature takes
+ precedence if also set.
+
+ The `texmfvar' setting in `MT_FEATURES' is overridden by the
+ `USE_TEXMFVAR' environment variable: if set to `1', the feature is
+ enabled, and if set to `0', the feature is disabled.
+
+1.2.9.2 `mktex' script names
+............................
+
+The following table shows the default name of the script for each
+possible file types. (The source is the variable `kpse_make_specs' in
+`kpathsea/tex-make.c'.)
+
+`mktexpk'
+ Glyph fonts.
+
+`mktextex'
+ TeX input files.
+
+`mktexmf'
+ Metafont input files.
+
+`mktextfm'
+ TFM files.
+
+These names are overridden by an environment variable specific to the
+program--for example, `DVIPSMAKEPK' for Dvipsk.
+
+ If a `mktex...' script fails, the invocation is appended to a file
+`missfont.log' (by default) in the current directory. You can then
+execute the log file to create the missing files after fixing the
+problem.
+
+ If the current directory is not writable and the environment variable
+or configuration file value `TEXMFOUTPUT' is set, its value is used.
+Otherwise, nothing is written. The name `missfont.log' is overridden
+by the `MISSFONT_LOG' environment variable or configuration file value.
+
+1.2.9.3 `mktex' script arguments
+................................
+
+The first argument to a `mktex' script is always the name of the file
+to be created.
+
+ In the default `mktexpk' implementation, additional arguments may
+also be passed:
+
+`--dpi NUM'
+ Sets the resolution of the generated font to NUM.
+
+`--mfmode NAME'
+ Sets the Metafont mode to NAME.
+
+`--bdpi NUM'
+ Sets the the "base dpi" for the font. This must match the mode
+ being used.
+
+`--mag STRING'
+ A "magstep" string suitable for the Metafont `mag' variable. This
+ must match the combination of BDPI and DPI being used.
+
+`--destdir STRING'
+ A directory name. If the directory is absolute, it is used as-is.
+ Otherwise, it is appended to the root destination directory set in
+ the script.
+
+1.2.10 Installation testing
+---------------------------
+
+Besides the tests listed in *Note Simple installation::, you can try
+running `make check'. This includes the torture tests (trip, trap, and
+mptrap) that come with Web2c (*note Triptrap: (web2c)Triptrap.).
+
+1.3 Security
+============
+
+None of the programs in the TeX system require any special system
+privileges, so there's no first-level security concern of people gaining
+illegitimate root access.
+
+ A TeX document, however, can write to arbitrary files, e.g.,
+`~/.rhosts', and thus an unwitting user who runs TeX on a random
+document is vulnerable to a trojan horse attack. This loophole is
+closed by default, but you can be permissive if you so desire in
+`texmf.cnf'. *Note tex invocation: (web2c)tex invocation. MetaPost has
+the same issue.
+
+ Dvips, Xdvi, and TeX can also execute shell commands under some
+circumstances. To disable this, see the `-R' option in *Note Option
+details: (dvips)Option details, the xdvi man page, and *Note tex
+invocation: (web2c)tex invocation, respectively.
+
+ Another security issue arises because it's very useful--almost
+necessary--to make arbitrary fonts on user demand with `mktexpk' and
+friends. Where do these files get installed? By default, the
+`mktexpk' distributed with Kpathsea assumes a world-writable `/var/tmp'
+directory; this is a simple and convenient approach, but it may not
+suit your situation because it means that a local cache of fonts is
+created on every machine.
+
+ To avoid this duplication, many people consider a shared, globally
+writable font tree desirable, in spite of the potential security
+problems. To do this you should change the value of `VARTEXFONTS' in
+`texmf.cnf' to refer to some globally known directory. *Note mktex
+configuration::.
+
+ The first restriction you can apply is to make newly-created
+directories under `texmf' be append-only with an option in `mktex.cnf'.
+*Note mktex configuration::.
+
+ Another approach is to establish a group (or user) for TeX files,
+make the `texmf' tree writable only to that group (or user), and make
+`mktexpk' et al. setgid to that group (or setuid to that user). Then
+users must invoke the scripts to install things. (If you're worried
+about the inevitable security holes in scripts, then you could write a
+C wrapper to exec the script.)
+
+ The `mktex...' scripts install files with the same read and write
+permissions as the directory they are installed in. The executable,
+sgid, suid, and sticky bits are always cleared.
+
+ Any directories created by the `mktex...' scripts have the same
+permissions as their parent directory, unless the `appendonlydir'
+feature is used, in which case the sticky bit is always set.
+
diff --git a/Build/source/texk/kpathsea/Makefile.in b/Build/source/texk/kpathsea/Makefile.in
new file mode 100644
index 00000000000..cc3208b2a1e
--- /dev/null
+++ b/Build/source/texk/kpathsea/Makefile.in
@@ -0,0 +1,287 @@
+# Makefile for kpathsea --kb@mail.tug.org. Public domain.
+version = @KPSEVERSION@
+
+# Add -DNO_DEBUG to disable debugging, for vanishingly better performance.
+
+kpse_include ../make/paths.mk
+kpse_include ../make/makevars.mk
+kpse_include ../make/common.mk
+kpse_include ../make/library.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/texi.mk
+
+@MAINT@warn_more = -Wmissing-prototypes -Wwrite-strings -Wshadow
+@MAINT@MAKEINFO_FLAGS := $(MAKEINFO_FLAGS) --no-split
+
+# Install these header files (except acconfig.h).
+install_headers = *.h $(srcdir)/*.h
+
+# Put tex-file.o first, because it's what depends on the paths, and may
+# reduce frustration if the paths are wrong by doing it first.
+
+objects = tex-file.lo absolute.lo atou.lo cnf.lo concat.lo concat3.lo \
+concatn.lo db.lo debug.lo dir.lo elt-dirs.lo expand.lo extend-fname.lo \
+file-p.lo find-suffix.lo fn.lo fontmap.lo getopt.lo getopt1.lo hash.lo \
+kdefault.lo line.lo magstep.lo make-suffix.lo path-elt.lo \
+pathsearch.lo proginit.lo progname.lo readable.lo rm-suffix.lo \
+str-list.lo str-llist.lo tex-glyph.lo tex-hush.lo tex-make.lo \
+tilde.lo truncate.lo uppercasify.lo variable.lo version.lo xbasename.lo \
+xcalloc.lo xdirname.lo xfopen.lo xfseek.lo xftell.lo xgetcwd.lo xmalloc.lo \
+xopendir.lo xputenv.lo xrealloc.lo xstat.lo xstrdup.lo $(liblobjs) $(malloc)
+liblobjs = @LTLIBOBJS@
+
+library = kpathsea
+
+# We want to compile almost everything with libtool ...
+KPATHSEA_CC = $(LIBTOOL) --mode=compile $(CC)
+.SUFFIXES: .lo
+.c.lo:
+ $(KPATHSEA_CC) $(ALL_CFLAGS) -DMAKE_KPSE_DLL -c $<
+
+default all: kpsewhich kpsestat kpseaccess kpsereadlink $(library).info manfiles
+
+kpsewhich: $(kpathsea) kpsewhich.o
+ $(kpathsea_link) kpsewhich.o $(LOADLIBES)
+
+kpsestat: kpsestat.o
+ $(link_command) kpsestat.o
+
+kpseaccess: access.o
+ $(link_command) access.o
+
+kpsereadlink: readlink.o
+ $(link_command) readlink.o
+
+$(kpathsea): $(objects)
+ $(kpathsea_link) -rpath $(libdir) -version-info 4:0:0 $(objects)
+
+# Make variable substitutions for paths.h.
+texmf.cnf: texmf.in texmf.sed
+ sed -f texmf.sed $(srcdir)/texmf.in >$@
+
+# The idea is to turn each var=value into s%@var@%value%g. Seems simpler
+# to put the substitutions in a file than to play shell quoting games.
+texmf.sed: Makefile
+ rm -f texmf.sed
+ echo $(makevars) \
+ | tr ' ' '\012' \
+ | sed -e 's/^/s%@/' -e 's/=/@%/' -e 's/$$/%g/' \
+ >$@
+# Insert $TEXMF in as many of the hardwired paths as possible. We could
+# use the slightly different rule 's%$(texmf)/%\$$TEXMF/%g' and avoid
+# the need for the corrections below. But if texmf.in is edited
+# the heuristic may no longer work.
+ echo 's%$(texmf)%\$$TEXMF%g' >>$@
+# Now we repair the damage this may have caused. Don't replace the rhs of
+# the TEXMFMAIN assignment itself, then we'd end up with TEXMFMAIN = $TEXMF
+# and TEXMF = $TEXMFMAIN. The (commented) assignment of TEXMFLOCAL is
+# likely to have been mangled as well.
+ echo '/^ *TEXMFMAIN[ =]/s%\$$TEXMF%$(texmf)%' >>$@
+ echo '/^[% ]*TEXMFLOCAL[ =]/s%\$$TEXMF%$(texmf)%' >>$@
+ echo '/^[% ]*TEXMFDIST[ =]/s%\$$TEXMF%$(texmf)%' >>$@
+ echo '/^[% ]*VARTEXMF[ =]/s%\$$TEXMF%$(texmf)%' >>$@
+ echo '/^[% ]*TEXMFSYSVAR[ =]/s%\$$TEXMF%$(texmf)%' >>$@
+ echo '/^[% ]*TEXMFSYSCONFIG[ =]/s%\$$TEXMF%$(texmf)%' >>$@
+ echo '/^[% ]*TEXMFSYSVAR[ =]/s%$(texmf)MAIN%\$$TEXMFMAIN%' >>$@
+ echo '/^[% ]*TEXMFSYSCONFIG[ =]/s%$(texmf)MAIN%\$$TEXMFMAIN%' >>$@
+ echo '/^[% ]*TEXMFVAR[ =]/s%\$$TEXMF%$(texmf)%' >>$@
+ echo '/^[% ]*TEXMFCONFIG[ =]/s%\$$TEXMF%$(texmf)%' >>$@
+ echo '/^[% ]*TEXMFVAR[ =]/s%$(texmf)MAIN%\$$TEXMFMAIN%' >>$@
+ echo '/^[% ]*TEXMFCONFIG[ =]/s%$(texmf)MAIN%\$$TEXMFMAIN%' >>$@
+ echo '/^[% ]*TEXMFCNF[ =]/s%\$$TEXMF%$(texmf)%' >>$@
+# And fill in the last clause of TEXMFCNF with an absolute path.
+ echo '/^ *TEXMFCNF[ =]/s%@web2c@%$(web2cdir)%' >>$@
+
+# First null out comments and leading/trailing whitespace, then remove
+# lines that define invalid C identifiers, then remove blank lines and
+# lines that define lowercase values (those are never path values). Each
+# line remaining looks like
+# <name> = <value>
+# (but = and surrounding spaces are optional, hence can't remove all spaces).
+# Change this to #ifndef DEFAULT_name@#define DEFAULT_name "value"@#endif,
+# then change the @'s to newlines (sed isn't good at multiline replacements).
+#
+# No backslash-newline escapes in the long sed replacement because that
+# will turn into a space in the output.
+#
+# Without the $TEXMF/prefix/etc. substitutions, if the cnf file was
+# not found, the compile-time paths would be of little use, since TEXMF
+# (etc.) wouldn't be defined. Alternatively, we could have a way to
+# specify compile-time default values for variables in general, but I
+# think it's better to keep the last-resort paths as simple as possible.
+#
+# The definition of DEFAULT_TEXMF (and other variables)
+# that winds up in the final paths.h will not be used.
+#
+# We don't want to rewrite paths.h when we have only changed comments
+# in texmf.in that have no effect on paths.h, since that would cause
+# almost everything to be rebuilt.
+#
+# We also replace all semicolons with colons in the paths. Ultimately
+# the path-splitting code should be changed to understand both.
+$(kpathsea_dir)/paths.h: stamp-paths
+stamp-paths: texmf.cnf
+ echo "/* paths.h: Generated from texmf.cnf. */" >paths.tmp
+ sed -e 's/%.*//' -e 's/^[ ]*//' -e 's/[ ]*$$//' texmf.cnf \
+ | grep '^[ ]*[A-Z0-9_]*[ =]' \
+ | sed '/^$$/d' \
+ | sed 's/^\([^ =]*\)[ ]*=*[ ]*\(.*\)/#ifndef DEFAULT_\1%#define DEFAULT_\1 "\2"%#endif/' \
+ | tr '%' '\012' \
+ | sed -e 's%\$$TEXMFMAIN%$(texmf)%g' \
+ -e 's%\$$TEXMF%$(texmf)%g' \
+ -e 's%\$$VARTEXFONTS%$(vartexfonts)%g' \
+ -e 's%\$$web2cdir%$(web2cdir)%g' \
+ -e 's%\$$prefix%$(prefix)%g' \
+ | sed -e 's%;%:%g' \
+ >>paths.tmp
+ @if cmp -s paths.h paths.tmp 2>/dev/null; then \
+ echo "paths.h is unchanged"; \
+ else \
+ echo "cp paths.tmp paths.h"; \
+ cp paths.tmp paths.h; \
+ fi
+ rm -f paths.tmp
+ date >stamp-paths
+
+# Need an extra definition for this. Dependencies included below.
+tex-file.o:
+ $(KPATHSEA_CC) -DDEFAULT_FONT_SIZES='\"$(default_texsizes)\"' $(srcdir)/tex-file.c
+
+check: kpsewhich
+ ./kpsewhich -expand-var '$$TEXMF'
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+install-exec: kpsewhich
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir) $(scriptdir) \
+ $(libdir) $(web2cdir)
+ if grep 'original mktexpk --' $(scriptdir)/mktexpk >/dev/null 2>&1\
+ || test ! -r $(scriptdir)/mktexpk; then \
+ $(INSTALL_SCRIPT) $(srcdir)/mktexpk $(scriptdir)/mktexpk; \
+ else true; fi
+ if grep 'original mktexmf --' $(scriptdir)/mktexmf >/dev/null 2>&1\
+ || test ! -r $(scriptdir)/mktexmf; then \
+ $(INSTALL_SCRIPT) $(srcdir)/mktexmf $(scriptdir)/mktexmf; \
+ else true; fi
+ if grep 'original mktextfm --' $(scriptdir)/mktextfm >/dev/null 2>&1\
+ || test ! -r $(scriptdir)/mktextfm; then \
+ $(INSTALL_SCRIPT) $(srcdir)/mktextfm $(scriptdir)/mktextfm; \
+ else true; fi
+ if grep 'original mktexlsr --' $(scriptdir)/mktexlsr >/dev/null 2>&1\
+ || test ! -r $(scriptdir)/mktexlsr; then \
+ $(INSTALL_SCRIPT) $(srcdir)/mktexlsr $(scriptdir)/mktexlsr; \
+ else true; fi
+# if grep 'original mktexfmt --' $(scriptdir)/mktexfmt > /dev/null 2>&1\
+# || test ! -r $(scriptdir)/mktexfmt; then \
+# $(INSTALL_SCRIPT) $(srcdir)/mktexfmt $(scriptdir)/mktexfmt; \
+# else true; fi
+ $(INSTALL_DATA) $(srcdir)/mktex.opt $(web2cdir)/mktex.opt
+ $(INSTALL_SCRIPT) $(srcdir)/mktexdir $(web2cdir)/mktexdir
+ $(INSTALL_DATA) $(srcdir)/mktexdir.opt $(web2cdir)/mktexdir.opt
+ $(INSTALL_SCRIPT) $(srcdir)/mktexnam $(web2cdir)/mktexnam
+ $(INSTALL_DATA) $(srcdir)/mktexnam.opt $(web2cdir)/mktexnam.opt
+ $(INSTALL_SCRIPT) $(srcdir)/mktexupd $(web2cdir)/mktexupd
+ $(INSTALL_LIBTOOL_LIBS) lib$(library).la $(libdir)
+ $(INSTALL_LIBTOOL_PROG) kpsewhich $(bindir)
+ $(INSTALL_PROGRAM) kpsestat $(bindir)
+ $(INSTALL_PROGRAM) kpseaccess $(bindir)
+ $(INSTALL_PROGRAM) kpsereadlink $(bindir)
+uninstall-exec:
+ $(UNINSTALL_LIBTOOL_LIBS) $(libdir)/lib$(library).la
+ $(UNINSTALL_LIBTOOL_PROG) $(bindir)/kpsewhich
+ $(UNINSTALL_PROGRAM) $(bindir)/kpsestat
+ $(UNINSTALL_PROGRAM) $(bindir)/kpseaccess
+ $(UNINSTALL_PROGRAM) $(bindir)/kpsereadlink
+
+install-data: texmf.cnf kpathsea.info install-man
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(texmf) $(infodir) $(web2cdir)
+ if grep 'original texmf.cnf --' $(web2cdir)/texmf.cnf >/dev/null 2>&1 \
+ || test ! -r $(web2cdir)/texmf.cnf; then \
+ $(INSTALL_DATA) texmf.cnf $(web2cdir)/texmf.cnf; \
+ else true; fi
+ test -r ./kpathsea.info || cd $(srcdir) && for i in kpathsea.i*; do \
+ $(INSTALL_DATA) $$i $(infodir)/$$i; done
+# Should we install the headers? They are not just system-dependent,
+# which is bad enough, but even compiler-dependent.
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(includedir)/kpathsea
+ for f in $(install_headers); do \
+ $(INSTALL_DATA) $$f $(includedir)/kpathsea/; done
+ rm -f $(includedir)/kpathsea/acconfig.h
+ $(POST_INSTALL)
+ test -r $(infodir)/dir || $(INSTALL_DATA) $(top_srcdir)/../dir $(infodir)
+ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ install-info --info-dir=$(infodir) $(infodir)/kpathsea.info; \
+ else true; fi
+
+uninstall-data:
+ $(PRE_UNINSTALL)
+ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ install-info --delete --info-dir=$(infodir) $(infodir)/kpathsea.info; \
+ else true; fi
+ $(NORMAL_UNINSTALL)
+ rm -f $(infodir)/kpathsea.i*
+# for f in $(install_headers); do rm -f $(includedir)/`basename $$f`; done
+
+# distdir is used by other distributions; they define $(distdir).
+distdir: doc $(library).dvi $(library).h
+ rm -rf $(distdir)
+ mkdir -p $(distdir)
+ ln $(ln_files) $(distdir)
+ touch *.info*
+ ln mktex* *.info* *.texi *.ftp $(library).aux $(library).cps $(distdir)
+ rm -f $(distdir)/*.1 $(distdir)/*.man
+ ln *.man $(distdir)
+ ln BUGS README.CONFIGURE HIER PROJECTS *.ac $(distdir)
+ touch kpathsea.h # to avoid .cps.h rule on Solaris
+ cd $(distdir) && rm -f paths.h
+
+# I don't use this, but other programmers want it. acconfig.h is an
+# autoheader input file, not an includable C header. Bad name.
+$(library).h: always
+ rm -f $@
+ echo '/* This is a generated file */' >$@
+ echo '/* collecting all kpathsea headers. */' >>$@
+ echo '#include <kpathsea/config.h>' >>$@
+ ls -1 *.h \
+ | grep -v '\(acconfig\|config\|kpathsea\|win32lib\)\.h' \
+ | sed -e 's,^,#include <kpathsea/,' -e s',$$,>,' >>$@
+ touch -r `ls -1t *.h | tail +2 | head -1` $@
+always:
+.PHONY: always
+
+kpse_include ../make/config.mk
+
+info: $(library).info
+dvi: $(library).dvi
+
+$(library).info: bugs.texi hier.texi install.texi unixtex.texi
+
+@MAINT@INSTALL: install.texi
+@MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@ $(top_srcdir)/../add-info-toc $@
+@MAINT@BUGS: bugs.texi
+@MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@ $(top_srcdir)/../add-info-toc $@
+@MAINT@HIER: hier.texi
+@MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@unixtex.ftp: unixtex.texi
+@MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@doc: info HIER BUGS INSTALL unixtex.ftp
+
+kpse_include ../make/clean.mk
+
+mostlyclean::
+ rm -f kpsewhich kpsestat kpseaccess kpsereadlink *.lo
+ $(LIBTOOL) --mode=clean $(RM) lib$(library).la
+distclean::
+ rm -f paths.h texmf.cnf texmf.sed stamp-paths
+
+# The manual pages
+manfiles = kpseaccess.1 kpsestat.1 kpsewhich.1 kpsereadlink.1 \
+ mktexlsr.1 mktexmf.1 mktextfm.1 mktexpk.1
+
+kpse_include ../make/man.mk
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/kpathsea/NEWS b/Build/source/texk/kpathsea/NEWS
new file mode 100644
index 00000000000..bac86594ea8
--- /dev/null
+++ b/Build/source/texk/kpathsea/NEWS
@@ -0,0 +1,316 @@
+This file records noteworthy changes.
+3.5.5
+* Copyrights of some source files were erroneously attributed to FSF.
+* On UNIX, accept the semicolon as well as the colon in environment
+ variables like TEXINPUTS.
+* Keep metafont from choking on large literals (> 4000) when calling
+ mktexpk.
+
+3.5.4 (7 March 2005)
+* Change of some standard environment/texmf.cnf variables:
+ HOMETEXMF -> TEXMFHOME
+ VARTEXMF -> TEXMFVAR
+ TEXMFVAR, TEXMFCONFIG: Always defined for the sake of teTeX 3.0.
+ TEXMFSYSVAR, TEXMFSYSCONFIG: Added for the sake of teTeX 3.0.
+* mktex*: A new option for MT_FEATURES in mktex.cnf: texmfvar. If
+ selected, files that would be written into a system texmf tree go
+ to the TEXMFVAR tree. Overriden by varfonts.
+
+3.5.3 (28 November 2004)
+* New options for kpsewhich
+ -var-value=VARIABLE to expand $VARIABLE without having to give an $
+ on the command line.
+ -engine=ENGINE to set the engine name, used in some search paths.
+* New formats: kpse_enc_format, kpse_cmap_format, kpse_sfd_format,
+ kpse_opentype_fomat, kpse_pdftex_config_format, kpse_lig_format,
+ kpse_texmfscript_format.
+* Add .afmt to the suffixes for kpse_fmt_format. Aleph uses this.
+* Rename access to kpseaccess.
+* Rename readlink to kpsereadlink.
+* Stop search early if we're given absolute or explicit relative names.
+* Add 'angle(0,0)' to the metafont errors mktexpk will ignore.
+* The withenable.ac script (used in configure) will fall back on using
+ kpsewhich to look for texmf trees.
+* If ls-R is not found check for ls-r as well.
+* kpsewhich: add -var-value option.
+
+3.5.2 (19 February 2003)
+* Critical bugfix to db.c.
+
+3.5.1 (17 February 2003)
+* No news.
+
+3.5.0 (15 February 2003)
+* Use libtool.
+* Do absolute searches again.
+* Retain '${prefix}' in Makefile for texmf if that's how we found the tree.
+
+3.4.6 (7 February 2003)
+* Support for e-Omega.
+* Change to the search algorithm: when there are several possibilities, look
+ for all of them in one directory before moving to the next directory.
+
+3.4.5 (28 January 2003)
+* Remove "." from the TEXCONFIG path.
+
+3.4.4 (16 January 2003)
+* Add VARTEXMF HOMETEXMF to the default paths of texmf.in.
+
+3.4.3 (11 January 2003)
+* Minor fixes.
+* Use both .w and .web suffixes for cweb.
+
+3.4.2 (23 December 2002)
+* Minor fixes to makefiles.
+* A Win32 implementation of the fork/exec path in mktex. This leaves
+ MSDOS to be done.
+
+3.4.1 (20 December 2002)
+* A couple of fixes for the fork/exec code.
+
+3.4.0 (14 December 2002)
+* 3.4.x number as ABI is certainly broken now.
+* Change the way the mktex* command lines are set up on unix systems.
+ Now we call fork/exec directly instead of using popen.
+ This code is not yet implemented for Windows/DOS.
+* We're now (un?)fairly restrictive on what names are allowed for fonts.
+ That part of the code probably need improvement.
+* When reading names from the ls-R file, they are no longer case-smashed.
+ So on platforms where this matters, the case-smashing should occur before
+ names are inserted into the ls-R file -- only lowercase should be used in
+ that file.
+
+3.3.11 (13 November 2002)
+* Minor fixes.
+
+3.3.10 (11 November 2002)
+* Minor fixes.
+
+3.3.9 (22 October 2002)
+* New extension: .oft for Omega formats.
+
+3.3.8 (11 October 2002)
+* Add support for mktexfmt (which is normally a link to fmtutil).
+* Check both VAR.progname and VAR_progname in the environment.
+
+3.3.7 (27 November 2001)
+* Minor fixes/changes to assist Omega development.
+
+3.3.6 (18 November 2001)
+* Minor fixes/changes to assist Omega development.
+
+3.3.5 (10 November 2001)
+* Minor bug fixes.
+
+3.3.4 (30 October 2001)
+* Minor bug fixes.
+
+3.3.3 (5 August 2000)
+* On NeXT, 'rm -rf' will not fail, but uses the cwd as its argument.
+ mktexlsr counted on it to fail, with sometimes disastrous results.
+
+3.3.2 (25 April 1999)
+* Minor bug fixes.
+
+3.3.1 (29 May 1999)
+* Minor bug fixes.
+
+3.3 (26 March 1999)
+* Minor bugfixes.
+
+3.2 (15 March 1998)
+* Brace expansion will accept the path separator as well as the comma,
+ e.g., {foo:bar}.
+* For TeX, we only recognize one suffix, because there is no such thing
+ as a canonical list of TeX suffixes.
+* We distinguish between two kinds of suffixes in the code: the standard
+ suffixes which may be appended to filenames when searching; and the
+ alternative suffixes which are never appended, but when found this
+ prevents a search with one of the standard suffixes.
+* kpse_reset_program_name: change assumed program name, resets the search
+ paths, so that searches will work as expected for the new name.
+* kpse_set_program_name: new function, replaces kpse_set_progname.
+* The MakeTeX* scripts have been renamed to mktex* forms.
+
+3.1 (10 November 1997)
+* The support for multiple texmf trees is much improved.
+* New MakeTeX* scripts, based on teTeX's. These scripts now use
+ heuristics to decide where generated files are placed and which
+ permissions they should have.
+* The varfonts feature is enabled by default.
+* Some MSDOS/Win32 support added to the sources.
+* Change in searching algorithm: if a name doesn't have the default suffix
+ we append it for the first search. Then we search for the bare name.
+ Thus if you have foo.bar and foo.bar.tex, the latter will now be found
+ first. Under the old system, you had to specify boo.bar.tex.tex to get
+ foo.bar.tex instead of foo.bar.
+* Prepend the value of KPSE_DOT to relative paths from texmf.cnf if it
+ defined in the environment. This means we can use . instead of
+ $KPSE_DOT in paths.
+* Define brace expansion so that {a,b}{1,2} expands to a1:b1:a2:b2. This
+ is different from how shells do it, and exploited in texmf.in.
+* Renamed texmf.cnf.in to texmf.in.
+* New value for debugging: DEBUG_VARS, equal to 64.
+* If a file format has no suffix, allow its long name as the argument to
+ kpsewhich --format.
+
+3.0 (7 February 1997)
+* Distribution terms changed to the GNU Library General Public License.
+* Default directory structure matches the TDS standard. The most
+ important change is in the fonts/ directory: the file type (tfm, pk)
+ is now directly underneath fonts/. Also, mft/ is now at the top level.
+ `modeless' is used for gsftopk/ps2pk/etc.-generated fonts.
+* Change in searching algorithm: if the name already has a suffix
+ (foo.sty), search for it by itself first, before appending the default
+ suffix (foo.sty.tex). This loses if you have an executable named
+ foo.bar, with documentation in foo.bar.tex (foo.bar will be found
+ first). But this is unusual, and the other case is common.
+* Environment variables PATH_program (e.g., TEXINPUTS_latex) checked
+ for, as with configuration file values (TEXINPUTS.latex).
+* Multiple TEXMF trees supported, via the following new facility:
+* Shell brace expansion {foo,bar} implemented, thanks to Bash.
+* Multiple ls-R files supported via the TEXMFDBS path.
+* An ``alias'' database for files in ls-R supported, to handle 8.3 problems.
+* Directories in the ls-R file can be relative (./) as well as absolute (/).
+* New MakeTeX{PK,TFM,MF} scripts with more features, based on teTeX's.
+* DVIPSMAKEPK (etc.) actually overrides the name `MakeTeXPK', as documented.
+* MakeTeX* can be globally disabled via configure options.
+* Support for building as a shared library with configure --enable-shared.
+* Directories whose names begin with `.' are ignored.
+* Some warnings can be suppressed by TEX_HUSH cnf value or envvar.
+* kpsewhich has many new capabilities, documented via --help and in the manual.
+* texfonts.map parsing has an include directive, and @c is a comment.
+* Input lines in texmf.cnf can be continued with \.
+* TEXMFLOG can be set in texmf.cnf, as previously documented.
+* SELFAUTODIR and SELFAUTOPARENT are defined according to the location
+ of the binary, and used to search for texmf.cnf.
+* /// (or more) is equivalent to //.
+* If $HOME = / (as with root on some systems), avoid creating // in paths.
+* Support for AFM, PostScript Type 1 font, source, documentation, Omega,
+ and MetaPost-related file formats.
+* New header kpathsea.h with all #include files.
+* Under DOS, ls-R lines need not start with . or / or \ (e.g., c:).
+* Amiga support.
+
+2.6 (9 January 1995)
+* MakeTeXPK installed from kpathsea, instead of each driver.
+* MakeTeXPK.site looked for in texmf/web2c, instead of texmf/dvips.
+* texmf.cnf installed and looked for in texmf/web2c, instead of texmf.
+* If a mode is not explicitly specified, search all subdirectories (this
+ was actually in a previous release).
+* install-sh only looked for in the top-level directory.
+* kpsewhich replaces and generalizes kpsexpand.
+
+2.5 (15 December 1994)
+* Go back to calling db_insert after a successful MakeTeXPK, and check
+ for lack of an ls-R.
+* Handle case of magstep -.5 for MakeTeXPK properly.
+
+2.4 (28 October 1994)
+* Avoid calling db_insert, which caused a segmentation fault.
+
+2.3 (26 October 1994)
+* Extra :'s in an envvar value, referring to the texmf.cnf value, work.
+* Names like dpi600/cmr10.pk can be found in ls-R.
+* KPATHSEA_DEBUG environment variable checked.
+* Directories like pk/ljfour directly under $TEXMF/fonts are found.
+* New standalone program, kpsexpand, optionally compiled and installed,
+ to do variable expansion (not path searching).
+* Debugging output written to stderr instead of stdout.
+* pxlNNN support removed; I never intended to support `pxl1500', and
+ pxl300 is never used.
+
+2.2 (14 October 1994)
+* MakeTeXPK invoked for the any_glyph type; this is for xdvik.
+* MakeTeXPK sources $(psheaderdir)/MakeTeXPK.site if it exists.
+* pxlNNN/cmr10.pk searched for (as well as dpiNNN/cmr10.pk and cmr10.NNNpk)
+
+2.1 (12 September 1994)
+* Manual goes through TeX, and .cps/.aux files are in the distribution.
+* INSTALL* variables set at the top level.
+* Dependency on GNU tr making paths.h and texmf.sed (->texmf.cnf) removed.
+* texmf.cnf installed if it didn't previously exist.
+
+2.0 (8 September 1994)
+* Runtime configuration file support; see the manual.
+* Both dpi600/cmr10.pk and cmr10.600pk are searched for.
+* ls-R matches $TEXMF//latex2e vs. $TEXMF//latex209.
+* $TEXMFLOG, if set, specifies a filename for logging successful searches.
+* All directory entries beginning with `.' are ignored, not just `.' and `..'.
+* Default path for PK and GF fonts includes the mode name.
+* ls-R is in $TEXMFROOT instead of hardwired at compile time.
+* More debugging flags, and they can be set with client program options.
+* If MakeTeX{PK,TFM} fail, or aren't invoked, a file missfont.log is
+ written with the requisite commands, as in dvips.
+* More 328/329/330 fixes, maybe for the last time.
+* The override font paths (XDVIFONTS etc.) apply only to glyph (PK/GF)
+ searches, not TFM or VF.
+* -g is not the default when linking, to avoid unnecessarily large binaries
+ (due to static libraries) under Linux.
+* configure checks for a smart putenv.
+* Stat results are cached to speed up disk searches.
+
+1.8 (2 April 1994)
+* New target install-info, so the documentation can be installed without
+ the headers.
+* Existing but unreadable files are complained about, instead of just ignored.
+* A leading %% in a path element forbids searching the disk for that
+ element; only a db will be searched (if it exists).
+* The db is only used if it might be relevant to a given path element,
+ not searched first regardless.
+
+1.7 (1 March 1994)
+* Searches can use an externally-built ls-R ``database'', for speed.
+* `VPATH = .' lines removed from generated Makefile, for broken Sun make.
+* A path foo//tfm finds foo/tfm as well as foo/*/tfm.
+
+1.6 (3 February 1994)
+* Memory fault in copying long paths fixed.
+* More variables passed down from the top-level Makefile.
+* Mention SMART_PUTENV in the INSTALL file, and fix bug in xputenv.c
+ when one envvar is a proper prefix of another.
+* More attempts at eliminating magstephalf annoyances.
+* Directory name substitutions are done globally when creating paths.h.
+* Various changes for DOS.
+
+1.5 (24 January 1994)
+* Default paths changed.
+* Defining GCC_WCHAR lets GCC define wchar_t.
+* EXIT_FAILURE and EXIT_SUCCESS defined in all cases (if they're not already).
+* str[r]chr never redefined (I hope).
+
+1.4 (3 November 1993)
+* Check closest fallback font size.
+* All default paths (including dvips') in paths.h.in, not the Makefile.
+* Rearrange directory lists so that dirs in which a file is found
+ migrate to the top.
+* Update for Autoconf 1.7.
+
+1.3 (6 October 1993)
+* Fix free of non-malloced memory bug.
+* Fix uninitialized gf path bug.
+* mkdirchain invoked as an absolute filename.
+
+1.2 (27 September 1993)
+* Running MakeTeXPK is tried before the fallback resolutions.
+* The final bitmap name uses a variable spec, so DOS & OS/2 can get
+ dpi300/cmr10.pk.
+* Document TeX-specific features.
+* Dpi passed to MakeTeXPK via the envvar KPATHSEA_DPI instead of MAKETEX_DPI.
+
+1.1 (26 August 1993)
+* Installation fixes.
+
+1.0 (5 August 1993)
+* Routines to look up TeX font files, default path specifications, etc.
+* Sort-of pattern matching: /foo//bar matches subdirectories
+ /foo/a/bar, /foo/b/bar, /foo/a1/a2/bar, etc.
+* $var and ${var} expansion.
+* Support for MakeTeX... scripts.
+* Support for fallback resolutions and font.
+* Lazy evaluation of path elements.
+* Some runtime debugging support.
+
+0.2 (12 May 1993)
+
+First general release as a standalone library.
diff --git a/Build/source/texk/kpathsea/PROJECTS b/Build/source/texk/kpathsea/PROJECTS
new file mode 100644
index 00000000000..80d5063a79d
--- /dev/null
+++ b/Build/source/texk/kpathsea/PROJECTS
@@ -0,0 +1,23 @@
+Here are some ideas for improvements. If you would like to contribute,
+please send mail to me (infovore@xs4all.nl) first.
+
+
+If the library is built shared, it would be nice if the binaries did not
+have it as a dependency; as it is, all of Web2c gets rebuilt if the
+library changes, even though logically only relinking (maybe not even
+that) is necessary. This is because if the Web2c programs themselves
+get relinked (as they do), we must reconvert the web programs.
+
+For multiple texmf.cnf files (or multiple dvips configuration files),
+replace extra :'s by the value from the next file in the path, rather
+than the value from the next level.
+
+Support runtime registration of file types to search for, not just
+compile-time. Either by a procedure call, or by reading a configuration
+file. Implies putting the envvar list into the kpse_format_info_type struct.
+
+cd during filesystem operations, to minimize the pathname
+length. Implies always using xgetwd.
+
+Separate the routines needed for path searching, and others that are here
+only because it's a common place -- i.e., a kutil library.
diff --git a/Build/source/texk/kpathsea/README b/Build/source/texk/kpathsea/README
new file mode 100644
index 00000000000..2f2960c5f81
--- /dev/null
+++ b/Build/source/texk/kpathsea/README
@@ -0,0 +1,19 @@
+This directory contains the Kpathsea[rch] library, which implements
+generic path searching, configuration, and TeX-specific file searching.
+
+See `NEWS' for changes by release, `ChangeLog` for all changes.
+See `INSTALL' for installation instructions.
+See `BUGS' for bug reporting details.
+See `README.CONFIGURE' for details on running the configure scripts.
+See `PROJECTS' for future improvements you might like to work on.
+
+Suggestions for improvements in either the library or the documentation,
+no matter how small, are welcome. But please read ./BUGS before sending
+a bug report.
+
+This is free software. See the files GPL and LGPL for copying permissions.
+The top-level headers are `pathsearch.h' for the generic path searching
+support, and `tex-{file,glyph}.h' for the TeX-specific support.
+
+kb@mail.tug.org
+Member of the League for Programming Freedom -- write lpf@uunet.uu.net.
diff --git a/Build/source/texk/kpathsea/README.CONFIGURE b/Build/source/texk/kpathsea/README.CONFIGURE
new file mode 100644
index 00000000000..77a38061f91
--- /dev/null
+++ b/Build/source/texk/kpathsea/README.CONFIGURE
@@ -0,0 +1,193 @@
+Contents:
+
+ Basic Installation
+ Compilers and Options
+ Compiling For Multiple Architectures
+ Installation Names
+ Optional Features
+ Specifying the System Type
+ Sharing Defaults
+ Operation Controls
+
+
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/Build/source/texk/kpathsea/absolute.c b/Build/source/texk/kpathsea/absolute.c
new file mode 100644
index 00000000000..73313d5edfc
--- /dev/null
+++ b/Build/source/texk/kpathsea/absolute.c
@@ -0,0 +1,74 @@
+/* absolute.c: Test if a filename is absolute or explicitly relative.
+
+ Copyright 1997, 2002, 2005 Olaf Weber.
+ Copyright 1993, 94, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/absolute.h>
+#include <kpathsea/c-pathch.h>
+
+/* Sorry this is such a system-dependent mess, but I can't see any way
+ to usefully generalize. */
+
+boolean
+kpse_absolute_p P2C(const_string, filename, boolean, relative_ok)
+{
+#ifdef VMS
+#include <string.h>
+ return strcspn (filename, "]>:") != strlen (filename);
+#else /* not VMS */
+ boolean absolute = IS_DIR_SEP (*filename)
+#ifdef DOSISH
+ /* Novell allows non-alphanumeric drive letters. */
+ || (*filename && IS_DEVICE_SEP (filename[1]))
+#endif /* DOSISH */
+#ifdef AMIGA
+ /* Colon anywhere means a device. */
+ || strchr (filename, ':')
+#endif /* AMIGA */
+ ;
+ boolean explicit_relative
+ = relative_ok
+#ifdef AMIGA
+ /* Leading / is like `../' on Unix and DOS. Allow Unix syntax,
+ too, though, because of possible patch programs like
+ `UnixDirsII' by Martin Scott. */
+ && IS_DIR_SEP (*filename) || 0
+#endif /* AMIGA */
+ && (*filename == '.' && (IS_DIR_SEP (filename[1])
+ || (filename[1] == '.' && IS_DIR_SEP (filename[2]))));
+
+ /* FIXME: On UNIX an IS_DIR_SEP of any but the last character in the name
+ implies relative. */
+ return absolute || explicit_relative;
+#endif /* not VMS */
+}
+
+#ifdef TEST
+int main()
+{
+ char **name;
+ char *t[] = { "./foo", "\\\\server\\foo\\bar", "ftp://localhost/foo" };
+
+ for (name = t; name - t < sizeof(t)/sizeof(char*); name++) {
+ printf("Path `%s' %s absolute.\n", *name, (kpse_absolute_p(*name, true) ? "is" : "is not"));
+ }
+}
+#endif /* TEST */
diff --git a/Build/source/texk/kpathsea/absolute.h b/Build/source/texk/kpathsea/absolute.h
new file mode 100644
index 00000000000..5a8d8a2b231
--- /dev/null
+++ b/Build/source/texk/kpathsea/absolute.h
@@ -0,0 +1,34 @@
+/* absolute.h: Declare absolute filename predicate.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1993, 94 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_ABSOLUTE_H
+#define KPATHSEA_ABSOLUTE_H
+
+#include <kpathsea/types.h>
+#include <kpathsea/c-proto.h>
+
+
+/* True if FILENAME is absolute (/foo) or, if RELATIVE_OK is true,
+ explicitly relative (./foo, ../foo), else false (foo). */
+
+extern KPSEDLL boolean kpse_absolute_p P2H(const_string filename, boolean relative_ok);
+
+#endif /* not KPATHSEA_ABSOLUTE_H */
diff --git a/Build/source/texk/kpathsea/access.c b/Build/source/texk/kpathsea/access.c
new file mode 100644
index 00000000000..ca1cee5722e
--- /dev/null
+++ b/Build/source/texk/kpathsea/access.c
@@ -0,0 +1,93 @@
+/* access -- test for access permissions of a file.
+
+ Copyright 1997-2001, 2005 Olaf Weber.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <stdio.h>
+#include <kpathsea/config.h>
+#include <kpathsea/c-unistd.h>
+#include <kpathsea/c-memstr.h>
+
+/*
+ * access mode x
+ * Returns 0 is x exists and can be accessed in accordance with mode.
+ * We use this rather than test because test looks at the permissions
+ * only, which doesn't take read-only file systems into account.
+ */
+
+int
+main P2C(int, argc, char **, argv)
+{
+ int mode;
+ int status;
+ char * i;
+
+ if (argc > 1 && strcmp (argv[1], "--help") == 0) {
+ printf("Usage: %s -MODE FILE\n\
+ MODE is one or more of rwx. Exit successfully if FILE exists and is\n\
+ readable (r), writable (w), or executable (x).\n\
+\n\
+--help display this help and exit\n\
+--version output version information and exit\n\n", argv[0]);
+ fputs ("Email bug reports to tex-k@mail.tug.org.\n", stdout);
+ exit(0);
+ } else if (argc > 1 && strcmp (argv[1], "--version") == 0) {
+ printf ("%s (%s)\n\
+Copyright (C) 1997 Olaf Weber.\n\
+There is NO warranty. You may redistribute this software\n\
+under the terms of the GNU General Public License\n\
+For more information about these matters, see the file named COPYING.\n\
+Primary author of %s: Olaf Weber.\n",
+argv[0], KPSEVERSION, argv[0]);
+ exit (0);
+ }
+
+ /* insist on exactly two args */
+ if (argc != 3) {
+ fprintf(stderr, "%s: Need exactly two arguments.\n\
+Try `%s --help' for more information.\n", argv[0], argv[0]);
+ exit(1);
+ }
+
+ /* The option parsing is somewhat primitive: '-' need not be the first
+ * character of the mode. The mode must be specified in a single
+ * option. Both of these may change.
+ */
+ mode = 0;
+ i = argv[1];
+ for (i = argv[1]; *i; ++i)
+ switch (*i) {
+ case 'r': mode |= R_OK; break;
+ case 'w': mode |= W_OK; break;
+ case 'x': mode |= X_OK; break;
+ case '-': if (i == argv[1]) break;
+ default:
+ fprintf(stderr, "%s: Invalid MODE.\n", argv[0]);
+ exit(1);
+ }
+
+ status = access(argv[2], mode);
+
+ /* fail if the access call failed */
+ if (status != 0) {
+ return 1;
+ }
+
+ /* otherwise, succeed */
+ return 0;
+}
diff --git a/Build/source/texk/kpathsea/acconfig.h b/Build/source/texk/kpathsea/acconfig.h
new file mode 100644
index 00000000000..30bd6fb86e1
--- /dev/null
+++ b/Build/source/texk/kpathsea/acconfig.h
@@ -0,0 +1,67 @@
+/* acconfig.h -- used by autoheader when generating c-auto.in.
+
+ If you're thinking of editing acconfig.h to fix a configuration
+ problem, don't. Edit the c-auto.h file created by configure,
+ instead. Even better, fix configure to give the right answer.
+
+ Copyright 1997-99, 2002, 2005 Olaf Weber.
+ Copyright 1994-97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+/* Guard against double inclusion. */
+#ifndef KPATHSEA_C_AUTO_H
+#define KPATHSEA_C_AUTO_H
+
+/* kpathsea: the version string. */
+#define KPSEVERSION "REPLACE-WITH-KPSEVERSION"
+
+/* kpathsea/configure.in tests for these functions with
+ kb_AC_KLIBTOOL_REPLACE_FUNCS, and naturally Autoheader doesn't know
+ about that macro. Since the shared library stuff is all preliminary
+ anyway, I decided not to change Autoheader, but rather to hack them
+ in here. */
+#undef HAVE_PUTENV
+#undef HAVE_STRCASECMP
+#undef HAVE_STRTOL
+#undef HAVE_STRSTR
+
+@TOP@
+
+/* Define if your compiler understands prototypes. */
+#undef HAVE_PROTOTYPES
+
+/* Define if getcwd if implemented using fork or vfork. Let me know
+ if you have to add this by hand because configure failed to detect
+ it. */
+#undef GETCWD_FORKS
+
+/* Define if you are using GNU libc or otherwise have global variables
+ `program_invocation_name' and `program_invocation_short_name'. */
+#undef HAVE_PROGRAM_INVOCATION_NAME
+
+/* all: Define to enable running scripts when missing input files. */
+#define MAKE_TEX_MF_BY_DEFAULT 0
+#define MAKE_TEX_PK_BY_DEFAULT 0
+#define MAKE_TEX_TEX_BY_DEFAULT 0
+#define MAKE_TEX_TFM_BY_DEFAULT 0
+#define MAKE_TEX_FMT_BY_DEFAULT 0
+#define MAKE_OMEGA_OFM_BY_DEFAULT 0
+#define MAKE_OMEGA_OCP_BY_DEFAULT 0
+
+@BOTTOM@
+#endif /* !KPATHSEA_C_AUTO_H */
diff --git a/Build/source/texk/kpathsea/atou.c b/Build/source/texk/kpathsea/atou.c
new file mode 100644
index 00000000000..73f9ea8c679
--- /dev/null
+++ b/Build/source/texk/kpathsea/atou.c
@@ -0,0 +1,32 @@
+/* atou.c: like atoi, but if the number is negative, abort.
+
+ Copyright 1992, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include "config.h"
+
+unsigned
+atou P1C(const_string, s)
+{
+ int i = atoi (s);
+
+ if (i < 0)
+ FATAL1 ("I expected a positive number, not %d", i);
+
+ return i;
+}
diff --git a/Build/source/texk/kpathsea/bugs.texi b/Build/source/texk/kpathsea/bugs.texi
new file mode 100644
index 00000000000..cb0731512d4
--- /dev/null
+++ b/Build/source/texk/kpathsea/bugs.texi
@@ -0,0 +1,900 @@
+@ifclear version
+@defcodeindex fl
+@defcodeindex op
+@end ifclear
+
+@node Reporting bugs
+@section Reporting bugs
+
+@cindex reporting bugs
+@cindex bugs, reporting
+
+@ifset version
+(A copy of this chapter is in the file @file{kpathsea/BUGS}.)
+@end ifset
+
+@flindex tex-k@@mail.tug.org @r{(bug address)}
+@cindex bug address
+If you have problems or suggestions, please report them to
+@email{tex-k@@mail.tug.org} using the bug checklist below.
+
+Please report bugs in the documentation; not only factual errors or
+inconsistent behavior, but unclear or incomplete explanations, typos,
+wrong fonts, @dots{}
+
+@menu
+* Bug checklist:: What to include in a good bug report.
+* Mailing lists:: Joining the bugs or announcements mailing lists.
+* Debugging:: Analyzing runtime problems.
+* Logging:: Recording searches.
+* Common problems:: When things go wrong.
+@end menu
+
+
+@node Bug checklist
+@subsection Bug checklist
+
+@cindex checklist for bug reports
+@cindex bug checklist
+
+Before reporting a bug, please check below to be sure it isn't already
+known (@pxref{Common problems}).
+
+Bug reports should be sent via electronic mail to
+@email{tex-k@@mail.tug.org}, or by postal mail to 135 Center Hill Road /
+Plymouth, MA 02360 / USA.
+
+The general principle is that a good bug report includes all the
+information necessary for reproduction. Therefore, to enable
+investigation, your report should include the following:
+
+@itemize @bullet
+@item
+@cindex version numbers, determining
+The version number(s) of the program(s) involved, and of Kpathsea
+itself. You can get the former by giving a sole option @samp{--version}
+to the program, and the latter by running @samp{kpsewhich --version}.
+The @file{NEWS} and @file{ChangeLog} files also contain the version
+number.
+
+@item
+@pindex uname
+The hardware, operating system (including version number), compiler, and
+@code{make} program you are using (the output of @code{uname -a} is a
+start on the first two, though often incomplete). If the bug involves
+the X window system, include X version and supplier information as well
+(examples: X11R6 from MIT; X11R4 from HP; OpenWindows 3.3 bundled with
+SunOS 4.1.4).
+
+@item
+@flindex config.log
+Any options you gave to @code{configure}. This is recorded in the
+@file{config.status} files.
+
+@cindex configuration bugs
+@flindex config.status
+If you are reporting a bug in @samp{configure} itself, it's probably
+system-dependent, and it will be unlikely the maintainers can do
+anything useful if you merely report that thus-and-such is broken.
+Therefore, you need to do some additional work: for some bugs, you can
+look in the file @file{config.log} where the test that failed should
+appear, along with the compiler invocation and source program in
+question. You can then compile it yourself by hand, and discover why
+the test failed. Other @samp{configure} bugs do not involve the
+compiler; in that case, the only recourse is to inspect the
+@code{configure} shell script itself, or the Autoconf macros that
+generated @code{configure}.
+
+@item
+The log of all debugging output, if the bug is in path searching. You
+can get this by setting the environment variable @code{KPATHSEA_DEBUG}
+to @samp{-1} before running the program. Please look at the log
+yourself to make sure the behavior is really a bug before reporting it;
+perhaps ``old'' environment variable settings are causing files not to
+be found, for example.
+
+@item
+The contents of any input files necessary to reproduce the bug. For
+bugs in DVI-reading programs, for example, this generally means a DVI
+file (and any EPS or other files it uses)---@TeX{} source files are
+helpful, but the DVI file is necessary, because that's the actual
+program input.
+
+@cindex shar@r{, recommended}
+GNU @code{shar}, available from @url{ftp://prep.ai.mit.edu/pub/gnu} is
+a convenient way of packaging multiple (possibly binary) files for
+electronic mail. If you feel your input files are too big to send by
+email, you can ftp them to @url{ftp://ftp.tug.org/incoming} (that
+directory is writable, but not readable).
+
+@item
+@cindex context diff
+@cindex sending patches
+@flindex ChangeLog @r{entry}
+If you are sending a patch (do so if you can!), please do so in the form
+of a context diff (@samp{diff -c}) against the original distribution
+source. Any other form of diff is either not as complete or harder for
+me to understand. Please also include a @file{ChangeLog} entry.
+
+@item
+@cindex stack trace
+@cindex debugger
+@cindex crashes, reporting
+@cindex core dumps, reporting
+@cindex null pointers, dereferencing
+@pindex gdb@r{, recommended}
+If the bug involved is an actual crash (i.e., core dump), it is easy and
+useful to include a stack trace from a debugger (I recommend the GNU
+debugger GDB, available from @url{ftp://prep.ai.mit.edu/pub/gnu}). If
+the cause is apparent (a @code{NULL} value being dereferenced, for
+example), please send the details along. If the program involved is
+@TeX{} or Metafont, and the crash is happening at apparently-sound code,
+however, the bug may well be in the compiler, rather than in the program
+or the library (@pxref{TeX or Metafont failing,, @TeX{} or Metafont
+failing}).
+
+@item
+Any additional information that will be helpful in reproducing,
+diagnosing, or fixing the bug.
+@end itemize
+
+
+@node Mailing lists
+@subsection Mailing lists
+
+@cindex mailing lists
+@cindex bug mailing list
+@cindex announcement mailing list
+
+Web2c and Kpathsea in general are discussed on the mailing list
+@email{tex-k@@mail.tug.org}.
+@flindex tex-k-request@@mail.tug.org
+To join, email @email{tex-k-request@@mail.tug.org} with a line
+consisting of
+
+@example
+subscribe @var{you}@@@var{your.preferred.email.address}
+@end example
+
+@noindent in the body of the message.
+
+You do not need to join to submit a report, nor will it affect whether
+you get a response. There is no Usenet newsgroup equivalent (if you can
+be the one to set this up, email @samp{tex-k-request}). Traffic on the
+list is fairly light, and is mainly bug reports and enhancement requests
+to the software. The best way to decide if you want to join or not is
+read some of the archives from @url{ftp://ftp.tug.org/mail/archives/tex-k/}.
+
+Be aware that large data files are sometimes included in bug reports.
+If this is a problem for you, do not join the list.
+
+@flindex tex-archive@@math.utah.edu
+@cindex announcement mailing list
+If you only want announcements of new releases, not bug reports and
+discussion, join @email{tex-archive@@math.utah.edu} (via mail to
+@email{tex-archive-request@@math.utah.edu}).
+
+@cindex @TeX{} help mailing list
+@cindex La@TeX{} help mailing list
+@cindex Usenet @TeX{} newsgroup
+@cindex newsgroup for @TeX{}
+@cindex help, mailing list for general @TeX{}
+@flindex info-tex@@shsu.edu
+@flindex comp.text.tex
+If you are looking for general @TeX{} help, such as how to use La@TeX{},
+please use the mailing list @email{info-tex@@shsu.edu} mailing list,
+which is gatewayed to the @samp{comp.text.tex} Usenet newsgroup (or post
+to the newsgroup; the gateway is bidirectional).
+
+
+@node Debugging
+@subsection Debugging
+
+@cindex debugging
+@cindex runtime debugging
+@cindex options for debugging
+
+@vindex kpathsea_debug
+@flindex debug.h
+Kpathsea provides a number of runtime debugging options, detailed below
+by their names and corresponding numeric values. When the files you
+expect aren't being found, the thing to do is enable these options and
+examine the output.
+
+You can set these with some runtime argument (e.g., @samp{-d}) to the
+program; in that case, you should use the numeric values described in
+the program's documentation (which, for Dvipsk and Xdvik, are different
+than those below). It's best to give the @samp{-d} (or whatever) option
+first, for maximal output. Dvipsk and Xdvik have additional
+program-specific debugging options as well.
+
+@vindex KPATHSEA_DEBUG
+@vindex kpathsea_debug
+You can also set the environment variable @code{KPATHSEA_DEBUG}; in this
+case, you should use the numbers below. If you run the program under a
+debugger and set the variable @code{kpathsea_debug}, also use the numbers
+below.
+
+@kindex -1 @r{debugging value}
+In any case, by far the simplest value to use is @samp{-1}, which will
+turn on all debugging output. This is usually better than guessing
+which particular values will yield the output you need.
+
+@cindex debugging output
+@cindex standard error and debugging output
+Debugging output always goes to standard error, so you can redirect it
+easily. For example, in Bourne-compatible shells:
+@example
+dvips -d -1 @dots{} 2>/tmp/debug
+@end example
+
+@cindex Kpsewhich, and debugging
+It is sometimes helpful to run the standalone Kpsewhich utility
+(@pxref{Invoking kpsewhich}), instead of the original program.
+
+@cindex numeric debugging values
+In any case, you can @emph{not} use the @emph{names} below; you must
+always use somebody's numbers. (Sorry.) To set more than one
+option, just sum the corresponding numbers.
+
+@vtable @code
+@item KPSE_DEBUG_STAT @r{(1)}
+Report @samp{stat}(2) calls. This is useful for verifying that your
+directory structure is not forcing Kpathsea to do many additional file
+tests (@pxref{Slow path searching}, and @pxref{Subdirectory
+expansion}). If you are using an up-to-date @file{ls-R} database
+(@pxref{Filename database}), this should produce no output unless a
+nonexistent file that must exist is searched for.
+
+@item KPSE_DEBUG_HASH @r{(2)}
+Report lookups in all hash tables: @file{ls-R} and @file{aliases}
+(@pxref{Filename database}); font aliases (@pxref{Fontmap}); and config
+file values (@pxref{Config files}). Useful when expected values are not
+being found, e.g.., file searches are looking at the disk instead of
+using @file{ls-R}.
+
+@item KPSE_DEBUG_FOPEN @r{(4)}
+@findex fopen@r{, redefined}
+Report file openings and closings. Especially useful when your system's
+file table is full, for seeing which files have been opened but never
+closed. In case you want to set breakpoints in a debugger: this works by
+redefining @samp{fopen} (@samp{fclose}) to be @samp{kpse_fopen_trace}
+(@samp{kpse_fclose_trace}).
+
+@item KPSE_DEBUG_PATHS @r{(8)}
+@tindex kpse_format_info_type
+Report general path information for each file type Kpathsea is asked to
+search. This is useful when you are trying to track down how a
+particular path got defined---from @file{texmf.cnf}, @file{config.ps},
+an environment variable, the compile-time default, etc. This is the
+contents of the @code{kpse_format_info_type} structure defined in
+@file{tex-file.h}.
+
+@item KPSE_DEBUG_EXPAND @r{(16)}
+Report the directory list corresponding to each path element Kpathsea
+searches. This is only relevant when Kpathsea searches the disk, since
+@file{ls-R} searches don't look through directory lists in this way.
+
+@item KPSE_DEBUG_SEARCH @r{(32)}
+Report on each file search: the name of the file searched for, the path
+searched in, whether or not the file must exist (when drivers search for
+@file{cmr10.vf}, it need not exist), and whether or not we are
+collecting all occurrences of the file in the path (as with, e.g.,
+@file{texmf.cnf} and @file{texfonts.map}), or just the first (as with
+most lookups). This can help you correlate what Kpathsea is doing with
+what is in your input file.
+
+@item KPSE_DEBUG_VARS @r{(64)}
+Report the value of each variable Kpathsea looks up. This is useful for
+verifying that variables do indeed obtain their correct values.
+
+@item GSFTOPK_DEBUG @r{(128)}
+Activates debugging printout specific to @code{gsftopk} program.
+
+@item MAKETEX_DEBUG @r{(512)}
+If you use the optional @code{mktex} programs instead of the
+traditional shell scripts, this will report the name of the site file
+(@file{mktex.cnf} by default) which is read, directories created by
+@code{mktexdir}, the full path of the @file{ls-R} database built by
+@code{mktexlsr}, font map searches, @code{MT_FEATURES} in effect,
+parameters from @code{mktexnam}, filenames added by
+@code{mktexupd}, and some subsidiary commands run by the programs.
+
+@item MAKETEX_FINE_DEBUG @r{(1024)}
+When the optional @code{mktex} programs are used, this will print
+additional debugging info from functions internal to these programs.
+@end vtable
+
+@cindex @samp{kdebug:}
+@vindex hash_summary_only @r{variable for debugging}
+@cindex hash table buckets, printing
+Debugging output from Kpathsea is always written to standard error, and
+begins with the string @samp{kdebug:}. (Except for hash table buckets,
+which just start with the number, but you can only get that output
+running under a debugger. See comments at the @code{hash_summary_only}
+variable in @file{kpathsea/db.c}.)
+
+
+@node Logging
+@subsection Logging
+
+@cindex log file
+
+@cindex logging successful searches
+@cindex recording successful searches
+@cindex usage patterns, finding
+@cindex disk usage, reducing
+Kpathsea can record the time and filename found for each successful
+search. This may be useful in finding good candidates for deletion when
+your filesystem is full, or in discovering usage patterns
+at your site.
+
+@vindex TEXMFLOG
+To do this, define the environment or config file variable
+@code{TEXMFLOG}. The value is the name of the file to append the
+information to. The file is created if it doesn't exist, and appended
+to if it does.
+
+@cindex epoch, seconds since
+@findex time @r{system call}
+Each successful search turns into one line in the log file: two words
+separated by a space. The first word is the time of the search, as the
+integer number of seconds since ``the epoch'', i.e., UTC midnight 1
+January 1970 (more precisely, the result of the @code{time} system
+call). The second word is the filename.
+
+For example, after @code{setenv TEXMFLOG /tmp/log}, running Dvips on
+@file{story.dvi} appends the following lines:
+
+@example
+774455887 /usr/local/share/texmf/dvips/config.ps
+774455887 /usr/local/share/texmf/dvips/psfonts.map
+774455888 /usr/local/share/texmf/dvips/texc.pro
+774455888 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmbx10.600pk
+774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmsl10.600pk
+774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk
+774455889 /usr/local/share/texmf/dvips/texc.pro
+@end example
+
+@cindex privacy, semblance of
+@noindent Only filenames that are absolute are recorded, to preserve
+some semblance of privacy.
+
+
+@node Common problems
+@subsection Common problems
+
+@cindex common problems
+@cindex problems, common
+@cindex FAQ, Kpathsea
+
+Here are some common problems with configuration, compilation, linking,
+execution, @dots{}
+
+@menu
+* Unable to find files:: If your program can't find fonts (or whatever).
+* Slow path searching:: If it takes forever to find anything.
+* Unable to generate fonts:: If mktexpk fails.
+* TeX or Metafont failing:: Likely compiler bugs.
+
+* Empty Makefiles:: When configure produces empty makefiles.
+* XtStrings:: When _XtStrings is undefined.
+* dlopen:: When dlopen is undefined.
+* ShellWidgetClass:: For dynamic linking troubles under OpenWindows.
+* Pointer combination warnings:: For old compilers that don't grok char *.
+@end menu
+
+@node Unable to find files
+@subsubsection Unable to find files
+
+@cindex unable to find files
+@cindex files, unable to find
+
+If a program complains it cannot find fonts (or other input files), any
+of several things might be wrong. In any case, you may find the
+debugging options helpful. @xref{Debugging}.
+
+@itemize @bullet
+@item
+Perhaps you simply haven't installed all the necessary files; the basic
+fonts and input files are distributed separately from the programs.
+@xref{unixtex.ftp}.
+
+@item
+@flindex /etc/profile
+@cindex environment variables, old
+You have (perhaps unknowingly) told Kpathsea to use search paths that
+don't reflect where the files actually are. One common cause is having
+environment variables set from a previous installation, thus overriding
+what you carefully set in @file{texmf.cnf} (@pxref{Supported file
+formats}). System @file{/etc/profile} or other files such may be the
+culprit.
+
+@item
+@cindex symbolic links not found
+@cindex leaf directories wrongly guessed
+Your files reside in a directory that is only pointed to via a symbolic
+link, in a leaf directory and is not listed in @file{ls-R}.
+
+Unfortunately, Kpathsea's subdirectory searching has an irremediable
+deficiency: If a directory @var{d} being searched for subdirectories
+contains plain files and symbolic links to other directories, but no
+true subdirectories, @var{d} will be considered a leaf directory, i.e.,
+the symbolic links will not be followed. @xref{Subdirectory expansion}.
+
+You can work around this problem by creating an empty dummy subdirectory
+in @var{d}. Then @var{d} will no longer be a leaf, and the symlinks will
+be followed.
+
+The directory immediately followed by the @samp{//} in the path
+specification, however, is always searched for subdirectories, even if
+it is a leaf. Presumably you would not have asked for the directory to
+be searched for subdirectories if you didn't want it to be.
+
+@item
+If the fonts (or whatever) don't already exist, @code{mktexpk} (or
+@code{mktexmf} or @code{mktextfm}) will try to create them. If
+these rather complicated shell scripts fail, you'll eventually get an
+error message saying something like @samp{Can't find font
+@var{fontname}}. The best solution is to fix (or at least report) the
+bug in @code{mktexpk}; the workaround is to generate the necessary
+fonts by hand with Metafont, or to grab them from a CTAN site
+(@pxref{unixtex.ftp}).
+
+@item
+There is a bug in the library. @xref{Reporting bugs}.
+@end itemize
+
+
+@node Slow path searching
+@subsubsection Slow path searching
+
+@cindex excessive startup time
+@cindex slow startup time
+@cindex startup time, excessive
+
+If your program takes an excessively long time to find fonts or other
+input files, but does eventually succeed, here are some possible culprits:
+
+@itemize @bullet
+@item
+Most likely, you just have a lot of directories to search, and that
+takes a noticeable time. The solution is to create and maintain a
+separate @file{ls-R} file that lists all the files in your main @TeX{}
+hierarchy. @xref{Filename database}. Kpathsea always uses @file{ls-R}
+if it's present; there's no need to recompile or reconfigure any of the
+programs.
+
+@item
+Your recursively-searched directories (e.g.,
+@file{/usr/local/share/texmf/fonts//}), contain a mixture of files and
+directories. This prevents Kpathsea from using a useful optimization
+(@pxref{Subdirectory expansion}).
+
+It is best to have only directories (and perhaps a @file{README}) in the
+upper levels of the directory structure, and it's very important to have
+@emph{only} files, and no subdirectories, in the leaf directories where
+the dozens of TFM, PK, or whatever files reside.
+@end itemize
+
+In any case, you may find the debugging options helpful in determining
+precisely when the disk or network is being pounded. @xref{Debugging}.
+
+
+@node Unable to generate fonts
+@subsubsection Unable to generate fonts
+
+@cindex unable to generate fonts
+@cindex font generation failures
+
+Metafont outputs fonts in bitmap format, tuned for a particular
+device at a particular resolution, in order to allow for the
+highest-possible quality of output. Some DVI-to-whatever programs,
+such as Dvips, try to generate these on the fly when they are needed,
+but this generation may fail in several cases.
+
+@cindex @code{mktexpk} can't guess mode
+If @code{mktexpk} runs, but fails with this error:
+@example
+mktexpk: Can't guess mode for @var{nnn} dpi devices.
+mktexpk: Use a config file to specify the mode, or update me.
+@end example
+you need to ensure the resolution and mode match; just
+specifying the resolution, as in @code{-D 360}, is not enough.
+
+You can specify the mode name with the @code{-mode} option on the
+Dvips command line, or in a Dvips configuration file (@pxref{Config
+files,,, dvips, Dvips}), such as @file{config.ps} in your document
+directory, @file{~/.dvipsrc} in your home directory, or in a system
+directory (again named @file{config.ps}). (Other drivers use other
+files, naturally.)
+
+For example, if you need 360@dmn{dpi} fonts, you could include this in
+a configuration file:
+@example
+D 360
+M lqmed
+@end example
+
+@cindex Metafont using the wrong device
+@cindex device, wrong
+If Metafont runs, but generates fonts at the wrong resolution or for
+the wrong device, most likely @code{mktexpk}'s built-in guess for the
+mode is wrong, and you should override it as above.
+
+See @url{ftp://ftp.tug.org/tex/modes.mf} for a list of resolutions and
+mode names for most devices (additional submissions are welcome).
+
+@flindex .2602gf
+@flindex 2602gf
+@cindex Metafont making too-large fonts
+@cindex proof mode
+@cindex online Metafont display, spurious
+If Metafont runs but generates fonts at a resolution of 2602@dmn{dpi}
+(and prints out the name of each character as well as just a character
+number, and maybe tries to display the characters), then your Metafont
+base file probably hasn't been made properly. (It's using the default
+@code{proof} mode, instead of an actual device mode.) To make a proper
+@file{plain.base}, assuming the local mode definitions are contained in
+a file @file{modes.mf}, run the following command (assuming Unix):
+
+@example
+inimf "plain; input modes; dump"
+@end example
+
+@noindent
+@flindex plain.base
+Then copy the @file{plain.base} file from the current directory to where
+the base files are stored on your system
+(@file{/usr/local/share/texmf/web2c} by default), and make a link
+(either hard or soft) from @file{plain.base} to @file{mf.base} in that
+directory.
+@xref{inimf invocation,,, web2c, Web2c}.
+
+@cindex Metafont installation
+If @code{mf} is a command not found at all by @code{mktexpk}, then you
+need to install Metafont (@pxref{unixtex.ftp}).
+
+
+@node TeX or Metafont failing
+@subsubsection @TeX{} or Metafont failing
+
+@cindex @TeX{} failures
+@cindex Metafont failures
+@cindex compiler bugs
+If @TeX{} or Metafont get a segmentation fault or otherwise fail while
+running a normal input file, the problem is usually a compiler bug
+(unlikely as that may sound). Even if the trip and trap tests are
+passed, problems may lurk. Optimization occasionally causes trouble in
+programs other than @TeX{} and Metafont themselves, too.
+
+Insufficient swap space may also cause core dumps or other erratic
+behavior.
+
+@cindex optimization caveat
+For a workaround, if you enabled any optimization flags, it's best to
+omit optimization entirely. In any case, the way to find the facts is
+to run the program under the debugger and see where it's failing.
+
+@cindex GNU C compiler bugs
+@cindex system C compiler bugs
+Also, if you have trouble with a system C compiler, I advise trying the
+GNU C compiler. And vice versa, unfortunately; but in that case I also
+recommend reporting a bug to the GCC mailing list; see @ref{Bugs,,, gcc,
+Using and Porting GNU CC}.
+
+@cindex compiler bugs, finding
+To report compiler bugs effectively requires perseverance and
+perspicacity: you must find the miscompiled line, and that usually
+involves delving backwards in time from the point of error, checking
+through @TeX{}'s (or whatever program's) data structures. Things are
+not helped by all-too-common bugs in the debugger itself. Good luck.
+
+@cindex ANSI C
+@cindex HP-UX, compiling on
+@cindex compiling on HP-UX
+One known cause of trouble is the way arrays are handled. Some of the
+Pascal arrays have a lower index other than 0, and the C code will take
+the pointer to the allocated memory, subtract the lower index, and use
+the resulting pointer for the array. While this trick often works, ANSI
+C doesn't guarantee that it will. It it known to fail on HP-UX 10
+mchines when the native compiler is used, unless the @samp{+u} compiler
+switch was specified. Using GCC will work on this platform as well.
+
+@node Empty Makefiles
+@subsubsection Empty Makefiles
+
+@cindex Makefiles, empty
+@pindex sed @r{error from @code{configure}}
+@pindex configure @r{error from @code{sed}}
+@cindex NetBSD @code{configure} error
+@cindex FreeBSD @code{configure} error
+@cindex Mach10 @code{configure} error
+@cindex AIX 4.1 @code{configure} error
+@cindex NeXT @code{sed} error
+
+On some systems (NetBSD, FreeBSD, AIX 4.1, and Mach10), @code{configure}
+may fail to properly create the Makefiles. Instead, you get an error
+which looks something like this:
+
+@example
+prompt$ ./configure
+@dots{}
+creating Makefile
+sed: 1: "\\@@^ac_include make/pat ...": \ can not be used as a string delimiter
+@end example
+
+So far as I know, the bug here is in @code{/bin/sh} on these systems. I
+don't have access to a machine running any of them, so if someone can
+find a workaround that avoids the quoting bug, I'd be most
+grateful. (Search for @code{ac_include} in the @code{configure} script
+to get to the problematic code.)
+
+It should work to run @code{bash configure}, instead of using
+@code{/bin/sh}. You can get Bash from
+@url{ftp://prep.ai.mit.edu/pub/gnu} and mirrors.
+
+Another possible cause (reported for NeXT) is a bug in the @code{sed}
+command. In that case the error may look like this:
+
+@example
+Unrecognized command: \@@^ac_include make/paths.make@@r make/paths.make
+@end example
+
+In this case, installing GNU @code{sed} should solve the problem. You
+can get GNU @code{sed} from the same places as Bash.
+
+@ignore
+@node wchar_t
+@subsubsection @code{wchar_t}
+
+@vindex FOIL_X_WCHAR_T
+@tindex wchar_t
+
+The upshot of all the following is that if you get error messages
+regarding @code{wchar_t}, try defining @code{NO_FOIL_X_WCHAR_T} (for
+Web2c) or @code{FOIL_X_WCHAR_T} (for everything else), as in:
+
+@example
+make XCFLAGS=-DNO_FOIL_X_WCHAR_T @var{other-make-options}
+@end example
+
+@flindex Xlib.h
+@flindex stddef.h
+@code{wchar_t} has caused infinite trouble. None of my code ever uses
+@code{wchar_t}; all I want to do is include X header files and various
+system header files, possibly compiling with GCC. This seems an
+impossible task! The basic problem is that the X11 header
+@file{<Xlib.h>} and GCC's @file{<stddef.h>} have conflicting definitions
+for @code{wchar_t}.
+
+The particulars: @file{<X11/Xlib.h>} from MIT X11R5 defines
+@code{wchar_t} if @code{X_WCHAR} is defined, which is defined if
+@code{X_NOT_STDC_ENV} is defined, and we define @emph{that} if
+@code{STDC_HEADERS} is not defined (@samp{configure} decides if
+@code{STDC_HEADERS} gets defined). But when compiling with GCC on SunOS
+4.1.x, @code{STDC_HEADERS} is not defined (@file{string.h} doesn't
+declare the @samp{mem}* functions), so we do get X's
+@code{wchar_t}---and we also get GCC's @code{wchar_t} from its
+@file{<stddef.h>}. Conflict.
+
+On the other hand, SunOS 4.1.1 with some other X configurations actually
+needs GCC to define @code{wchar_t}, and fails otherwise.
+
+My current theory is to define @code{wchar_t} to a nonsense symbol
+before the X include files are read; that way its definition (if any)
+will be ignored by other system include files. Going along with that,
+define @code{X_WCHAR} to tell X not to use @file{<stddef.h>}, that we've
+already included, but instead to make its own definition.
+
+But this is not the end of the story. The X11 include files distributed
+with DG/UX 5.4.2 for the Aviion have been modified to include
+@file{<_int_wchar_t.h>} if @code{X_WCHAR}, so our @code{#define} will
+not have any typedef to change---but the uses of @code{wchar_t} in the X
+include files will be changed to reference this undefined symbol. So
+there's nothing to foil in this case. I don't know how to detect this
+automatically, so it's up to you to define @code{NO_FOIL_X_WCHAR_T}
+yourself.
+@end ignore
+
+@node XtStrings
+@subsubsection @code{XtStrings}
+
+@findex XtStrings
+You may find that linking X programs results in an error from the linker
+that @samp{XtStrings} is undefined, something like this:
+
+@example
+gcc -o virmf @dots{}
+@dots{}/x11.c:130: undefined reference to `XtStrings'
+@end example
+
+This generally happens because of a mismatch between the X include files
+with which you compiled and the X libraries with which you linked;
+often, the include files are from MIT and the libraries from Sun.
+
+The solution is to use the same X distribution for compilation and
+linking. Probably @samp{configure} was unable to guess the proper
+directories from your installation. You can use the @code{configure}
+options @samp{--x-includes=@var{path}} and
+@samp{--x-libraries=@var{path}} to explicitly specify them.
+
+
+@node dlopen
+@subsubsection @code{dlopen}
+
+@cindex static linking and @code{dlsym}
+@flindex dlopen
+@flindex dlsym
+@flindex dlclose
+@flindex wcstombs
+@flindex libdl.a
+(This section adapted from the file @file{dlsym.c} in the X distribution.)
+
+The @code{Xlib} library uses the standard C function @code{wcstombs}.
+Under SunOS 4.1, @code{wcstombs} uses the @samp{dlsym} interface defined
+in @file{libdl.so}. Unfortunately, the SunOS 4.1 distribution does not
+include a static @samp{libdl.a} library.
+
+As a result, if you try to link an X program statically under SunOS, you
+may get undefined references to @code{dlopen}, @code{dlsym}, and
+@code{dlclose}. One workaround is to include these definitions
+when you link:
+
+@example
+void *dlopen() @{ return 0; @}
+void *dlsym() @{ return 0; @}
+int dlclose() @{ return -1; @}
+@end example
+
+@flindex dlsym.c
+@noindent These are contained in the @file{dlsym.c} file in the MIT X
+distribution.
+
+
+@node ShellWidgetClass
+@subsubsection @code{ShellWidgetClass}
+
+@cindex dynamic linking problems with OpenWin libraries
+@cindex OpenWin libraries, dynamic linking problems
+@findex get_wmShellWidgetClass
+@findex get_applicationShellWidgetClass
+
+@flindex comp.sys.sun.admin @r{FAQ}
+@cindex FAQ, @t{comp.sys.sun.admin}
+(This section adapted from the @t{comp.sys.sun.admin} FAQ.)
+
+If you are linking with Sun's OpenWindows libraries in SunOS 4.1.x, you
+may get undefined symbols @code{_get_wmShellWidgetClass} and
+@code{_get_applicationShellWidgetClass} when linking. This problem does
+not arise using the standard MIT X libraries under SunOS.
+
+@findex Xmu @r{library problems}
+The cause is bugs in the @code{Xmu} shared library as shipped from Sun.
+There are several fixes:
+
+@itemize @bullet
+
+@item Install the free MIT distribution from @samp{ftp.x.org} and mirrors.
+
+@item Get the OpenWindows patches listed below.
+
+@item Statically link the @code{Xmu} library into the executable.
+
+@item Avoid using @code{Xmu} at all. If you are compiling
+Metafont, see @ref{Online Metafont graphics,,, web2c, Web2c}. If you are
+compiling Xdvi, see the @code{-DNOTOOL} option in @file{xdvik/INSTALL}.
+
+@item Ignore the errors. The binary runs fine regardless.
+
+@end itemize
+
+@cindex Sun OpenWin patches
+@cindex patches, Sun OpenWin
+Here is the information for getting the two patches:
+
+@display
+Patch ID: 100512-02
+Bug ID's: 1086793, 1086912, 1074766
+Description: 4.1.x OpenWindows 3.0 @code{libXt} jumbo patch
+
+Patch ID: 100573-03
+Bug ID: 1087332
+Description: 4.1.x OpenWindows 3.0 undefined symbols when using shared @code{libXmu}.
+@end display
+
+@cindex static linking
+The way to statically link with @code{libXmu} depends on whether you are
+using a Sun compiler (e.g., @code{cc}) or @code{gcc}. If the latter,
+alter the @code{x_libs} Make variable to include
+
+@opindex -static
+@opindex -dynamic
+@example
+-static -lXmu -dynamic
+@end example
+
+@opindex -Bstatic
+@opindex -Bdynamic
+If you are using the Sun compiler, use @samp{-Bstatic} and @samp{-Bdynamic}.
+
+
+@node Pointer combination warnings
+@subsubsection Pointer combination warnings
+
+@cindex warnings, pointer combinations
+@cindex pointer combination warnings
+@cindex illegal pointer combination warnings
+@pindex cc @r{warnings}
+When compiling with old C compilers, you may get some warnings about
+``illegal pointer combinations''. These are spurious; just ignore them.
+I decline to clutter up the source with casts to get rid of them.
+
+@c This isn't worth including any more, OSF 1.x is too old.
+@c The other XtInherit problem (R4 Xlib on Suns) should never come up,
+@c but the answer from the X faq is included anyway.
+@c
+@c @node XtInherit
+@c @subsubsection @code{XtInherit}
+@c
+@c @findex XtInherit @r{bug on OSF/1}
+@c @cindex OSF/1 loader bug and @code{XtInherit}
+@c @cindex Alpha OSF/1 loader bug and @code{XtInherit}
+@c
+@c On DEC OSF/1 1.x systems, the loader has a bug that manifests itself in
+@c the following error (all on one line, but for the sake of the paper
+@c width it's broken here):
+@c
+@c @example
+@c xdvik/xdvi: /sbin/loader: Fatal Error: search_for_undefineds:
+@c symbol _XtInherit should not have any relocation entry
+@c @end example
+@c
+@c @noindent According to Michael Rickabaugh @code{<mjr@@quarry.enet.dec.com>}:
+@c
+@c @quotation
+@c This is a bug fixed in DEC OSF/1 2.0.
+@c
+@c If you know how, installing @file{/sbin/loader} from a 2.0 system onto a
+@c 1.3 system will work. Make sure that @file{/usr} is @emph{not} mounted
+@c when you do this. (If you forget about umounting @code{/usr}, it is
+@c possible most of your filesystems will become corrupted.)
+@c
+@c Otherwise, I suggest getting a later CD and running
+@c @file{/usr/sbin/installupdate}.
+@c @end quotation
+@c
+@c Alternatively, you may be able to use the freely available X11 libraries
+@c that come with the MIT distribution (on @file{ftp.x.org}, for example).
+@c
+@c Linking statically, perhaps only with some of the X libraries, may also
+@c work.
+@c
+@c The Sun XtInherit weirdness, from the comp.windows.x FAQ:
+@c Subject: 126)! What are these problems with "*_XtInherit* not found" on the Sun?
+@c When I link a X program that I wrote on a SunOS 4.0.3 or 4.1 machine I get the
+@c error "ld.so: symbol not found *_XtInherit*".
+@c
+@c What you are seeing is a side-effect of a kludge in the R4 libXt.a to
+@c get Sun shared libraries working. Apparently, you can't share a function that
+@c is both called and compared, as *_XtInherit* is. This was handled by putting
+@c *_XtInherit* in the same file as a function that is always used, thereby
+@c guaranteeing that it would be loaded -- that is, in Initialize.c, where
+@c XtToolkitInitialize() and XtInitialize() reside. These routines would normally
+@c be called.
+@c
+@c You are probably seeing this error because your program is not a normal
+@c Xt-based program and does not call XtToolkitInitialize() anywhere.
+@c 1) it may be a program that uses Xt functions but never opens a
+@c connection to the X server. [OSF/Motif's 1.1.0 UIL had this problem; it called
+@c XtMalloc() and other Xt functions.] The solution is to add the call to your
+@c program; the function does not have to be executed, just linked in.
+@c 2) alternatively, your program doesn't need any Xt functions and is
+@c correct in not calling XtToolkitInitialize() -- it may be an Xlib or XView
+@c program. In this case, you can remove -lXt from your link command.
+@c
+@c It should not be necessary to link the shared libraries statically,
+@c although this will certainly solve the problem.
+
+@c * Empty Makefiles:: If configure gives you sed errors.
+@c * wchar_t:: For wchar_t difficulties.
diff --git a/Build/source/texk/kpathsea/c-auto.in b/Build/source/texk/kpathsea/c-auto.in
new file mode 100644
index 00000000000..ae57d32f0d2
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-auto.in
@@ -0,0 +1,170 @@
+/* c-auto.in. Generated automatically from configure.in by autoheader 2.13. */
+/* acconfig.h -- used by autoheader when generating c-auto.in.
+
+ If you're thinking of editing acconfig.h to fix a configuration
+ problem, don't. Edit the c-auto.h file created by configure,
+ instead. Even better, fix configure to give the right answer.
+
+ Copyright 1997-99, 2002, 2005 Olaf Weber.
+ Copyright 1994-97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+/* Guard against double inclusion. */
+#ifndef KPATHSEA_C_AUTO_H
+#define KPATHSEA_C_AUTO_H
+
+/* kpathsea: the version string. */
+#define KPSEVERSION "REPLACE-WITH-KPSEVERSION"
+
+/* kpathsea/configure.in tests for these functions with
+ kb_AC_KLIBTOOL_REPLACE_FUNCS, and naturally Autoheader doesn't know
+ about that macro. Since the shared library stuff is all preliminary
+ anyway, I decided not to change Autoheader, but rather to hack them
+ in here. */
+#undef HAVE_PUTENV
+#undef HAVE_STRCASECMP
+#undef HAVE_STRTOL
+#undef HAVE_STRSTR
+
+
+/* Define if the closedir function returns void instead of int. */
+#undef CLOSEDIR_VOID
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define if your struct stat has st_mtim. */
+#undef HAVE_ST_MTIM
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if your compiler understands prototypes. */
+#undef HAVE_PROTOTYPES
+
+/* Define if getcwd if implemented using fork or vfork. Let me know
+ if you have to add this by hand because configure failed to detect
+ it. */
+#undef GETCWD_FORKS
+
+/* Define if you are using GNU libc or otherwise have global variables
+ `program_invocation_name' and `program_invocation_short_name'. */
+#undef HAVE_PROGRAM_INVOCATION_NAME
+
+/* all: Define to enable running scripts when missing input files. */
+#define MAKE_TEX_MF_BY_DEFAULT 0
+#define MAKE_TEX_PK_BY_DEFAULT 0
+#define MAKE_TEX_TEX_BY_DEFAULT 0
+#define MAKE_TEX_TFM_BY_DEFAULT 0
+#define MAKE_TEX_FMT_BY_DEFAULT 0
+#define MAKE_OMEGA_OFM_BY_DEFAULT 0
+#define MAKE_OMEGA_OCP_BY_DEFAULT 0
+
+/* Define if you have the bcmp function. */
+#undef HAVE_BCMP
+
+/* Define if you have the bcopy function. */
+#undef HAVE_BCOPY
+
+/* Define if you have the bzero function. */
+#undef HAVE_BZERO
+
+/* Define if you have the getcwd function. */
+#undef HAVE_GETCWD
+
+/* Define if you have the getwd function. */
+#undef HAVE_GETWD
+
+/* Define if you have the index function. */
+#undef HAVE_INDEX
+
+/* Define if you have the memcmp function. */
+#undef HAVE_MEMCMP
+
+/* Define if you have the memcpy function. */
+#undef HAVE_MEMCPY
+
+/* Define if you have the putenv function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the rindex function. */
+#undef HAVE_RINDEX
+
+/* Define if you have the strcasecmp function. */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strchr function. */
+#undef HAVE_STRCHR
+
+/* Define if you have the strrchr function. */
+#undef HAVE_STRRCHR
+
+/* Define if you have the strstr function. */
+#undef HAVE_STRSTR
+
+/* Define if you have the strtol function. */
+#undef HAVE_STRTOL
+
+/* Define if you have the <assert.h> header file. */
+#undef HAVE_ASSERT_H
+
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the m library (-lm). */
+#undef HAVE_LIBM
+#endif /* !KPATHSEA_C_AUTO_H */
diff --git a/Build/source/texk/kpathsea/c-ctype.h b/Build/source/texk/kpathsea/c-ctype.h
new file mode 100644
index 00000000000..553a0df96f7
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-ctype.h
@@ -0,0 +1,90 @@
+/* c-ctype.h: ASCII-safe versions of the <ctype.h> macros.
+
+ Copyright 1998, 2000, 2005 Olaf Weber
+ Copyright 1992, 1994 Karl Berry
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_CTYPE_H
+#define KPATHSEA_C_CTYPE_H
+
+#include <ctype.h>
+
+/* Be sure we have `isascii'. */
+#ifdef WIN32
+#include <oldnames.h>
+#else
+#ifndef isascii
+#define isascii(c) 1
+#endif
+#endif
+
+#define ISALNUM(c) (isascii (c) && isalnum(c))
+#define ISALPHA(c) (isascii (c) && isalpha(c))
+#define ISASCII isascii
+#define ISCNTRL(c) (isascii (c) && iscntrl(c))
+#define ISDIGIT(c) (isascii (c) && isdigit (c))
+#define ISGRAPH(c) (isascii (c) && isgraph(c))
+#define ISLOWER(c) (isascii (c) && islower(c))
+#define ISPRINT(c) (isascii (c) && isprint(c))
+#define ISPUNCT(c) (isascii (c) && ispunct(c))
+#define ISSPACE(c) (isascii (c) && isspace(c))
+#define ISUPPER(c) (isascii (c) && isupper(c))
+#define ISXDIGIT(c) (isascii (c) && isxdigit(c))
+#define TOASCII toascii
+#define TOLOWER(c) (ISUPPER (c) ? tolower (c) : (c))
+#define TOUPPER(c) (ISLOWER (c) ? toupper (c) : (c))
+
+/* This isn't part of the usual <ctype.h>, but it's useful sometimes. */
+#ifndef isblank
+#define isblank(c) ((c) == ' ' || (c) == '\t')
+#endif
+
+#define ISBLANK(c) (isascii (c) && isblank (c))
+
+
+/* Here's why this mess is necessary:
+
+From: meyering@cs.utexas.edu (Jim Meyering)
+Date: Wed, 25 Nov 1992 09:52:33 -0600
+Subject: ss-921123: using isascii with <ctype.h> macros
+
+ Yesterday some cursory regression testing found that GNU od
+ (in an upcoming release of textutils) generated incorrect output
+ when run on an SGI indigo because isprint ('\377') returned true.
+ Of course, '\377' is not a printing character; the problem lay
+ in using isprint without first making sure its integer argument
+ corresponded to an ascii code.
+
+ MORAL: always guard uses of ctype macros with isascii if it's available.
+ An obvious alternative is to avoid <ctype.h> and define and use your
+ own versions of the ctype macros.
+
+ A pretty clean approach to using <ctype.h> and isascii was
+ suggested by David MacKenzie:
+
+ #ifndef isascii
+ #define isascii(c) 1
+ #endif
+
+ #define ISDIGIT(c) (isascii (c) && isdigit (c))
+ #define ISPRINT(c) (isascii (c) && isprint (c))
+ ...
+
+ then, use ISDIGIT, etc. instead of isdigit, etc. */
+
+#endif /* not KPATHSEA_C_CTYPE_H */
diff --git a/Build/source/texk/kpathsea/c-dir.h b/Build/source/texk/kpathsea/c-dir.h
new file mode 100644
index 00000000000..a8ba51d3457
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-dir.h
@@ -0,0 +1,55 @@
+/* c-dir.h: directory headers.
+
+ Copyright 1998, 2005 Olaf Weber
+ Copyright 1992, 93, 94 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_DIR_H
+#define KPATHSEA_C_DIR_H
+
+#ifdef WIN32
+
+#include <direct.h>
+
+#else /* not WIN32 */
+
+/* Use struct dirent instead of struct direct. */
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#define NAMLEN(dirent) strlen ((dirent)->d_name)
+#else /* not DIRENT */
+#define dirent direct
+#define NAMLEN(dirent) ((dirent)->d_namlen)
+
+#ifdef HAVE_SYS_NDIR_H
+#include <sys/ndir.h>
+#endif
+
+#ifdef HAVE_SYS_DIR_H
+#include <sys/dir.h>
+#endif
+
+#ifdef HAVE_NDIR_H
+#include <ndir.h>
+#endif
+
+#endif /* not DIRENT */
+
+#endif /* not WIN32 */
+
+#endif /* not KPATHSEA_C_DIR_H */
diff --git a/Build/source/texk/kpathsea/c-errno.h b/Build/source/texk/kpathsea/c-errno.h
new file mode 100644
index 00000000000..2867941d0e3
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-errno.h
@@ -0,0 +1,30 @@
+/* c-errno.h: <errno.h> and the errno variable.
+
+ Copyright 2005 Olaf Weber
+ Copyright 1992 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_ERRNO_H
+#define KPATHSEA_C_ERRNO_H
+
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+
+#endif /* not KPATHSEA_C_ERRNO_H */
diff --git a/Build/source/texk/kpathsea/c-fopen.h b/Build/source/texk/kpathsea/c-fopen.h
new file mode 100644
index 00000000000..62675cc9388
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-fopen.h
@@ -0,0 +1,75 @@
+/* c-fopen.h: how to open files with fopen.
+
+ Copyright 1998, 2005 Olaf Weber.
+ Copyright (C) 1992, 94, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef C_FOPEN_H
+#define C_FOPEN_H
+
+/* How to open a text file: */
+#ifndef FOPEN_A_MODE
+#define FOPEN_A_MODE "a"
+#endif
+
+#ifndef FOPEN_R_MODE
+#define FOPEN_R_MODE "r"
+#endif
+
+#ifndef FOPEN_W_MODE
+#define FOPEN_W_MODE "w"
+#endif
+
+/* How to open a binary file for reading: */
+#ifndef FOPEN_RBIN_MODE
+#define FOPEN_RBIN_MODE "rb"
+#endif /* not FOPEN_RBIN_MODE */
+
+/* How to open a binary file for writing: */
+#ifndef FOPEN_WBIN_MODE
+#define FOPEN_WBIN_MODE "wb"
+#endif /* not FOPEN_WBIN_MODE */
+
+/* How to open a binary file for appending: */
+#ifndef FOPEN_ABIN_MODE
+#define FOPEN_ABIN_MODE "ab"
+#endif /* not FOPEN_ABIN_MODE */
+
+/* How to switch an already open file handle to binary mode.
+ Used on DOSISH systems when we need to switch a standard
+ stream, such as stdin or stdout, to binary mode. */
+#include <fcntl.h>
+#ifdef DOSISH
+#include <io.h>
+#ifndef O_BINARY
+#ifdef _O_BINARY
+#define O_BINARY _O_BINARY
+#endif
+#endif
+#if defined (__i386_pc_gnu__) || \
+ defined (WIN32) || defined (__WIN32__) || defined (_WIN32)
+#define SET_BINARY(f) setmode((f), O_BINARY)
+#endif
+#else /* not DOSISH */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+#define SET_BINARY(f) 0
+#endif /* not DOSISH */
+
+#endif /* not C_FOPEN_H */
diff --git a/Build/source/texk/kpathsea/c-limits.h b/Build/source/texk/kpathsea/c-limits.h
new file mode 100644
index 00000000000..45bdf4f8df6
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-limits.h
@@ -0,0 +1,39 @@
+/* c-limits.h: include the system parameter file.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 93, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef C_LIMITS_H
+#define C_LIMITS_H
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#else
+#include <kpathsea/systypes.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#endif /* not HAVE_LIMITS_H */
+
+/* Some systems may have the floating-point limits in the above. */
+#if defined (HAVE_FLOAT_H) && !defined (FLT_MAX)
+#include <float.h>
+#endif
+
+#endif /* not C_LIMITS_H */
diff --git a/Build/source/texk/kpathsea/c-memstr.h b/Build/source/texk/kpathsea/c-memstr.h
new file mode 100644
index 00000000000..4f85cdf3938
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-memstr.h
@@ -0,0 +1,86 @@
+/* c-memstr.h: memcpy, strchr, etc.
+
+ Copyright 1998, 1999, 2000, 2004, 2005 Olaf Weber.
+ Copyright 1992, 93, 94, 95, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_MEMSTR_H
+#define KPATHSEA_C_MEMSTR_H
+
+/* <X11/Xfuncs.h> tries to declare bcopy etc., which can only conflict. */
+#define _XFUNCS_H_
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+/* An ANSI string.h and pre-ANSI memory.h might conflict. */
+#if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
+#include <memory.h>
+#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
+
+/* Just to be complete, we make both the system V/ANSI and the BSD
+ versions of the string functions available. */
+#if !defined(HAVE_STRCHR) && !defined(strchr)
+#define strchr index
+#endif
+
+#if !defined(HAVE_STRRCHR) && !defined(strrchr)
+#define strrchr rindex
+#endif
+
+#if !defined(HAVE_MEMCMP) && !defined(memcmp)
+#define memcmp(s1, s2, n) bcmp ((s1), (s2), (n))
+#endif
+
+#if !defined(HAVE_MEMCPY) && !defined(memcpy)
+#define memcpy(to, from, len) bcopy ((from), (to), (len))
+#endif
+
+/* Note that these functions should not be used. */
+#if !defined(HAVE_BCMP) && !defined(bcmp)
+#define bcmp(s1, s2, len) memcmp ((s1), (s2), (len))
+#endif
+
+#if !defined(HAVE_BCOPY) && !defined(bcopy)
+#define bcopy(from, to, len) memcpy ((to), (from), (len))
+#endif
+
+#if !defined(HAVE_BZERO) && !defined(bzero)
+#define bzero(s, len) memset ((s), 0, (len))
+#endif
+
+#if !defined(HAVE_INDEX) && !defined(index)
+#define index(s, c) strchr ((s), (c))
+#endif
+
+#if !defined(HAVE_RINDEX) && !defined(rindex)
+#define rindex(s, c) strrchr ((s), (c))
+#endif
+
+#if !defined(HAVE_STRING_H)
+extern char *strtok ();
+#ifndef strstr
+extern char *strstr ();
+#endif
+#endif
+
+#endif /* not KPATHSEA_C_MEMSTR_H */
diff --git a/Build/source/texk/kpathsea/c-minmax.h b/Build/source/texk/kpathsea/c-minmax.h
new file mode 100644
index 00000000000..a50be21483f
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-minmax.h
@@ -0,0 +1,87 @@
+/* c-minmax.h: define INT_MIN, etc. Assume a 32-bit machine if the
+ values aren't defined.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_MINMAX_H
+#define KPATHSEA_C_MINMAX_H
+
+#include <kpathsea/c-limits.h>
+
+/* Declared in <limits.h> on ANSI C systems. If the system doesn't
+ define it, we use the minimum ANSI values -- except for `int'; we
+ assume 32-bit integers. */
+
+#ifndef SCHAR_MIN
+#define SCHAR_MIN (-127)
+#endif
+#ifndef SCHAR_MAX
+#define SCHAR_MAX 128
+#endif
+#ifndef UCHAR_MAX
+#define UCHAR_MAX 255
+#endif
+
+#ifndef SHRT_MIN
+#define SHRT_MIN (-32767)
+#endif
+#ifndef SHRT_MAX
+#define SHRT_MAX 32767
+#endif
+#ifndef USHRT_MAX
+#define USHRT_MAX 65535
+#endif
+
+#ifndef INT_MIN
+#define INT_MIN (-2147483647)
+#endif
+#ifndef INT_MAX
+#define INT_MAX 2147483647
+#endif
+#ifndef UINT_MAX
+#define UINT_MAX 4294967295
+#endif
+
+#ifndef LONG_MIN
+#define LONG_MIN INT_MIN
+#endif
+#ifndef LONG_MAX
+#define LONG_MAX INT_MAX
+#endif
+#ifndef ULONG_MAX
+#define ULONG_MAX UINT_MAX
+#endif
+
+/* Declared in <float.h> on ANSI C systems. */
+#ifndef DBL_MIN
+#define DBL_MIN 1e-37
+#endif
+#ifndef DBL_MAX
+#define DBL_MAX 1e+37
+#endif
+
+#ifndef FLT_MIN
+#define FLT_MIN 1e-37
+#endif
+#ifndef FLT_MAX
+#define FLT_MAX 1e+37
+#endif
+
+#endif /* not KPATHSEA_C_MINMAX_H */
diff --git a/Build/source/texk/kpathsea/c-namemx.h b/Build/source/texk/kpathsea/c-namemx.h
new file mode 100644
index 00000000000..37f7d1537d6
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-namemx.h
@@ -0,0 +1,39 @@
+/* c-namemx.h: define NAME_MAX, the maximum length of a single
+ component in a filename. No such limit may exist, or may vary
+ depending on the filesystem.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_NAME_MX_H
+#define KPATHSEA_C_NAME_MX_H
+
+#include <kpathsea/c-limits.h>
+
+/* Most likely the system will truncate filenames if it is not POSIX,
+ and so we can use the BSD value here. */
+#ifndef _POSIX_NAME_MAX
+#define _POSIX_NAME_MAX 255
+#endif
+
+#ifndef NAME_MAX
+#define NAME_MAX _POSIX_NAME_MAX
+#endif
+
+#endif /* not KPATHSEA_C_NAME_MX_H */
diff --git a/Build/source/texk/kpathsea/c-pathch.h b/Build/source/texk/kpathsea/c-pathch.h
new file mode 100644
index 00000000000..4f106a471a9
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-pathch.h
@@ -0,0 +1,110 @@
+/* c-pathch.h: define the characters which separate components of
+ filenames and environment variable paths.
+
+ Copyright 1997, 1999, 2001, 2005 Olaf Weber.
+ Copyright 1992, 93, 95, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef C_PATHCH_H
+#define C_PATHCH_H
+
+#include <kpathsea/c-ctype.h>
+
+/* What separates filename components? */
+#ifndef DIR_SEP
+#ifdef VMS
+#define DIR_SEP ':'
+#define DIR_SEP_STRING ":"
+#else
+#ifdef DOSISH
+/* Either \'s or 's work. Wayne Sullivan's web2pc prefers /, so we'll
+ go with that. */
+#define DIR_SEP '/'
+#define DIR_SEP_STRING "/"
+#define IS_DEVICE_SEP(ch) ((ch) == ':')
+#define NAME_BEGINS_WITH_DEVICE(name) (*(name) && IS_DEVICE_SEP((name)[1]))
+/* On DOS, it's good to allow both \ and / between directories. */
+#define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\')
+/* On win32, UNC names are authorized */
+#ifdef WIN32
+#define IS_UNC_NAME(name) (strlen(name)>=3 && IS_DIR_SEP(*name) \
+ && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
+#endif
+#else
+#ifdef AMIGA
+#define DIR_SEP '/'
+#define DIR_SEP_STRING "/"
+#define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == ':')
+#define IS_DEVICE_SEP(ch) ((ch) == ':')
+#else
+#ifdef VMCMS
+#define DIR_SEP ' '
+#define DIR_SEP_STRING " "
+#else
+#define DIR_SEP '/'
+#define DIR_SEP_STRING "/"
+#endif /* not VM/CMS */
+#endif /* not AMIGA */
+#endif /* not DOSISH */
+#endif /* not VMS */
+#endif /* not DIR_SEP */
+
+#ifndef IS_DIR_SEP
+#define IS_DIR_SEP(ch) ((ch) == DIR_SEP)
+#endif
+#ifndef IS_DEVICE_SEP /* No `devices' on, e.g., Unix. */
+#define IS_DEVICE_SEP(ch) 0
+#endif
+#ifndef NAME_BEGINS_WITH_DEVICE
+#define NAME_BEGINS_WITH_DEVICE(name) 0
+#endif
+#ifndef IS_UNC_NAME /* Unc names are in practice found on Win32 only. */
+#define IS_UNC_NAME(name) 0
+#endif
+
+/* What separates elements in environment variable path lists? */
+#ifndef ENV_SEP
+#ifdef VMS
+#define ENV_SEP ','
+#define ENV_SEP_STRING ","
+#else
+#ifdef DOSISH
+#define ENV_SEP ';'
+#define ENV_SEP_STRING ";"
+#else
+#ifdef AMIGA
+#define ENV_SEP ';'
+#define ENV_SEP_STRING ";"
+#else
+#ifdef VMCMS
+#define ENV_SEP ' '
+#define ENV_SEP_STRING " "
+#else
+#define ENV_SEP ':'
+#define ENV_SEP_STRING ":"
+#endif /* not VM/CMS */
+#endif /* not AMIGA */
+#endif /* not DOS */
+#endif /* not VMS */
+#endif /* not ENV_SEP */
+
+#ifndef IS_ENV_SEP
+#define IS_ENV_SEP(ch) ((ch) == ENV_SEP)
+#endif
+
+#endif /* not C_PATHCH_H */
diff --git a/Build/source/texk/kpathsea/c-pathmx.h b/Build/source/texk/kpathsea/c-pathmx.h
new file mode 100644
index 00000000000..41f9ac0424e
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-pathmx.h
@@ -0,0 +1,45 @@
+/* c-pathmx.h: define PATH_MAX, the maximum length of a filename.
+ Since no such limit may exist, it's preferable to dynamically grow
+ filenames as needed.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_PATH_MX_H
+#define KPATHSEA_C_PATH_MX_H
+
+#include <kpathsea/c-limits.h>
+
+/* Cheat and define this as a manifest constant no matter what, instead
+ of using pathconf. I forget why we want to do this. */
+
+#ifndef _POSIX_PATH_MAX
+#define _POSIX_PATH_MAX 255
+#endif
+
+#ifndef PATH_MAX
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX _POSIX_PATH_MAX
+#endif
+#endif /* not PATH_MAX */
+
+
+#endif /* not KPATHSEA_C_PATH_MAX_H */
diff --git a/Build/source/texk/kpathsea/c-proto.h b/Build/source/texk/kpathsea/c-proto.h
new file mode 100644
index 00000000000..281adc19514
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-proto.h
@@ -0,0 +1,183 @@
+/* c-proto.h: macros to include or discard prototypes.
+
+ Copyright 1999, 2000, 01, 03, 04, 05 Olaf Weber.
+ Copyright 1992, 93, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_PROTO_H
+#define KPATHSEA_C_PROTO_H
+
+#if defined (KPSE_DLL) && (defined (WIN32) || defined (__CYGWIN__))
+#ifdef MAKE_KPSE_DLL
+#define KPSEDLL __declspec(dllexport)
+#else /* ! MAKE_KPSE_DLL */
+#define KPSEDLL __declspec(dllimport)
+#endif
+#else /* ! (KPSE_DLL && (WIN32 || __CYGWIN__)) */
+#define KPSEDLL
+#endif
+
+/* These macros munge function declarations to make them work in both
+ cases. The P?H macros are used for declarations, the P?C for
+ definitions. Cf. <ansidecl.h> from the GNU C library. P1H(void)
+ also works for definitions of routines which take no args. */
+
+#ifdef HAVE_PROTOTYPES
+
+#define AA(args) args /* For an arbitrary number; ARGS must be in parens. */
+
+#define P1H(p1) (p1)
+#define P2H(p1,p2) (p1, p2)
+#define P3H(p1,p2,p3) (p1, p2, p3)
+#define P4H(p1,p2,p3,p4) (p1, p2, p3, p4)
+#define P5H(p1,p2,p3,p4,p5) (p1, p2, p3, p4, p5)
+#define P6H(p1,p2,p3,p4,p5,p6) (p1, p2, p3, p4, p5, p6)
+#define P7H(p1,p2,p3,p4,p5,p6,p7) (p1, p2, p3, p4, p5, p6, p7)
+#define P8H(p1,p2,p3,p4,p5,p6,p7,p8) (p1, p2, p3, p4, p5, p6, p7, p8)
+#define P9H(p1,p2,p3,p4,p5,p6,p7,p8,p9) (p1, p2, p3, p4, p5, p6, p7, p8, p9)
+#define P10H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) \
+ (p1,p2,p3,p4,p5,p6,p7,p8,p9,p10)
+#define P11H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11) \
+ (p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11)
+#define P12H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12) \
+ (p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12)
+#define P13H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13) \
+ (p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13)
+#define P14H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14) \
+ (p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14)
+#define P15H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15) \
+ (p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15)
+#define P16H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16) \
+ (p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16)
+#define P17H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17) \
+ (p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17)
+
+
+#define P1C(t1,n1)(t1 n1)
+#define P2C(t1,n1, t2,n2)(t1 n1, t2 n2)
+#define P3C(t1,n1, t2,n2, t3,n3)(t1 n1, t2 n2, t3 n3)
+#define P4C(t1,n1, t2,n2, t3,n3, t4,n4)(t1 n1, t2 n2, t3 n3, t4 n4)
+#define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5)
+#define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6)
+#define P7C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7)
+#define P8C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7, t8,n8) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8)
+#define P9C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7, t8,n8, t9,n9) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9)
+#define P10C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10)
+#define P11C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10, \
+ t11 n11)
+#define P12C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10, \
+ t11 n11, t12 n12)
+#define P13C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10, \
+ t11 n11, t12 n12, t13 n13)
+#define P14C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13,t14,n14) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10, \
+ t11 n11, t12 n12, t13 n13, t14 n14)
+#define P15C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13,t14,n14,t15,n15) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10, \
+ t11 n11, t12 n12, t13 n13, t14 n14, t15 n15)
+#define P16C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13,t14,n14,t15,n15,t16,n16) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10, \
+ t11 n11, t12 n12, t13 n13, t14 n14, t15 n15, t16 n16)
+#define P17C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13,t14,n14,t15,n15,t16,n16,t17,n17) \
+ (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10, \
+ t11 n11, t12 n12, t13 n13, t14 n14, t15 n15, t16 n16, t17 n17)
+
+#else /* not HAVE_PROTOTYPES */
+
+#define AA(args) ()
+
+#define P1H(p1) ()
+#define P2H(p1, p2) ()
+#define P3H(p1, p2, p3) ()
+#define P4H(p1, p2, p3, p4) ()
+#define P5H(p1, p2, p3, p4, p5) ()
+#define P6H(p1, p2, p3, p4, p5, p6) ()
+#define P7H(p1, p2, p3, p4, p5, p6, p7) ()
+#define P8H(p1, p2, p3, p4, p5, p6, p7, p8) ()
+#define P9H(p1, p2, p3, p4, p5, p6, p7, p8, p9) ()
+#define P10H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) ()
+#define P11H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11) ()
+#define P12H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12) ()
+#define P13H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13) ()
+#define P14H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14) ()
+#define P15H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15) ()
+#define P16H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16) ()
+#define P17H(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17) ()
+
+#define P1C(t1,n1) (n1) t1 n1;
+#define P2C(t1,n1, t2,n2) (n1,n2) t1 n1; t2 n2;
+#define P3C(t1,n1, t2,n2, t3,n3) (n1,n2,n3) t1 n1; t2 n2; t3 n3;
+#define P4C(t1,n1, t2,n2, t3,n3, t4,n4) (n1,n2,n3,n4) \
+ t1 n1; t2 n2; t3 n3; t4 n4;
+#define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) (n1,n2,n3,n4,n5) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5;
+#define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) (n1,n2,n3,n4,n5,n6) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6;
+#define P7C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7) \
+ (n1,n2,n3,n4,n5,n6,n7) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7;
+#define P8C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7, t8,n8) \
+ (n1,n2,n3,n4,n5,n6,n7,n8) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8;
+#define P9C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7, t8,n8, t9,n9) \
+ (n1,n2,n3,n4,n5,n6,n7,n8,n9) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8; t9 n9;
+#define P10C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10) \
+ (n1,n2,n3,n4,n5,n6,n7,n8,n9,n10) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8; t9 n9; t10 n10;
+#define P11C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11) \
+ (n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8; t9 n9; t10 n10; \
+ t11 n11;
+#define P12C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12) \
+ (n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8; t9 n9; t10 n10; \
+ t11 n11; t12 n12;
+#define P13C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13) \
+ (n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8; t9 n9; t10 n10; \
+ t11 n11; t12 n12; t13 n13;
+#define P14C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13,t14,n14) \
+ (n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8; t9 n9; t10 n10; \
+ t11 n11; t12 n12; t13 n13; t14 n14;
+#define P15C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13,t14,n14,t15,n15) \
+ (n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8; t9 n9; t10 n10; \
+ t11 n11; t12 n12; t13 n13; t14 n14; t15 n15;
+#define P16C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13,t14,n14,t15,n15,t16,n16) \
+ (n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8; t9 n9; t10 n10; \
+ t11 n11; t12 n12; t13 n13; t14 n14; t15 n15; t16 n16;
+#define P17C(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6,t7,n7,t8,n8,t9,n9,t10,n10,t11,n11,t12,n12,t13,n13,t14,n14,t15,n15,t16,n16,t17,n17) \
+ (n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17) \
+ t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; t8 n8; t9 n9; t10 n10; \
+ t11 n11; t12 n12; t13 n13; t14 n14; t15 n15; t16 n16; t17 n17;
+
+#endif /* not HAVE_PROTOTYPES */
+
+#endif /* not KPATHSEA_C_PROTO_H */
diff --git a/Build/source/texk/kpathsea/c-stat.h b/Build/source/texk/kpathsea/c-stat.h
new file mode 100644
index 00000000000..cd939fdca31
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-stat.h
@@ -0,0 +1,63 @@
+/* c-stat.h: declarations for using stat(2).
+
+ Copyright 1998, 2000, 2005 Olaf Weber.
+ Copyright 1993, 96 Karl berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_STAT_H
+#define KPATHSEA_STAT_H
+
+#include <kpathsea/systypes.h>
+#include <sys/stat.h>
+
+#ifdef WIN32
+#include <oldnames.h>
+#endif /* WIN32 */
+
+/* POSIX predicates for testing file attributes. */
+
+#if !defined (S_ISBLK) && defined (S_IFBLK)
+#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+#endif
+#if !defined (S_ISCHR) && defined (S_IFCHR)
+#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+#endif
+#if !defined (S_ISDIR) && defined (S_IFDIR)
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+#if !defined (S_ISREG) && defined (S_IFREG)
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
+#if !defined (S_ISFIFO) && defined (S_IFIFO)
+#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+#endif
+#if !defined (S_ISLNK) && defined (S_IFLNK)
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#endif
+#if !defined (S_ISSOCK) && defined (S_IFSOCK)
+#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+#endif
+#if !defined (S_ISMPB) && defined (S_IFMPB) /* V7 */
+#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
+#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
+#endif
+#if !defined (S_ISNWK) && defined (S_IFNWK) /* HP/UX */
+#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
+#endif
+
+#endif /* not KPATHSEA_STAT_H */
diff --git a/Build/source/texk/kpathsea/c-std.h b/Build/source/texk/kpathsea/c-std.h
new file mode 100644
index 00000000000..448addfa412
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-std.h
@@ -0,0 +1,105 @@
+/* c-std.h: the first header files.
+
+ Copyright 1999, 2005 Olaf Weber
+ Copyright 1992, 93, 94, 95, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_STD_H
+#define KPATHSEA_C_STD_H
+
+/* Header files that essentially all of our sources need, and
+ that all implementations have. We include these first, to help with
+ NULL being defined multiple times. */
+/* Workaround against a <math.h> MSVC bug : it can't be declared
+ extern "C" in a c++ source file. */
+#ifndef __cplusplus
+#include <math.h>
+#endif
+#include <stdio.h>
+
+/* Be sure we have constants from <unistd.h>. */
+#include <kpathsea/c-unistd.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+/* Include <stdlib.h> before <stddef.h>, to help avoid NULL
+ redefinitions on some systems. (We don't include <stddef.h>
+ ourselves any more, but FYI.) */
+#else
+/* It's impossible to say for sure what the system will deign to put in
+ <stdlib.h>, but let's hope it's at least this. */
+extern char *getenv ();
+#endif /* not HAVE_STDLIB_H */
+
+#ifdef WIN32
+#include <malloc.h>
+#else
+#ifndef STDC_HEADERS
+#ifndef ALLOC_RETURN_TYPE
+#ifdef DOSISH
+#define ALLOC_RETURN_TYPE void
+#else
+#define ALLOC_RETURN_TYPE char
+#endif /* not DOSISH */
+#endif /* not ALLOC_RETURN_TYPE */
+extern ALLOC_RETURN_TYPE *calloc (), *malloc (), *realloc ();
+#endif /* not STDC_HEADERS */
+#endif /* not WIN32 */
+
+/* SunOS 4.1.1 gets STDC_HEADERS defined, but it doesn't provide
+ EXIT_FAILURE. So far no system has defined one of EXIT_FAILURE and
+ EXIT_SUCCESS without the other. */
+#ifndef EXIT_SUCCESS
+#ifdef VMS
+#define EXIT_SUCCESS 1
+#define EXIT_FAILURE 0
+#else
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+#endif
+#endif /* not EXIT_SUCCESS */
+
+/* strchr vs. index, memcpy vs. bcopy, etc. */
+#include <kpathsea/c-memstr.h>
+
+/* Error numbers and errno declaration. */
+#include <kpathsea/c-errno.h>
+
+/* Numeric minima and maxima. */
+#include <kpathsea/c-minmax.h>
+
+/* Assertions are too useful to not make generally available. */
+#ifdef HAVE_ASSERT_H
+#include <assert.h>
+#else
+#define assert(expr) /* as nothing */
+#endif
+
+#ifdef VMS
+#include <unixlib.h>
+#include <unixio.h>
+#else
+#ifndef WIN32
+/* `popen' and `pclose' are part of POSIX.2, not POSIX.1. So
+ STDC_HEADERS isn't enough. */
+extern FILE *popen ();
+extern int pclose ();
+#endif /* not WIN32 */
+#endif /* not VMS */
+
+#endif /* not KPATHSEA_C_STD_H */
diff --git a/Build/source/texk/kpathsea/c-unistd.h b/Build/source/texk/kpathsea/c-unistd.h
new file mode 100644
index 00000000000..68f3b65c76f
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-unistd.h
@@ -0,0 +1,56 @@
+/* c-unistd.h: ensure we have constants from <unistd.h>. Included from
+ c-std.h.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_C_UNISTD_H
+#define KPATHSEA_C_UNISTD_H
+
+/* <unistd.h> is allowed to depend on <sys/types.h>. */
+#include <kpathsea/systypes.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <kpathsea/c-std.h>
+
+/* For fseek. */
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+#endif /* not SEEK_SET */
+
+/* For access. */
+#ifndef F_OK
+#define F_OK 0
+#define X_OK 1
+#define W_OK 2
+#define R_OK 4
+#endif /* not F_OK */
+
+#ifndef STDIN_FILENO
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+#endif /* not STDIN_FILENO */
+
+#endif /* not KPATHSEA_C_UNISTD_H */
diff --git a/Build/source/texk/kpathsea/c-vararg.h b/Build/source/texk/kpathsea/c-vararg.h
new file mode 100644
index 00000000000..5479fbe9f4f
--- /dev/null
+++ b/Build/source/texk/kpathsea/c-vararg.h
@@ -0,0 +1,64 @@
+/* c-vararg.h: Top layer for stdarg and varargs.
+
+ Copyright 1998, 2005 Olaf Weber.
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef C_VARARG_H
+#define C_VARARG_H
+
+/* See function `init_path' in `kpathsea/tex-file.c' for an example of use.
+ The idea is to say PVAR1C(type1, parameter1, ap) in the function header,
+ and then end the function with two }}'s. We do this to avoid having to
+ specify the argument list (with types) twice -- once in the function
+ header, and once in a (hypothetical) VA_START1. */
+
+#ifdef HAVE_PROTOTYPES
+#include <stdarg.h>
+
+#define PVAR1H(p1) (p1, ...)
+#define PVAR2H(p1, p2) (p1, p2, ...)
+#define PVAR3H(p1, p2, p3) (p1, p2, p3, ...)
+
+#define PVAR1C(t1, n1, ap) \
+ (t1 n1, ...) { va_list ap; va_start (ap, n1);
+#define PVAR2C(t1, n1, t2, n2, ap) \
+ (t1 n1, t2 n2, ...) { va_list ap; va_start (ap, n2);
+#define PVAR3C(t1, n1, t2, n2, t3, n3, ap) \
+ (t1 n1, t2 n2, t3 n3, ...) { va_list ap; va_start (ap, n3);
+
+#else /* not HAVE_PROTOTYPES */
+#include <varargs.h>
+
+#define PVAR1H(p1) ()
+#define PVAR2H(p1, p2) ()
+#define PVAR3H(p1, p2, p3) ()
+
+#define PVAR1C(t1, n1, ap) \
+ (va_alist) va_dcl { t1 n1; va_list ap; va_start (ap); \
+ n1 = va_arg (ap, t1);
+#define PVAR2C(t1, n1, t2, n2, ap) \
+ (va_alist) va_dcl { t1 n1; t2 n2; va_list ap; va_start (ap); \
+ n1 = va_arg (ap, t1); n2 = va_arg (ap, t2);
+#define PVAR3C(t1, n1, t2, n2, t3, n3, ap) \
+ (va_alist) va_dcl { t1 n1; t2 n2; t3 n3; va_list ap; va_start (ap); \
+ n1 = va_arg (ap, t1); n2 = va_arg (ap, t2); \
+ n3 = va_arg (ap, t3);
+#endif /* not HAVE_PROTOTYPES */
+
+#endif /* not C_VARARG_H */
diff --git a/Build/source/texk/kpathsea/cnf.c b/Build/source/texk/kpathsea/cnf.c
new file mode 100644
index 00000000000..982495bde48
--- /dev/null
+++ b/Build/source/texk/kpathsea/cnf.c
@@ -0,0 +1,251 @@
+/* cnf.c: read config files.
+
+ Copyright 1997-2005 Olaf Weber.
+ Copyright 1994, 95, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/cnf.h>
+#include <kpathsea/db.h>
+#include <kpathsea/hash.h>
+#include <kpathsea/line.h>
+#include <kpathsea/paths.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/progname.h>
+#include <kpathsea/tex-file.h>
+#include <kpathsea/variable.h>
+
+/* By using our own hash table, instead of the environment, we
+ complicate variable expansion (because we have to look in two
+ places), but we don't bang so much on the system. DOS and System V
+ have very limited environment space. Also, this way
+ `kpse_init_format' can distinguish between values originating from
+ the cnf file and ones from environment variables, which can be useful
+ for users trying to figure out what's going on. */
+static hash_table_type cnf_hash;
+#define CNF_HASH_SIZE 751
+#define CNF_NAME "texmf.cnf"
+
+/* Do a single line in a cnf file: if it's blank or a comment, skip it.
+ Otherwise, parse <variable>[.<program>] [=] <value>. Do
+ this even if the <variable> is already set in the environment, since
+ the envvalue might contain a trailing :, in which case we'll be
+ looking for the cnf value. */
+
+static void
+do_line P1C(string, line)
+{
+ unsigned len;
+ string start;
+ string value, var;
+ string prog = NULL;
+
+ /* Skip leading whitespace. */
+ while (ISSPACE (*line))
+ line++;
+
+ /* More to do only if we have non-comment material left. */
+ if (*line == 0 || *line == '%' || *line == '#')
+ return;
+
+ /* The variable name is everything up to the next space or = or `.'. */
+ start = line;
+ while (!ISSPACE (*line) && *line != '=' && *line != '.')
+ line++;
+
+ /* `line' is now one character past the end of the variable name. */
+ len = line - start;
+ var = (string)xmalloc (len + 1);
+ strncpy (var, start, len);
+ var[len] = 0;
+
+ /* If the variable is qualified with a program name, find out which. */
+ while (ISSPACE (*line))
+ line++;
+ if (*line == '.') {
+ /* Skip spaces, then everything up to the next space or =. */
+ line++;
+ while (ISSPACE (*line))
+ line++;
+ start = line;
+ while (!ISSPACE (*line) && *line != '=')
+ line++;
+
+ /* It's annoying to repeat all this, but making a tokenizing
+ subroutine would be just as long and annoying. */
+ len = line - start;
+ prog = (string)xmalloc (len + 1);
+ strncpy (prog, start, len);
+ prog[len] = 0;
+ }
+
+ /* Skip whitespace, an optional =, more whitespace. */
+ while (ISSPACE (*line))
+ line++;
+ if (*line == '=') {
+ line++;
+ while (ISSPACE (*line))
+ line++;
+ }
+
+ /* The value is whatever remains. Remove trailing whitespace. */
+ start = line;
+ len = strlen (start);
+ while (len > 0 && ISSPACE (start[len - 1]))
+ len--;
+
+ value = (string)xmalloc (len + 1);
+ strncpy (value, start, len);
+ value[len] = 0;
+
+ /* Suppose we want to write a single texmf.cnf that can be used under
+ both NT and Unix. This is feasible except for the path separators
+ : on Unix, ; on NT. We can't switch NT to allowing :'s, since :
+ is the drive separator. So we switch Unix to allowing ;'s. On the
+ other hand, we don't want to change IS_ENV_SEP and all the rest.
+
+ So, simply translate all ;'s in the path
+ values to :'s if we are a Unix binary. (Fortunately we don't use ;
+ in other kinds of texmf.cnf values.) */
+
+ if (IS_ENV_SEP(':')) {
+ string loc;
+ for (loc = value; *loc; loc++) {
+ if (*loc == ';')
+ *loc = ':';
+ }
+ }
+
+ /* We want TEXINPUTS.prog to override plain TEXINPUTS. The simplest
+ way is to put both in the hash table (so we don't have to write
+ hash_delete and hash_replace, and keep track of values' sources),
+ and then look up the .prog version first in `kpse_cnf_get'. */
+ if (prog) {
+ string lhs = concat3 (var, ".", prog);
+ free (var);
+ free (prog);
+ var = lhs;
+ }
+ hash_insert (&cnf_hash, var, value);
+
+ /* We could check that anything remaining is preceded by a comment
+ character, but let's not bother. */
+}
+
+/* Read all the configuration files in the path. */
+
+static void
+read_all_cnf P1H(void)
+{
+ string *cnf_files;
+ string *cnf;
+ const_string cnf_path = kpse_init_format (kpse_cnf_format);
+
+ cnf_hash = hash_create (CNF_HASH_SIZE);
+
+ cnf_files = kpse_all_path_search (cnf_path, CNF_NAME);
+ if (cnf_files) {
+ for (cnf = cnf_files; *cnf; cnf++) {
+ string line;
+ FILE *cnf_file = xfopen (*cnf, FOPEN_R_MODE);
+
+ while ((line = read_line (cnf_file)) != NULL) {
+ unsigned len = strlen (line);
+ /* Strip trailing spaces. */
+ while (len > 0 && ISSPACE(line[len-1])) {
+ line[len - 1] = 0;
+ --len;
+ }
+ /* Concatenate consecutive lines that end with \. */
+ while (len > 0 && line[len - 1] == '\\') {
+ string next_line = read_line (cnf_file);
+ line[len - 1] = 0;
+ if (!next_line) {
+ WARNING1 ("%s: Last line ends with \\", *cnf);
+ } else {
+ string new_line;
+ new_line = concat (line, next_line);
+ free (line);
+ line = new_line;
+ len = strlen (line);
+ }
+ }
+
+ do_line (line);
+ free (line);
+ }
+
+ xfclose (cnf_file, *cnf);
+ free (*cnf);
+ }
+ free (cnf_files);
+ }
+}
+
+/* Read the cnf files on the first call. Return the first value in the
+ returned list -- this will be from the last-read cnf file. */
+
+string
+kpse_cnf_get P1C(const_string, name)
+{
+ string ret, ctry;
+ string *ret_list;
+ static boolean doing_cnf_init = false;
+
+ /* When we expand the compile-time value for DEFAULT_TEXMFCNF,
+ we end up needing the value for TETEXDIR and other variables,
+ so kpse_var_expand ends up calling us again. No good. */
+ if (doing_cnf_init)
+ return NULL;
+
+ if (cnf_hash.size == 0) {
+ doing_cnf_init = true;
+ read_all_cnf ();
+ doing_cnf_init = false;
+
+ /* Here's a pleasant kludge: Since `kpse_init_dbs' recursively calls
+ us, we must call it from outside a `kpse_path_element' loop
+ (namely, the one in `read_all_cnf' above): `kpse_path_element' is
+ not reentrant. */
+ kpse_init_db ();
+ }
+
+ /* First look up NAME.`kpse_program_name', then NAME. */
+ assert (kpse_program_name);
+ ctry = concat3 (name, ".", kpse_program_name);
+ ret_list = hash_lookup (cnf_hash, ctry);
+ free (ctry);
+ if (ret_list) {
+ ret = *ret_list;
+ free (ret_list);
+ } else {
+ ret_list = hash_lookup (cnf_hash, name);
+ if (ret_list) {
+ ret = *ret_list;
+ free (ret_list);
+ } else {
+ ret = NULL;
+ }
+ }
+
+ return ret;
+
+}
diff --git a/Build/source/texk/kpathsea/cnf.h b/Build/source/texk/kpathsea/cnf.h
new file mode 100644
index 00000000000..738c2df62a3
--- /dev/null
+++ b/Build/source/texk/kpathsea/cnf.h
@@ -0,0 +1,33 @@
+/* cnf.h: runtime config files.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1994, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_CNF_H
+#define KPATHSEA_CNF_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+/* Return the value in the last-read cnf file for VAR, or NULL if none.
+ On the first call, also read all the `texmf.cnf' files in the
+ path for kpse_cnf_format (and initialize the path). */
+extern KPSEDLL string kpse_cnf_get P1H(const_string var);
+
+#endif /* not KPATHSEA_CNF_H */
diff --git a/Build/source/texk/kpathsea/common.ac b/Build/source/texk/kpathsea/common.ac
new file mode 100644
index 00000000000..85ca33a57c1
--- /dev/null
+++ b/Build/source/texk/kpathsea/common.ac
@@ -0,0 +1,116 @@
+dnl Common Autoconf sinclude file for kpathsea-using programs. (Have to
+dnl use the m4 `sinclude' builtin instead of `include', since Autoconf
+dnl disables `include'.)
+
+dnl These configure scripts won't work with anything else.
+AC_PREREQ(2.12.1)
+
+dnl Write output here, instead of putting a zillion -D's on the command line.
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+sinclude(../libtool.m4)
+
+AC_PROG_LIBTOOL
+
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_FUNC_CLOSEDIR_VOID
+AC_CHECK_HEADERS(assert.h float.h limits.h memory.h pwd.h stdlib.h \
+ string.h strings.h sys/param.h unistd.h)
+
+dnl Libtool supporting objects that may be required on ancient broken system.
+AC_CHECK_FUNCS(putenv,, LTLIBOBJS="$LTLIBOBJS putenv.lo")
+AC_CHECK_FUNCS(strcasecmp,, LTLIBOBJS="$LTLIBOBJS strcasecmp.lo")
+AC_CHECK_FUNCS(strtol,, LTLIBOBJS="$LTLIBOBJS strtol.lo")
+AC_CHECK_FUNCS(strstr,, LTLIBOBJS="$LTLIBOBJS strstr.lo")
+AC_SUBST(LTLIBOBJS)
+
+AC_CHECK_FUNCS(bcmp bcopy bzero getcwd getwd index memcmp memcpy rindex strchr strrchr)
+
+AC_C_CONST
+
+# Check whether struct stat provides high-res time.
+KPSE_STRUCT_ST_MTIM
+
+# Check whether prototypes work.
+AC_MSG_CHECKING(whether the compiler accepts prototypes)
+AC_CACHE_VAL(kb_cv_c_prototypes,
+[AC_TRY_COMPILE([#include <stdarg.h>], [extern void foo(int i,...);],
+ kb_cv_c_prototypes=yes, kb_cv_c_prototypes=no)])dnl
+AC_MSG_RESULT($kb_cv_c_prototypes)
+if test "$kb_cv_c_prototypes" = yes; then
+ AC_DEFINE(HAVE_PROTOTYPES)
+fi
+
+# This is a GNU libc invention.
+AC_MSG_CHECKING(whether program_invocation_name is predefined)
+AC_CACHE_VAL(kb_cv_var_program_inv_name,
+[AC_TRY_LINK(,
+ [extern char *program_invocation_name; program_invocation_name = "love";],
+ kb_cv_var_program_inv_name=yes, kb_cv_var_program_inv_name=no)])dnl
+AC_MSG_RESULT($kb_cv_var_program_inv_name)
+if test "$kb_cv_var_program_inv_name" = yes; then
+ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME)
+fi
+
+if test $ac_cv_func_getcwd = yes; then
+# We only need to run this if we have getcwd.
+AC_MSG_CHECKING(whether getcwd uses fork or vfork)
+AC_CACHE_VAL(kb_cv_func_getcwd_forks,
+[AC_TRY_RUN([
+int fork() { exit(1); }
+int vfork() { exit(1); }
+extern char *getcwd();
+char path[100];
+int main() {
+getcwd(path,100);
+return 0;
+}], kb_cv_func_getcwd_forks=no, kb_cv_func_getcwd_forks=yes,
+ kb_cv_func_getcwd_forks=no)])dnl
+AC_MSG_RESULT($kb_cv_func_getcwd_forks)
+if test $kb_cv_func_getcwd_forks = yes; then
+ AC_DEFINE(GETCWD_FORKS)
+fi
+fi
+
+# Common --with and --enable options.
+sinclude(../../texk/kpathsea/withenable.ac)
+
+# Implementation of those options.
+if test "x$with_mktexmf_default" = xyes; then
+ AC_DEFINE(MAKE_TEX_MF_BY_DEFAULT)
+fi
+if test "x$with_mktexpk_default" = xyes; then
+ AC_DEFINE(MAKE_TEX_PK_BY_DEFAULT)
+fi
+if test "x$with_mktextex_default" = xyes; then
+ AC_DEFINE(MAKE_TEX_TEX_BY_DEFAULT)
+fi
+if test "x$with_mktexfmt_default" = xyes; then
+ AC_DEFINE(MAKE_TEX_FMT_BY_DEFAULT)
+fi
+if test "x$with_mktextfm_default" = xyes; then
+ AC_DEFINE(MAKE_TEX_TFM_BY_DEFAULT)
+fi
+if test "x$with_mkocp_default" = xyes; then
+ AC_DEFINE(MAKE_OMEGA_OCP_BY_DEFAULT)
+fi
+if test "x$with_mkofm_default" = xyes; then
+ AC_DEFINE(MAKE_OMEGA_OFM_BY_DEFAULT)
+fi
+
+# Is libm present. FIXME: do we need it at all?
+AC_CHECK_LIB(m, main)
+
+# If you're cross-compiling, these macros set up the variables in
+# ../make/cross.mk: BUILDCC, BUILDCFLAGS, BUILDCCLD etc.
+KPSE_CROSS_BUILD_VAR(CC, cc)
+KPSE_CROSS_BUILD_VAR(CFLAGS, $(BUILDXCFLAGS))
+KPSE_CROSS_BUILD_VAR(CPPFLAGS, $(BUILDXCPPFLAGS))
+KPSE_CROSS_BUILD_VAR(LDFLAGS, $(BUILDXLDFLAGS))
+KPSE_CROSS_BUILD_VAR(CCLD, $(BUILDCC))
diff --git a/Build/source/texk/kpathsea/concat.c b/Build/source/texk/kpathsea/concat.c
new file mode 100644
index 00000000000..602c9122fc8
--- /dev/null
+++ b/Build/source/texk/kpathsea/concat.c
@@ -0,0 +1,38 @@
+/* concat.c: dynamic string concatenation.
+
+ Copyright 2002, 2005 Olaf Weber.
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+
+/* Return the concatenation of S1 and S2. See `concatn.c' for a
+ `concatn', which takes a variable number of arguments. */
+
+string
+concat P2C(const_string, s1, const_string, s2)
+{
+ unsigned s1len = strlen(s1);
+ unsigned s2len = strlen(s2);
+ string answer = (string) xmalloc (s1len + s2len + 1);
+ strcpy (answer, s1);
+ strcat (answer + s1len, s2);
+
+ return answer;
+}
diff --git a/Build/source/texk/kpathsea/concat3.c b/Build/source/texk/kpathsea/concat3.c
new file mode 100644
index 00000000000..60945e2ad24
--- /dev/null
+++ b/Build/source/texk/kpathsea/concat3.c
@@ -0,0 +1,34 @@
+/* concat3.c: concatenate three strings.
+
+ Copyright 1992 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+
+string
+concat3 P3C(const_string, s1, const_string, s2, const_string, s3)
+{
+ string answer
+ = (string) xmalloc (strlen (s1) + strlen (s2) + strlen (s3) + 1);
+ strcpy (answer, s1);
+ strcat (answer, s2);
+ strcat (answer, s3);
+
+ return answer;
+}
diff --git a/Build/source/texk/kpathsea/concatn.c b/Build/source/texk/kpathsea/concatn.c
new file mode 100644
index 00000000000..3d73e01cc12
--- /dev/null
+++ b/Build/source/texk/kpathsea/concatn.c
@@ -0,0 +1,73 @@
+/* concatn.c: Concatenate an arbitrary number of strings.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1993, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/concatn.h>
+
+
+/* OK, it would be epsilon more efficient to compute the total length
+ and then do the copying ourselves, but I doubt it matters in reality. */
+
+string
+concatn PVAR1C(const_string, str1, ap)
+{
+ string arg;
+ string ret;
+
+ if (!str1)
+ return NULL;
+
+ ret = xstrdup (str1);
+
+ while ((arg = va_arg (ap, string)) != NULL)
+ {
+ string temp = concat (ret, arg);
+ free (ret);
+ ret = temp;
+ }
+ va_end (ap);
+
+ return ret;
+}}
+
+#ifdef TEST
+int
+main ()
+{
+ printf ("null = \"%s\"\n", concatn (NULL));
+ printf ("\"a\" = \"%s\"\n", concatn ("a", NULL));
+ printf ("\"ab\" = \"%s\"\n", concatn ("a", "b", NULL));
+ printf ("\"abc\" = \"%s\"\n", concatn ("a", "b", "c", NULL));
+ printf ("\"abcd\" = \"%s\"\n", concatn ("ab", "cd", NULL));
+ printf ("\"abcde\" = \"%s\"\n", concatn ("ab", "c", "de", NULL));
+ printf ("\"abcdef\" = \"%s\"\n", concatn ("", "a", "", "bcd", "ef", NULL));
+ return 0;
+}
+
+#endif /* TEST */
+
+
+/*
+Local variables:
+standalone-compile-command: "gcc -posix -g -I. -I.. -DTEST concatn.c kpathsea.a"
+End:
+*/
diff --git a/Build/source/texk/kpathsea/concatn.h b/Build/source/texk/kpathsea/concatn.h
new file mode 100644
index 00000000000..675eadba9d4
--- /dev/null
+++ b/Build/source/texk/kpathsea/concatn.h
@@ -0,0 +1,36 @@
+/* concatn.h: concatenate a variable number of strings.
+ This is a separate include file only because I don't see the point of
+ having every source file include <c-vararg.h>. The declarations for
+ the other concat routines are in lib.h.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1993, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_CONCATN_H
+#define KPATHSEA_CONCATN_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/c-vararg.h>
+#include <kpathsea/types.h>
+
+/* Concatenate a null-terminated list of strings and return the result
+ in malloc-allocated memory. */
+extern KPSEDLL string concatn PVAR1H(const_string str1);
+
+#endif /* not KPATHSEA_CONCATN_H */
diff --git a/Build/source/texk/kpathsea/config.h b/Build/source/texk/kpathsea/config.h
new file mode 100644
index 00000000000..e359e3fbaa2
--- /dev/null
+++ b/Build/source/texk/kpathsea/config.h
@@ -0,0 +1,131 @@
+/* config.h: master configuration file, included first by all compilable
+ source files (not headers).
+
+ Copyright 2000, 2003, 2004, 2005 Olaf Weber.
+ Copyright 1993, 95, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_CONFIG_H
+#define KPATHSEA_CONFIG_H
+
+/* System defines are for non-Unix systems only. (Testing for all Unix
+ variations should be done in configure.) Presently the defines used
+ are: AMIGA DOS OS2 WIN32. I do not use any of these systems myself;
+ if you do, I'd be grateful for any changes. --olaf@infovore.xs4all.nl */
+
+#if defined(DJGPP) || defined(__DJGPP__) || \
+ defined(CYGWIN) || defined(__CYGWIN__) || \
+ defined(CYGWIN32) || defined(__CYGWIN32__) || \
+ defined(MINGW32) || defined(__MINGW32__)
+#define __i386_pc_gnu__
+#endif
+
+/* If we have either DOS or OS2, we are DOSISH. Cygwin pretends to be
+ * unix, mostly, so don't include it here.
+ */
+#if defined(OS2) || \
+ defined(MSDOS) || defined(__MSDOS__) || defined(DOS) || \
+ defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || \
+ defined(DJGPP) || defined(__DJGPP__) || \
+ defined(MINGW32) || defined(__MINGW32__)
+#define DOSISH
+#endif
+
+/* case-insensitive filename comparisons? */
+#if defined (DOSISH)
+#define MONOCASE_FILENAMES
+#endif
+
+/* NULL device. */
+#if defined (DOSISH)
+#define DEV_NULL "NUL"
+#else
+#define DEV_NULL "/dev/null"
+#endif
+
+#ifdef WIN32
+#define __STDC__ 1
+#endif /* not WIN32 */
+
+/* System dependencies that are figured out by `configure'. */
+#include <kpathsea/c-auto.h>
+
+#ifdef __DJGPP__
+#include <fcntl.h> /* for long filenames' stuff */
+#include <dir.h> /* for `getdisk' */
+#include <io.h> /* for `setmode' */
+#endif
+
+/* Some drivers have partially integrated kpathsea changes. */
+#ifndef KPATHSEA
+#define KPATHSEA 34
+#endif
+
+#include <kpathsea/c-std.h> /* <stdio.h>, <math.h>, etc. */
+
+#include <kpathsea/c-proto.h> /* Macros to discard or keep prototypes. */
+
+/*
+ This must be included after "c-proto.h"
+ but before "lib.h". FP.
+*/
+#ifdef WIN32
+#include <win32lib.h>
+#endif
+
+#include <kpathsea/debug.h> /* Runtime tracing. */
+#include <kpathsea/lib.h> /* STREQ, etc. */
+#include <kpathsea/types.h> /* <sys/types.h>, boolean, string, etc. */
+#include <kpathsea/progname.h> /* for program_invocation_*name */
+
+
+/* If you want to find subdirectories in a directory with non-Unix
+ semantics (specifically, if a directory with no subdirectories does
+ not have exactly two links), define this. */
+#if !defined (VMS) && !defined (VMCMS)
+#if !defined (DOSISH) || defined(__DJGPP__)
+/* Surprise! DJGPP returns st_nlink exactly like on Unix. */
+#define ST_NLINK_TRICK
+#endif /* either not DOSISH or __DJGPP__ */
+#endif /* not DOS and not VMS and not VMCMS */
+
+#ifdef AMIGA
+/* No popen/pclose on Amiga, but rather than put #ifdef's in tex-make.c,
+ let's get rid of the functions here. (CallMF will automatically
+ generate fonts.) pclose must not be simply empty, since it still
+ occurs in a comparison. */
+#define popen(cmd, mode) NULL
+#define pclose(file) 0
+#endif /* AMIGA */
+
+#ifdef OS2
+#define access ln_access
+#define chmod ln_chmod
+#define creat ln_creat
+#define fopen ln_fopen
+#define freopen ln_freopen
+#define lstat ln_lstat
+#define open ln_open
+#define remove ln_remove
+#define rename ln_rename
+#define sopen ln_sopen
+#define stat ln_stat
+#define unlink ln_unlink
+#endif /* OS2 */
+
+#endif /* not KPATHSEA_CONFIG_H */
diff --git a/Build/source/texk/kpathsea/configure b/Build/source/texk/kpathsea/configure
new file mode 100755
index 00000000000..47f17bab956
--- /dev/null
+++ b/Build/source/texk/kpathsea/configure
@@ -0,0 +1,7231 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+ --enable-shared[=PKGS] build shared libraries [default=yes]"
+ac_help="$ac_help
+ --enable-static[=PKGS] build static libraries [default=yes]"
+ac_help="$ac_help
+ --enable-fast-install[=PKGS] optimize for fast installation [default=yes]"
+ac_help="$ac_help
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
+
+# Find the correct PATH separator. Usually this is `:', but
+# DJGPP uses `;' like DOS.
+if test "X${PATH_SEPARATOR+set}" != Xset; then
+ UNAME=${UNAME-`uname 2>/dev/null`}
+ case X$UNAME in
+ *-DOS) lt_cv_sys_path_separator=';' ;;
+ *) lt_cv_sys_path_separator=':' ;;
+ esac
+ PATH_SEPARATOR=$lt_cv_sys_path_separator
+fi
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+ac_help="$ac_help
+ --disable-libtool-lock avoid locking (might break parallel builds)"
+ac_help="$ac_help
+ --with-pic try to use only PIC/non-PIC objects [default=use both]"
+ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
+ac_help="$ac_help
+ --without-mktexmf-default do not run mktexmf if MF source missing"
+ac_help="$ac_help
+ --without-mktexpk-default do not run mktexpk if PK font missing"
+ac_help="$ac_help
+ --without-mktextfm-default do not run mktextfm if TFM file missing"
+ac_help="$ac_help
+ --without-mkocp-default do not run mkocp if OCP file missing"
+ac_help="$ac_help
+ --without-mkofm-default do not run mkofm if OFM file missing"
+ac_help="$ac_help
+ --with-mktexfmt-default run mktexfmt if format file missing"
+ac_help="$ac_help
+ --with-mktextex-default run mktextex if TeX source missing"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+ac_config_files=
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+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=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -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 ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$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" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$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)
+ # 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 << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --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
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$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" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ 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)
+ 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" ;;
+
+ -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 ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=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" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: invalid variable name: $ac_envvar" 1>&2; exit 1; }
+ fi
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=pathsearch.c
+
+# 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 its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ 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
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+KPSEVERSION=3.5.5
+
+cat >> confdefs.h <<EOF
+#define KPSEVERSION "kpathsea version $KPSEVERSION"
+EOF
+
+
+
+
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:740: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+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
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:771: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_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 $# -gt 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
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:823: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:856: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 867 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:898: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:903: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:931: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&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
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ case $ac_dir in
+ /*|[A-z]:/*) ac_aux_dir=$ac_dir;;
+ *) ac_aux_dir=`pwd`/$ac_dir;;
+ esac
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ case $ac_dir in
+ /*|[A-z]:/*) ac_aux_dir=$ac_dir;;
+ *) ac_aux_dir=`pwd`/$ac_dir;;
+ esac
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# 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
+# 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"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:999: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ # Hack for MSDOS and descendants.
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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
+ if test $ac_x $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+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. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&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'
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1054: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+# MS-DOS is a special case, because it sort of pretends that ln -s
+# works for executables.
+if test -z "$COMSPEC" && ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:1077: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001
+## Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# serial 46 AC_PROG_LIBTOOL
+
+
+
+
+
+# AC_LIBTOOL_HEADER_ASSERT
+# ------------------------
+# AC_LIBTOOL_HEADER_ASSERT
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+# _LT_AC_CHECK_DLFCN
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+ # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+# ---------------------------------
+# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+# _LT_AC_PROG_ECHO_BACKSLASH
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+# _LT_AC_TRY_DLOPEN_SELF
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+# AC_LIBTOOL_DLOPEN_SELF
+
+# _LT_AC_LTCONFIG_HACK
+
+# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+
+
+# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+
+
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+
+
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+
+
+# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
+
+
+# AC_LIBTOOL_PICMODE - implement the --with-pic flag
+# Usage: AC_LIBTOOL_PICMODE[(MODE)]
+# Where MODE is either `yes' or `no'. If omitted, it defaults to
+# `both'.
+
+
+
+# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
+
+
+
+# AC_PATH_MAGIC - find a file program which can recognise a shared library
+
+
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+
+
+# AC_PROG_LD_GNU -
+
+
+# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+
+
+# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+
+
+
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+
+
+# AC_CHECK_LIBM - check for math library
+
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library and LTDLINCL to the include flags for
+# the libltdl header and adds --enable-ltdl-convenience to the
+# configure arguments. Note that LIBLTDL and LTDLINCL are not
+# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
+# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
+# with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library and LTDLINCL to the include flags for
+# the libltdl header and adds --enable-ltdl-install to the configure
+# arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
+# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
+# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
+# with '${top_srcdir}/' (note the single quotes!). If your package is
+# not flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+
+
+# old names
+
+
+
+
+
+
+
+
+# This is just to silence aclocal about the macro not being used
+
+
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+
+
+
+# Find the correct PATH separator. Usually this is `:', but
+# DJGPP uses `;' like DOS.
+if test "X${PATH_SEPARATOR+set}" != Xset; then
+ UNAME=${UNAME-`uname 2>/dev/null`}
+ case X$UNAME in
+ *-DOS) lt_cv_sys_path_separator=';' ;;
+ *) lt_cv_sys_path_separator=':' ;;
+ esac
+ PATH_SEPARATOR=$lt_cv_sys_path_separator
+fi
+
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:1299: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1304 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:1315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:1332: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1337 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1361: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 1376 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 1393 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 1410 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+# Check whether --enable-shared or --disable-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.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=yes
+fi
+
+# Check whether --enable-static or --disable-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.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi
+
+# Check whether --enable-fast-install or --disable-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.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:1516: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:1537: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:1566: checking for ld used by GCC" >&5
+ 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.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path 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 "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:1596: checking for GNU ld" >&5
+else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:1599: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ 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 GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_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
+ echo "$ac_t""$LD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:1634: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ lt_cv_prog_gnu_ld=yes
+else
+ lt_cv_prog_gnu_ld=no
+fi
+fi
+
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
+echo "configure:1651: checking for $LD option to reload object files" >&5
+if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+
+echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:1663: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/${ac_tool_prefix}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
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ else
+ 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
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+
+NM="$lt_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
+echo "configure:1701: checking for a sed that does not truncate output" >&5
+if eval "test \"`echo '$''{'lt_cv_path_SED'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_executable_p="test -f"
+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
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+
+ # Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=$TMPDIR/sed$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+ { (exit 1); exit 1; }
+}
+ _max=0
+ _count=0
+ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
+ # along with /bin/sed that truncates output.
+ for _sed in $_sed_list /usr/xpg4/bin/sed; do
+ test ! -f ${_sed} && break
+ cat /dev/null > "$tmp/sed.in"
+ _count=0
+ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
+ # Check for GNU sed and select it if it is found.
+ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
+ lt_cv_path_SED=${_sed}
+ break
+ fi
+ while true; do
+ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
+ mv "$tmp/sed.tmp" "$tmp/sed.in"
+ cp "$tmp/sed.in" "$tmp/sed.nl"
+ echo >>"$tmp/sed.nl"
+ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
+ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
+ # 40000 chars as input seems more than enough
+ test $_count -gt 10 && break
+ _count=`expr $_count + 1`
+ if test $_count -gt $_max; then
+ _max=$_count
+ lt_cv_path_SED=$_sed
+ fi
+ done
+ done
+ rm -rf "$tmp"
+
+fi
+
+if test "X$SED" != "X"; then
+ lt_cv_path_SED=$SED
+else
+ SED=$lt_cv_path_SED
+fi
+echo "$ac_t""$SED" 1>&6
+
+echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
+echo "configure:1785: checking how to recognise dependent libraries" >&5
+if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&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
+# which responds to the $file_magic_cmd with a given egrep 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
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ 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* | mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
+
+freebsd* | kfreebsd*-gnu)
+ 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)/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
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20*|hpux11*)
+ 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_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ irix5* | nonstopux*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ case $host_cpu in
+ alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
+ 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
+ ;;
+
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ 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
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:1971: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:1977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c) ;;
+ *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
+else
+ { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1997: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:2007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+if test $host != $build; then
+ ac_tool_prefix=${host_alias}-
+else
+ ac_tool_prefix=
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
+echo "configure:2038: checking command to parse $NM output" >&5
+if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&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]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris* | sysv5*)
+ symcode='[BDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $host_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ symcode='[ABCDGISTW]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Write the raw and C identifiers.
+lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if { (eval echo configure:2121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { (eval echo configure:2124: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && 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 egrep ' nm_test_var$' "$nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if { (eval echo configure:2175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$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 -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ global_symbol_to_cdecl=
+ global_symbol_to_c_name_address=
+else
+ global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
+ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
+fi
+if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
+then
+ echo "$ac_t""failed" 1>&6
+else
+ echo "$ac_t""ok" 1>&6
+fi
+
+for ac_hdr in dlfcn.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2224: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2229 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
+echo "configure:2270: checking for ${ac_tool_prefix}file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ 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 <<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
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$ac_t""$MAGIC_CMD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ echo $ac_n "checking for file""... $ac_c" 1>&6
+echo "configure:2332: checking for file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ 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 <<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
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$ac_t""$MAGIC_CMD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# 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
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2403: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_RANLIB"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2436: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ RANLIB=":"
+fi
+fi
+
+# 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
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2472: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_STRIP"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2505: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_STRIP="strip"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ STRIP=":"
+fi
+fi
+
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+ :
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 2555 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ 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
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:2577: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 2590 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+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'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+need_locks="$enable_libtool_lock"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+if test x"$host" != x"$build"; then
+ ac_tool_prefix=${host_alias}-
+else
+ ac_tool_prefix=
+fi
+
+# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+case $host_os in
+linux-gnu*) ;;
+linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+esac
+
+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 "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Allow CC to be a program name with arguments.
+set dummy $CC
+compiler="$2"
+
+## FIXME: this should be a separate macro
+##
+echo $ac_n "checking for objdir""... $ac_c" 1>&6
+echo "configure:2719: checking for objdir" >&5
+rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+echo "$ac_t""$objdir" 1>&6
+##
+## END FIXME
+
+
+## FIXME: this should be a separate macro
+##
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+test -z "$pic_mode" && pic_mode=default
+
+# We assume here that the value for lt_cv_prog_cc_pic will not be cached
+# in isolation, and that seeing it set (from the cache) indicates that
+# the associated values are set (in the cache) correctly too.
+echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
+echo "configure:2750: checking for $compiler option to produce PIC" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_prog_cc_pic=
+ lt_cv_prog_cc_shlib=
+ lt_cv_prog_cc_wl=
+ lt_cv_prog_cc_static=
+ lt_cv_prog_cc_no_builtin=
+ lt_cv_prog_cc_can_build_shared=$can_build_shared
+
+ if test "$GCC" = yes; then
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static='-static'
+
+ case $host_os in
+ aix*)
+ # Below there is a dirty hack to force normal static linking with -ldl
+ # The problem is because libdl dynamically linked with both libc and
+ # libC (AIX C++ library), which obviously doesn't included in libraries
+ # list by gcc. This cause undefined symbols with -static flags.
+ # This hack allows C programs to be linked with "-static -ldl", but
+ # not sure about C++ programs.
+ lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
+ ;;
+ amigaos*)
+ # 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_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_cv_prog_cc_pic='-fno-common'
+ ;;
+ cygwin* | mingw* | pw32* | os2*)
+ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_cv_prog_cc_pic=-Kconform_pic
+ fi
+ ;;
+ *)
+ lt_cv_prog_cc_pic='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for PIC flags for the system compiler.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ lt_cv_prog_cc_wl='-Wl,'
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_cv_prog_cc_static='-Bstatic'
+ else
+ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
+ lt_cv_prog_cc_pic='+Z'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static='-non_shared'
+ # PIC (with -KPIC) is the default.
+ ;;
+
+ cygwin* | mingw* | pw32* | os2*)
+ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
+ ;;
+
+ newsos6)
+ lt_cv_prog_cc_pic='-KPIC'
+ lt_cv_prog_cc_static='-Bstatic'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ # All OSF/1 code is PIC.
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ lt_cv_prog_cc_pic='-Kpic'
+ lt_cv_prog_cc_static='-dn'
+ lt_cv_prog_cc_shlib='-belf'
+ ;;
+
+ solaris*)
+ lt_cv_prog_cc_pic='-KPIC'
+ lt_cv_prog_cc_static='-Bstatic'
+ lt_cv_prog_cc_wl='-Wl,'
+ ;;
+
+ sunos4*)
+ lt_cv_prog_cc_pic='-PIC'
+ lt_cv_prog_cc_static='-Bstatic'
+ lt_cv_prog_cc_wl='-Qoption ld '
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_cv_prog_cc_pic='-KPIC'
+ lt_cv_prog_cc_static='-Bstatic'
+ lt_cv_prog_cc_wl='-Wl,'
+ ;;
+
+ uts4*)
+ lt_cv_prog_cc_pic='-pic'
+ lt_cv_prog_cc_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_cv_prog_cc_pic='-Kconform_pic'
+ lt_cv_prog_cc_static='-Bstatic'
+ fi
+ ;;
+
+ *)
+ lt_cv_prog_cc_can_build_shared=no
+ ;;
+ esac
+ fi
+
+fi
+
+if test -z "$lt_cv_prog_cc_pic"; then
+ echo "$ac_t""none" 1>&6
+else
+ echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
+
+ # Check to make sure the pic_flag actually works.
+ echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
+echo "configure:2898: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
+ if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
+ cat > conftest.$ac_ext <<EOF
+#line 2905 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ case $host_os in
+ hpux9* | hpux10* | hpux11*)
+ # On HP-UX, both CC and GCC only warn that PIC is supported... then
+ # they create non-PIC objects. So, if there were any warnings, we
+ # assume that PIC is not supported.
+ if test -s conftest.err; then
+ lt_cv_prog_cc_pic_works=no
+ else
+ lt_cv_prog_cc_pic_works=yes
+ fi
+ ;;
+ *)
+ lt_cv_prog_cc_pic_works=yes
+ ;;
+ esac
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_prog_cc_pic_works=no
+
+fi
+rm -f conftest*
+ CFLAGS="$save_CFLAGS"
+
+fi
+
+
+ if test "X$lt_cv_prog_cc_pic_works" = Xno; then
+ lt_cv_prog_cc_pic=
+ lt_cv_prog_cc_can_build_shared=no
+ else
+ lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
+ fi
+
+ echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
+fi
+##
+## END FIXME
+
+# Check for any special shared library compilation flags.
+if test -n "$lt_cv_prog_cc_shlib"; then
+ echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
+ if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then :
+ else
+ echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
+ lt_cv_prog_cc_can_build_shared=no
+ fi
+fi
+
+## FIXME: this should be a separate macro
+##
+echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
+echo "configure:2968: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_prog_cc_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
+ cat > conftest.$ac_ext <<EOF
+#line 2976 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_prog_cc_static_works=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+
+
+# Belt *and* braces to stop my trousers falling down:
+test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
+echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
+
+pic_flag="$lt_cv_prog_cc_pic"
+special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
+wl="$lt_cv_prog_cc_wl"
+link_static_flag="$lt_cv_prog_cc_static"
+no_builtin_flag="$lt_cv_prog_cc_no_builtin"
+can_build_shared="$lt_cv_prog_cc_can_build_shared"
+##
+## END FIXME
+
+
+## FIXME: this should be a separate macro
+##
+# Check to see if options -o and -c are simultaneously supported by compiler
+echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
+echo "configure:3014: checking if $compiler supports -c -o file.$ac_objext" >&5
+if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+$rm -r conftest 2>/dev/null
+mkdir conftest
+cd conftest
+echo "int some_variable = 0;" > conftest.$ac_ext
+mkdir out
+# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+# that will create temporary files in the current directory regardless of
+# the output directory. Thus, making CWD read-only will cause this test
+# to fail, enabling locking or at least warning the user not to do parallel
+# builds.
+chmod -w .
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
+compiler_c_o=no
+if { (eval echo configure:3033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
+ if test -s out/conftest.err; then
+ lt_cv_compiler_c_o=no
+ else
+ lt_cv_compiler_c_o=yes
+ fi
+else
+ # Append any errors to the config.log.
+ cat out/conftest.err 1>&5
+ lt_cv_compiler_c_o=no
+fi
+CFLAGS="$save_CFLAGS"
+chmod u+w .
+$rm conftest* out/*
+rmdir out
+cd ..
+rmdir conftest
+$rm -r conftest 2>/dev/null
+
+fi
+
+compiler_c_o=$lt_cv_compiler_c_o
+echo "$ac_t""$compiler_c_o" 1>&6
+
+if test x"$compiler_c_o" = x"yes"; then
+ # Check to see if we can write to a .lo
+ echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
+echo "configure:3062: checking if $compiler supports -c -o file.lo" >&5
+ if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ lt_cv_compiler_o_lo=no
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -c -o conftest.lo"
+ save_objext="$ac_objext"
+ ac_objext=lo
+ cat > conftest.$ac_ext <<EOF
+#line 3073 "configure"
+#include "confdefs.h"
+
+int main() {
+int some_variable = 0;
+; return 0; }
+EOF
+if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ lt_cv_compiler_o_lo=no
+ else
+ lt_cv_compiler_o_lo=yes
+ fi
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ ac_objext="$save_objext"
+ CFLAGS="$save_CFLAGS"
+
+fi
+
+ compiler_o_lo=$lt_cv_compiler_o_lo
+ echo "$ac_t""$compiler_o_lo" 1>&6
+else
+ compiler_o_lo=no
+fi
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# Check to see if we can do hard links to lock some files if needed
+hard_links="nottested"
+if test "$compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
+echo "configure:3115: checking if we can lock with hard links" >&5
+ 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
+ echo "$ac_t""$hard_links" 1>&6
+ if test "$hard_links" = no; then
+ echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+if test "$GCC" = yes; then
+ # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
+ echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
+echo "configure:3138: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
+ compiler_rtti_exceptions=no
+ cat > conftest.$ac_ext <<EOF
+#line 3144 "configure"
+#include "confdefs.h"
+
+int main() {
+int some_variable = 0;
+; return 0; }
+EOF
+if { (eval echo configure:3151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ compiler_rtti_exceptions=no
+ else
+ compiler_rtti_exceptions=yes
+ fi
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ CFLAGS="$save_CFLAGS"
+ echo "$ac_t""$compiler_rtti_exceptions" 1>&6
+
+ if test "$compiler_rtti_exceptions" = "yes"; then
+ no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
+ else
+ no_builtin_flag=' -fno-builtin'
+ fi
+fi
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# See if the linker supports building shared libraries.
+echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
+echo "configure:3182: checking whether the linker ($LD) supports shared libraries" >&5
+
+allow_undefined_flag=
+no_undefined_flag=
+need_lib_prefix=unknown
+need_version=unknown
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+archive_cmds=
+archive_expsym_cmds=
+old_archive_from_new_cmds=
+old_archive_from_expsyms_cmds=
+export_dynamic_flag_spec=
+whole_archive_flag_spec=
+thread_safe_flag_spec=
+hardcode_into_libs=no
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+hardcode_shlibpath_var=unsupported
+runpath_var=
+link_all_deplibs=unknown
+always_export_symbols=no
+export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
+# 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 egrep regular expression 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_"
+# 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.
+extract_expsyms_cmds=
+
+case $host_os in
+cygwin* | mingw* | pw32*)
+ # 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 "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX, the GNU linker is very broken
+ # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ ;;
+
+ amigaos*)
+ 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
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can use
+ # them.
+ ld_shlibs=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | egrep ': 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*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+
+ extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
+ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
+ test -f $output_objdir/impgen.exe || (cd $output_objdir && \
+ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
+ else $CC -o impgen impgen.c ; fi)~
+ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
+
+ old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
+
+ # cygwin and mingw dlls have different entry points and sets of symbols
+ # to exclude.
+ # FIXME: what about values for MSVC?
+ dll_entry=__cygwin_dll_entry@12
+ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
+ case $host_os in
+ mingw*)
+ # mingw values
+ dll_entry=_DllMainCRTStartup@12
+ dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
+ ;;
+ esac
+
+ # mingw and cygwin differ, and it's simplest to just exclude the union
+ # of the two symbol sets.
+ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
+
+ # recent cygwin and mingw systems supply a stub DllMain which the user
+ # can override, but on older systems we have to supply one (in ltdll.c)
+ if test "x$lt_cv_need_dllmain" = "xyes"; then
+ ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
+ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
+ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
+ else
+ ltdll_obj=
+ ltdll_cmds=
+ fi
+
+ # Extract the symbol export list from an `--export-all' def file,
+ # then regenerate the def file from the symbol export list, so that
+ # the compiled dll only exports the symbol export list.
+ # Be careful not to strip the DATA tag left be newer dlltools.
+ export_symbols_cmds="$ltdll_cmds"'
+ $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
+ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
+
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is.
+ # If DATA tags from a recent dlltool are present, honour them!
+ archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname-def;
+ else
+ echo EXPORTS > $output_objdir/$soname-def;
+ _lt_hint=1;
+ cat $export_symbols | while read symbol; do
+ set dummy \$symbol;
+ case \$# in
+ 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+ 4) echo " \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
+ *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
+ esac;
+ _lt_hint=`expr 1 + \$_lt_hint`;
+ done;
+ fi~
+ '"$ltdll_cmds"'
+ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
+ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
+ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
+ ;;
+
+ 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 -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<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.
+
+EOF
+ elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ 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
+ ;;
+
+ 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 | egrep ': supported targets:.* elf' > /dev/null; then
+ 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
+
+ if test "$ld_shlibs" = yes; then
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # dlltool doesn't understand --whole-archive et. al.
+ whole_archive_flag_spec=
+ ;;
+ *)
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ ;;
+ esac
+ 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 "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; 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
+ 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
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ 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.
+
+ hardcode_direct=yes
+ archive_cmds=''
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ 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'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ shared_flag='${wl}-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall can do strange things, so it is better to
+ # generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; 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'
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; 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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='${wl}-berok'
+ # This is a bit strange, but is similar to how AIX traditionally builds
+ # it's shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ 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
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # 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.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''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'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ ;;
+
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+ # We need to add '_' to the symbols in $export_symbols first
+ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ whole_archive_flag_spec='-all_load $convenience'
+ ;;
+
+ freebsd1*)
+ ld_shlibs=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* | kfreebsd*-gnu)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ case $host_os in
+ hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
+ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
+ esac
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_minus_L=yes # Not in the search PATH, but as the default
+ # location of the library.
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ link_all_deplibs=yes
+ ;;
+
+ 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
+ ;;
+
+ openbsd*)
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ #Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+
+ sco3.2v5*)
+ 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
+ export_dynamic_flag_spec='${wl}-Bexport'
+ ;;
+
+ solaris*)
+ # gcc --version < 3.0 without binutils cannot create self contained
+ # shared libraries reliably, requiring libgcc.a to resolve some of
+ # the object symbols generated in some cases. Libraries that use
+ # assert need libgcc.a to resolve __eprintf, for example. Linking
+ # a copy of libgcc.a into every shared library to guarantee resolving
+ # such symbols causes other problems: According to Tim Van Holder
+ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
+ # (to the application) exception stack for one thing.
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ case `$CC --version 2>/dev/null` in
+ [12].*)
+ cat <<EOF 1>&2
+
+*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
+*** create self contained shared libraries on Solaris systems, without
+*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
+*** -no-undefined support, which will at least allow you to build shared
+*** libraries. However, you may find that when you link such libraries
+*** into an application without using GCC, you have to manually add
+*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
+*** upgrade to a newer version of GCC. Another option is to rebuild your
+*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
+
+EOF
+ no_undefined_flag=
+ ;;
+ esac
+ fi
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ 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'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; 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'
+ ;;
+
+ sysv5*)
+ no_undefined_flag=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ 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'
+ hardcode_libdir_flag_spec=
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ 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.2uw2*)
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5uw7* | unixware7*)
+ no_undefined_flag='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+echo "$ac_t""$ld_shlibs" 1>&6
+test "$ld_shlibs" = no && can_build_shared=no
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# Check hardcoding attributes.
+echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
+echo "configure:3885: checking how to hardcode library paths into programs" >&5
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var"; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct" != no &&
+ # 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 "$hardcode_shlibpath_var" != no &&
+ test "$hardcode_minus_L" != no; 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
+echo "$ac_t""$hardcode_action" 1>&6
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+striplib=
+old_striplib=
+echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
+echo "configure:3917: checking whether stripping libraries is possible" >&5
+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"
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+##
+## END FIXME
+
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+## FIXME: this should be a separate macro
+##
+# PORTME Fill in your ld.so characteristics
+echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
+echo "configure:3935: checking dynamic linker characteristics" >&5
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+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"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}.so$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
+ 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
+ # AIX (on Power*) has no versioning support, so currently we can
+ # not hardcode correct soname into executable. Probably we can
+ # add versioning support to collect2, so additional links can
+ # be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # 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}.so$versuffix ${libname}${release}.so$major $libname.so'
+ else
+ # 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}.so$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ hardcode_into_libs=yes
+ ;;
+
+amigaos*)
+ 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $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'
+ ;;
+
+beos*)
+ library_names_spec='${libname}.so'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$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"
+ export_dynamic_flag_spec=-rdynamic
+ # 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*)
+ version_type=windows
+ need_version=no
+ need_lib_prefix=no
+ case $GCC,$host_os in
+ yes,cygwin*)
+ library_names_spec='$libname.dll.a'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+ postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog .libs/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ ;;
+ yes,mingw*)
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
+ ;;
+ yes,pw32*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
+ ;;
+ *)
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # 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
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes.
+ library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
+ soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU/FreeBSD ld.so'
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ *)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ 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.
+ dynamic_linker="$host_os dld.sl"
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
+ soname_spec='${libname}${release}.sl$major'
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *) version_type=irix ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 ") 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}"
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # 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
+
+ # 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}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
+ soname_spec='${libname}${release}.so$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
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case "$host_os" in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+os2*)
+ libname_spec='$name'
+ need_lib_prefix=no
+ library_names_spec='$libname.dll $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_version=no
+ need_lib_prefix=no
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ 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"
+ hardcode_into_libs=yes
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ 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
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
+ soname_spec='$libname.so.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$ac_t""$dynamic_linker" 1>&6
+test "$dynamic_linker" = no && can_build_shared=no
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# Report the final consequences.
+echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
+echo "configure:4363: checking if libtool supports shared libraries" >&5
+echo "$ac_t""$can_build_shared" 1>&6
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
+echo "configure:4371: checking whether to build shared libraries" >&5
+test "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+echo "$ac_t""$enable_shared" 1>&6
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
+echo "configure:4398: checking whether to build static libraries" >&5
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$ac_t""$enable_static" 1>&6
+##
+## END FIXME
+
+if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "x$enable_dlopen" != xyes; 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
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ *)
+ echo $ac_n "checking for shl_load""... $ac_c" 1>&6
+echo "configure:4441: checking for shl_load" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4446 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load();
+
+int main() {
+
+/* 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_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+shl_load();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_shl_load=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_shl_load=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="shl_load"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
+echo "configure:4487: checking for shl_load in -ldld" >&5
+ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4495 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load();
+
+int main() {
+shl_load()
+; return 0; }
+EOF
+if { (eval echo configure:4506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dlopen""... $ac_c" 1>&6
+echo "configure:4525: checking for dlopen" >&5
+if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4530 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+
+/* 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_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+dlopen();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_dlopen=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_dlopen=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dlopen"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "configure:4571: checking for dlopen in -ldl" >&5
+ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4579 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo configure:4590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
+echo "configure:4609: checking for dlopen in -lsvld" >&5
+ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsvld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4617 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo configure:4628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
+echo "configure:4647: checking for dld_link in -ldld" >&5
+ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4655 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link();
+
+int main() {
+dld_link()
+; return 0; }
+EOF
+if { (eval echo configure:4666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
+echo "configure:4722: checking whether a program can dlopen itself" >&5
+if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; 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 <<EOF
+#line 4732 "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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=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;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo configure:4793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+
+echo "$ac_t""$lt_cv_dlopen_self" 1>&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
+echo "configure:4816: checking whether a statically linked program can dlopen itself" >&5
+if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; 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 <<EOF
+#line 4826 "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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=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;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo configure:4887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+
+echo "$ac_t""$lt_cv_dlopen_self_static" 1>&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
+
+
+## FIXME: this should be a separate macro
+##
+if test "$enable_shared" = yes && test "$GCC" = yes; 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.
+ echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
+echo "configure:4938: checking whether -lc should be explicitly linked in" >&5
+ if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ $rm conftest*
+ echo 'static int dummy;' > conftest.$ac_ext
+
+ if { (eval echo configure:4945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_cv_prog_cc_wl
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { (eval echo configure:4958: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+fi
+
+ echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
+ ;;
+ esac
+fi
+need_lc=${lt_cv_archive_cmds_need_lc-yes}
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# The second clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ :
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
+fi
+
+if test -f "$ltmain"; then
+ trap "$rm \"${ofile}T\"; exit 1" 1 2 15
+ $rm -f "${ofile}T"
+
+ echo creating $ofile
+
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS SED \
+ AR AR_FLAGS CC LD LN_S NM SHELL \
+ reload_flag reload_cmds wl \
+ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
+ thread_safe_flag_spec whole_archive_flag_spec libname_spec \
+ library_names_spec soname_spec \
+ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
+ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
+ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
+ old_striplib striplib file_magic_cmd export_symbols_cmds \
+ deplibs_check_method allow_undefined_flag no_undefined_flag \
+ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
+ global_symbol_to_c_name_address \
+ hardcode_libdir_flag_spec hardcode_libdir_separator \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
+
+ case $var in
+ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
+ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ cat <<__EOF__ > "${ofile}T"
+#! $SHELL
+
+# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996-2000 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="${SED} -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$need_lc
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# The default C compiler.
+CC=$lt_CC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_pic_flag
+pic_mode=$pic_mode
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_compiler_c_o
+
+# Can we write directly to a .lo ?
+compiler_o_lo=$lt_compiler_o_lo
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# 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
+
+# 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
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_link_static_flag
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_no_builtin_flag
+
+# 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
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# 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
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# 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 and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# 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
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# 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.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# 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
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# 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
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_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
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "${ofile}T"
+
+# 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 "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2*)
+ cat <<'EOF' >> "${ofile}T"
+ # This is a source program that is used to create dlls on Windows
+ # Don't remove nor modify the starting and closing comments
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+ # This is a source program that is used to create import libraries
+ # on Windows for dlls which lack them. Don't remove nor modify the
+ # starting and closing comments
+# /* impgen.c starts here */
+# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
+#
+# This file is part of GNU libtool.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# */
+#
+# #include <stdio.h> /* for printf() */
+# #include <unistd.h> /* for open(), lseek(), read() */
+# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
+# #include <string.h> /* for strdup() */
+#
+# /* O_BINARY isn't required (or even defined sometimes) under Unix */
+# #ifndef O_BINARY
+# #define O_BINARY 0
+# #endif
+#
+# static unsigned int
+# pe_get16 (fd, offset)
+# int fd;
+# int offset;
+# {
+# unsigned char b[2];
+# lseek (fd, offset, SEEK_SET);
+# read (fd, b, 2);
+# return b[0] + (b[1]<<8);
+# }
+#
+# static unsigned int
+# pe_get32 (fd, offset)
+# int fd;
+# int offset;
+# {
+# unsigned char b[4];
+# lseek (fd, offset, SEEK_SET);
+# read (fd, b, 4);
+# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# static unsigned int
+# pe_as32 (ptr)
+# void *ptr;
+# {
+# unsigned char *b = ptr;
+# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# int
+# main (argc, argv)
+# int argc;
+# char *argv[];
+# {
+# int dll;
+# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
+# unsigned long export_rva, export_size, nsections, secptr, expptr;
+# unsigned long name_rvas, nexp;
+# unsigned char *expdata, *erva;
+# char *filename, *dll_name;
+#
+# filename = argv[1];
+#
+# dll = open(filename, O_RDONLY|O_BINARY);
+# if (dll < 1)
+# return 1;
+#
+# dll_name = filename;
+#
+# for (i=0; filename[i]; i++)
+# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
+# dll_name = filename + i +1;
+#
+# pe_header_offset = pe_get32 (dll, 0x3c);
+# opthdr_ofs = pe_header_offset + 4 + 20;
+# num_entries = pe_get32 (dll, opthdr_ofs + 92);
+#
+# if (num_entries < 1) /* no exports */
+# return 1;
+#
+# export_rva = pe_get32 (dll, opthdr_ofs + 96);
+# export_size = pe_get32 (dll, opthdr_ofs + 100);
+# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
+# secptr = (pe_header_offset + 4 + 20 +
+# pe_get16 (dll, pe_header_offset + 4 + 16));
+#
+# expptr = 0;
+# for (i = 0; i < nsections; i++)
+# {
+# char sname[8];
+# unsigned long secptr1 = secptr + 40 * i;
+# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
+# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
+# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
+# lseek(dll, secptr1, SEEK_SET);
+# read(dll, sname, 8);
+# if (vaddr <= export_rva && vaddr+vsize > export_rva)
+# {
+# expptr = fptr + (export_rva - vaddr);
+# if (export_rva + export_size > vaddr + vsize)
+# export_size = vsize - (export_rva - vaddr);
+# break;
+# }
+# }
+#
+# expdata = (unsigned char*)malloc(export_size);
+# lseek (dll, expptr, SEEK_SET);
+# read (dll, expdata, export_size);
+# erva = expdata - export_rva;
+#
+# nexp = pe_as32 (expdata+24);
+# name_rvas = pe_as32 (expdata+32);
+#
+# printf ("EXPORTS\n");
+# for (i = 0; i<nexp; i++)
+# {
+# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
+# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
+# }
+#
+# return 0;
+# }
+# /* impgen.c ends here */
+
+EOF
+ ;;
+ esac
+
+ # 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" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
+
+ mv -f "${ofile}T" "$ofile" || \
+ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
+ chmod +x "$ofile"
+fi
+##
+## END FIXME
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
+echo "configure:5554: checking for $ac_hdr that defines DIR" >&5
+if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5559 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:5567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ ac_header_dirent=$ac_hdr; break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
+echo "configure:5592: checking for opendir in -ldir" >&5
+ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldir $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5600 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:5611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -ldir"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:5633: checking for opendir in -lx" >&5
+ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lx $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5641 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:5652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lx"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:5675: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5680 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 5705 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ 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 > conftest.$ac_ext <<EOF
+#line 5723 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ 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 > conftest.$ac_ext <<EOF
+#line 5744 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#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)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:5755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6
+echo "configure:5779: checking whether closedir returns void" >&5
+if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_closedir_void=yes
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5787 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_header_dirent>
+int closedir(); main() { exit(closedir(opendir(".")) != 0); }
+EOF
+if { (eval echo configure:5793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_closedir_void=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_closedir_void=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_closedir_void" 1>&6
+if test $ac_cv_func_closedir_void = yes; then
+ cat >> confdefs.h <<\EOF
+#define CLOSEDIR_VOID 1
+EOF
+
+fi
+
+for ac_hdr in assert.h float.h limits.h memory.h pwd.h stdlib.h \
+ string.h strings.h sys/param.h unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5820: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5825 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+for ac_func in putenv
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5860: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5865 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:5888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+LTLIBOBJS="$LTLIBOBJS putenv.lo"
+fi
+done
+
+for ac_func in strcasecmp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5916: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5921 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:5944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+LTLIBOBJS="$LTLIBOBJS strcasecmp.lo"
+fi
+done
+
+for ac_func in strtol
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5972: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5977 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+LTLIBOBJS="$LTLIBOBJS strtol.lo"
+fi
+done
+
+for ac_func in strstr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6028: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6033 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+LTLIBOBJS="$LTLIBOBJS strstr.lo"
+fi
+done
+
+
+
+for ac_func in bcmp bcopy bzero getcwd getwd index memcmp memcpy rindex strchr strrchr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6086: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6091 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:6140: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6145 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* 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";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 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 saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:6194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+
+# Check whether struct stat provides high-res time.
+echo $ac_n "checking for st_mtim in struct stat""... $ac_c" 1>&6
+echo "configure:6217: checking for st_mtim in struct stat" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_st_mtim'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6222 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+int main() {
+struct stat s; s.st_mtim;
+; return 0; }
+EOF
+if { (eval echo configure:6230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_struct_st_mtim=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_struct_st_mtim=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_st_mtim" 1>&6
+if test $ac_cv_struct_st_mtim = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ST_MTIM 1
+EOF
+
+fi
+
+
+# Check whether prototypes work.
+echo $ac_n "checking whether the compiler accepts prototypes""... $ac_c" 1>&6
+echo "configure:6253: checking whether the compiler accepts prototypes" >&5
+if eval "test \"`echo '$''{'kb_cv_c_prototypes'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6258 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+int main() {
+extern void foo(int i,...);
+; return 0; }
+EOF
+if { (eval echo configure:6265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ kb_cv_c_prototypes=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ kb_cv_c_prototypes=no
+fi
+rm -f conftest*
+fi
+echo "$ac_t""$kb_cv_c_prototypes" 1>&6
+if test "$kb_cv_c_prototypes" = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PROTOTYPES 1
+EOF
+
+fi
+
+# This is a GNU libc invention.
+echo $ac_n "checking whether program_invocation_name is predefined""... $ac_c" 1>&6
+echo "configure:6286: checking whether program_invocation_name is predefined" >&5
+if eval "test \"`echo '$''{'kb_cv_var_program_inv_name'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6291 "configure"
+#include "confdefs.h"
+
+int main() {
+extern char *program_invocation_name; program_invocation_name = "love";
+; return 0; }
+EOF
+if { (eval echo configure:6298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ kb_cv_var_program_inv_name=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ kb_cv_var_program_inv_name=no
+fi
+rm -f conftest*
+fi
+echo "$ac_t""$kb_cv_var_program_inv_name" 1>&6
+if test "$kb_cv_var_program_inv_name" = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PROGRAM_INVOCATION_NAME 1
+EOF
+
+fi
+
+if test $ac_cv_func_getcwd = yes; then
+# We only need to run this if we have getcwd.
+echo $ac_n "checking whether getcwd uses fork or vfork""... $ac_c" 1>&6
+echo "configure:6320: checking whether getcwd uses fork or vfork" >&5
+if eval "test \"`echo '$''{'kb_cv_func_getcwd_forks'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ kb_cv_func_getcwd_forks=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6328 "configure"
+#include "confdefs.h"
+
+int fork() { exit(1); }
+int vfork() { exit(1); }
+extern char *getcwd();
+char path[100];
+int main() {
+getcwd(path,100);
+return 0;
+}
+EOF
+if { (eval echo configure:6340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ kb_cv_func_getcwd_forks=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ kb_cv_func_getcwd_forks=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$kb_cv_func_getcwd_forks" 1>&6
+if test $kb_cv_func_getcwd_forks = yes; then
+ cat >> confdefs.h <<\EOF
+#define GETCWD_FORKS 1
+EOF
+
+fi
+fi
+
+# Common --with and --enable options.
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:6365: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-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
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+ if test "x$USE_MAINTAINER_MODE" = xyes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+
+
+
+echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6
+echo "configure:6384: checking for loader (symbol LD)" >&5
+if eval "test \"`echo '$''{'cf_cv_subst_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+test -z "$LD" && LD=ld
+cf_cv_subst_LD=$LD
+fi
+
+LD=${cf_cv_subst_LD}
+echo "$ac_t""$LD" 1>&6
+
+
+echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6
+echo "configure:6398: checking for archiver (symbol AR)" >&5
+if eval "test \"`echo '$''{'cf_cv_subst_AR'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+test -z "$AR" && AR=ar
+cf_cv_subst_AR=$AR
+fi
+
+AR=${cf_cv_subst_AR}
+echo "$ac_t""$AR" 1>&6
+
+
+echo $ac_n "checking for archiver options (symbol ARFLAGS)""... $ac_c" 1>&6
+echo "configure:6412: checking for archiver options (symbol ARFLAGS)" >&5
+if eval "test \"`echo '$''{'cf_cv_subst_ARFLAGS'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+test -z "$ARFLAGS" && ARFLAGS=rc
+cf_cv_subst_ARFLAGS=$ARFLAGS
+fi
+
+ARFLAGS=${cf_cv_subst_ARFLAGS}
+echo "$ac_t""$ARFLAGS" 1>&6
+
+
+
+# Check whether --with-mktexmf-default or --without-mktexmf-default was given.
+if test "${with_mktexmf_default+set}" = set; then
+ withval="$with_mktexmf_default"
+ :
+else
+ with_mktexmf_default=yes
+fi
+
+# Check whether --with-mktexpk-default or --without-mktexpk-default was given.
+if test "${with_mktexpk_default+set}" = set; then
+ withval="$with_mktexpk_default"
+ :
+else
+ with_mktexpk_default=yes
+fi
+
+# Check whether --with-mktextfm-default or --without-mktextfm-default was given.
+if test "${with_mktextfm_default+set}" = set; then
+ withval="$with_mktextfm_default"
+ :
+else
+ with_mktextfm_default=yes
+fi
+
+# Check whether --with-mkocp-default or --without-mkocp-default was given.
+if test "${with_mkocp_default+set}" = set; then
+ withval="$with_mkocp_default"
+ :
+else
+ with_mkocp_default=yes
+fi
+
+# Check whether --with-mkofm-default or --without-mkofm-default was given.
+if test "${with_mkofm_default+set}" = set; then
+ withval="$with_mkofm_default"
+ :
+else
+ with_mkofm_default=yes
+fi
+
+# Check whether --with-mktexfmt-default or --without-mktexfmt-default was given.
+if test "${with_mktexfmt_default+set}" = set; then
+ withval="$with_mktexfmt_default"
+ :
+fi
+
+# Check whether --with-mktextex-default or --without-mktextex-default was given.
+if test "${with_mktextex_default+set}" = set; then
+ withval="$with_mktextex_default"
+ with_mktextex_default=yes
+else
+ with_mktextex_default=no
+fi
+
+
+echo $ac_n "checking where the main texmf tree is located""... $ac_c" 1>&6
+echo "configure:6482: checking where the main texmf tree is located" >&5
+texmfmain=
+if test "x$datadir" != 'x${prefix}/share'; then
+ # First case, datadir is defined...
+ eval p=\"$datadir\"
+ # Unconditionally set the directory, but...
+ texmfmain=`echo "$p/texmf" | sed 's,//*,/,g'`
+ # ... do complain if it wasn't found.
+ if test -d "$texmfmain"; then
+ echo "$ac_t"""$texmfmain"" 1>&6
+ else
+ echo "$ac_t""not found" 1>&6
+ echo "configure: warning: No texmf tree found at $texmfmain.
+ *****************************************************************
+ * Error: The main texmf tree was not found. *
+ * If you do not have the files, you should be able to them from *
+ * the same place you got these sources from, or from one of the *
+ * CTAN hosts. *
+ *****************************************************************
+ Winging it." 1>&2
+ fi
+else
+ # Second case, datadir is default...
+ if test "x$prefix" = "xNONE"; then
+ p="$ac_default_prefix"
+ else
+ eval p=\"$prefix\"
+ fi
+ for e in share/texmf lib/texmf texmf; do
+ if test -d "$p/$e"; then
+ texmfmain='${prefix}'/"$e"
+ break
+ fi
+ done
+ if test -z "$texmfmain" && test "x$prefix" = "xNONE"; then
+ # Still no texmfmain found, no prefix set, perhaps kpsewhich is
+ # installed and can help us out.
+ texmfmain=`kpsewhich --expand-path='$TEXMFMAIN'` 2>/dev/null
+ fi
+ texmfmain=`echo "$texmfmain" | sed 's,//*,/,g'`
+ if test -n "$texmfmain"; then
+ echo "$ac_t"""$texmfmain"" 1>&6
+ else
+ eval texmfmain="$datadir/texmf"
+ echo "$ac_t""not found" 1>&6
+ echo "configure: warning: The main texmf tree was not found at $texmfmain.
+ *****************************************************************
+ * Error: The main texmf tree was not found. *
+ * Use the --datadir option to specify its parent directory. *
+ * If you do not have the files, you should be able to them from *
+ * the same place you got these sources from, or from one of the *
+ * CTAN hosts. *
+ *****************************************************************
+ Winging it by pretending $texmfmain is correct." 1>&2
+ fi
+fi
+
+
+
+# Implementation of those options.
+if test "x$with_mktexmf_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_MF_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mktexpk_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_PK_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mktextex_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_TEX_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mktexfmt_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_FMT_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mktextfm_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_TFM_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mkocp_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_OMEGA_OCP_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mkofm_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_OMEGA_OFM_BY_DEFAULT 1
+EOF
+
+fi
+
+# Is libm present. FIXME: do we need it at all?
+echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
+echo "configure:6587: checking for main in -lm" >&5
+ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6595 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:6602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lm $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+# If you're cross-compiling, these macros set up the variables in
+# ../make/cross.mk: BUILDCC, BUILDCFLAGS, BUILDCCLD etc.
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDCC}"; then
+ BUILDCC='cc'
+ fi
+ echo "$ac_t""setting \$BUILDCC to ${BUILDCC}" 1>&6
+else
+ if test -n "${BUILDCC}"; then
+ echo "configure: warning: \$BUILDCC set but not cross-compiling." 1>&2
+ fi
+ BUILDCC='$(CC)'
+fi
+
+
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDCFLAGS}"; then
+ BUILDCFLAGS='$(BUILDXCFLAGS)'
+ fi
+ echo "$ac_t""setting \$BUILDCFLAGS to ${BUILDCFLAGS}" 1>&6
+else
+ if test -n "${BUILDCFLAGS}"; then
+ echo "configure: warning: \$BUILDCFLAGS set but not cross-compiling." 1>&2
+ fi
+ BUILDCFLAGS='$(CFLAGS)'
+fi
+
+
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDCPPFLAGS}"; then
+ BUILDCPPFLAGS='$(BUILDXCPPFLAGS)'
+ fi
+ echo "$ac_t""setting \$BUILDCPPFLAGS to ${BUILDCPPFLAGS}" 1>&6
+else
+ if test -n "${BUILDCPPFLAGS}"; then
+ echo "configure: warning: \$BUILDCPPFLAGS set but not cross-compiling." 1>&2
+ fi
+ BUILDCPPFLAGS='$(CPPFLAGS)'
+fi
+
+
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDLDFLAGS}"; then
+ BUILDLDFLAGS='$(BUILDXLDFLAGS)'
+ fi
+ echo "$ac_t""setting \$BUILDLDFLAGS to ${BUILDLDFLAGS}" 1>&6
+else
+ if test -n "${BUILDLDFLAGS}"; then
+ echo "configure: warning: \$BUILDLDFLAGS set but not cross-compiling." 1>&2
+ fi
+ BUILDLDFLAGS='$(LDFLAGS)'
+fi
+
+
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDCCLD}"; then
+ BUILDCCLD='$(BUILDCC)'
+ fi
+ echo "$ac_t""setting \$BUILDCCLD to ${BUILDCCLD}" 1>&6
+else
+ if test -n "${BUILDCCLD}"; then
+ echo "configure: warning: \$BUILDCCLD set but not cross-compiling." 1>&2
+ fi
+ BUILDCCLD='$(CCLD)'
+fi
+
+
+
+
+ac_config_files="$ac_config_files Makefile"
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# 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. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# 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.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+
+trap 'rm -fr `echo "$ac_config_files c-auto.h:c-auto.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@KPSEVERSION@%$KPSEVERSION%g
+s%@CC@%$CC%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@LN_S@%$LN_S%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@OBJEXT@%$OBJEXT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@ECHO@%$ECHO%g
+s%@RANLIB@%$RANLIB%g
+s%@STRIP@%$STRIP%g
+s%@CPP@%$CPP%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@LTLIBOBJS@%$LTLIBOBJS%g
+s%@MAINT@%$MAINT%g
+s%@LD@%$LD%g
+s%@AR@%$AR%g
+s%@ARFLAGS@%$ARFLAGS%g
+s%@texmfmain@%$texmfmain%g
+s%@BUILDCC@%$BUILDCC%g
+s%@BUILDCFLAGS@%$BUILDCFLAGS%g
+s%@BUILDCPPFLAGS@%$BUILDCPPFLAGS%g
+s%@BUILDLDFLAGS@%$BUILDLDFLAGS%g
+s%@BUILDCCLD@%$BUILDCCLD%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"$ac_config_files"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*|[A-z]:/*) # Absolute path.
+ srcdir="$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ "") ;;
+ [/$]*|[A-z]:/*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ rm -f conftest.in
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%g" -e "s%^%$ac_given_srcdir/%"`
+ cat $ac_file_inputs > conftest.in
+ #
+ # Replace lines of the form ac_include foo with the contents of foo:
+ # first, from the ac_include lines construct a list of file names.
+ # From that list, we construct a second list of those files that exist.
+ # Then we construct lists of sed commands for including those files,
+ # and a sed command that removes the ac_include lines. We don't attempt
+ # to read non-existent files because some (buggy) versions of sed choke
+ # on this. Have to use sed because old (Ultrix, SunOS) awk does not support
+ # getline or system. (Anyway, configure scripts aren't supposed to use awk.)
+ # Can't use only one -e and commands {dr foo} because foo has to be last.
+ # Be careful, because the filename may contain /. Be careful with
+ # whitespace; we need to use echo.
+ #
+ file_substs=`sed -n '/^ac_include/s%ac_include[ ]*\(.*\)%\1%p' conftest.in`
+ # Create the sed command line ...
+ if test -n "$file_substs"; then
+ echo "configure: warning: ac_include is obsolete; instead use kpse_include" 1>&2
+ file_subst_cmd="sed -e 's/^ac_include/kpse_include/'"
+ else
+ file_subst_cmd='sed'
+ fi
+ kpse_substs=`sed -n '/^kpse_include/s%kpse_include[ ]*\(.*\)%\1%p' conftest.in`
+ for ac_inc in $file_substs $kpse_substs; do
+ if test -f "$ac_given_srcdir/$ac_inc"; then
+ ac_mung=`echo $ac_inc | sed 's,/,%,g'`
+ file_subst_cmd="$file_subst_cmd -e '/^kpse_include $ac_mung$/r $ac_given_srcdir/$ac_inc'"
+ fi
+ done
+ file_subst_cmd="$file_subst_cmd -e '/^kpse_include/d'"
+ # ... and fix the whitespace and escaped slashes.
+ file_subst_cmd=`echo "$file_subst_cmd" | sed -e 's,%,\\\/,g' \
+-e 's/kpse_include /kpse_include[ ]*/g'`
+ # I can't find any way to do variable substitution in the sed commands
+ # (so the user could have, e.g., $top_srcdir in their ac_include line).
+ (eval $file_subst_cmd conftest.in) \
+ | sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s* conftest.in
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ].*$%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS=" c-auto.h:c-auto.in"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%g" -e "s%^%$ac_given_srcdir/%"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #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.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+date >stamp-auto
+
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+if test "$no_recursion" != yes; then
+
+ # Remove --cache-file and --srcdir arguments so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ for ac_arg in $ac_configure_args; do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case "$ac_arg" in
+ -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=*)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+ esac
+ done
+
+ for ac_config_dir in : $subdirs; do
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ if test ! -d $srcdir/$ac_config_dir; then
+ continue
+ fi
+
+ echo configuring in $ac_config_dir
+
+ case "$srcdir" in
+ .) ;;
+ *)
+ if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
+ else
+ { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
+ fi
+ ;;
+ esac
+
+ ac_popdir=`pwd`
+ cd $ac_config_dir
+
+ # A "../" for each directory in /$ac_config_dir.
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+
+ case "$srcdir" in
+ .) # No --srcdir option. We are building in place.
+ ac_sub_srcdir=$srcdir ;;
+ /*|[A-z]:/*) # Absolute path.
+ ac_sub_srcdir=$srcdir/$ac_config_dir ;;
+ *) # Relative path.
+ ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
+ esac
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f ./configure; then
+ ac_sub_configure=./configure
+ elif test -f $ac_sub_srcdir/configure; then
+ ac_sub_configure=$ac_sub_srcdir/configure
+ elif test -f $ac_sub_srcdir/configure.in; then
+ ac_sub_configure=$ac_configure
+ else
+ echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+
+ # Make the cache file name correct relative to the subdirectory.
+ case "$cache_file" in
+ /*|[A-z]:/*) ac_sub_cache_file=$cache_file ;;
+ *) # Relative path.
+ ac_sub_cache_file="$ac_dots$cache_file" ;;
+ esac
+ case "$ac_given_INSTALL" in
+ "") ;;
+ [/$]*|[A-z]:/*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
+ # The eval makes quoting arguments work.
+ if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
+ then :
+ else
+ { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
+ fi
+ fi
+
+ cd $ac_popdir
+ done
+fi
+
diff --git a/Build/source/texk/kpathsea/configure.in b/Build/source/texk/kpathsea/configure.in
new file mode 100644
index 00000000000..c37074f465c
--- /dev/null
+++ b/Build/source/texk/kpathsea/configure.in
@@ -0,0 +1,11 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(pathsearch.c)
+
+KPSEVERSION=3.5.5
+AC_SUBST(KPSEVERSION)
+AC_DEFINE_UNQUOTED(KPSEVERSION, "kpathsea version $KPSEVERSION")
+
+sinclude(common.ac)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/kpathsea/db.c b/Build/source/texk/kpathsea/db.c
new file mode 100644
index 00000000000..2062f5ba229
--- /dev/null
+++ b/Build/source/texk/kpathsea/db.c
@@ -0,0 +1,704 @@
+/* db.c: an external database to avoid filesystem lookups.
+
+ Copyright 1997-2005 Olaf Weber.
+ Copyright 1994, 95, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/absolute.h>
+#include <kpathsea/c-stat.h>
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/db.h>
+#include <kpathsea/hash.h>
+#include <kpathsea/line.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/readable.h>
+#include <kpathsea/str-list.h>
+#include <kpathsea/tex-file.h>
+#include <kpathsea/variable.h>
+
+static hash_table_type db; /* The hash table for all the ls-R's. */
+/* SMALL: The old size of the hash table was 7603, with the assumption
+ that a minimal ls-R bas about 3500 entries. But a typical ls-R will
+ be more like double that size. */
+#ifndef DB_HASH_SIZE
+#define DB_HASH_SIZE 15991
+#endif
+#ifndef DB_NAME
+#define DB_NAME "ls-R"
+#endif
+#ifndef DB_NAME_LC
+#define DB_NAME_LC "ls-r"
+#endif
+
+static const_string db_names[] = {
+ DB_NAME,
+ DB_NAME_LC,
+ NULL
+};
+
+static hash_table_type alias_db;
+#ifndef ALIAS_NAME
+#define ALIAS_NAME "aliases"
+#endif
+#ifndef ALIAS_HASH_SIZE
+#define ALIAS_HASH_SIZE 1009
+#endif
+
+static str_list_type db_dir_list;
+
+/* If DIRNAME contains any element beginning with a `.' (that is more
+ than just `./'), return true. This is to allow ``hidden''
+ directories -- ones that don't get searched. */
+
+static boolean
+ignore_dir_p P1C(const_string, dirname)
+{
+ const_string dot_pos = dirname;
+
+ while ((dot_pos = strchr (dot_pos + 1, '.'))) {
+ /* If / before and no / after, skip it. */
+ if (IS_DIR_SEP (dot_pos[-1]) && dot_pos[1] && !IS_DIR_SEP (dot_pos[1]))
+ return true;
+ }
+
+ return false;
+}
+
+/* If no DB_FILENAME, return false (maybe they aren't using this feature).
+ Otherwise, add entries from DB_FILENAME to TABLE, and return true. */
+
+static boolean
+db_build P2C(hash_table_type *, table, const_string, db_filename)
+{
+ string line;
+ unsigned dir_count = 0, file_count = 0, ignore_dir_count = 0;
+ unsigned len = strlen (db_filename) - sizeof (DB_NAME) + 1; /* Keep the /. */
+ string top_dir = (string)xmalloc (len + 1);
+ string cur_dir = NULL; /* First thing in ls-R might be a filename. */
+ FILE *db_file = fopen (db_filename, FOPEN_R_MODE);
+
+ strncpy (top_dir, db_filename, len);
+ top_dir[len] = 0;
+
+ if (db_file) {
+ while ((line = read_line (db_file)) != NULL) {
+ len = strlen (line);
+
+ /* A line like `/foo:' = new dir foo. Allow both absolute (/...)
+ and explicitly relative (./...) names here. It's a kludge to
+ pass in the directory name with the trailing : still attached,
+ but it doesn't actually hurt. */
+ if (len > 0 && line[len - 1] == ':' && kpse_absolute_p (line, true)) {
+ /* New directory line. */
+ if (!ignore_dir_p (line)) {
+ /* If they gave a relative name, prepend full directory name now. */
+ line[len - 1] = DIR_SEP;
+ /* Skip over leading `./', it confuses `match' and is just a
+ waste of space, anyway. This will lose on `../', but `match'
+ won't work there, either, so it doesn't matter. */
+ cur_dir = *line == '.' ? concat (top_dir, line + 2) : xstrdup (line);
+ dir_count++;
+ } else {
+ cur_dir = NULL;
+ ignore_dir_count++;
+ }
+
+ /* Ignore blank, `.' and `..' lines. */
+ } else if (*line != 0 && cur_dir /* a file line? */
+ && !(*line == '.'
+ && (line[1] == 0 || (line[1] == '.' && line[2] == 0))))
+ {
+ /* Make a new hash table entry with a key of `line' and a data
+ of `cur_dir'. An already-existing identical key is ok, since
+ a file named `foo' can be in more than one directory. Share
+ `cur_dir' among all its files (and hence never free it).
+
+ Note that we assume that all names in the ls-R file have already
+ been case-smashed to lowercase where appropriate.
+ */
+ hash_insert_normalized (table, xstrdup (line), cur_dir);
+ file_count++;
+
+ } /* else ignore blank lines or top-level files
+ or files in ignored directories*/
+
+ free (line);
+ }
+
+ xfclose (db_file, db_filename);
+
+ if (file_count == 0) {
+ WARNING1 ("kpathsea: No usable entries in %s", db_filename);
+ WARNING ("kpathsea: See the manual for how to generate ls-R");
+ db_file = NULL;
+ } else {
+ str_list_add (&db_dir_list, xstrdup (top_dir));
+ }
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) {
+ /* Don't make this a debugging bit, since the output is so
+ voluminous, and being able to specify -1 is too useful.
+ Instead, let people who want it run the program under
+ a debugger and change the variable that way. */
+ boolean hash_summary_only = true;
+
+ DEBUGF4 ("%s: %u entries in %d directories (%d hidden).\n",
+ db_filename, file_count, dir_count, ignore_dir_count);
+ DEBUGF ("ls-R hash table:");
+ hash_print (*table, hash_summary_only);
+ fflush (stderr);
+ }
+#endif /* KPSE_DEBUG */
+ }
+
+ free (top_dir);
+
+ return db_file != NULL;
+}
+
+
+/* Insert FNAME into the hash table. This is for files that get built
+ during a run. We wouldn't want to reread all of ls-R, even if it got
+ rebuilt. */
+
+void
+kpse_db_insert P1C(const_string, passed_fname)
+{
+ /* We might not have found ls-R, or even had occasion to look for it
+ yet, so do nothing if we have no hash table. */
+ if (db.buckets) {
+ const_string dir_part;
+ string fname = xstrdup (passed_fname);
+ string baseptr = (string)xbasename (fname);
+ const_string file_part = xstrdup (baseptr);
+
+ *baseptr = '\0'; /* Chop off the filename. */
+ dir_part = fname; /* That leaves the dir, with the trailing /. */
+
+ /* Note that we do not assuse that these names have been normalized. */
+ hash_insert (&db, file_part, dir_part);
+ }
+}
+
+/* Return true if FILENAME could be in PATH_ELT, i.e., if the directory
+ part of FILENAME matches PATH_ELT. Have to consider // wildcards, but
+ $ and ~ expansion have already been done. */
+
+static boolean
+match P2C(const_string, filename, const_string, path_elt)
+{
+ const_string original_filename = filename;
+ boolean matched = false;
+
+ for (; *filename && *path_elt; filename++, path_elt++) {
+ if (FILECHARCASEEQ (*filename, *path_elt)) /* normal character match */
+ ;
+
+ else if (IS_DIR_SEP (*path_elt) /* at // */
+ && original_filename < filename && IS_DIR_SEP (path_elt[-1])) {
+ while (IS_DIR_SEP (*path_elt))
+ path_elt++; /* get past second and any subsequent /'s */
+ if (*path_elt == 0) {
+ /* Trailing //, matches anything. We could make this part of the
+ other case, but it seems pointless to do the extra work. */
+ matched = true;
+ break;
+ } else {
+ /* Intermediate //, have to match rest of PATH_ELT. */
+ for (; !matched && *filename; filename++) {
+ /* Try matching at each possible character. */
+ if (IS_DIR_SEP (filename[-1])
+ && FILECHARCASEEQ (*filename, *path_elt))
+ matched = match (filename, path_elt);
+ }
+ /* Prevent filename++ when *filename='\0'. */
+ break;
+ }
+ }
+
+ else /* normal character nonmatch, quit */
+ break;
+ }
+
+ /* If we've reached the end of PATH_ELT, check that we're at the last
+ component of FILENAME, we've matched. */
+ if (!matched && *path_elt == 0) {
+ /* Probably PATH_ELT ended with `vf' or some such, and FILENAME ends
+ with `vf/ptmr.vf'. In that case, we'll be at a directory
+ separator. On the other hand, if PATH_ELT ended with a / (as in
+ `vf/'), FILENAME being the same `vf/ptmr.vf', we'll be at the
+ `p'. Upshot: if we're at a dir separator in FILENAME, skip it.
+ But if not, that's ok, as long as there are no more dir separators. */
+ if (IS_DIR_SEP (*filename))
+ filename++;
+
+ while (*filename && !IS_DIR_SEP (*filename))
+ filename++;
+ matched = *filename == 0;
+ }
+
+ return matched;
+}
+
+
+/* If DB_DIR is a prefix of PATH_ELT, return true; otherwise false.
+ That is, the question is whether to try the db for a file looked up
+ in PATH_ELT. If PATH_ELT == ".", for example, the answer is no. If
+ PATH_ELT == "/usr/local/lib/texmf/fonts//tfm", the answer is yes.
+
+ In practice, ls-R is only needed for lengthy subdirectory
+ comparisons, but there's no gain to checking PATH_ELT to see if it is
+ a subdir match, since the only way to do that is to do a string
+ search in it, which is all we do anyway. */
+
+static boolean
+elt_in_db P2C(const_string, db_dir, const_string, path_elt)
+{
+ boolean found = false;
+
+ while (!found && FILECHARCASEEQ (*db_dir++, *path_elt++)) {
+ /* If we've matched the entire db directory, it's good. */
+ if (*db_dir == 0)
+ found = true;
+
+ /* If we've reached the end of PATH_ELT, but not the end of the db
+ directory, it's no good. */
+ else if (*path_elt == 0)
+ break;
+ }
+
+ return found;
+}
+
+/* If ALIAS_FILENAME exists, read it into TABLE. */
+
+static boolean
+alias_build P2C(hash_table_type *, table, const_string, alias_filename)
+{
+ string line, real, alias;
+ unsigned count = 0;
+ FILE *alias_file = fopen (alias_filename, FOPEN_R_MODE);
+
+ if (alias_file) {
+ while ((line = read_line (alias_file)) != NULL) {
+ /* comments or empty */
+ if (*line == 0 || *line == '%' || *line == '#') {
+ ;
+ } else {
+ /* Each line should have two fields: realname aliasname. */
+ real = line;
+ while (*real && ISSPACE (*real))
+ real++;
+ alias = real;
+ while (*alias && !ISSPACE (*alias))
+ alias++;
+ *alias++ = 0;
+ while (*alias && ISSPACE (*alias))
+ alias++;
+ /* Is the check for errors strong enough? Should we warn the user
+ for potential errors? */
+ if (strlen (real) != 0 && strlen (alias) != 0) {
+ /* Stuff in the alias file should be normalized. */
+ hash_insert_normalized (table, xstrdup (alias), xstrdup (real));
+ count++;
+ }
+ }
+ free (line);
+ }
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) {
+ /* As with ls-R above ... */
+ boolean hash_summary_only = true;
+ DEBUGF2 ("%s: %u aliases.\n", alias_filename, count);
+ DEBUGF ("alias hash table:");
+ hash_print (*table, hash_summary_only);
+ fflush (stderr);
+ }
+#endif /* KPSE_DEBUG */
+
+ xfclose (alias_file, alias_filename);
+ }
+
+ return alias_file != NULL;
+}
+
+/* Initialize the path for ls-R files, and read them all into the hash
+ table `db'. If no usable ls-R's are found, set db.buckets to NULL. */
+
+void
+kpse_init_db P1H(void)
+{
+ boolean ok = false;
+ const_string db_path;
+ string *db_files;
+ string *orig_db_files;
+
+ assert(sizeof(DB_NAME) == sizeof(DB_NAME_LC));
+
+ db_path = kpse_init_format (kpse_db_format);
+ db_files = kpse_all_path_search_list (db_path, db_names);
+ orig_db_files = db_files;
+
+ /* Must do this after the path searching (which ends up calling
+ kpse_db_search recursively), so db.buckets stays NULL. */
+ db = hash_create (DB_HASH_SIZE);
+
+ while (db_files && *db_files) {
+ if (db_build (&db, *db_files))
+ ok = true;
+ free (*db_files);
+ db_files++;
+ }
+
+ if (!ok) {
+ /* If db can't be built, leave `size' nonzero (so we don't
+ rebuild it), but clear `buckets' (so we don't look in it). */
+ free (db.buckets);
+ db.buckets = NULL;
+ }
+
+ free (orig_db_files);
+
+ /* Add the content of any alias databases. There may exist more than
+ one alias file along DB_NAME files. This duplicates the above code
+ -- should be a function. */
+ ok = false;
+ db_files = kpse_all_path_search (db_path, ALIAS_NAME);
+ orig_db_files = db_files;
+
+ alias_db = hash_create (ALIAS_HASH_SIZE);
+
+ while (db_files && *db_files) {
+ if (alias_build (&alias_db, *db_files))
+ ok = true;
+ free (*db_files);
+ db_files++;
+ }
+
+ if (!ok) {
+ free (alias_db.buckets);
+ alias_db.buckets = NULL;
+ }
+
+ free (orig_db_files);
+}
+
+/* Avoid doing anything if this PATH_ELT is irrelevant to the databases. */
+
+str_list_type *
+kpse_db_search P3C(const_string, name, const_string, orig_path_elt,
+ boolean, all)
+{
+ string *db_dirs, *orig_dirs, *r;
+ const_string last_slash;
+ string path_elt;
+ boolean done;
+ str_list_type *ret;
+ unsigned e;
+ string *aliases = NULL;
+ boolean relevant = false;
+
+ /* If we failed to build the database (or if this is the recursive
+ call to build the db path), quit. */
+ if (db.buckets == NULL)
+ return NULL;
+
+ /* When tex-glyph.c calls us looking for, e.g., dpi600/cmr10.pk, we
+ won't find it unless we change NAME to just `cmr10.pk' and append
+ `/dpi600' to PATH_ELT. We are justified in using a literal `/'
+ here, since that's what tex-glyph.c unconditionally uses in
+ DPI_BITMAP_SPEC. But don't do anything if the / begins NAME; that
+ should never happen. */
+ last_slash = strrchr (name, '/');
+ if (last_slash && last_slash != name) {
+ unsigned len = last_slash - name + 1;
+ string dir_part = (string)xmalloc (len);
+ strncpy (dir_part, name, len - 1);
+ dir_part[len - 1] = 0;
+ path_elt = concat3 (orig_path_elt, "/", dir_part);
+ name = last_slash + 1;
+ } else
+ path_elt = (string) orig_path_elt;
+
+ /* Don't bother doing any lookups if this `path_elt' isn't covered by
+ any of database directories. We do this not so much because the
+ extra couple of hash lookups matter -- they don't -- but rather
+ because we want to return NULL in this case, so path_search can
+ know to do a disk search. */
+ for (e = 0; !relevant && e < STR_LIST_LENGTH (db_dir_list); e++) {
+ relevant = elt_in_db (STR_LIST_ELT (db_dir_list, e), path_elt);
+ }
+ if (!relevant)
+ return NULL;
+
+ /* If we have aliases for this name, use them. */
+ if (alias_db.buckets)
+ aliases = hash_lookup (alias_db, name);
+
+ if (!aliases) {
+ aliases = XTALLOC1 (string);
+ aliases[0] = NULL;
+ }
+ { /* Push aliases up by one and insert the original name at the front. */
+ unsigned i;
+ unsigned len = 1; /* Have NULL element already allocated. */
+ for (r = aliases; *r; r++)
+ len++;
+ XRETALLOC (aliases, len + 1, string);
+ for (i = len; i > 0; i--) {
+ aliases[i] = aliases[i - 1];
+ }
+ aliases[0] = (string) name;
+ }
+
+ done = false;
+ for (r = aliases; !done && *r; r++) {
+ string ctry = *r;
+
+ /* We have an ls-R db. Look up `try'. */
+ orig_dirs = db_dirs = hash_lookup (db, ctry);
+
+ ret = XTALLOC1 (str_list_type);
+ *ret = str_list_init ();
+
+ /* For each filename found, see if it matches the path element. For
+ example, if we have .../cx/cmr10.300pk and .../ricoh/cmr10.300pk,
+ and the path looks like .../cx, we don't want the ricoh file. */
+ while (!done && db_dirs && *db_dirs) {
+ string db_file = concat (*db_dirs, ctry);
+ boolean matched = match (db_file, path_elt);
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH))
+ DEBUGF3 ("db:match(%s,%s) = %d\n", db_file, path_elt, matched);
+#endif
+
+ /* We got a hit in the database. Now see if the file actually
+ exists, possibly under an alias. */
+ if (matched) {
+ string found = NULL;
+ if (kpse_readable_file (db_file)) {
+ found = db_file;
+
+ } else {
+ string *a;
+
+ free (db_file); /* `db_file' wasn't on disk. */
+
+ /* The hit in the DB doesn't exist in disk. Now try all its
+ aliases. For example, suppose we have a hierarchy on CD,
+ thus `mf.bas', but ls-R contains `mf.base'. Find it anyway.
+ Could probably work around this with aliases, but
+ this is pretty easy and shouldn't hurt. The upshot is that
+ if one of the aliases actually exists, we use that. */
+ for (a = aliases + 1; *a && !found; a++) {
+ string atry = concat (*db_dirs, *a);
+ if (kpse_readable_file (atry))
+ found = atry;
+ else
+ free (atry);
+ }
+ }
+
+ /* If we have a real file, add it to the list, maybe done. */
+ if (found) {
+ str_list_add (ret, found);
+ if (!all && found)
+ done = true;
+ }
+ } else { /* no match in the db */
+ free (db_file);
+ }
+
+
+ /* On to the next directory, if any. */
+ db_dirs++;
+ }
+
+ /* This is just the space for the pointers, not the strings. */
+ if (orig_dirs && *orig_dirs)
+ free (orig_dirs);
+ }
+
+ free (aliases);
+
+ /* If we had to break up NAME, free the temporary PATH_ELT. */
+ if (path_elt != orig_path_elt)
+ free (path_elt);
+
+ return ret;
+}
+
+str_list_type *
+kpse_db_search_list P3C(const_string*, names, const_string, path_elt,
+ boolean, all)
+{
+ string *db_dirs, *orig_dirs, *r;
+ const_string last_slash, name, path;
+ boolean done;
+ str_list_type *ret;
+ unsigned e;
+ string *aliases;
+ boolean relevant = false;
+ int n;
+
+ /* If we failed to build the database (or if this is the recursive
+ call to build the db path), quit. */
+ if (db.buckets == NULL)
+ return NULL;
+
+ /* Don't bother doing any lookups if this `path_elt' isn't covered by
+ any of database directories. We do this not so much because the
+ extra couple of hash lookups matter -- they don't -- but rather
+ because we want to return NULL in this case, so path_search can
+ know to do a disk search. */
+ for (e = 0; !relevant && e < STR_LIST_LENGTH (db_dir_list); e++) {
+ relevant = elt_in_db (STR_LIST_ELT (db_dir_list, e), path_elt);
+ }
+ if (!relevant)
+ return NULL;
+
+ done = false;
+ /* Handle each name. */
+ for (n = 0; !done && names[n]; n++) {
+ name = names[n];
+
+ /* Absolute names should have been caught in our caller. */
+ if (kpse_absolute_p(name, true))
+ continue;
+
+ /* When tex-glyph.c calls us looking for, e.g., dpi600/cmr10.pk, we
+ won't find it unless we change NAME to just `cmr10.pk' and append
+ `/dpi600' to PATH_ELT. We are justified in using a literal `/'
+ here, since that's what tex-glyph.c unconditionally uses in
+ DPI_BITMAP_SPEC. But don't do anything if the / begins NAME; that
+ should never happen. */
+ last_slash = strrchr (name, '/');
+ if (last_slash && last_slash != name) {
+ unsigned len = last_slash - name + 1;
+ string dir_part = (string)xmalloc (len);
+ strncpy (dir_part, name, len - 1);
+ dir_part[len - 1] = 0;
+ path = concat3 (path_elt, "/", dir_part);
+ name = last_slash + 1;
+ free(dir_part);
+ } else {
+ path = path_elt;
+ }
+
+ /* If we have aliases for this name, use them. */
+ if (alias_db.buckets)
+ aliases = hash_lookup (alias_db, name);
+ else
+ aliases = NULL;
+
+ if (!aliases) {
+ aliases = XTALLOC1 (string);
+ aliases[0] = NULL;
+ }
+ { /* Push aliases up by one and insert the original name at the front. */
+ unsigned i;
+ unsigned len = 1; /* Have NULL element already allocated. */
+ for (r = aliases; *r; r++)
+ len++;
+ XRETALLOC (aliases, len + 1, string);
+ for (i = len; i > 0; i--) {
+ aliases[i] = aliases[i - 1];
+ }
+ aliases[0] = (string) name;
+ }
+
+ for (r = aliases; !done && *r; r++) {
+ string ctry = *r;
+
+ /* We have an ls-R db. Look up `try'. */
+ orig_dirs = db_dirs = hash_lookup (db, ctry);
+
+ ret = XTALLOC1 (str_list_type);
+ *ret = str_list_init ();
+
+ /* For each filename found, see if it matches the path element. For
+ example, if we have .../cx/cmr10.300pk and .../ricoh/cmr10.300pk,
+ and the path looks like .../cx, we don't want the ricoh file. */
+ while (!done && db_dirs && *db_dirs) {
+ string db_file = concat (*db_dirs, ctry);
+ boolean matched = match (db_file, path);
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH))
+ DEBUGF3 ("db:match(%s,%s) = %d\n", db_file, path, matched);
+#endif
+
+ /* We got a hit in the database. Now see if the file actually
+ exists, possibly under an alias. */
+ if (matched) {
+ string found = NULL;
+ if (kpse_readable_file (db_file)) {
+ found = db_file;
+
+ } else {
+ string *a;
+
+ free (db_file); /* `db_file' wasn't on disk. */
+
+ /* The hit in the DB doesn't exist in disk. Now try all its
+ aliases. For example, suppose we have a hierarchy on CD,
+ thus `mf.bas', but ls-R contains `mf.base'. Find it anyway.
+ Could probably work around this with aliases, but
+ this is pretty easy and shouldn't hurt. The upshot is that
+ if one of the aliases actually exists, we use that. */
+ for (a = aliases + 1; *a && !found; a++) {
+ string atry = concat (*db_dirs, *a);
+ if (kpse_readable_file (atry))
+ found = atry;
+ else
+ free (atry);
+ }
+ }
+
+ /* If we have a real file, add it to the list, maybe done. */
+ if (found) {
+ str_list_add (ret, found);
+ if (!all && found)
+ done = true;
+ }
+ } else { /* no match in the db */
+ free (db_file);
+ }
+
+ /* On to the next directory, if any. */
+ db_dirs++;
+ }
+
+ /* This is just the space for the pointers, not the strings. */
+ if (orig_dirs && *orig_dirs)
+ free (orig_dirs);
+ }
+
+ free (aliases);
+ if (path != path_elt)
+ free((string)path);
+ }
+ return ret;
+
+}
+
diff --git a/Build/source/texk/kpathsea/db.h b/Build/source/texk/kpathsea/db.h
new file mode 100644
index 00000000000..b4e03b7ab9a
--- /dev/null
+++ b/Build/source/texk/kpathsea/db.h
@@ -0,0 +1,49 @@
+/* db.h: lookups in an externally built db file.
+
+ Copyright 1999, 2003, 2005 Olaf Weber.
+ Copyright 1994, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_DB_H
+#define KPATHSEA_DB_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+#include <kpathsea/str-list.h>
+
+/* Initialize the database. Until this is called, no ls-R matches will
+ be found. */
+extern void kpse_init_db P1H(void);
+
+/* Return list of matches for NAME in the ls-R file matching PATH_ELT. If
+ ALL is set, return (null-terminated list) of all matches, else just
+ the first. If no matches, return a pointer to an empty list. If no
+ databases can be read, or PATH_ELT is not in any of the databases,
+ return NULL. */
+extern str_list_type *kpse_db_search P3H(const_string name,
+ const_string path_elt, boolean all);
+
+extern str_list_type *kpse_db_search_list P3H(const_string* names,
+ const_string path_elt,
+ boolean all);
+
+/* Insert the filename FNAME into the database.
+ Called by mktexpk et al. */
+extern KPSEDLL void kpse_db_insert P1H(const_string fname);
+
+#endif /* not KPATHSEA_DB_H */
diff --git a/Build/source/texk/kpathsea/debug.c b/Build/source/texk/kpathsea/debug.c
new file mode 100644
index 00000000000..6cfb9e419a8
--- /dev/null
+++ b/Build/source/texk/kpathsea/debug.c
@@ -0,0 +1,54 @@
+/* debug.c: Help the user discover what's going on.
+
+ Copyright 1993, 94 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#ifdef KPSE_DEBUG /* whole file */
+
+unsigned kpathsea_debug = 0;
+
+/* If the real definitions of fopen or fclose are macros, we lose -- the
+ #undef won't restore them. */
+
+FILE *
+fopen P2C(const_string, filename, const_string, mode)
+{
+#undef fopen
+ FILE *ret = fopen (filename, mode);
+
+ if (KPSE_DEBUG_P (KPSE_DEBUG_FOPEN))
+ DEBUGF3 ("fopen(%s, %s) => 0x%lx\n", filename, mode, (unsigned long) ret);
+
+ return ret;
+}
+
+int
+fclose P1C(FILE *, f)
+{
+#undef fclose
+ int ret = fclose (f);
+
+ if (KPSE_DEBUG_P (KPSE_DEBUG_FOPEN))
+ DEBUGF2 ("fclose(0x%lx) => %d\n", (unsigned long) f, ret);
+
+ return ret;
+}
+
+#endif /* KPSE DEBUG */
diff --git a/Build/source/texk/kpathsea/debug.h b/Build/source/texk/kpathsea/debug.h
new file mode 100644
index 00000000000..9321d182ae2
--- /dev/null
+++ b/Build/source/texk/kpathsea/debug.h
@@ -0,0 +1,100 @@
+/* debug.h: Runtime tracing.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1993, 94, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_DEBUG_H
+#define KPATHSEA_DEBUG_H
+
+/* If NO_DEBUG is defined (not recommended), skip all this. */
+#ifndef NO_DEBUG
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/c-std.h>
+#include <kpathsea/types.h>
+
+#if defined(WIN32)
+#if defined(_DEBUG)
+/* This was needed at some time for catching errors in pdftex. */
+#include <crtdbg.h>
+#define SET_CRT_DEBUG_FIELD(a) \
+ _CrtSetDbgFlag((a) | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
+#define CLEAR_CRT_DEBUG_FIELD(a) \
+ _CrtSetDbgFlag(~(a) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
+#define SETUP_CRTDBG \
+ { _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); \
+ _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); \
+ _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); \
+ _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); \
+ _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); \
+ _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );\
+ }
+#else /* ! _DEBUG */
+#define SET_CRT_DEBUG_FIELD(a)
+#define CLEAR_CRT_DEBUG_FIELD(a)
+#define SETUP_CRTDBG
+#endif /* _DEBUG */
+#endif /* WIN32 */
+
+/* OK, we'll have tracing support. */
+#define KPSE_DEBUG
+
+/* Bit vector defining what we should trace. */
+extern KPSEDLL unsigned kpathsea_debug;
+
+/* Set a bit. */
+#define KPSE_DEBUG_SET(bit) kpathsea_debug |= 1 << (bit)
+
+/* Test if a bit is on. */
+#define KPSE_DEBUG_P(bit) (kpathsea_debug & (1 << (bit)))
+
+#define KPSE_DEBUG_STAT 0 /* stat calls */
+#define KPSE_DEBUG_HASH 1 /* hash lookups */
+#define KPSE_DEBUG_FOPEN 2 /* fopen/fclose calls */
+#define KPSE_DEBUG_PATHS 3 /* search path initializations */
+#define KPSE_DEBUG_EXPAND 4 /* path element expansion */
+#define KPSE_DEBUG_SEARCH 5 /* searches */
+#define KPSE_DEBUG_VARS 6 /* variable values */
+#define KPSE_LAST_DEBUG KPSE_DEBUG_VARS
+
+/* A printf for the debugging. */
+#define DEBUGF_START() do { fputs ("kdebug:", stderr)
+#define DEBUGF_END() fflush (stderr); } while (0)
+
+#define DEBUGF(str) \
+ DEBUGF_START (); fputs (str, stderr); DEBUGF_END ()
+#define DEBUGF1(str, e1) \
+ DEBUGF_START (); fprintf (stderr, str, e1); DEBUGF_END ()
+#define DEBUGF2(str, e1, e2) \
+ DEBUGF_START (); fprintf (stderr, str, e1, e2); DEBUGF_END ()
+#define DEBUGF3(str, e1, e2, e3) \
+ DEBUGF_START (); fprintf (stderr, str, e1, e2, e3); DEBUGF_END ()
+#define DEBUGF4(str, e1, e2, e3, e4) \
+ DEBUGF_START (); fprintf (stderr, str, e1, e2, e3, e4); DEBUGF_END ()
+
+#undef fopen
+#define fopen kpse_fopen_trace
+extern KPSEDLL FILE *fopen P2H(const_string filename, const_string mode);
+#undef fclose
+#define fclose kpse_fclose_trace
+extern KPSEDLL int fclose P1H(FILE *);
+
+#endif /* not NO_DEBUG */
+
+#endif /* not KPATHSEA_DEBUG_H */
diff --git a/Build/source/texk/kpathsea/default.h b/Build/source/texk/kpathsea/default.h
new file mode 100644
index 00000000000..860d712e467
--- /dev/null
+++ b/Build/source/texk/kpathsea/default.h
@@ -0,0 +1,34 @@
+/* default.h: Declare default path expander.
+
+ Copyright 1993, 94 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_DEFAULT_H
+#define KPATHSEA_DEFAULT_H
+
+#include <kpathsea/types.h>
+#include <kpathsea/c-proto.h>
+
+
+/* Replace a leading or trailing or doubled : in PATH with DFLT. If
+ no extra colons, return PATH. Only one extra colon is replaced.
+ DFLT may not be NULL. */
+
+extern string kpse_expand_default P2H(const_string path, const_string dflt);
+
+#endif /* not KPATHSEA_DEFAULT_H */
diff --git a/Build/source/texk/kpathsea/depend.mak b/Build/source/texk/kpathsea/depend.mak
new file mode 100644
index 00000000000..3182cfb7e45
--- /dev/null
+++ b/Build/source/texk/kpathsea/depend.mak
@@ -0,0 +1,1307 @@
+$(objdir)/pathsearch.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-fopen.h \
+ $(kpathseadir)/absolute.h \
+ $(kpathseadir)/expand.h \
+ $(kpathseadir)/db.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/readable.h \
+ $(kpathseadir)/variable.h
+
+$(objdir)/strtol.obj: \
+ config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/remote.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/str-list.h \
+ $(geturldir)/geturl.h
+
+$(objdir)/xopendir.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/xopendir.h
+
+$(objdir)/tex-make.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-fopen.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/concatn.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/db.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/fn.h \
+ $(kpathseadir)/magstep.h \
+ $(kpathseadir)/readable.h \
+ $(kpathseadir)/tex-make.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/variable.h
+
+$(objdir)/getopt.obj: \
+ config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ getopt.h
+
+$(objdir)/concat3.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/uppercasify.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/kpsewhich.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/expand.h \
+ $(kpathseadir)/getopt.h \
+ $(kpathseadir)/line.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/proginit.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/tex-glyph.h \
+ $(kpathseadir)/variable.h
+
+$(objdir)/kpsestat.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-stat.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/xgetcwd.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-dir.h \
+ $(kpathseadir)/xopendir.h \
+ $(kpathseadir)/xstat.h \
+ $(kpathseadir)/c-stat.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/db.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/absolute.h \
+ $(kpathseadir)/c-stat.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-fopen.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(kpathseadir)/db.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/line.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/readable.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/variable.h
+
+$(objdir)/expand.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/expand.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/tilde.h \
+ $(kpathseadir)/variable.h \
+ $(kpathseadir)/concatn.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/absolute.h \
+ $(kpathseadir)/str-list.h
+
+$(objdir)/concatn.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/concatn.h \
+ $(kpathseadir)/c-vararg.h
+
+$(objdir)/make-suffix.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/rm-suffix.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/xfseek.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/truncate.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-namemx.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-pathmx.h \
+ $(kpathseadir)/truncate.h
+
+$(objdir)/dir.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-dir.h \
+ $(kpathseadir)/c-stat.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h
+
+$(objdir)/tilde.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/tilde.h
+
+$(objdir)/str-llist.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/str-llist.h
+
+$(objdir)/progname.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/absolute.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-stat.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h
+
+$(objdir)/fn.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/fn.h
+
+$(objdir)/kpsecheck.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/getopt.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/proginit.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h \
+ $(gsw32dir)/gs32lib.h \
+ ../../gstools/ghostscript/src/gsdll.h \
+ ../../gstools/ghostscript/src/iapi.h \
+ ../../gstools/ghostscript/src/errors.h \
+ $(regexdir)/fnmatch.h
+
+$(objdir)/find-suffix.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/xcalloc.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/access.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/xstrdup.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/xputenv.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/path-elt.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h
+
+$(objdir)/xrealloc.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/concat.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/xfopen.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/xdirname.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/str-list.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/str-list.h
+
+$(objdir)/elt-dirs.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/expand.h \
+ $(kpathseadir)/fn.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/xopendir.h
+
+$(objdir)/proginit.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/proginit.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h
+
+$(objdir)/version.obj: \
+ c-auto.h \
+ $(kpathseadir)/c-proto.h
+
+$(objdir)/line.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/line.h
+
+$(objdir)/xftell.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/getopt1.obj: \
+ config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ getopt.h
+
+$(objdir)/readlink.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathmx.h \
+ $(kpathseadir)/c-stat.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/variable.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/cnf.h \
+ $(kpathseadir)/fn.h \
+ $(kpathseadir)/variable.h
+
+$(objdir)/tex-glyph.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/absolute.h \
+ $(kpathseadir)/expand.h \
+ $(kpathseadir)/fontmap.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/tex-glyph.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/tex-make.h \
+ $(kpathseadir)/variable.h
+
+$(objdir)/strcasecmp.obj: \
+ config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/file-p.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/xstat.h \
+ $(kpathseadir)/c-stat.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/magstep.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/magstep.h
+
+$(objdir)/tex-file.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-fopen.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/cnf.h \
+ $(kpathseadir)/concatn.h \
+ $(kpathseadir)/default.h \
+ $(kpathseadir)/expand.h \
+ $(kpathseadir)/fontmap.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/paths.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/tex-make.h \
+ $(kpathseadir)/variable.h
+
+$(objdir)/fontmap.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-fopen.h \
+ $(kpathseadir)/fontmap.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/line.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h
+
+$(objdir)/debug.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/remote.h
+
+$(objdir)/atou.obj: \
+ config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/xmalloc.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/hash.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/str-list.h
+
+$(objdir)/xstat.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/xstat.h \
+ $(kpathseadir)/c-stat.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/readable.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-stat.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(kpathseadir)/readable.h \
+ $(kpathseadir)/tex-hush.h \
+ $(kpathseadir)/truncate.h
+
+$(objdir)/kdefault.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/default.h
+
+$(objdir)/cnf.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-fopen.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/cnf.h \
+ $(kpathseadir)/db.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/line.h \
+ $(kpathseadir)/paths.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/variable.h
+
+$(objdir)/xbasename.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h
+
+$(objdir)/win32hash.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/hash.h \
+ $(kpathseadir)/str-list.h \
+ $(kpathseadir)/remote.h
+
+$(objdir)/tex-hush.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/pathsearch.h \
+ $(kpathseadir)/str-llist.h \
+ $(kpathseadir)/tex-hush.h \
+ $(kpathseadir)/variable.h
+
+$(objdir)/extend-fname.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h
+
+$(objdir)/absolute.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/absolute.h \
+ $(kpathseadir)/c-pathch.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h
+
diff --git a/Build/source/texk/kpathsea/depend.mk b/Build/source/texk/kpathsea/depend.mk
new file mode 100644
index 00000000000..39cf08cca7a
--- /dev/null
+++ b/Build/source/texk/kpathsea/depend.mk
@@ -0,0 +1,615 @@
+absolute.lo: absolute.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h
+access.o: access.c \
+ $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+atou.lo: atou.c config.h $(kpathsea_dir)/c-auto.h $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+cnf.lo: cnf.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-fopen.h \
+ $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/c-pathch.h \
+ $(kpathsea_srcdir)/cnf.h $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h \
+ $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h $(kpathsea_dir)/paths.h \
+ $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-file.h \
+ $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/variable.h
+concat3.lo: concat3.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+concat.lo: concat.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+concatn.lo: concatn.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/c-vararg.h
+db.lo: db.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-stat.h \
+ $(kpathsea_srcdir)/c-fopen.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h \
+ $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h $(kpathsea_srcdir)/pathsearch.h \
+ $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/tex-file.h \
+ $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/variable.h
+debug.lo: debug.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+dir.lo: dir.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-dir.h \
+ $(kpathsea_srcdir)/c-stat.h \
+ $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h
+elt-dirs.lo: elt-dirs.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/fn.h $(kpathsea_srcdir)/pathsearch.h \
+ $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/xopendir.h $(kpathsea_srcdir)/c-dir.h
+expand.lo: expand.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \
+ $(kpathsea_srcdir)/tilde.h $(kpathsea_srcdir)/variable.h $(kpathsea_srcdir)/concatn.h \
+ $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/str-list.h
+extend-fname.lo: extend-fname.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+file-p.lo: file-p.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/xstat.h $(kpathsea_srcdir)/c-stat.h
+find-suffix.lo: find-suffix.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h
+fn.lo: fn.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/fn.h
+fontmap.lo: fontmap.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/c-fopen.h \
+ $(kpathsea_srcdir)/fontmap.h \
+ $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h $(kpathsea_srcdir)/pathsearch.h \
+ $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/tex-file.h \
+ $(kpathsea_srcdir)/c-vararg.h
+getopt1.lo: getopt1.c config.h $(kpathsea_dir)/c-auto.h $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+getopt.lo: getopt.c config.h $(kpathsea_dir)/c-auto.h $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+hash.lo: hash.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/hash.h \
+ $(kpathsea_srcdir)/str-list.h
+kdefault.lo: kdefault.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/default.h
+kpsestat.o: kpsestat.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-stat.h
+kpsewhich.o: kpsewhich.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/c-pathch.h \
+ $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/getopt.h $(kpathsea_srcdir)/line.h \
+ $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/proginit.h \
+ $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/tex-glyph.h \
+ $(kpathsea_srcdir)/variable.h
+line.lo: line.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/line.h
+magstep.lo: magstep.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/magstep.h
+make-suffix.lo: make-suffix.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h
+path-elt.lo: path-elt.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h
+pathsearch.lo: pathsearch.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/c-fopen.h \
+ $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/db.h \
+ $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \
+ $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/variable.h
+proginit.lo: proginit.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/c-vararg.h
+progname.lo: progname.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/c-stat.h \
+ $(kpathsea_srcdir)/pathsearch.h \
+ $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/c-vararg.h
+putenv.lo: putenv.c
+readable.lo: readable.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-stat.h \
+ $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/readable.h \
+ $(kpathsea_srcdir)/tex-hush.h $(kpathsea_srcdir)/truncate.h
+readlink.o: readlink.c \
+ $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathmx.h $(kpathsea_srcdir)/c-stat.h
+rm-suffix.lo: rm-suffix.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+strcasecmp.lo: strcasecmp.c config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+str-list.lo: str-list.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/str-list.h
+str-llist.lo: str-llist.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/str-llist.h
+strstr.lo: strstr.c
+strtol.lo: strtol.c config.h $(kpathsea_dir)/c-auto.h $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+tex-file.lo: tex-file.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-fopen.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/cnf.h $(kpathsea_srcdir)/concatn.h \
+ $(kpathsea_srcdir)/default.h $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/fontmap.h \
+ $(kpathsea_srcdir)/hash.h $(kpathsea_dir)/paths.h $(kpathsea_srcdir)/pathsearch.h \
+ $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/tex-make.h \
+ $(kpathsea_srcdir)/variable.h
+tex-glyph.lo: tex-glyph.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/fontmap.h \
+ $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \
+ $(kpathsea_srcdir)/tex-glyph.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/c-vararg.h \
+ $(kpathsea_srcdir)/tex-make.h $(kpathsea_srcdir)/variable.h
+tex-hush.lo: tex-hush.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-hush.h \
+ $(kpathsea_srcdir)/variable.h
+tex-make.lo: tex-make.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-fopen.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/db.h \
+ $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/fn.h $(kpathsea_srcdir)/magstep.h \
+ $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/tex-make.h $(kpathsea_srcdir)/tex-file.h \
+ $(kpathsea_srcdir)/variable.h
+tilde.lo: tilde.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/tilde.h
+truncate.lo: truncate.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-namemx.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/c-pathmx.h $(kpathsea_srcdir)/truncate.h
+uppercasify.lo: uppercasify.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-ctype.h
+variable.lo: variable.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/cnf.h \
+ $(kpathsea_srcdir)/fn.h $(kpathsea_srcdir)/variable.h
+version.lo: version.c c-auto.h $(kpathsea_srcdir)/c-proto.h
+xbasename.lo: xbasename.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h
+xcalloc.lo: xcalloc.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+xdirname.lo: xdirname.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h
+xfopen.lo: xfopen.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+xfseek.lo: xfseek.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+xftell.lo: xftell.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+xgetcwd.lo: xgetcwd.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/c-pathmx.h
+xmalloc.lo: xmalloc.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+xopendir.lo: xopendir.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/xopendir.h $(kpathsea_srcdir)/c-dir.h
+xputenv.lo: xputenv.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+xrealloc.lo: xrealloc.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
+xstat.lo: xstat.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h \
+ $(kpathsea_srcdir)/xstat.h $(kpathsea_srcdir)/c-stat.h
+xstrdup.lo: xstrdup.c $(kpathsea_srcdir)/config.h $(kpathsea_dir)/c-auto.h \
+ $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ getopt.h \
+ $(kpathsea_srcdir)/c-memstr.h \
+ $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
+ $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/progname.h
diff --git a/Build/source/texk/kpathsea/dir.c b/Build/source/texk/kpathsea/dir.c
new file mode 100644
index 00000000000..0add0c0ffef
--- /dev/null
+++ b/Build/source/texk/kpathsea/dir.c
@@ -0,0 +1,130 @@
+/* dir.c: directory operations.
+
+ Copyright 2000, 2002, 2005 Olaf Weber
+ Copyright 1992, 93, 94, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-dir.h>
+#include <kpathsea/c-stat.h>
+#include <kpathsea/hash.h>
+#include <kpathsea/pathsearch.h>
+
+/* Return true if FN is a directory or a symlink to a directory,
+ false if not. */
+
+boolean
+dir_p P1C(const_string, fn)
+{
+ /* FIXME : using the stat() replacement in gnuw32,
+ we could avoid this win32 specific code. However,
+ I wonder if it would be as fast as this one is ?
+ */
+#ifdef WIN32
+ int fa;
+
+ kpse_normalize_path((string)fn);
+ fa = GetFileAttributes(fn);
+
+ if (KPSE_DEBUG_P(KPSE_DEBUG_STAT)) {
+ if (fa == 0xFFFFFFFF) {
+ fprintf(stderr, "failed to get file attributes for %s (%d)\n",
+ fn, GetLastError());
+ } else {
+ fprintf(stderr, "path %s %s a directory\n",
+ fn , (fa & FILE_ATTRIBUTE_DIRECTORY) ?
+ "is" : "is not");
+ }
+ }
+ return (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
+#else
+ struct stat stats;
+ return stat (fn, &stats) == 0 && S_ISDIR (stats.st_mode);
+#endif
+}
+
+/*
+ Return -1 if FN isn't a directory, else its number of links.
+ Duplicate the call to stat; no need to incur overhead of a function
+ call for that little bit of cleanliness.
+
+ The process is a bit different under Win32 : the first call
+ memoizes the nlinks value, the following ones retrieve it.
+*/
+int
+dir_links P2C(const_string, fn, long, nlinks)
+{
+ static hash_table_type link_table;
+ string *hash_ret;
+
+ if (link_table.size == 0)
+ link_table = hash_create (457);
+
+#ifdef KPSE_DEBUG
+ /* This is annoying, but since we're storing integers as pointers, we
+ can't print them as strings. */
+ if (KPSE_DEBUG_P (KPSE_DEBUG_HASH))
+ kpse_debug_hash_lookup_int = true;
+#endif
+
+ hash_ret = hash_lookup (link_table, fn);
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_HASH))
+ kpse_debug_hash_lookup_int = false;
+#endif
+
+ /* Have to cast the int we need to/from the const_string that the hash
+ table stores for values. Let's hope an int fits in a pointer. */
+ if (hash_ret) {
+#ifdef WIN32
+ memcpy(&nlinks, hash_ret, sizeof(nlinks));
+#else
+ nlinks = (long) *hash_ret;
+#endif
+ } else {
+#ifdef WIN32
+ /* Insert it only if we have some informations about it. */
+ if (nlinks) {
+ char str_nlinks[sizeof(nlinks)+1];
+ memcpy(str_nlinks, (char *)&nlinks, sizeof(nlinks));
+ str_nlinks[sizeof(nlinks)] = '\0';
+ /* It's up to us to copy the value. */
+ hash_insert(&link_table, xstrdup(fn), (const_string)str_nlinks);
+ }
+#else
+ struct stat stats;
+ if (stat (fn, &stats) == 0 && S_ISDIR (stats.st_mode))
+ nlinks = stats.st_nlink;
+ else
+ nlinks = -1;
+ /* It's up to us to copy the value. */
+ hash_insert(&link_table, xstrdup(fn), (const_string)nlinks);
+#endif
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_STAT))
+ DEBUGF2 ("dir_links(%s) => %ld\n", fn, nlinks);
+#endif
+ }
+
+ /* In any case, return nlinks
+ (either 0, the value inserted or the value retrieved. */
+ return nlinks;
+}
diff --git a/Build/source/texk/kpathsea/elt-dirs.c b/Build/source/texk/kpathsea/elt-dirs.c
new file mode 100644
index 00000000000..92d41a5be3a
--- /dev/null
+++ b/Build/source/texk/kpathsea/elt-dirs.c
@@ -0,0 +1,504 @@
+/* elt-dirs.c: Translate a path element to its corresponding director{y,ies}.
+
+ Copyright 1997, 1998, 99, 2000, 2005, Olaf Weber.
+ Copyright 1993, 94, 95, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/expand.h>
+#include <kpathsea/fn.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/xopendir.h>
+
+/* To avoid giving prototypes for all the routines and then their real
+ definitions, we give all the subroutines first. The entry point is
+ the last routine in the file. */
+
+/* Make a copy of DIR (unless it's null) and save it in L. Ensure that
+ DIR ends with a DIR_SEP for the benefit of later searches. */
+
+static void
+dir_list_add P2C(str_llist_type *, l, const_string, dir)
+{
+ char last_char = dir[strlen (dir) - 1];
+ string saved_dir
+ = IS_DIR_SEP (last_char) || IS_DEVICE_SEP (last_char)
+ ? xstrdup (dir)
+ : concat (dir, DIR_SEP_STRING);
+
+ str_llist_add (l, saved_dir);
+}
+
+
+/* If DIR is a directory, add it to the list L. */
+
+static void
+checked_dir_list_add P2C(str_llist_type *, l, const_string, dir)
+{
+ if (dir_p (dir))
+ dir_list_add (l, dir);
+}
+
+/* The cache. Typically, several paths have the same element; for
+ example, /usr/local/lib/texmf/fonts//. We don't want to compute the
+ expansion of such a thing more than once. Even though we also cache
+ the dir_links call, that's not enough -- without this path element
+ caching as well, the execution time doubles. */
+
+typedef struct
+{
+ const_string key;
+ str_llist_type *value;
+} cache_entry;
+
+static cache_entry *the_cache = NULL;
+static unsigned cache_length = 0;
+
+
+/* Associate KEY with VALUE. We implement the cache as a simple linear
+ list, since it's unlikely to ever be more than a dozen or so elements
+ long. We don't bother to check here if PATH has already been saved;
+ we always add it to our list. We copy KEY but not VALUE; not sure
+ that's right, but it seems to be all that's needed. */
+
+static void
+cache P2C(const_string, key, str_llist_type *, value)
+{
+ cache_length++;
+ XRETALLOC (the_cache, cache_length, cache_entry);
+ the_cache[cache_length - 1].key = xstrdup (key);
+ the_cache[cache_length - 1].value = value;
+}
+
+
+/* To retrieve, just check the list in order. */
+
+static str_llist_type *
+cached P1C(const_string, key)
+{
+ unsigned p;
+
+ for (p = 0; p < cache_length; p++)
+ {
+ if (FILESTRCASEEQ (the_cache[p].key, key))
+ return the_cache[p].value;
+ }
+
+ return NULL;
+}
+
+/* Handle the magic path constructs. */
+
+/* Declare recursively called routine. */
+static void expand_elt P3H(str_llist_type *, const_string, unsigned);
+
+
+/* POST is a pointer into the original element (which may no longer be
+ ELT) to just after the doubled DIR_SEP, perhaps to the null. Append
+ subdirectories of ELT (up to ELT_LENGTH, which must be a /) to
+ STR_LIST_PTR. */
+
+#ifdef WIN32
+/* Shared across recursive calls, it acts like a stack. */
+static char dirname[MAX_PATH];
+#endif
+
+static void
+do_subdir P4C(str_llist_type *, str_list_ptr, const_string, elt,
+ unsigned, elt_length, const_string, post)
+{
+#ifdef WIN32
+ WIN32_FIND_DATA find_file_data;
+ HANDLE hnd;
+ int proceed;
+ int nlinks = 2;
+#else
+ DIR *dir;
+ struct dirent *e;
+#endif /* not WIN32 */
+ fn_type name;
+
+ /* Some old compilers don't allow aggregate initialization. */
+ name = fn_copy0 (elt, elt_length);
+
+ assert (IS_DIR_SEP (elt[elt_length - 1])
+ || IS_DEVICE_SEP (elt[elt_length - 1]));
+
+#if defined (WIN32)
+ strcpy(dirname, FN_STRING(name));
+ strcat(dirname, "/*.*"); /* "*.*" or "*" -- seems equivalent. */
+ hnd = FindFirstFile(dirname, &find_file_data);
+
+ if (hnd == INVALID_HANDLE_VALUE) {
+ fn_free(&name);
+ return;
+ }
+
+ /* Include top level before subdirectories, if nothing to match. */
+ if (*post == 0)
+ dir_list_add (str_list_ptr, FN_STRING (name));
+ else {
+ /* If we do have something to match, see if it exists. For
+ example, POST might be `pk/ljfour', and they might have a
+ directory `$TEXMF/fonts/pk/ljfour' that we should find. */
+ fn_str_grow (&name, post);
+ expand_elt (str_list_ptr, FN_STRING (name), elt_length);
+ fn_shrink_to (&name, elt_length);
+ }
+ proceed = 1;
+ while (proceed) {
+ if (find_file_data.cFileName[0] != '.') {
+ int links;
+
+ /* Construct the potential subdirectory name. */
+ fn_str_grow (&name, find_file_data.cFileName);
+
+ /* Maybe we have cached the leafness of this directory.
+ The function will return 0 if unknown,
+ else the actual (Unix-like) value. */
+ links = dir_links (FN_STRING (name), 0);
+
+ if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ unsigned potential_len = FN_LENGTH (name);
+ /* in any case, compute the leafness */
+ nlinks++;
+
+ /* It's a directory, so append the separator. */
+ fn_str_grow (&name, DIR_SEP_STRING);
+ if (*post != 0) {
+ fn_str_grow (&name, post);
+ /* Unfortunately we can't check if the new element is
+ a leaf directory, because we don't have a directory
+ name here, we just have a path spec. This means we
+ may descend into a leaf directory cm/pk, if the
+ spec is ...fonts//pk//. */
+ expand_elt (str_list_ptr, FN_STRING (name), potential_len);
+ fn_shrink_to (&name, potential_len);
+ }
+ /* Should we recurse? To see if the subdirectory is a
+ leaf, check if it has two links (one for . and one for
+ ..). This means that symbolic links to directories do
+ not affect the leaf-ness. This is arguably wrong, but
+ the only alternative I know of is to stat every entry
+ in the directory, and that is unacceptably slow. */
+
+ if (links == 0 || links > 2)
+ /* All criteria are met; find subdirectories. */
+ do_subdir (str_list_ptr, FN_STRING (name),
+ potential_len, post);
+ else if (*post == 0)
+ /* Nothing to match, no recursive subdirectories to
+ look for: we're done with this branch. Add it. */
+ dir_list_add (str_list_ptr, FN_STRING (name));
+ }
+ fn_shrink_to (&name, elt_length);
+ }
+ proceed = FindNextFile (hnd, &find_file_data);
+ }
+ /* Update the leafness of name. */
+ dir_links(FN_STRING(name), nlinks);
+ fn_free (&name);
+ FindClose(hnd);
+
+#else /* not WIN32 */
+
+ /* If we can't open it, quit. */
+ dir = opendir (FN_STRING (name));
+ if (dir == NULL)
+ {
+ fn_free (&name);
+ return;
+ }
+
+ /* Include top level before subdirectories, if nothing to match. */
+ if (*post == 0)
+ dir_list_add (str_list_ptr, FN_STRING (name));
+ else
+ { /* If we do have something to match, see if it exists. For
+ example, POST might be `pk/ljfour', and they might have a
+ directory `$TEXMF/fonts/pk/ljfour' that we should find. */
+ fn_str_grow (&name, post);
+ expand_elt (str_list_ptr, FN_STRING (name), elt_length);
+ fn_shrink_to (&name, elt_length);
+ }
+
+ while ((e = readdir (dir)) != NULL)
+ { /* If it begins with a `.', never mind. (This allows ``hidden''
+ directories that the algorithm won't find.) */
+ if (e->d_name[0] != '.')
+ {
+ int links;
+
+ /* Construct the potential subdirectory name. */
+ fn_str_grow (&name, e->d_name);
+
+ /* If we can't stat it, or if it isn't a directory, continue. */
+ links = dir_links (FN_STRING (name), 0);
+
+ if (links >= 0)
+ {
+ unsigned potential_len = FN_LENGTH (name);
+
+ /* It's a directory, so append the separator. */
+ fn_str_grow (&name, DIR_SEP_STRING);
+
+ if (*post != 0)
+ {
+ fn_str_grow (&name, post);
+ /* Unfortunately we can't check if the new element is
+ a leaf directory, because we don't have a directory
+ name here, we just have a path spec. This means we
+ may descend into a leaf directory cm/pk, if the
+ spec is ...fonts//pk//. */
+ expand_elt (str_list_ptr, FN_STRING (name), potential_len);
+ fn_shrink_to (&name, potential_len);
+ }
+
+ /* Should we recurse? To see if the subdirectory is a
+ leaf, check if it has two links (one for . and one for
+ ..). This means that symbolic links to directories do
+ not affect the leaf-ness. This is arguably wrong, but
+ the only alternative I know of is to stat every entry
+ in the directory, and that is unacceptably slow.
+
+ The #ifdef here makes all this configurable at
+ compile-time, so that if we're using VMS directories or
+ some such, we can still find subdirectories, even if it
+ is much slower. */
+#ifdef ST_NLINK_TRICK
+#ifdef AMIGA
+ /* With SAS/C++ 6.55 on the Amiga, `stat' sets the `st_nlink'
+ field to -1 for a file, or to 1 for a directory. */
+ if (links == 1)
+#else
+ if (links > 2)
+#endif /* not AMIGA */
+#endif /* not ST_NLINK_TRICK */
+ /* All criteria are met; find subdirectories. */
+ do_subdir (str_list_ptr, FN_STRING (name),
+ potential_len, post);
+#ifdef ST_NLINK_TRICK
+ else if (*post == 0)
+ /* Nothing to match, no recursive subdirectories to
+ look for: we're done with this branch. Add it. */
+ dir_list_add (str_list_ptr, FN_STRING (name));
+#endif
+ }
+
+ /* Remove the directory entry we just checked from `name'. */
+ fn_shrink_to (&name, elt_length);
+ }
+ }
+
+ fn_free (&name);
+ xclosedir (dir);
+#endif /* not WIN32 */
+}
+
+
+/* Assume ELT is non-empty and non-NULL. Return list of corresponding
+ directories (with no terminating NULL entry) in STR_LIST_PTR. Start
+ looking for magic constructs at START. */
+
+static void
+expand_elt P3C(str_llist_type *, str_list_ptr, const_string, elt,
+ unsigned, start)
+{
+ const_string dir = elt + start, post;
+
+ while (*dir != 0)
+ {
+ if (IS_DIR_SEP (*dir))
+ {
+ /* If two or more consecutive /'s, find subdirectories. */
+ if (IS_DIR_SEP (dir[1]))
+ {
+ for (post = dir + 1; IS_DIR_SEP (*post); post++) ;
+ do_subdir (str_list_ptr, elt, dir - elt + 1, post);
+ return;
+ }
+
+ /* No special stuff at this slash. Keep going. */
+ }
+
+ dir++;
+ }
+
+ /* When we reach the end of ELT, it will be a normal filename. */
+ checked_dir_list_add (str_list_ptr, elt);
+}
+
+/* The first bits of a path element can be problematic because they
+ look like a request to expand a whole disk, rather than a subtree.
+ - It can contain a drive specification.
+ - It can be a UNC path (win32, but they are part of the single
+ UNIX specification as well).
+ The argument is a string as the function can diddle into the argument
+ to canonicalize it, which tends to matter on windows platforms.
+ - Always lower-case drive letters a-z, even those filesystem that
+ preserve case in filenames do not care about the case of the drive
+ letters.
+ - Remove unneeded double slashes. The problem is Windows does not
+ handle well filenames like c://dir/foo. So canonicalize the names.
+ The resulting name will always be shorter than the one passed, so no
+ problem.
+ - If possible, we merely skip multiple leading slashes to prevent
+ expanding from the root of a UNIX filesystem tree.
+*/
+unsigned
+kpse_normalize_path P1C(string, elt)
+{
+ unsigned ret;
+ unsigned i;
+
+ if (NAME_BEGINS_WITH_DEVICE(elt)) {
+ if (*elt >= 'A' && *elt <= 'Z')
+ *elt += 'a' - 'A';
+ for (i = 2; IS_DIR_SEP(elt[i]); ++i)
+ ;
+ if (i > 3)
+ memmove(elt+3, elt+i, strlen(elt+i) + 1);
+ ret = 2;
+ } else if (IS_UNC_NAME(elt)) {
+ for (ret = 2; elt[ret] && !IS_DIR_SEP(elt[ret]); ++ret)
+ ;
+ for (i = ret; elt[i] && IS_DIR_SEP(elt[i]); ++i)
+ ;
+ if (i > ret+1)
+ memmove(elt+ret+1, elt+i, strlen(elt+i) + 1);
+ } else {
+ for (ret = 0; IS_DIR_SEP(elt[ret]); ++ret)
+ ;
+ }
+
+ if (KPSE_DEBUG_P (KPSE_DEBUG_STAT))
+ DEBUGF2 ("kpse_normalize_path (%s) => %u\n", elt, ret);
+
+ return ret;
+}
+
+/* Here is the entry point. Returns directory list for ELT. */
+
+str_llist_type *
+kpse_element_dirs P1C(string, elt)
+{
+ str_llist_type *ret;
+
+ /* If given nothing, return nothing. */
+ if (!elt || !*elt)
+ return NULL;
+
+ /* If we've already cached the answer for ELT, return it. */
+ ret = cached (elt);
+ if (ret)
+ return ret;
+
+ /* We're going to have a real directory list to return. */
+ ret = XTALLOC1 (str_llist_type);
+ *ret = NULL;
+
+ /* We handle the hard case in a subroutine. */
+ expand_elt (ret, elt, kpse_normalize_path (elt));
+
+ /* Remember the directory list we just found, in case future calls are
+ made with the same ELT. */
+ cache (elt, ret);
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_EXPAND))
+ {
+ DEBUGF1 ("path element %s =>", elt);
+ if (ret)
+ {
+ str_llist_elt_type *e;
+ for (e = *ret; e; e = STR_LLIST_NEXT (*e))
+ fprintf (stderr, " %s", STR_LLIST (*e));
+ }
+ putc ('\n', stderr);
+ fflush (stderr);
+ }
+#endif /* KPSE_DEBUG */
+
+ return ret;
+}
+
+#ifdef TEST
+
+void
+print_element_dirs (const_string elt)
+{
+ str_llist_type *dirs;
+
+ printf ("Directories of %s:\t", elt ? elt : "(nil)");
+ fflush (stdout);
+
+ dirs = kpse_element_dirs (elt);
+
+ if (!dirs)
+ printf ("(nil)");
+ else
+ {
+ str_llist_elt_type *dir;
+ for (dir = *dirs; dir; dir = STR_LLIST_NEXT (*dir))
+ {
+ string d = STR_LLIST (*dir);
+ printf ("%s ", *d ? d : "`'");
+ }
+ }
+
+ putchar ('\n');
+}
+
+int
+main ()
+{
+ /* DEBUG_SET (DEBUG_STAT); */
+ /* All lists end with NULL. */
+ print_element_dirs (NULL); /* */
+ print_element_dirs (""); /* ./ */
+ print_element_dirs ("/k"); /* */
+ print_element_dirs (".//"); /* ./ ./archive/ */
+ print_element_dirs (".//archive"); /* ./ ./archive/ */
+#ifdef AMIGA
+ print_element_dirs ("TeXMF:AmiWeb2c/texmf/fonts//"); /* lots */
+ print_element_dirs ("TeXMF:AmiWeb2c/share/texmf/fonts//bakoma"); /* just one */
+ print_element_dirs ("TeXMF:AmiWeb2c/texmf/fonts//"); /* lots again [cache] */
+ print_element_dirs ("TeXMF:"); /* TeXMF: */
+ print_element_dirs ("TeXMF:/"); /* TeXMF: and all subdirs */
+#else /* not AMIGA */
+ print_element_dirs ("/tmp/fonts//"); /* no need to stat anything */
+ print_element_dirs ("/usr/local/lib/tex/fonts//"); /* lots */
+ print_element_dirs ("/usr/local/lib/tex/fonts//times"); /* just one */
+ print_element_dirs ("/usr/local/lib/tex/fonts//"); /* lots again [cache] */
+ print_element_dirs ("~karl"); /* tilde expansion */
+ print_element_dirs ("$karl"); /* variable expansion */
+ print_element_dirs ("~${LOGNAME}"); /* both */
+#endif /* not AMIGA */
+ return 0;
+}
+
+#endif /* TEST */
+
+
+/*
+Local variables:
+test-compile-command: "gcc -g -I. -I.. -DTEST elt-dirs.c kpathsea.a"
+End:
+*/
diff --git a/Build/source/texk/kpathsea/expand.c b/Build/source/texk/kpathsea/expand.c
new file mode 100644
index 00000000000..78ea662f566
--- /dev/null
+++ b/Build/source/texk/kpathsea/expand.c
@@ -0,0 +1,359 @@
+/* expand.c: general expansion.
+
+ Copyright 1993, 94, 95, 96, 97, 98, 05 Karl Berry & Olaf Weber.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/expand.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/tilde.h>
+#include <kpathsea/variable.h>
+#include <kpathsea/concatn.h>
+#include <kpathsea/absolute.h>
+#include <kpathsea/str-list.h>
+
+/* Do variable expansion first so ~${USER} works. (Besides, it's what the
+ shells do.) */
+
+string
+kpse_expand P1C(const_string, s)
+{
+ string var_expansion = kpse_var_expand (s);
+ string tilde_expansion = kpse_tilde_expand (var_expansion);
+
+ /* `kpse_var_expand' always gives us new memory; `kpse_tilde_expand'
+ doesn't, necessarily. So be careful that we don't free what we are
+ about to return. */
+ if (tilde_expansion != var_expansion)
+ free (var_expansion);
+
+ return tilde_expansion;
+}
+
+
+/* Forward declarations of functions from the original expand.c */
+static str_list_type brace_expand P1H(const_string*);
+
+/* If $KPSE_DOT is defined in the environment, prepend it to any relative
+ path components. */
+
+static string
+kpse_expand_kpse_dot P1C(string, path)
+{
+ string ret, elt;
+ string kpse_dot = getenv("KPSE_DOT");
+#ifdef MSDOS
+ boolean malloced_kpse_dot = false;
+#endif
+
+ if (kpse_dot == NULL)
+ return path;
+ ret = (string)xmalloc(1);
+ *ret = 0;
+
+#ifdef MSDOS
+ /* Some setups of ported Bash force $KPSE_DOT to have the //d/foo/bar
+ form (when `pwd' is used), which is not understood by libc and the OS.
+ Convert them back to the usual d:/foo/bar form. */
+ if (kpse_dot[0] == '/' && kpse_dot[1] == '/'
+ && kpse_dot[2] >= 'A' && kpse_dot[2] <= 'z' && kpse_dot[3] == '/') {
+ kpse_dot++;
+ kpse_dot = xstrdup (kpse_dot);
+ kpse_dot[0] = kpse_dot[1]; /* drive letter */
+ kpse_dot[1] = ':';
+ malloced_kpse_dot = true;
+ }
+#endif
+
+ for (elt = kpse_path_element (path); elt; elt = kpse_path_element (NULL)) {
+ string save_ret = ret;
+ /* We assume that the !! magic is only used on absolute components.
+ Single "." gets special treatment, as does "./" or its equivalent. */
+ if (kpse_absolute_p (elt, false) || (elt[0] == '!' && elt[1] == '!')) {
+ ret = concat3(ret, elt, ENV_SEP_STRING);
+ } else if (elt[0] == '.' && elt[1] == 0) {
+ ret = concat3 (ret, kpse_dot, ENV_SEP_STRING);
+#ifndef VMS
+ } else if (elt[0] == '.' && IS_DIR_SEP(elt[1])) {
+ ret = concatn (ret, kpse_dot, elt + 1, ENV_SEP_STRING, NULL);
+ } else {
+ ret = concatn (ret, kpse_dot, DIR_SEP_STRING, elt, ENV_SEP_STRING, NULL);
+#endif
+ }
+ free (save_ret);
+ }
+
+#ifdef MSDOS
+ if (malloced_kpse_dot) free (kpse_dot);
+#endif
+
+ ret[strlen (ret) - 1] = 0;
+ return ret;
+}
+
+/* Do brace expansion on ELT; then do variable and ~ expansion on each
+ element of the result; then do brace expansion again, in case a
+ variable definition contained braces (e.g., $TEXMF). Return a
+ string comprising all of the results separated by ENV_SEP_STRING. */
+
+static string
+kpse_brace_expand_element P1C(const_string, elt)
+{
+ unsigned i;
+ str_list_type expansions = brace_expand (&elt);
+ string ret = (string)xmalloc (1);
+ *ret = 0;
+
+ for (i = 0; i != STR_LIST_LENGTH(expansions); i++) {
+ /* Do $ and ~ expansion on each element. */
+ string x = kpse_expand (STR_LIST_ELT(expansions,i));
+ string save_ret = ret;
+ if (!STREQ (x, STR_LIST_ELT(expansions,i))) {
+ /* If we did any expansions, do brace expansion again. Since
+ recursive variable definitions are not allowed, this recursion
+ must terminate. (In practice, it's unlikely there will ever be
+ more than one level of recursion.) */
+ string save_x = x;
+ x = kpse_brace_expand_element (x);
+ free (save_x);
+ }
+ ret = concat3 (ret, x, ENV_SEP_STRING);
+ free (save_ret);
+ free (x);
+ }
+ for (i = 0; i != STR_LIST_LENGTH(expansions); ++i) {
+ free(STR_LIST_ELT(expansions,i));
+ }
+ str_list_free(&expansions);
+ ret[strlen (ret) - 1] = 0; /* waste the trailing null */
+ return ret;
+}
+
+/* Be careful to not waste all the memory we allocate for each element. */
+
+string
+kpse_brace_expand P1C(const_string, path)
+{
+ string kpse_dot_expansion;
+ string elt;
+ unsigned len;
+ /* Must do variable expansion first because if we have
+ foo = .:~
+ TEXINPUTS = $foo
+ we want to end up with TEXINPUTS = .:/home/karl.
+ Since kpse_path_element is not reentrant, we must get all
+ the path elements before we start the loop. */
+ string xpath = kpse_var_expand (path);
+ string ret = (string)xmalloc (1);
+ *ret = 0;
+
+ for (elt = kpse_path_element (xpath); elt; elt = kpse_path_element (NULL)) {
+ string save_ret = ret;
+ /* Do brace expansion first, so tilde expansion happens in {~ka,~kb}. */
+ string expansion = kpse_brace_expand_element (elt);
+ ret = concat3 (ret, expansion, ENV_SEP_STRING);
+ free (expansion);
+ free (save_ret);
+ }
+
+ /* Waste the last byte by overwriting the trailing env_sep with a null. */
+ len = strlen (ret);
+ if (len != 0)
+ ret[len - 1] = 0;
+ free (xpath);
+
+ kpse_dot_expansion = kpse_expand_kpse_dot (ret);
+ if (kpse_dot_expansion != ret)
+ free (ret);
+
+ return kpse_dot_expansion;
+}
+
+/* Expand all special constructs in a path, and include only the actually
+ existing directories in the result. */
+string
+kpse_path_expand P1C(const_string, path)
+{
+ string ret;
+ string xpath;
+ string elt;
+ unsigned len;
+
+ /* Initialise ret to the empty string. */
+ ret = (string)xmalloc (1);
+ *ret = 0;
+ len = 0;
+
+ /* Expand variables and braces first. */
+ xpath = kpse_brace_expand (path);
+
+ /* Now expand each of the path elements, printing the results */
+ for (elt = kpse_path_element (xpath); elt; elt = kpse_path_element (NULL)) {
+ str_llist_type *dirs;
+
+ /* Skip and ignore magic leading chars. */
+ if (*elt == '!' && *(elt + 1) == '!')
+ elt += 2;
+
+ /* Search the disk for all dirs in the component specified.
+ Be faster to check the database, but this is more reliable. */
+ dirs = kpse_element_dirs (elt);
+ if (dirs && *dirs) {
+ str_llist_elt_type *dir;
+
+ for (dir = *dirs; dir; dir = STR_LLIST_NEXT (*dir)) {
+ string thedir = STR_LLIST (*dir);
+ unsigned dirlen = strlen (thedir);
+ string save_ret = ret;
+ /* We need to retain trailing slash if that's the root directory.
+ * On unix, "/" is root dir, "" often taken to be current dir.
+ * On windows, "C:/" is root dir of drive C, and "C:" is current
+ * on drive C. There's no need to look at other cases, like UNC
+ * names.
+ */
+ if (dirlen == 1 || (dirlen == 3 && NAME_BEGINS_WITH_DEVICE (thedir)
+ && IS_DIR_SEP (thedir[2]))) {
+ ret = concat3 (ret, thedir, ENV_SEP_STRING);
+ len += dirlen + 1;
+ ret[len - 1] = ENV_SEP;
+ } else {
+ ret = concat (ret, thedir);
+ len += dirlen;
+ ret [len - 1] = ENV_SEP;
+ }
+ free (save_ret);
+ }
+ }
+ }
+ /* Get rid of trailing ':', if any. */
+ if (len != 0)
+ ret[len - 1] = 0;
+ return ret;
+}
+
+/* ... */
+static void expand_append P3C(str_list_type*, partial,
+ const_string, text, const_string, p)
+{
+ string new_string;
+ unsigned len;
+ str_list_type tmp;
+ tmp = str_list_init();
+ len = p - text;
+ new_string = (string)xmalloc(len+1);
+ strncpy(new_string, text, len);
+ new_string[len]=0;
+ str_list_add(&tmp, new_string);
+ str_list_concat_elements(partial, tmp);
+}
+
+
+
+static str_list_type brace_expand P1C(const_string *, text)
+{
+ str_list_type result, partial, recurse;
+ const_string p;
+ result = str_list_init();
+ partial = str_list_init();
+ for (p = *text; *p && *p != '}'; ++p) {
+ /* FIXME: Should be IS_ENV_SEP(*p) */
+ if (*p == ENV_SEP || *p == ',') {
+ expand_append(&partial, *text, p);
+ str_list_concat(&result, partial);
+ str_list_free(&partial);
+ *text = p+1;
+ partial = str_list_init();
+ } else if (*p == '{') {
+ expand_append(&partial, *text, p);
+ ++p;
+ recurse = brace_expand(&p);
+ str_list_concat_elements(&partial, recurse);
+ str_list_free(&recurse);
+ /* Check for missing closing brace. */
+ if (*p != '}') {
+ WARNING1 ("%s: Unmatched {", *text);
+ }
+ *text = p+1;
+ } else if (*p == '$') {
+ /* Skip ${VAR} */
+ if (*(p+1) == '{')
+ for (p+=2; *p!='}';++p);
+ }
+ }
+ expand_append(&partial, *text, p);
+ str_list_concat(&result, partial);
+ str_list_free(&partial);
+ *text = p;
+ return result;
+}
+
+
+
+#if defined (TEST)
+#include <stdio.h>
+
+fatal_error (format, arg1, arg2)
+ char *format, *arg1, *arg2;
+{
+ report_error (format, arg1, arg2);
+ exit (1);
+}
+
+report_error (format, arg1, arg2)
+ char *format, *arg1, *arg2;
+{
+ fprintf (stderr, format, arg1, arg2);
+ fprintf (stderr, "\n");
+}
+
+main ()
+{
+ char example[256];
+
+ for (;;)
+ {
+ char **result;
+ int i;
+
+ fprintf (stderr, "brace_expand> ");
+
+ if ((!fgets (example, 256, stdin)) ||
+ (strncmp (example, "quit", 4) == 0))
+ break;
+
+ if (strlen (example))
+ example[strlen (example) - 1] = 0;
+
+ result = brace_expand (example);
+
+ for (i = 0; result[i]; i++)
+ printf ("%s\n", result[i]);
+
+ free_array (result);
+ }
+}
+
+/*
+ * Local variables:
+ * test-compile-command: "gcc -g -DTEST -I.. -I. -o brace_expand braces.c -L. -lkpathsea"
+ * end:
+ */
+
+#endif /* TEST */
diff --git a/Build/source/texk/kpathsea/expand.h b/Build/source/texk/kpathsea/expand.h
new file mode 100644
index 00000000000..ed46a867f89
--- /dev/null
+++ b/Build/source/texk/kpathsea/expand.h
@@ -0,0 +1,45 @@
+/* expand.h: general expansion.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1993, 94, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_EXPAND_H
+#define KPATHSEA_EXPAND_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+/* Call kpse_var_expand and kpse_tilde_expand (in that order). Result
+ is always in fresh memory, even if no expansions were done. */
+extern KPSEDLL string kpse_expand P1H(const_string s);
+
+/* Do brace expansion and call `kpse_expand' on each element of the
+ result; return the final expansion (always in fresh memory, even if
+ no expansions were done). We don't call `kpse_expand_default'
+ because there is a whole sequence of defaults to run through; see
+ `kpse_init_format'. */
+extern KPSEDLL string kpse_brace_expand P1H(const_string path);
+
+/* Do brace expansion and call `kpse_expand' on each argument of the
+ result, then expand any `//' constructs. The final expansion (always
+ in fresh memory) is a path of all the existing directories that match
+ the pattern. */
+extern KPSEDLL string kpse_path_expand P1H(const_string path);
+
+#endif /* not KPATHSEA_EXPAND_H */
diff --git a/Build/source/texk/kpathsea/extend-fname.c b/Build/source/texk/kpathsea/extend-fname.c
new file mode 100644
index 00000000000..883a93cde07
--- /dev/null
+++ b/Build/source/texk/kpathsea/extend-fname.c
@@ -0,0 +1,36 @@
+/* extend-fname.c: give a filename a suffix, if necessary.
+
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+
+/* We may or may not return NAME. It's up to the caller not to assume
+ the return value is modifiable. */
+
+string
+extend_filename P2C(const_string, name, const_string, default_suffix)
+{
+ string new_s;
+ const_string suffix = find_suffix (name);
+
+ new_s = suffix == NULL ? concat3 (name, ".", default_suffix)
+ : (string) name;
+ return new_s;
+}
diff --git a/Build/source/texk/kpathsea/file-p.c b/Build/source/texk/kpathsea/file-p.c
new file mode 100644
index 00000000000..50a805db000
--- /dev/null
+++ b/Build/source/texk/kpathsea/file-p.c
@@ -0,0 +1,39 @@
+/* file-p.c: file predicates.
+
+ Copyright 1992, 93, 94 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/xstat.h>
+
+
+/* Test whether FILENAME1 and FILENAME2 are actually the same file. If
+ stat fails on either of the names, we return false, without error. */
+
+boolean
+same_file_p P2C(const_string, filename1, const_string, filename2)
+{
+ struct stat sb1, sb2;
+ /* These are put in variables only so the results can be inspected
+ under gdb. */
+ int r1 = stat (filename1, &sb1);
+ int r2 = stat (filename2, &sb2);
+
+ return r1 == 0 && r2 == 0 ? SAME_FILE_P (sb1, sb2) : false;
+}
diff --git a/Build/source/texk/kpathsea/find-suffix.c b/Build/source/texk/kpathsea/find-suffix.c
new file mode 100644
index 00000000000..3b2c9f6b3ff
--- /dev/null
+++ b/Build/source/texk/kpathsea/find-suffix.c
@@ -0,0 +1,47 @@
+/* find-suffix.c: return the stuff after a dot.
+
+ Copyright 1992, 93, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-pathch.h>
+
+
+/* Return pointer to first character after `.' in last directory element
+ of NAME. If the name is `foo' or `/foo.bar/baz', we have no extension. */
+
+string
+find_suffix P1C(const_string, name)
+{
+ const_string slash_pos;
+ string dot_pos = strrchr (name, '.');
+
+ if (dot_pos == NULL)
+ return NULL;
+
+ for (slash_pos = name + strlen (name);
+ slash_pos > dot_pos && !IS_DIR_SEP (*slash_pos);
+ slash_pos--)
+ ;
+
+ return slash_pos > dot_pos ? NULL : dot_pos + 1;
+}
+
+
+
diff --git a/Build/source/texk/kpathsea/fn.c b/Build/source/texk/kpathsea/fn.c
new file mode 100644
index 00000000000..f22192d647b
--- /dev/null
+++ b/Build/source/texk/kpathsea/fn.c
@@ -0,0 +1,122 @@
+/* fn.c: arbitrarily long filenames (or just strings).
+
+ Copyright 2001, 2005 Olaf Weber.
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/fn.h>
+
+
+/* /usr/local/lib/texmf/fonts/public/cm/pk/ljfour/cmr10.300pk is 58
+ chars, so ASCII `K' seems a good choice. */
+#define CHUNK_SIZE 75
+
+
+fn_type
+fn_init P1H(void)
+{
+ fn_type ret;
+
+ FN_ALLOCATED (ret) = FN_LENGTH (ret) = 0;
+ FN_STRING (ret) = NULL;
+
+ return ret;
+}
+
+
+fn_type
+fn_copy0 P2C(const_string, s, unsigned, len)
+{
+ fn_type ret;
+
+ FN_ALLOCATED (ret) = CHUNK_SIZE > len ? CHUNK_SIZE : len + 1;
+ FN_STRING (ret) = (string)xmalloc (FN_ALLOCATED (ret));
+
+ strncpy (FN_STRING (ret), s, len);
+ FN_STRING (ret)[len] = 0;
+ FN_LENGTH (ret) = len + 1;
+
+ return ret;
+}
+
+/* Don't think we ever try to free something that might usefully be
+ empty, so give fatal error if nothing allocated. */
+
+void
+fn_free P1C(fn_type *, f)
+{
+ assert (FN_STRING (*f) != NULL);
+ free (FN_STRING (*f));
+ FN_STRING (*f) = NULL;
+ FN_ALLOCATED (*f) = 0;
+ FN_LENGTH (*f) = 0;
+}
+
+/* An arithmetic increase seems more reasonable than geometric. We
+ don't increase the length member since it may be more convenient for
+ the caller to add than subtract when appending the stuff that will
+ presumably follow. */
+
+static void
+grow P2C(fn_type *, f, unsigned, len)
+{
+ while (FN_LENGTH (*f) + len > FN_ALLOCATED (*f))
+ {
+ FN_ALLOCATED (*f) += CHUNK_SIZE;
+ XRETALLOC (FN_STRING (*f), FN_ALLOCATED (*f), char);
+ }
+}
+
+
+void
+fn_1grow P2C(fn_type *, f, char, c)
+{
+ grow (f, 1);
+ FN_STRING (*f)[FN_LENGTH (*f)] = c;
+ FN_LENGTH (*f)++;
+}
+
+
+void
+fn_grow P3C(fn_type *, f, const_string, source, unsigned, len)
+{
+ grow (f, len);
+ strncpy (FN_STRING (*f) + FN_LENGTH (*f), source, len);
+ FN_LENGTH (*f) += len;
+}
+
+
+void
+fn_str_grow P2C(fn_type *, f, const_string, s)
+{
+ unsigned more_len = strlen (s);
+ grow (f, more_len);
+ strcat (FN_STRING (*f), s);
+ FN_LENGTH (*f) += more_len;
+}
+
+
+void
+fn_shrink_to P2C(fn_type *, f, unsigned, loc)
+{
+ assert (FN_LENGTH (*f) > loc);
+ FN_STRING (*f)[loc] = 0;
+ FN_LENGTH (*f) = loc + 1;
+}
diff --git a/Build/source/texk/kpathsea/fn.h b/Build/source/texk/kpathsea/fn.h
new file mode 100644
index 00000000000..f544acdc8a6
--- /dev/null
+++ b/Build/source/texk/kpathsea/fn.h
@@ -0,0 +1,70 @@
+/* fn.h: arbitrarily long filenames (or just strings).
+
+ Copyright 2001, 2005 Olaf Weber.
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_FN_H
+#define KPATHSEA_FN_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+/* Arbitrarily long filenames; it's inconvenient to use obstacks here,
+ because we want to maintain a null terminator. Also used for
+ dynamically growing strings even when the null byte isn't necessary,
+ e.g., in `variable.c', since I don't want to pass obstacks around
+ everywhere, and one can't free parts of an obstack arbitrarily. */
+
+typedef struct
+{
+ string str;
+ unsigned allocated;
+ unsigned length; /* includes the terminating null byte, if any */
+} fn_type;
+
+#define FN_STRING(fn) ((fn).str)
+#define FN_ALLOCATED(fn) ((fn).allocated)
+#define FN_LENGTH(fn) ((fn).length)
+
+
+/* Create a new empty fn. */
+extern KPSEDLL fn_type fn_init P1H(void);
+
+/* Create a new fn from the first LEN characters from S and a null. */
+extern KPSEDLL fn_type fn_copy0 P2H(const_string s, unsigned len);
+
+/* Free what's been allocated. Can also just free the string if it's
+ been extracted out. Fatal error if nothing allocated in F. */
+extern KPSEDLL void fn_free P1H(fn_type *f);
+
+/* Append the character C to the fn F. Don't append trailing null. */
+extern KPSEDLL void fn_1grow P2H(fn_type *f, char c);
+
+/* Append LENGTH bytes from SOURCE to F. */
+extern KPSEDLL void fn_grow P3H(fn_type *f, const_string source, unsigned length);
+
+/* Concatenate the component S to the fn F. Assumes string currently in
+ F is null terminated. */
+extern KPSEDLL void fn_str_grow P2H(fn_type *f, const_string s);
+
+/* Add a null to F's string at position LOC, and update its length.
+ Fatal error if LOC is past the end of the string. */
+extern KPSEDLL void fn_shrink_to P2H(fn_type *f, unsigned loc);
+
+#endif /* not KPATHSEA_FN_H */
diff --git a/Build/source/texk/kpathsea/fontmap.c b/Build/source/texk/kpathsea/fontmap.c
new file mode 100644
index 00000000000..8c2777404ad
--- /dev/null
+++ b/Build/source/texk/kpathsea/fontmap.c
@@ -0,0 +1,200 @@
+/* fontmap.c: read files for additional font names.
+
+ Copyright 2001, 2002, 2005 Olaf Weber.
+ Copyright 1993, 94, 95, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/fontmap.h>
+#include <kpathsea/hash.h>
+#include <kpathsea/line.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/str-list.h>
+#include <kpathsea/tex-file.h>
+
+/* We have one and only one fontmap, so may as well make it static
+ instead of passing it around. */
+static hash_table_type map;
+#ifndef MAP_NAME
+#define MAP_NAME "texfonts.map"
+#endif
+#ifndef MAP_HASH_SIZE
+#define MAP_HASH_SIZE 4001
+#endif
+
+static const_string map_path; /* Only want to create this once. */
+
+/* Return next whitespace-delimited token in STR or NULL if none. */
+
+static string
+token P1C(const_string, str)
+{
+ unsigned len;
+ const_string start;
+ string ret;
+
+ while (*str && ISSPACE (*str))
+ str++;
+
+ start = str;
+ while (*str && !ISSPACE (*str))
+ str++;
+
+ len = str - start;
+ ret = (string)xmalloc (len + 1);
+ strncpy (ret, start, len);
+ ret[len] = 0;
+
+ return ret;
+}
+
+/* Open and read the mapping file MAP_FILENAME, putting its entries into
+ MAP. Comments begin with % and continue to the end of the line. Each
+ line of the file defines an entry: the first word is the real
+ filename (e.g., `ptmr'), the second word is the alias (e.g.,
+ `Times-Roman'), and any subsequent words are ignored. .tfm is added
+ if either the filename or the alias have no extension. This is the
+ same order as in Dvips' psfonts.map. Perhaps someday the programs
+ will both read the same file. */
+
+static void
+map_file_parse P1C(const_string, map_filename)
+{
+ char *orig_l;
+ unsigned map_lineno = 0;
+ FILE *f = xfopen (map_filename, FOPEN_R_MODE);
+
+ while ((orig_l = read_line (f)) != NULL) {
+ string filename;
+ string l = orig_l;
+ string comment_loc = strrchr (l, '%');
+ if (!comment_loc) {
+ comment_loc = strstr (l, "@c");
+ }
+
+ /* Ignore anything after a % or @c. */
+ if (comment_loc)
+ *comment_loc = 0;
+
+ map_lineno++;
+
+ /* Skip leading whitespace so we can use strlen below. Can't use
+ strtok since this routine is recursive. */
+ while (*l && ISSPACE (*l))
+ l++;
+
+ /* If we don't have any filename, that's ok, the line is blank. */
+ filename = token (l);
+ if (filename) {
+ string alias = token (l + strlen (filename));
+
+ if (STREQ (filename, "include")) {
+ if (alias == NULL) {
+ WARNING2 ("%s:%u: Filename argument for include directive missing",
+ map_filename, map_lineno);
+ } else {
+ string include_fname = kpse_path_search (map_path, alias, false);
+ if (include_fname) {
+ map_file_parse (include_fname);
+ if (include_fname != alias)
+ free (include_fname);
+ } else {
+ WARNING3 ("%s:%u: Can't find fontname include file `%s'",
+ map_filename, map_lineno, alias);
+ }
+ free (alias);
+ free (filename);
+ }
+
+ /* But if we have a filename and no alias, something's wrong. */
+ } else if (alias == NULL) {
+ WARNING3 ("%s:%u: Fontname alias missing for filename `%s'",
+ map_filename, map_lineno, filename);
+ free (filename);
+
+ } else {
+ /* We've got everything. Insert the new entry. They were
+ already dynamically allocated, so don't bother with xstrdup. */
+ hash_insert_normalized (&map, alias, filename);
+ }
+ }
+
+ free (l);
+ }
+
+ xfclose (f, map_filename);
+}
+
+/* Parse the file MAP_NAME in each of the directories in PATH and
+ return the resulting structure. Entries in earlier files override
+ later files. */
+
+static void
+read_all_maps P1H(void)
+{
+ string *filenames;
+
+ map_path = kpse_init_format (kpse_fontmap_format);
+ filenames = kpse_all_path_search (map_path, MAP_NAME);
+
+ map = hash_create (MAP_HASH_SIZE);
+
+ while (*filenames) {
+ map_file_parse (*filenames);
+ filenames++;
+ }
+}
+
+/* Look up KEY in texfonts.map's; if it's not found, remove any suffix
+ from KEY and try again. Create the map if necessary. */
+
+string *
+kpse_fontmap_lookup P1C(const_string, key)
+{
+ string *ret;
+ string suffix = find_suffix (key);
+
+ if (map.size == 0) {
+ read_all_maps ();
+ }
+
+ ret = hash_lookup (map, key);
+ if (!ret) {
+ /* OK, the original KEY didn't work. Let's check for the KEY without
+ an extension -- perhaps they gave foobar.tfm, but the mapping only
+ defines `foobar'. */
+ if (suffix) {
+ string base_key = remove_suffix (key);
+ ret = hash_lookup (map, base_key);
+ free (base_key);
+ }
+ }
+
+ /* Append any original suffix. */
+ if (ret && suffix) {
+ string *elt;
+ for (elt = ret; *elt; elt++) {
+ *elt = extend_filename (*elt, suffix);
+ }
+ }
+
+ return ret;
+}
diff --git a/Build/source/texk/kpathsea/fontmap.h b/Build/source/texk/kpathsea/fontmap.h
new file mode 100644
index 00000000000..31d65b049eb
--- /dev/null
+++ b/Build/source/texk/kpathsea/fontmap.h
@@ -0,0 +1,33 @@
+/* fontmap.h: declarations for reading a file to define additional font names.
+
+ Copyright 1993, 94, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef FONTMAP_H
+#define FONTMAP_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/hash.h>
+#include <kpathsea/types.h>
+
+
+/* Look up KEY in all texfonts.map's in the glyph_format path, and
+ return a null-terminated list of all matching entries, or NULL. */
+extern string *kpse_fontmap_lookup P1H(const_string key);
+
+#endif /* not FONTMAP_H */
diff --git a/Build/source/texk/kpathsea/getopt.c b/Build/source/texk/kpathsea/getopt.c
new file mode 100644
index 00000000000..281ae90a0bf
--- /dev/null
+++ b/Build/source/texk/kpathsea/getopt.c
@@ -0,0 +1,1004 @@
+/* Getopt for GNU.
+
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 2000
+ Free Software Foundation, Inc.
+
+ The original version of this file was part of the GNU C Library.
+ Its master source is NOT part of the C library, however.
+ The master source lives in /gd/gnu/lib.
+ This version has been modified for use with libkpathsea.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
+ Ditto for AIX 3.2 and <stdlib.h>. */
+#ifndef _NO_PROTO
+#define _NO_PROTO
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#define GETOPT_INTERFACE_VERSION 2
+#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#include <gnu-versions.h>
+#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+#define ELIDE_CODE
+#endif
+#endif
+
+#ifndef ELIDE_CODE
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+/* Don't include stdlib.h for non-GNU C libraries because some of them
+ contain conflicting prototypes for getopt. */
+#include <stdlib.h>
+#include <unistd.h>
+#endif /* GNU C library. */
+
+#ifdef VMS
+#include <unixlib.h>
+#if HAVE_STRING_H - 0
+#include <string.h>
+#endif
+#endif
+
+#if defined (WIN32) && !defined (__CYGWIN32__)
+/* It's not Unix, really. See? Capital letters. */
+#include <stdlib.h>
+#include <windows.h>
+#ifdef getpid
+#undef getpid
+#endif
+#define getpid() GetCurrentProcessId()
+#endif
+
+#ifndef _
+/* This is for other GNU distributions with internationalized messages.
+ When compiling libc, the _ macro is predefined. */
+#ifdef HAVE_LIBINTL_H
+# include <libintl.h>
+# define _(msgid) gettext (msgid)
+#else
+# define _(msgid) (msgid)
+#endif
+#endif
+
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+ but it behaves differently for the user, since it allows the user
+ to intersperse the options with the other arguments.
+
+ As `getopt' works, it permutes the elements of ARGV so that,
+ when it is done, all the options precede everything else. Thus
+ all application programs are extended to handle flexible argument order.
+
+ Setting the environment variable POSIXLY_CORRECT disables permutation.
+ Then the behavior is completely standard.
+
+ GNU application programs can use a third alternative mode in which
+ they can distinguish the relative order of options and other arguments. */
+
+#include "getopt.h"
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *optarg = NULL;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* 1003.2 says this must be 1 before any call. */
+int optind = 1;
+
+/* Formerly, initialization of getopt depended on optind==0, which
+ causes problems with re-calling getopt as programs generally don't
+ know that. */
+
+int __getopt_initialized = 0;
+
+/* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+
+static char *nextchar;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+int optopt = '?';
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using `+' as the first character
+ of the list of option characters.
+
+ PERMUTE is the default. We permute the contents of ARGV as we scan,
+ so that eventually all the non-options are at the end. This allows options
+ to be given in any order, even with programs that were not written to
+ expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were written
+ to expect options and other ARGV-elements in any order and that care about
+ the ordering of the two. We describe each non-option ARGV-element
+ as if it were the argument of an option with character code 1.
+ Using `-' as the first character of the list of option characters
+ selects this mode of operation.
+
+ The special argument `--' forces an end of option-scanning regardless
+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
+ `--' can cause `getopt' to return -1 with `optind' != ARGC. */
+
+static enum
+{
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+} ordering;
+
+/* Value of POSIXLY_CORRECT environment variable. */
+static char *posixly_correct;
+
+#if defined(__GNU_LIBRARY__) || defined(WIN32)
+/* We want to avoid inclusion of string.h with non-GNU libraries
+ because there are many ways it can cause trouble.
+ On some systems, it contains special magic macros that don't work
+ in GCC. */
+#include <string.h>
+#define my_index strchr
+#else
+
+/* Avoid depending on library functions or files
+ whose names are inconsistent. */
+
+char *getenv ();
+
+static char *
+my_index (str, chr)
+ const char *str;
+ int chr;
+{
+ while (*str)
+ {
+ if (*str == chr)
+ return (char *) str;
+ str++;
+ }
+ return 0;
+}
+
+/* If using GCC, we can safely declare strlen this way.
+ If not using GCC, it is ok not to declare it. */
+#ifdef __GNUC__
+/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
+ That was relevant to code that was here before. */
+#if !defined (__STDC__) || !__STDC__
+/* gcc with -traditional declares the built-in strlen to return int,
+ and has done so at least since version 2.4.5. -- rms. */
+extern int strlen (const char *);
+#endif /* not __STDC__ */
+#endif /* __GNUC__ */
+
+#endif /* not __GNU_LIBRARY__ */
+
+/* Handle permutation of arguments. */
+
+/* Describe the part of ARGV that contains non-options that have
+ been skipped. `first_nonopt' is the index in ARGV of the first of them;
+ `last_nonopt' is the index after the last of them. */
+
+static int first_nonopt;
+static int last_nonopt;
+
+#ifdef _LIBC
+/* Bash 2.0 gives us an environment variable containing flags
+ indicating ARGV elements that should not be considered arguments. */
+
+static const char *nonoption_flags;
+static int nonoption_flags_len;
+
+static int original_argc;
+static char *const *original_argv;
+
+/* Make sure the environment variable bash 2.0 puts in the environment
+ is valid for the getopt call we must make sure that the ARGV passed
+ to getopt is that one passed to the process. */
+static void store_args (int argc, char *const *argv) __attribute__ ((unused));
+static void
+store_args (int argc, char *const *argv)
+{
+ /* XXX This is no good solution. We should rather copy the args so
+ that we can compare them later. But we must not use malloc(3). */
+ original_argc = argc;
+ original_argv = argv;
+}
+text_set_element (__libc_subinit, store_args);
+#endif
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ `first_nonopt' and `last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved. */
+
+#if defined (__STDC__) && __STDC__
+static void exchange (char **);
+#endif
+
+static void
+exchange (argv)
+ char **argv;
+{
+ int bottom = first_nonopt;
+ int middle = last_nonopt;
+ int top = optind;
+ char *tem;
+
+ /* Exchange the shorter segment with the far end of the longer segment.
+ That puts the shorter segment into the right place.
+ It leaves the longer segment in the right place overall,
+ but it consists of two parts that need to be swapped next. */
+
+ while (top > middle && middle > bottom)
+ {
+ if (top - middle > middle - bottom)
+ {
+ /* Bottom segment is the short one. */
+ int len = middle - bottom;
+ register int i;
+
+ /* Swap it with the top part of the top segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[top - (middle - bottom) + i];
+ argv[top - (middle - bottom) + i] = tem;
+ }
+ /* Exclude the moved bottom segment from further swapping. */
+ top -= len;
+ }
+ else
+ {
+ /* Top segment is the short one. */
+ int len = top - middle;
+ register int i;
+
+ /* Swap it with the bottom part of the bottom segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[middle + i];
+ argv[middle + i] = tem;
+ }
+ /* Exclude the moved top segment from further swapping. */
+ bottom += len;
+ }
+ }
+
+ /* Update records for the slots the non-options now occupy. */
+
+ first_nonopt += (optind - last_nonopt);
+ last_nonopt = optind;
+}
+
+/* Initialize the internal data when the first call is made. */
+
+#if defined (__STDC__) && __STDC__
+static const char *_getopt_initialize (int, char *const *, const char *);
+#endif
+static const char *
+_getopt_initialize (argc, argv, optstring)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+{
+ /* Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+
+ first_nonopt = last_nonopt = optind = 1;
+
+ nextchar = NULL;
+
+ posixly_correct = getenv ("POSIXLY_CORRECT");
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+
+ if (optstring[0] == '-')
+ {
+ ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (posixly_correct != NULL)
+ ordering = REQUIRE_ORDER;
+ else
+ ordering = PERMUTE;
+
+#ifdef _LIBC
+ if (posixly_correct == NULL
+ && argc == original_argc && argv == original_argv)
+ {
+ /* Bash 2.0 puts a special variable in the environment for each
+ command it runs, specifying which ARGV elements are the results of
+ file name wildcard expansion and therefore should not be
+ considered as options. */
+ char var[100];
+ sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ());
+ nonoption_flags = getenv (var);
+ if (nonoption_flags == NULL)
+ nonoption_flags_len = 0;
+ else
+ nonoption_flags_len = strlen (nonoption_flags);
+ }
+ else
+ nonoption_flags_len = 0;
+#endif
+
+ return optstring;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If `getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If `getopt' finds another option character, it returns that character,
+ updating `optind' and `nextchar' so that the next call to `getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, `getopt' returns -1.
+ Then `optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return '?' after printing an error message. If you set `opterr' to
+ zero, the error message is suppressed but we still return '?'.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in `optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in `optarg', otherwise `optarg' is set to zero.
+
+ If OPTSTRING starts with `-' or `+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with `--' instead of `-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a `=', or else the in next ARGV-element.
+ When `getopt' finds a long-named option, it returns 0 if that option's
+ `flag' field is nonzero, the value of the option's `val' field
+ if the `flag' field is zero.
+
+ The elements of ARGV aren't really const, because we permute them.
+ But we pretend they're const in the prototype to be compatible
+ with other systems.
+
+ LONGOPTS is a vector of `struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+int
+_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+ const struct option *longopts;
+ int *longind;
+ int long_only;
+{
+ optarg = NULL;
+
+ if (!__getopt_initialized || optind == 0)
+ {
+ optstring = _getopt_initialize (argc, argv, optstring);
+ optind = 1; /* Don't scan ARGV[0], the program name. */
+ __getopt_initialized = 1;
+ }
+
+ /* Test whether ARGV[optind] points to a non-option argument.
+ Either it does not have option syntax, or there is an environment flag
+ from the shell indicating it is not an option. The later information
+ is only used when the used in the GNU libc. */
+#ifdef _LIBC
+#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
+ || (optind < nonoption_flags_len \
+ && nonoption_flags[optind] == '1'))
+#else
+#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
+#endif
+
+ if (nextchar == NULL || *nextchar == '\0')
+ {
+ /* Advance to the next ARGV-element. */
+
+ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
+ moved back by the user (who may also have changed the arguments). */
+ if (last_nonopt > optind)
+ last_nonopt = optind;
+ if (first_nonopt > optind)
+ first_nonopt = optind;
+
+ if (ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (last_nonopt != optind)
+ first_nonopt = optind;
+
+ /* Skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (optind < argc && NONOPTION_P)
+ optind++;
+ last_nonopt = optind;
+ }
+
+ /* The special ARGV-element `--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (optind != argc && !strcmp (argv[optind], "--"))
+ {
+ optind++;
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (first_nonopt == last_nonopt)
+ first_nonopt = optind;
+ last_nonopt = argc;
+
+ optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (first_nonopt != last_nonopt)
+ optind = first_nonopt;
+ return -1;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if (NONOPTION_P)
+ {
+ if (ordering == REQUIRE_ORDER)
+ return -1;
+ optarg = argv[optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Skip the initial punctuation. */
+
+ nextchar = (argv[optind] + 1
+ + (longopts != NULL && argv[optind][1] == '-'));
+ }
+
+ /* Decode the current option-ARGV-element. */
+
+ /* Check whether the ARGV-element is a long option.
+
+ If long_only and the ARGV-element has the form "-f", where f is
+ a valid short option, don't consider it an abbreviated form of
+ a long option that starts with f. Otherwise there would be no
+ way to give the -f short option.
+
+ On the other hand, if there's a long option "fubar" and
+ the ARGV-element is "-fu", do consider that an abbreviation of
+ the long option, just like "--fu", and not "-f" with arg "u".
+
+ This distinction seems to be the most useful approach. */
+
+ if (longopts != NULL
+ && (argv[optind][1] == '-'
+ || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
+ {
+ char *nameend;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int exact = 0;
+ int ambig = 0;
+ int indfound = -1;
+ int option_index;
+
+ for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
+ {
+ if ((unsigned int) (nameend - nextchar)
+ == (unsigned int) strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second or later nonexact match found. */
+ ambig = 1;
+ }
+
+ if (ambig && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
+ argv[0], argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ optopt = 0;
+ return '?';
+ }
+
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ optind++;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ optarg = nameend + 1;
+ else
+ {
+ if (opterr)
+ if (argv[optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ _("%s: option `--%s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ _("%s: option `%c%s' doesn't allow an argument\n"),
+ argv[0], argv[optind - 1][0], pfound->name);
+
+ nextchar += strlen (nextchar);
+
+ optopt = pfound->val;
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (optind < argc)
+ optarg = argv[optind++];
+ else
+ {
+ if (opterr)
+ fprintf (stderr,
+ _("%s: option `%s' requires an argument\n"),
+ argv[0], argv[optind - 1]);
+ nextchar += strlen (nextchar);
+ optopt = pfound->val;
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short
+ option, then it's an error.
+ Otherwise interpret it as a short option. */
+ if (!long_only || argv[optind][1] == '-'
+ || my_index (optstring, *nextchar) == NULL)
+ {
+ if (opterr)
+ {
+ if (argv[optind][1] == '-')
+ /* --option */
+ fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
+ argv[0], nextchar);
+ else
+ /* +option or -option */
+ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
+ argv[0], argv[optind][0], nextchar);
+ }
+ nextchar = (char *) "";
+ optind++;
+ optopt = 0;
+ return '?';
+ }
+ }
+
+ /* Look at and handle the next short option-character. */
+
+ {
+ char c = *nextchar++;
+ char *temp = my_index (optstring, c);
+
+ /* Increment `optind' when we start to process its last character. */
+ if (*nextchar == '\0')
+ ++optind;
+
+ if (temp == NULL || c == ':')
+ {
+ if (opterr)
+ {
+ if (posixly_correct)
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, _("%s: illegal option -- %c\n"),
+ argv[0], c);
+ else
+ fprintf (stderr, _("%s: invalid option -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ return '?';
+ }
+ /* Convenience. Treat POSIX -W foo same as long option --foo */
+ if (temp[0] == 'W' && temp[1] == ';')
+ {
+ char *nameend;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int exact = 0;
+ int ambig = 0;
+ int indfound = 0;
+ int option_index;
+
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ optind++;
+ }
+ else if (optind == argc)
+ {
+ if (opterr)
+ {
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ return c;
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ optarg = argv[optind++];
+
+ /* optarg is now the argument, see if it's in the
+ table of longopts. */
+
+ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
+ {
+ if ((unsigned int) (nameend - nextchar) == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second or later nonexact match found. */
+ ambig = 1;
+ }
+ if (ambig && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
+ argv[0], argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ return '?';
+ }
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ optarg = nameend + 1;
+ else
+ {
+ if (opterr)
+ fprintf (stderr, _("\
+%s: option `-W %s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+
+ nextchar += strlen (nextchar);
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (optind < argc)
+ optarg = argv[optind++];
+ else
+ {
+ if (opterr)
+ fprintf (stderr,
+ _("%s: option `%s' requires an argument\n"),
+ argv[0], argv[optind - 1]);
+ nextchar += strlen (nextchar);
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+ nextchar = NULL;
+ return 'W'; /* Let the application handle it. */
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ optind++;
+ }
+ else
+ optarg = NULL;
+ nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ optind++;
+ }
+ else if (optind == argc)
+ {
+ if (opterr)
+ {
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr,
+ _("%s: option requires an argument -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ optarg = argv[optind++];
+ nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int
+getopt (argc, argv, optstring)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+{
+ return _getopt_internal (argc, argv, optstring,
+ (const struct option *) 0,
+ (int *) 0,
+ 0);
+}
+
+#endif /* Not ELIDE_CODE. */
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of `getopt'. */
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+
+ c = getopt (argc, argv, "abc:d:0123456789");
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/Build/source/texk/kpathsea/getopt.h b/Build/source/texk/kpathsea/getopt.h
new file mode 100644
index 00000000000..6b913c08058
--- /dev/null
+++ b/Build/source/texk/kpathsea/getopt.h
@@ -0,0 +1,153 @@
+/* Declarations for getopt.
+
+ Copyright 1989,90,91,92,93,94,96,97,2000,05 Free Software Foundation, Inc.
+
+ The original version of this file was part of the GNU C Library.
+ Its master source is NOT part of the C library, however.
+ The master source lives in /gd/gnu/lib.
+ This version has been modified for use with libkpathsea.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef _GETOPT_H
+#define _GETOPT_H 1
+
+#if defined(WIN32)
+#ifndef __STDC__
+#define __STDC__ 1
+#endif
+#endif
+
+#if defined (KPSE_DLL) && (defined (WIN32) || defined (__CYGWIN__))
+#ifdef MAKE_KPSE_DLL
+#define KPSEDLL __declspec(dllexport)
+#else /* ! MAKE_KPSE_DLL */
+#define KPSEDLL __declspec(dllimport)
+#endif
+#else /* ! (KPSE_DLL && (WIN32 || __CYGWIN__)) */
+#define KPSEDLL
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern KPSEDLL char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern KPSEDLL int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern KPSEDLL int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern KPSEDLL int optopt;
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct option
+{
+#if defined (__STDC__) && __STDC__
+ const char *name;
+#else
+ char *name;
+#endif
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+#if defined (__STDC__) && __STDC__
+#ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
+extern KPSEDLL int getopt (int argc, char *const *argv, const char *shortopts);
+#else /* not __GNU_LIBRARY__ */
+extern KPSEDLL int getopt ();
+#endif /* __GNU_LIBRARY__ */
+extern KPSEDLL int getopt_long (int argc, char *const *argv, const char *shortopts,
+ const struct option *longopts, int *longind);
+extern KPSEDLL int getopt_long_only (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind);
+
+/* Internal only. Users should not call this directly. */
+extern int _getopt_internal (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind,
+ int long_only);
+#else /* not __STDC__ */
+extern KPSEDLL int getopt ();
+extern KPSEDLL int getopt_long ();
+extern KPSEDLL int getopt_long_only ();
+
+extern int _getopt_internal ();
+#endif /* __STDC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GETOPT_H */
diff --git a/Build/source/texk/kpathsea/getopt1.c b/Build/source/texk/kpathsea/getopt1.c
new file mode 100644
index 00000000000..984bf934323
--- /dev/null
+++ b/Build/source/texk/kpathsea/getopt1.c
@@ -0,0 +1,190 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+
+ Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
+
+ The original version of this file was part of the GNU C Library.
+ It has been modified for use with libkpathsea.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "getopt.h"
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#define GETOPT_INTERFACE_VERSION 2
+#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#include <gnu-versions.h>
+#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+#define ELIDE_CODE
+#endif
+#endif
+
+#ifndef ELIDE_CODE
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+#include <stdlib.h>
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+int
+getopt_long (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+ If an option that starts with '-' (not '--') doesn't match a long option,
+ but does match a short option, it is parsed as a short option
+ instead. */
+
+int
+getopt_long_only (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+}
+
+
+#endif /* Not ELIDE_CODE. */
+
+#ifdef TEST
+
+#include <stdio.h>
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static struct option long_options[] =
+ {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "abc:d:0123456789",
+ long_options, &option_index);
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case 0:
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case 'd':
+ printf ("option d with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/Build/source/texk/kpathsea/hash.c b/Build/source/texk/kpathsea/hash.c
new file mode 100644
index 00000000000..fe5157f0997
--- /dev/null
+++ b/Build/source/texk/kpathsea/hash.c
@@ -0,0 +1,252 @@
+/* hash.c: hash table operations.
+
+ Copyright 1994, 95, 96, 97, 98, 99, 2000, 02, 05 Karl Berry & Olaf Weber.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-ctype.h>
+
+#include <kpathsea/hash.h>
+#include <kpathsea/str-list.h>
+
+
+/* The hash function. We go for simplicity here. */
+
+/* All our hash tables are related to filenames. */
+#ifdef MONOCASE_FILENAMES
+#if defined(WIN32) && !defined(__i386_pc_gnu__)
+/* This is way faster under Win32. */
+#define TRANSFORM(x) ((unsigned)CharLower((LPTSTR)(BYTE)(x)))
+#else
+#define TRANSFORM(x) (tolower(x))
+#endif
+#else
+#define TRANSFORM(x) (x)
+#endif
+
+static unsigned
+hash P2C(hash_table_type, table, const_string, key)
+{
+ unsigned n = 0;
+
+ /* Our keys aren't often anagrams of each other, so no point in
+ weighting the characters. */
+ while (*key != 0)
+ n = (n + n + TRANSFORM (*key++)) % table.size;
+
+ return n;
+}
+
+/* Identical has function as above, but does not normalize keys. */
+static unsigned
+hash_normalized P2C(hash_table_type, table, const_string, key)
+{
+ unsigned n = 0;
+
+ /* Our keys aren't often anagrams of each other, so no point in
+ weighting the characters. */
+ while (*key != 0)
+ n = (n + n + (*key++)) % table.size;
+
+ return n;
+}
+
+hash_table_type
+hash_create P1C(unsigned, size)
+{
+ /* hash_table_type ret; changed into "static ..." to work around gcc
+ optimizer bug for Alpha. */
+ static hash_table_type ret;
+ unsigned b;
+ ret.buckets = XTALLOC (size, hash_element_type *);
+ ret.size = size;
+
+ /* calloc's zeroes aren't necessarily NULL, so be safe. */
+ for (b = 0; b <ret.size; b++)
+ ret.buckets[b] = NULL;
+
+ return ret;
+}
+
+/* Whether or not KEY is already in MAP, insert it and VALUE. Do not
+ duplicate the strings, in case they're being purposefully shared. */
+
+void
+hash_insert P3C(hash_table_type *, table,
+ const_string, key,
+ const_string, value)
+{
+ unsigned n = hash (*table, key);
+ hash_element_type *new_elt = XTALLOC1 (hash_element_type);
+
+ new_elt->key = key;
+ new_elt->value = value;
+ new_elt->next = NULL;
+
+ /* Insert the new element at the end of the list. */
+ if (!table->buckets[n])
+ /* first element in bucket is a special case. */
+ table->buckets[n] = new_elt;
+ else
+ {
+ hash_element_type *loc = table->buckets[n];
+ while (loc->next) /* Find the last element. */
+ loc = loc->next;
+ loc->next = new_elt; /* Insert the new one after. */
+ }
+}
+
+/* Same as above, for normalized keys. */
+void
+hash_insert_normalized P3C(hash_table_type *, table,
+ const_string, key,
+ const_string, value)
+{
+ unsigned n = hash_normalized (*table, key);
+ hash_element_type *new_elt = XTALLOC1 (hash_element_type);
+
+ new_elt->key = key;
+ new_elt->value = value;
+ new_elt->next = NULL;
+
+ /* Insert the new element at the end of the list. */
+ if (!table->buckets[n])
+ /* first element in bucket is a special case. */
+ table->buckets[n] = new_elt;
+ else
+ {
+ hash_element_type *loc = table->buckets[n];
+ while (loc->next) /* Find the last element. */
+ loc = loc->next;
+ loc->next = new_elt; /* Insert the new one after. */
+ }
+}
+
+/* Remove a (KEY, VALUE) pair. */
+
+void
+hash_remove P3C(hash_table_type *, table, const_string, key,
+ const_string, value)
+{
+ hash_element_type *p;
+ hash_element_type *q;
+ unsigned n = hash (*table, key);
+
+ /* Find pair. */
+ for (q = NULL, p = table->buckets[n]; p != NULL; q = p, p = p->next)
+ if (FILESTRCASEEQ (key, p->key) && STREQ (value, p->value))
+ break;
+ if (p) {
+ /* We found something, remove it from the chain. */
+ if (q) q->next = p->next; else table->buckets[n] = p->next;
+ /* We cannot dispose of the contents. */
+ free (p);
+ }
+}
+
+/* Look up STR in MAP. Return a (dynamically-allocated) list of the
+ corresponding strings or NULL if no match. */
+
+#ifdef KPSE_DEBUG
+/* Print the hash values as integers if this is nonzero. */
+boolean kpse_debug_hash_lookup_int = false;
+#endif
+
+string *
+hash_lookup P2C(hash_table_type, table, const_string, key)
+{
+ hash_element_type *p;
+ str_list_type ret;
+ unsigned n = hash (table, key);
+ ret = str_list_init ();
+
+ /* Look at everything in this bucket. */
+ for (p = table.buckets[n]; p != NULL; p = p->next)
+ if (FILESTRCASEEQ (key, p->key))
+ /* Cast because the general str_list_type shouldn't force const data. */
+ str_list_add (&ret, (string) p->value);
+
+ /* If we found anything, mark end of list with null. */
+ if (STR_LIST (ret))
+ str_list_add (&ret, NULL);
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_HASH))
+ {
+ DEBUGF1 ("hash_lookup(%s) =>", key);
+ if (!STR_LIST (ret))
+ fputs (" (nil)\n", stderr);
+ else
+ {
+ string *r;
+ for (r = STR_LIST (ret); *r; r++)
+ {
+ putc (' ', stderr);
+ if (kpse_debug_hash_lookup_int)
+ fprintf (stderr, "%ld", (long) *r);
+ else
+ fputs (*r, stderr);
+ }
+ putc ('\n', stderr);
+ }
+ fflush (stderr);
+ }
+#endif
+
+ return STR_LIST (ret);
+}
+
+/* We only print nonempty buckets, to decrease output volume. */
+
+void
+hash_print P2C(hash_table_type, table, boolean, summary_only)
+{
+ unsigned b;
+ unsigned total_elements = 0, total_buckets = 0;
+
+ for (b = 0; b < table.size; b++) {
+ hash_element_type *bucket = table.buckets[b];
+
+ if (bucket) {
+ unsigned len = 1;
+ hash_element_type *tb;
+
+ total_buckets++;
+ if (!summary_only) fprintf (stderr, "%4d ", b);
+
+ for (tb = bucket->next; tb != NULL; tb = tb->next)
+ len++;
+ if (!summary_only) fprintf (stderr, ":%-5d", len);
+ total_elements += len;
+
+ if (!summary_only) {
+ for (tb = bucket; tb != NULL; tb = tb->next)
+ fprintf (stderr, " %s=>%s", tb->key, tb->value);
+ putc ('\n', stderr);
+ }
+ }
+ }
+
+ fprintf (stderr,
+ "%u buckets, %u nonempty (%u%%); %u entries, average chain %.1f.\n",
+ table.size,
+ total_buckets,
+ 100 * total_buckets / table.size,
+ total_elements,
+ total_buckets ? total_elements / (double) total_buckets : 0.0);
+}
diff --git a/Build/source/texk/kpathsea/hash.h b/Build/source/texk/kpathsea/hash.h
new file mode 100644
index 00000000000..d8048f1ad4a
--- /dev/null
+++ b/Build/source/texk/kpathsea/hash.h
@@ -0,0 +1,76 @@
+/* hash.h: declarations for a hash table.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1994, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef HASH_H
+#define HASH_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+
+/* A single (key,value) pair. */
+typedef struct hash_element_struct
+{
+ const_string key;
+ const_string value;
+ struct hash_element_struct *next;
+} hash_element_type;
+
+/* The usual arrangement of buckets initialized to null. */
+typedef struct
+{
+ hash_element_type **buckets;
+ unsigned size;
+} hash_table_type;
+
+#ifdef KPSE_DEBUG
+/* How to print the hash results when debugging. */
+extern KPSEDLL boolean kpse_debug_hash_lookup_int;
+#endif
+
+/* Create a hash table of size SIZE. */
+extern KPSEDLL hash_table_type hash_create P1H(unsigned size);
+
+/* Insert the (KEY,VALUE) association into TABLE. KEY may have more
+ than one VALUE. Neither KEY nor VALUE is copied. */
+extern KPSEDLL void hash_insert P3H(hash_table_type *table,
+ const_string key,
+ const_string value);
+
+/* Insert the (KEY, VALUE) association into TABLE. KEY may have more
+ than one VALUE. Neither KEY nor VALUE is copied. Assume that KEY
+ is already normalized (all lowercase) on platforms where this matters. */
+extern KPSEDLL void hash_insert_normalized P3H(hash_table_type *table,
+ const_string key,
+ const_string value);
+
+/* Remove the (KEY,VALUE) association from TABLE. */
+extern KPSEDLL void hash_remove P3H(hash_table_type *table, const_string key,
+ const_string value);
+
+/* Look up KEY in MAP, and return NULL-terminated list of all matching
+ values (not copies), in insertion order. If none, return NULL. */
+extern KPSEDLL string *hash_lookup P2H(hash_table_type table, const_string key);
+
+/* Print TABLE to stderr. */
+extern void hash_print P2H(hash_table_type table, boolean summary_only);
+
+#endif /* not HASH_H */
diff --git a/Build/source/texk/kpathsea/hier.texi b/Build/source/texk/kpathsea/hier.texi
new file mode 100644
index 00000000000..007be809140
--- /dev/null
+++ b/Build/source/texk/kpathsea/hier.texi
@@ -0,0 +1,102 @@
+@ifclear version
+@defcodeindex fl
+@defcodeindex op
+@end ifclear
+
+@node TeX directory structure
+@section @TeX{} directory structure
+
+@vindex TEXMF
+@cindex @TeX{} directory structure
+@cindex directory structure, for @TeX{} files
+@cindex skeleton @TeX{} directory
+@cindex TDS
+
+This section describes the default installation hierarchy of the
+distribution. It conforms to both the GNU coding standards and the
+@TeX{} directory structure (TDS) standard. For rationale and further
+explanation, please see those documents. The GNU standard is available
+as @url{ftp://prep.ai.mit.edu/pub/gnu/standards/standards.texi} and
+mirrors. The TDS document is available from
+@file{@var{CTAN:}/tex-archive/tds} (@pxref{unixtex.ftp}).
+
+You can change the default paths in many ways (@pxref{Changing search
+paths}). One common desire is to put everything (binaries and all)
+under a single top-level directory such as @file{/usr/local/texmf} or
+@file{/opt/texmf}---in the terms used below, make @var{prefix} and
+@var{texmf} the same. For specific instructions on doing that,
+see @ref{configure scenarios}.
+
+Here is a skeleton of the default directory structure, extracted from
+the TDS document:
+
+@example
+@var{prefix}/ @r{installation root (@file{/usr/local} by default)}
+ bin/ @r{executables}
+ man/ @r{man pages}
+ include/ @r{C header files}
+ info/ @r{GNU info files}
+ lib/ @r{libraries (@file{libkpathsea.*})}
+ share/ @r{architecture-independent files}
+ texmf/ @r{TDS root}
+ bibtex/ @r{Bib@TeX{} input files}
+ bib/ @r{Bib@TeX{} databases}
+ base/ @r{base distribution (e.g., @samp{xampl.bib})}
+ misc/ @r{single-file databases}
+ @var{pkg}/ @r{name of a package}
+ bst/ @r{Bib@TeX{} style files}
+ base/ @r{base distribution (e.g., @samp{plain.bst}, @samp{acm.bst})}
+ misc/ @r{single-file styles}
+ @var{pkg}/ @r{name of a package}
+ doc/ @r{additional documentation}
+ dvips/ @r{@samp{.pro}, @samp{.ps}, @samp{psfonts.map}}
+ fonts/ @r{font-related files}
+ @var{type}/ @r{file type (e.g., @samp{tfm}, @samp{pk})}
+ @var{mode}/ @r{type of output device (types @samp{pk} and @samp{gf} only)}
+ @var{supplier}/ @r{name of a font supplier (e.g., @samp{public})}
+ @var{typeface}/ @r{name of a typeface (e.g., @samp{cm})}
+ dpi@var{nnn}/ @r{font resolution (types @samp{pk} and @samp{gf} only)}
+ metafont/ @r{Metafont (non-font) input files}
+ base/ @r{base distribution (e.g., @samp{plain.mf})}
+ misc/ @r{single-file packages (e.g., @samp{modes.mf})}
+ @var{pkg}/ @r{name of a package (e.g., @samp{mfpic})}
+ metapost/ @r{MetaPost input files}
+ base/ @r{base distribution (e.g., @samp{plain.mp})}
+ misc/ @r{single-file packages}
+ @var{pkg}/ @r{name of a package}
+ support/ @r{support files for MetaPost-related utilities (e.g., @samp{trfonts.map})}
+ mft/ @r{@samp{MFT} inputs (e.g., @samp{plain.mft})}
+ tex/ @r{@TeX{} input files}
+ @var{format}/ @r{name of a format (e.g., @samp{plain})}
+ base/ @r{base distribution for @var{format} (e.g., @samp{plain.tex})}
+ misc/ @r{single-file packages (e.g., @samp{webmac.tex})}
+ local/ @r{local additions to or local configuration files for @var{format}}
+ @var{pkg}/ @r{name of a package (e.g., @samp{graphics}, @samp{mfnfss})}
+ generic/ @r{format-independent packages}
+ hyphen/ @r{hyphenation patterns (e.g., @samp{hyphen.tex})}
+ images/ @r{image input files (e.g., Encapsulated PostScript)}
+ misc/ @r{single-file format-independent packages (e.g., @samp{null.tex}).}
+ @var{pkg}/ @r{name of a package (e.g., @samp{babel})}
+ web2c/ @r{implementation-dependent files (@file{.pool}, @file{.fmt}, @file{texmf.cnf}, etc.)}
+@end example
+
+Some concrete examples for most file types:
+
+@example
+/usr/local/bin/tex
+/usr/local/man/man1/xdvi.1
+/usr/local/info/kpathsea.info
+/usr/local/lib/libkpathsea.a
+/usr/local/share/texmf/bibtex/bst/base/plain.bst
+/usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk
+/usr/local/share/texmf/fonts/source/public/pandora/pnr10.mf
+/usr/local/share/texmf/fonts/tfm/public/cm/cmr10.tfm
+/usr/local/share/texmf/fonts/type1/adobe/utopia/putr.pfa
+/usr/local/share/texmf/metafont/base/plain.mf
+/usr/local/share/texmf/metapost/base/plain.mp
+/usr/local/share/texmf/tex/plain/base/plain.tex
+/usr/local/share/texmf/tex/generic/hyphen/hyphen.tex
+/usr/local/share/texmf/web2c/tex.pool
+/usr/local/share/texmf/web2c/tex.fmt
+/usr/local/share/texmf/web2c/texmf.cnf
+@end example
diff --git a/Build/source/texk/kpathsea/install.texi b/Build/source/texk/kpathsea/install.texi
new file mode 100644
index 00000000000..09e02d7e410
--- /dev/null
+++ b/Build/source/texk/kpathsea/install.texi
@@ -0,0 +1,1235 @@
+@ifclear version
+@defcodeindex cm
+@defcodeindex fl
+@defcodeindex op
+@end ifclear
+
+@node Installation
+@chapter Installation
+
+@cindex installation
+@cindex configuration
+@cindex compilation
+
+@ifset version
+(A copy of this chapter is in the distribution file @file{kpathsea/INSTALL}.)
+@end ifset
+
+The procedure for Kpathsea (and Web2c, etc.) configuration and
+installation follows. If you encounter trouble, see @ref{Common
+problems}, a copy of which is in the file @file{kpathsea/BUGS}.
+
+@menu
+* Simple installation:: If you just want to do it.
+* Custom installation:: If you want to change things around.
+* Security:: Who can write what files, etc.
+* TeX directory structure:: Managing the horde of TeX input files.
+* unixtex.ftp:: Getting software via FTP, on CD-ROM, or on tape.
+* Reporting bugs:: Where and how to report bugs.
+@end menu
+
+
+@node Simple installation
+@section Simple installation
+
+@cindex simple installation
+@cindex installation, simple
+
+@cindex precompiled executables, instead of installation
+@cindex installation, getting executables instead of
+Installing @TeX{} and friends for the first time can be a daunting
+experience. Thus, you may prefer to skip this whole thing and just get
+precompiled executables: see @ref{unixtex.ftp}.
+
+This section explains what to do if you wish to take the defaults for
+everything, and generally to install in the simplest possible way. Most
+steps here refer to corresponding subsection in the next section which
+explains how to override defaults and generally gives more details.
+
+By default everything will be installed under @file{/usr/local} and the
+following discussion assumes this. However, if you already have @TeX{}
+installed, its location is used to derive the directory under which
+everything is to be installed.
+
+@enumerate
+@item
+Be sure you have enough disk space: approximately 8 megabytes for the
+compressed archives, 15MB for sources, 50MB for compilation, 40MB for
+the (initial) installed system (including library files). @xref{Disk
+space}.
+
+@item
+Retrieve these distribution archives:
+@table @url
+@item ftp://ftp.tug.org/tex/texk.tar.gz
+These are the sources, which you will be compiling.
+
+@item ftp://ftp.tug.org/tex/texklib.tar.gz
+This is a basic set of input files. You should unpack it in the
+directory @file{/usr/local/share}; doing so will create a @file{texmf}
+subdirectory there.
+@end table
+
+These archives are mirrored on the CTAN hosts, in the
+@file{systems/web2c} directory.
+
+@noindent @xref{Kpathsea application distributions}.
+
+@item
+When using the default search paths, there is no need to edit any
+distribution files. @xref{Changing search paths}.
+
+@item
+At the top level of the distribution, run @samp{sh configure}. (If you
+have the GNU Bash shell installed, run @samp{bash configure}.)
+@xref{Running configure}.
+
+@item
+@samp{make}. @xref{Running make}. If you are using a BSD 4.4 system
+such as FreeBSD or NetBSD, you may have to use GNU make (often installed
+in @file{/usr/local/bin}), not the BSD make.
+
+@item
+@samp{make install}. @xref{Installing files}.
+
+@item
+@samp{make distclean}. @xref{Cleaning up}.
+
+@item
+Set up a cron job to rebuild the filename database that makes searching
+faster. This line will rebuild it every midnight:
+@example
+0 0 * * * cd /usr/local/share/texmf && @var{/bindir}/mktexlsr
+@end example
+@xref{Filename database generation}, and @ref{Filename database}.
+
+@item
+@cindex printer configuration files
+@cindex PostScript fonts, additional
+@cindex color printers, configuring
+If you're installing Dvips, you also need to set up configuration files
+for your printers and make any additional PostScript fonts available.
+@xref{Installation,,, dvips, Dvips}. If you have any color printers,
+see @ref{Color device configuration,,, dvips, Dvips}.
+
+@item
+The first time you run a DVI driver, a bunch of PK fonts will be built
+by Metafont via @code{mktexpk} (and added to the filename database).
+This will take some time. Don't be alarmed; they will created only this
+first time (unless something is wrong with your path definitions).
+
+By default, @code{mktexpk} will create these fonts in a hierarchy
+under @file{/var/tmp/texfonts}; it simply assumes that @file{/var/tmp}
+exists and is globally writable. If you need a different arrangement,
+see @ref{mktex configuration}.
+
+@xref{mktex scripts}.
+
+@item
+@cindex fonts, being created
+@pindex mktexpk @r{, initial runs}
+@cindex tests, simple
+For some simple tests, try @samp{tex story \\bye} and @samp{latex
+sample2e}. Then run @file{xdvi story} or @file{dvips sample2e} on the
+resulting DVI files to preview/print the documents. @xref{Installation
+testing}.
+@end enumerate
+
+
+@node Custom installation
+@section Custom installation
+
+@cindex custom installation
+@cindex installation, customized
+
+Most sites need to modify the default installation procedure in some
+way, perhaps merely changing the prefix from @samp{/usr/local}, perhaps
+adding extra compiler or loader options to work around @code{configure}
+bugs. This section explains how to override default choices. For
+additional distribution-specific information:
+@itemize @bullet
+@item @file{dviljk/INSTALL}.
+@item @xref{Installation,,,dvips,Dvips}.
+@item @xref{Installation,,,web2c,Web2c}.
+@item @file{xdvik/INSTALL}.
+@end itemize
+
+@cindex non-Unix operating systems
+@cindex Amiga support
+@cindex DOS support
+@cindex OS/2 support
+@cindex VMS support
+These instructions are for Unix systems. Other operating-system
+specific distributions have their own instructions. The code base
+itself supports Amiga, DOS, OS/2, and VMS.
+
+
+Following are the same steps as in the previous section (which describes
+the simplest installation), but with much more detail.
+
+@menu
+* Disk space::
+* Kpathsea application distributions::
+* Changing search paths::
+* Running configure::
+* Running make::
+* Installing files::
+* Cleaning up::
+* Filename database generation::
+* mktex scripts::
+* Installation testing::
+@end menu
+
+
+@node Disk space
+@subsection Disk space
+
+@cindex disk space, needed
+@cindex total disk space
+@cindex size of distribution archives
+Here is a table showing the disk space needed for each distribution
+(described in the next section). The `(totals)' line reflects the
+@samp{texk} source distribution and @samp{texklib}; the individual
+distributions don't enter into it. Sizes are in megabytes. All numbers
+are approximate.
+
+@multitable {distribution} {.tar.gz} {unpacked} {compiled} {installed}
+@item Distribution @tab .tar.gz @tab Unpacked @tab Compiled @tab Installed
+@item dviljk @tab .9 @tab 3.8 @tab
+@item dvipsk @tab .9 @tab 3.2 @tab
+@item xdvik @tab .7 @tab 2.5 @tab
+@item web2c @tab 1.3 @tab 5.0 @tab
+@item web @tab 1.9 @tab 6.5 @tab - @tab -
+@item texk @tab 7.5 @tab 32.1 @tab 95.3 @tab 33.5
+@item texklib @tab 6.3 @tab 15.0 @tab - @tab 15.0
+@item (totals) @tab 14.6 @tab 47.1 @tab 95.3 @tab 48.5
+@end multitable
+
+
+@node Kpathsea application distributions
+@subsection Kpathsea application distributions
+
+@cindex distributions, compiling simultaneously
+@cindex version number, of Kpathsea
+@cindex Kpathsea version number
+
+@cindex distributions, not compiling
+@cindex NeXT, lacking X11
+@cindex X11, lacking on NeXT
+The archive @url{ftp://ftp.tug.org/tex/texk.tar.gz} contains all of the
+Kpathsea applications I maintain, and the library itself. For example,
+since NeXT does not generally support X11, you'd probably want to skip
+@samp{xdvik} (or simply remove it after unpacking @file{texk.tar.gz}.
+If you are not interested in all of them, you can also retrieve them
+separately:
+
+@cindex DVI drivers
+@table @file
+@item dviljk.tar.gz
+@cindex PCL driver
+@cindex LaserJet drive
+DVI to PCL, for LaserJet printers.
+
+@item dvipsk.tar.gz
+@cindex PDF generation
+@cindex PostScript driver
+DVI to PostScript, for previewers, printers, or PDF generation.
+
+@item web2c.tar.gz
+The software needed to compile @TeX{} and friends.
+
+@item web.tar.gz
+The original WEB source files, also used in compilation.
+
+@item xdvik.tar.gz
+@cindex X11 previewer
+DVI previewing under the X window system.
+
+@end table
+
+@cindex Babel
+@cindex non-English typesetting
+If you want to use the Babel La@TeX{} package for support of non-English
+typesetting, you may need to retrieve additional files. See the file
+@file{install.txt} in the Babel distribution.
+
+
+@node Changing search paths
+@subsection Changing search paths
+
+@cindex search paths, changing default
+@cindex paths, changing default
+@flindex texmf.in@r{, editing}
+If the search paths for your installation differ from the standard
+@TeX{} directory structure (@pxref{Top,, Introduction, tds, A Directory
+Structure for @TeX{} files}), edit the file @file{kpathsea/texmf.in}
+as desired, before running @code{configure}. For example, if you have
+all your fonts or macros in one big directory.
+
+You may also wish to edit the file @file{mktex.cnf}, either before or
+after installation, to control various aspects of @code{mktexpk} and
+friends. @xref{mktex configuration}.
+
+You do not need to edit @file{texmf.in} to change the default
+top-level or other installation @emph{directories} (only the paths).
+You can and should do that when you run @code{configure} (next step).
+
+You also do not need to edit @file{texmf.in} if you are willing to
+rely on @file{texmf.cnf} at runtime to define the paths, and let the
+compile-time default paths be incorrect. Usually there is no harm in
+doing this.
+
+The section below explains default generation in more detail.
+
+@menu
+* Default path features::
+* Default path generation::
+@end menu
+
+
+@node Default path features
+@subsubsection Default path features
+
+@cindex default path features
+@cindex features, of default paths
+
+The purpose of having all the different files described in the section
+above is to avoid having the same information in more than one place. If
+you change the installation directories or top-level prefix at
+@code{configure}-time, those changes will propagate through the whole
+sequence. And if you change the default paths in @file{texmf.in},
+those changes are propagated to the compile-time defaults.
+
+The Make definitions are all repeated in several @t{Makefile}'s; but
+changing the top-level @file{Makefile} should suffice, as it passes down
+all the variable definitions, thus overriding the submakes. (The
+definitions are repeated so you can run Make in the subdirectories, if
+you should have occasion to.)
+
+@vindex MAKETEX_MODE
+@cindex paths, device name included in
+By default, the bitmap font paths end with @samp{/$MAKETEX_MODE}, thus
+including the device name (usually a Metafont mode name such as
+@samp{ljfour}). This distinguishes two different devices with the same
+resolution---a write/white from a write/black 300@dmn{dpi} printer, for
+example.
+
+@findex kpse_init_prog@r{, and @code{MAKETEX_MODE}}
+@flindex proginit.c
+However, since most sites don't have this complication, Kpathsea
+(specifically, the @code{kpse_init_prog} function in
+@file{kpathsea/proginit.c}) has a special case: if the mode has not been
+explicitly set by the user (or in a configuration file), it sets
+@code{MAKETEX_MODE} to @code{/}. This makes the default PK path, for
+example, expand into @code{@dots{}/pk//}, so fonts will be found even if
+there is no subdirectory for the mode (if you arranged things that way
+because your site has only one printer, for example) or if the program
+is mode-independent (e.g., @code{pktype}).
+
+To make the paths independent of the mode, simply edit
+@file{texmf.in} before installation, or the installed
+@file{texmf.cnf}, and remove the @samp{$MAKETEX_MODE}.
+
+@xref{mktex script arguments}, for how this interacts with @code{mktexpk}.
+
+@flindex HIER
+@flindex kpathsea/HIER
+@xref{TeX directory structure,, @TeX{} directory structure}, for a
+description of the default arrangement of the input files that comprise
+the @TeX{} system. The file @file{kpathsea/HIER} is a copy of that
+section.
+
+
+@node Default path generation
+@subsubsection Default path generation
+
+@cindex default paths, changing
+@cindex paths, changing default
+@cindex installation, changing default directories
+@cindex directories, changing default installation
+
+This section describes how the default paths are constructed.
+
+You may wish to ignore the whole mess and simply edit @file{texmf.cnf}
+after it is installed, perhaps even copying it into place beforehand so
+you can complete the installation, if it seems necessary.
+
+@cindex default paths, how they're made
+To summarize the chain of events that go into defining the default paths:
+
+@enumerate
+@item
+@samp{configure} creates a @file{Makefile} from each @file{Makefile.in}.
+
+@item
+@flindex texmf.sed
+When Make runs in the @file{kpathsea} directory, it creates a file
+@file{texmf.sed} that substitutes the Make value of @code{$(var)} for a
+string @code{@@var@@}. The variables in question are the one that
+define the installation directories.
+
+@item
+@flindex texmf.in
+@flindex texmf.cnf@r{, generated}
+@file{texmf.sed} (together with a little extra magic---see
+@file{kpathsea/Makefile}) is applied to @file{texmf.in} to generate
+@file{texmf.cnf}. This is the file that will eventually be installed
+and used.
+
+@item
+@flindex paths.h
+The definitions in @file{texmf.cnf} are recast as C @code{#define}'s in
+@file{paths.h}. These values will be the compile-time defaults; they
+are not used at runtime unless no @file{texmf.cnf} file can be found.
+
+(That's a lie: the compile-time defaults are what any extra @t{:}'s in
+@file{texmf.cnf} expand into; but the paths as distributed have no extra
+@t{:}'s, and there's no particular reason for them to.)
+@end enumerate
+
+
+@node Running configure
+@subsection Running @code{configure}
+
+@flindex configure@r{, running}
+@flindex c-auto.in
+@flindex Makefile.in
+@findex ac_include@r{, Autoconf extension}
+@cindex @@@var{var}@@ substitutions
+@cindex system dependencies
+Run @code{sh configure @var{options}} (in the top-level directory, the
+one containing @file{kpathsea/}), possibly using a shell other than
+@code{sh} (@pxref{configure shells}).
+
+@code{configure} adapts the source distribution to the present system
+via @code{#define}'s in @file{*/c-auto.h}, which are created from the
+corresponding @file{c-auto.in}. It also creates a @file{Makefile} from
+the corresponding @file{Makefile.in}, doing @samp{@@@var{var}@@} and
+@samp{ac_include} substitutions).
+
+@flindex README.CONFIGURE
+@flindex kpathsea/README.CONFIGURE
+@code{configure} is the best place to control the configuration,
+compilation, and installed location of the software, either via
+command-line options, or by setting environment variables before
+invoking it. For example, you can disable @code{mktexpk} by default
+with the option @samp{--disable-mktexpk}.
+@xref{configure options}.
+
+@menu
+* configure shells::
+* configure options::
+* configure environment::
+* configure scenarios::
+* Shared library::
+@end menu
+
+
+@node configure shells
+@subsubsection @code{configure} shells
+
+@cindex shells and @code{configure}
+@pindex bash@r{, recommended for running @code{configure}}
+
+Considerable effort has gone into trying to ensure that the
+@code{configure} scripts can be run by most Bourne shell variants.
+If @code{sh} runs into trouble, your best bet is to use Bash, the GNU
+Bourne-again shell (@pxref{Top,,,bash,Bash Reference Manual}).
+
+Bourne shell variants for which problems have been reported in the past
+are:
+@table @code
+@item ksh
+@pindex ksh@r{, losing with @code{configure}}
+@pindex bsh@r{, ok with @code{configure}}
+@cindex Korn shell@r{, losing with @code{configure}}
+@cindex AIX shells and @code{configure}
+Old versions of the Korn shell may fail to handle the scripts. The Korn
+shell may be installed as @file{/bin/sh} on AIX, in which case
+@file{/bin/bsh} may serve instead.
+
+@item ash
+@pindex ash@r{, losing with @code{configure}}
+@cindex NetBSD shells and @code{configure}
+@cindex FreeBSD shells and @code{configure}
+@cindex Linux shells and @code{configure}
+Old versions of ash are unable to handle the scripts. Ash is sometimes
+installed as @file{/bin/sh} on NetBSD, FreeBSD, and Linux systems.
+@file{/bin/bash} should be available for those systems, but might not be
+part of a default installation.
+
+@item @r{Ultrix} /bin/sh
+@cindex DEC shells and @code{configure}
+@cindex Ultrix shells and @code{configure}
+@pindex sh5@r{, ok with @code{configure}}
+@file{/bin/sh} under Ultrix is a DEC-grown shell that is notably
+deficient in many ways. @file{/bin/sh5} may be necessary.
+@end table
+
+
+@node configure options
+@subsubsection @code{configure} options
+
+@cindex @code{configure} options
+
+For a complete list of all @code{configure} options, run @samp{configure
+--help} or see @ref{Invoking configure,, Running @code{configure} scripts,
+autoconf, Autoconf}, (a copy is in the file @file{kpathsea/README.CONFIGURE}).
+The generic options are listed first in the @samp{--help} output, and
+the package-specific options come last. The environment variables
+@code{configure} pays attention to are listed below.
+
+Options particularly likely to be useful are @samp{--prefix},
+@samp{--datadir}, and the like; see @ref{configure scenarios}.
+
+@opindex --with @r{options}
+@opindex --enable @r{options}
+@cindex configuration of optional features
+@cindex options to @code{configure}
+This section gives pointers to descriptions of the @samp{--with} and
+@samp{--enable} options to @code{configure} that Kpathsea-using programs
+accept.
+
+@table @samp
+@item --without-mktexmf-default
+@itemx --without-mktexpk-default
+@itemx --without-mktextfm-default
+@itemx --with-mktextex-default
+Enable or disable the dynamic generation programs. @xref{mktex
+configuration}.
+
+@item --enable-shared
+@opindex --enable-shared
+Build Kpathsea as a shared library, and link against it. Also build the
+usual static library. @xref{Shared library}.
+
+@item --disable-static
+@opindex --disable-static
+Build only the shared library. Implies @samp{--enable-shared}.
+
+@item --enable-maintainer-mode
+@opindex --enable-maintainer-mode
+Enables make targets that are useful for the maintainer and likely to be
+a pain for anyone else; the makefiles created when this option is
+enabled may not work at all for you. You have been warned.
+@end table
+
+@node configure environment
+@subsubsection @code{configure} environment
+
+@code{configure} uses the value of the following environment variables in
+determining your system's characteristics, and substitutes for them in
+@t{Makefile}'s:
+
+@vtable @samp
+@item CC
+@pindex gcc@r{, compiling with}
+@pindex cc@r{, compiling with}
+The compiler to use: default is @code{gcc} if it's installed, otherwise
+@code{cc}.
+
+@item CFLAGS
+@cindex compiler options, specifying
+Options to give the compiler: default is @samp{-g -O2} for @code{gcc},
+@samp{-g} otherwise. @code{CFLAGS} comes after any other options. You
+may need to include @code{-w} here if your compilations commonly have
+useless warnings (e.g., @code{NULL redefined}), or @code{configure} may
+fail to detect the presence of header files (it takes the messages on
+standard error to mean the header file doesn't exist).
+
+@item CPPFLAGS
+@cindex configuration compiler options
+Options to pass to the compiler preprocessor; this matters most for
+configuration, not the actual source compilation. The @code{configure}
+script often does only preprocessing (e.g., to check for the existence
+of @t{#include} files), and @code{CFLAGS} is not used for this. You may
+need to set this to something like
+@samp{-I/usr/local/include/wwwhatever} if you have the libwww library
+installed for hyper-xdvik (see @file{xdvik/INSTALL}).
+
+@item DEFS
+@cindex preprocessor options
+Additional preprocessor options, but not used by @code{configure}.
+Provided for enabling or disabling program features, as documented in
+the various program-specific installation instructions. @code{DEFS}
+comes before any compiler options included by the distribution
+@file{Makefile}s or by @code{configure}.
+
+@item LDFLAGS
+@cindex loader options
+Additional options to give to the loader. @code{LDFLAGS} comes before
+any other linker options.
+
+@item LIBS
+@cindex libraries, specifying additional
+Additional libraries to link with.
+@end vtable
+
+
+@node configure scenarios
+@subsubsection @code{configure} scenarios
+
+Here are some common installation scenarios:
+
+@itemize @bullet
+@item
+Including X support in Metafont. This is disabled by default, since
+many sites have no use for it, and it's a leading cause of configuration
+problems.
+@example
+configure --with-x
+@end example
+
+@item
+@cindex @TeX{} hierarchy, one
+Putting the binaries, @TeX{} files, GNU info files, etc.@: into a single
+@TeX{} hierarchy, say @file{/here/texmf}, requires overriding defaults in
+@code{configure}:
+@example
+configure --prefix=/here/texmf --datadir=/here
+@end example
+
+@item
+@cindex multiple architectures, compiling on
+@cindex architectures, compiling multiple
+@cindex symbolic link trees, for multiple architectures
+@opindex --srcdir@r{, for building multiple architectures}
+@pindex lndir @r{for building symlink trees}
+You can compile on multiple architectures simultaneously either by
+building symbolic link trees with the @code{lndir} script from the X11
+distribution, or with the @samp{--srcdir} option:
+@example
+configure --srcdir=@var{srcdir}
+@end example
+
+@item
+@cindex multiple architectures, directories for
+If you are installing binaries for multiple architectures into a single
+hierarchy, you will probably want to override the default @file{bin} and
+@file{lib} directories, something like this:
+@example
+configure --prefix=@var{texmf} --datadir=@var{texmf} \
+ --bindir=@var{texmf}/@var{arch}/bin --libdir=@var{texmf}/@var{arch}/lib
+make texmf=@var{texmf}
+@end example
+@pindex depot
+@cindex automounter, and configuration
+@noindent (Unless you make provisions for architecture-specific files in
+other ways, e.g., with Depot or an automounter.)
+
+@item
+@opindex -O@r{, compiling with}
+@opindex -g@r{, compiling without}
+@cindex optimization, enabling
+@cindex debugging with @samp{-g}, disabling
+To compile with optimization (to compile without debugging, remove the
+@samp{-g}):
+@example
+env CFLAGS="-g -O" sh configure @dots{}
+@end example
+@noindent For a potential problem if you optimize, see @ref{TeX or
+Metafont failing,, @TeX{} or Metafont failing}.
+@end itemize
+
+
+@node Shared library
+@subsubsection Shared library
+
+@cindex shared library, making
+
+@opindex --enable-shared
+You can compile Kpathsea as a shared library on a few systems, by
+specifying the option @samp{--enable-shared} when you run
+@samp{configure}.
+
+@cindex code sharing
+The main advantage in doing this is that the executables can then share
+the code, thus decreasing memory and disk space requirements.
+
+On some systems, you can record the location of shared libraries in a
+binary, usually by giving certain options to the linker. Then
+individual users do not need to set their system's environment variable
+(e.g., @code{LD_LIBRARY_PATH}) to find shared libraries. If you want to
+do this, you will need to add the necessary options to @code{LDFLAGS}
+yourself; for example, on Solaris, include something like
+@samp{-R$@{prefix@}/lib}, on IRIX or Linux, use
+@samp{-rpath$@{prefix@}/lib}. (Unfortunately, making this happen by
+default is very difficult, because of interactions with an existing
+installed shared library.)
+
+Currently, shared library support is implemented only on Linux, SunOS 4
+(Solaris 1), SunOS 5 (Solaris 2), IRIX 5, and IRIX 6. If you're
+interested and willing in adding support for other systems, please see
+the @samp{configure} mode in the @file{klibtool} script, especially the
+host-specific case statement around line 250.
+
+
+@node Running make
+@subsection Running @code{make}
+
+@pindex make@r{, running}
+
+@flindex texmf.cnf@r{, creating}
+@flindex paths.h@r{, creating}
+@code{make} (still in the top-level directory). This also creates the
+@file{texmf.cnf} and @file{paths.h} files that define the default search
+paths, and (by default) the @samp{plain} and @samp{latex} @TeX{} formats.
+
+@cindex fallback resolutions, overriding
+You can override directory names and other values at @code{make}-time.
+@file{make/paths.make} lists the variables most commonly reset. For
+example, @samp{make default_texsizes=600} changes the list of fallback
+resolutions.
+
+You can also override each of @code{configure}'s environment variables
+(@pxref{configure environment}). The Make variables have the same names.
+
+Finally, you can supply additional options via the following variables.
+(@code{configure} does not use these.)
+
+@vtable @samp
+@item XCPPFLAGS
+@itemx XDEFS
+@cindex preprocessor options, additional
+Preprocessor options.
+
+@item XCFLAGS
+@cindex compiler options, additional
+Compiler options.
+
+@item XLDFLAGS
+@cindex loader options, initial
+Loader options (included at beginning of link commands).
+
+@item XLOADLIBES
+@cindex loader options, final
+More loader options (included at end of link commands).
+
+@item XMAKEARGS
+@cindex Make arguments, additional
+Additional Make arguments passed to all sub-@code{make}'s. You may need
+to include assignments to the other variables here via @code{XMAKEARGS};
+for example: @samp{make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"}.
+@end vtable
+
+@cindex compiler, changing
+@cindex libraries, changing
+It's generally a bad idea to use a different compiler (@samp{CC}) or
+libraries (@code{LIBS}) for compilation than you did for configuration,
+since the values @code{configure} determined may then be incorrect.
+
+@cindex universe, BSD vs.@: system V
+@cindex BSD universe
+@cindex system V universe
+@cindex Solaris BSD compatibility, not
+@flindex libucb@r{, avoiding}
+@flindex ucbinclude@r{, avoiding}
+Adding compiler options to change the ``universe'' you are using
+(typically BSD vs.@: system V) is generally a cause of trouble. It's
+best to use the native environment, whatever that is; @code{configure}
+and the software usually adapt best to that. In particular, under
+Solaris 2.x, you should not use the BSD-compatibility library
+(@file{libucb}) or include files (@file{ucbinclude}).
+
+@cindex Babel
+If you want to use the Babel La@TeX{} package for support of non-English
+typesetting, you need to modify some files before making the La@TeX{}
+format. See the file @file{install.txt} in the Babel distribution.
+
+
+@node Installing files
+@subsection Installing files
+
+@cindex installing files
+
+The basic command is the usual @code{make install}. For security
+issues, @pxref{Security}.
+
+The first time you install any manual in the GNU Info system, you should
+add a line (you choose where) to the file @file{dir} in your
+@samp{$(infodir)} directory. Sample text for this is given near the top
+of the Texinfo source files (@file{kpathsea/kpathsea.texi},
+@file{dvipsk/dvips.texi}, and @file{web2c/doc/web2c.texi}).
+If you have a recent version of the GNU Texinfo distribution installed
+(@url{ftp://prep.ai.mit.edu/pub/gnu/texinfo-3.9.tar.gz} or later), this
+should happen automatically.
+
+On the offchance that this is your first Info installation, the
+@file{dir} file I use is included in the distribution as
+@file{etc/dir-example}.
+
+@cindex multiple architectures, installing on
+@cindex architecture-(in)dependent files, installing only
+@cindex installation, architecture-(in)dependent files only
+You may wish to use one of the following targets, especially if you are
+installing on multiple architectures:
+@itemize @bullet
+@item
+@findex install-exec @r{Make target}
+@code{make install-exec} to install in architecture-dependent
+directories, i.e., ones that depend on the @code{$(exec_prefix)} Make
+variable. This includes links to binaries, libraries, etc., not just
+``executables''.
+
+@item
+@findex install-data @r{Make target}
+@code{make install-data} to install in architecture-independent
+directories, such as documentation, configuration files, pool files, etc.
+@end itemize
+
+@cindex AFS
+@cindex Andrew File System, installing with
+@flindex /afs/@dots{} @r{, installing into}
+If you use the Andrew File System, the normal path (e.g.,
+@var{prefix}/bin) only gets you to a read-only copy of the files, and
+you must specify a different path for installation. The best way to do this
+is by setting the @samp{prefix} variable on the @code{make} command
+line. The sequence becomes something like this:
+@example
+configure --prefix=/whatever
+make
+make install prefix=/afs/.@var{system.name}/system/1.3/@@sys/whatever
+@end example
+@flindex ls-R @r{and AFS}
+@cindex relative filenames in @file{ls-R}
+@noindent With AFS, you will definitely want to use relative filenames in
+@file{ls-R} (@pxref{Filename database}), not absolute filenames. This
+is done by default, but check anyway.
+
+
+@node Cleaning up
+@subsection Cleaning up
+
+@findex distclean @r{Make target}
+The basic command is @code{make distclean}. This removes all files
+created by the build.
+
+Alternatively,
+@itemize @bullet
+@item
+@findex mostlyclean @r{Make target}
+@code{make mostlyclean} if you intend to compile on another
+architecture. For Web2C, since the generated C files are portable,
+they are not removed. If the @code{lex} vs.@: @code{flex} situation
+is going to be different on the next machine, @code{rm
+web2c/lex.yy.c}.
+
+@item
+@findex clean @r{Make target}
+@code{make clean} to remove files created by compiling, but leave
+configuration files and Makefiles.
+
+@item
+@findex maintainer-clean @r{Make target}
+@code{make maintainer-clean} to remove everything that the Makefiles can
+rebuild. This is more than @samp{distclean} removes, and you should
+only use it if you are thoroughly conversant with (and have the necessary
+versions of) Autoconf.
+
+@item
+@findex extraclean @r{Make target}
+@code{make extraclean} to remove other junk, e.g., core files, log
+files, patch rejects. This is independent of the other @samp{clean}
+targets.
+@end itemize
+
+
+@node Filename database generation
+@subsection Filename database generation
+
+@cindex filename database generation
+@cindex generation of filename database
+
+You will probably want to set up a @code{cron} entry on the appropriate
+machine(s) to rebuild the filename database nightly or so, as in:
+@example
+0 0 * * * cd @var{texmf} && @var{/bindir}/mktexlsr
+@end example
+@noindent @xref{Filename database}.
+
+Although the @code{mktex@dots{}} scripts make every effort to add
+newly-created files on the fly, it can't hurt to make sure you get a
+fresh version every so often.
+
+
+@node mktex scripts
+@subsection @file{mktex} scripts
+
+@cindex @file{mktex} scripts
+@cindex scripts for file creation
+
+@cindex font set, infinite
+@cindex dynamic creation of files
+@cindex Sauter fonts, and dynamic source creation
+@cindex EC fonts, and dynamic source creation
+If Kpathsea cannot otherwise find a file, for some file types it is
+configured by default to invoke an external program to create it
+dynamically (@pxref{mktex configuration}). This is most useful for
+fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as
+the Sauter and EC fonts), since any given document can use fonts never
+before referenced. Trying to build all fonts in advance is therefore
+impractical, if not impossible.
+
+The script is passed the name of the file to create and possibly other
+arguments, as explained below. It must echo the full pathname of the
+file it created (and nothing else) to standard output; it can write
+diagnostics to standard error.
+
+@menu
+* mktex configuration::
+* mktex script names::
+* mktex script arguments::
+@end menu
+
+
+@node mktex configuration
+@subsubsection @file{mktex} configuration
+
+@cindex @file{mktex} script configuration
+@cindex configuration of @file{mktex} scripts
+@cindex enabling @file{mktex} scripts
+@cindex disabling @file{mktex} scripts
+
+The following file types can run an external program to create missing
+files: @file{pk}, @file{tfm}, @file{mf}, @file{tex}; the scripts are
+named @file{mktexpk}, @file{mktextfm}, @file{mktexmf}, and
+@file{mktextex}.
+
+In the absence of @code{configure} options specifying otherwise,
+everything but @file{mktextex} will be enabled by default. The
+@code{configure} options to change the defaults are:
+
+@cindex @code{configure} options for @file{mktex} scripts
+@opindex --without-mktexmf-default
+@opindex --without-mktexpk-default
+@opindex --without-mktextfm-default
+@opindex --with-mktextex-default
+@example
+--without-mktexmf-default
+--without-mktexpk-default
+--without-mktextfm-default
+--with-mktextex-default
+@end example
+
+The @code{configure} setting is overridden if the environment variable
+or configuration file value named for the script is set; e.g.,
+@file{MKTEXPK} (@pxref{mktex script arguments}).
+
+@flindex mktex.cnf
+@cindex site overrides for @code{mktex@dots{}}
+As distributed, all the scripts source a file
+@file{texmf/web2c/mktex.cnf} if it exists, so you can override
+various defaults. See @file{mktex.opt}, for instance, which defines
+the default mode, resolution, some special directory names, etc. If you
+prefer not to change the distributed scripts, you can simply create
+@file{mktex.cnf} with the appropriate definitions (you do not need to
+create it if you have nothing to put in it). @file{mktex.cnf} has no
+special syntax; it's an arbitrary Bourne shell script. The distribution
+contains a sample @file{mktex.cnf} for you to copy and modify as you
+please (it is not installed anywhere).
+
+@flindex mktex.opt
+@vindex MT_FEATURES
+In addition, you can configure a number of features with the
+@code{MT_FEATURES} variable, which you can define:
+@itemize @bullet
+@item
+in @file{mktex.opt}, as just mentioned;
+
+@item
+by editing the file @file{mktex.opt}, either before @samp{make
+install} (in the source hierarchy) or after (in the installed
+hierarchy);
+
+@item
+or in the environment.
+@end itemize
+
+If none of the options below are enabled, @code{mktexpk},
+@code{mktextfm}, and @code{mktexmf} follow the following procedure to
+decide where fonts should be installed. Find the tree where the font's
+sources are, and test the permissions of the @samp{fonts} directory of
+that tree to determine whether it is writable. If it is, put the files
+in the tree in appropriate locations. If it isn't writable, see whether
+the tree is a system tree (named in @code{SYSTEXMF}). If so, the
+@code{VARTEXFONTS} tree is used. In all other cases the working
+directory is used.
+
+The @samp{appendonlydir} option is enabled by default.
+
+@vtable @samp
+@item appendonlydir
+@cindex directories, making append-only
+@flindex mktexdir
+Tell @code{mktexdir} to create directories append-only, i.e., set
+their sticky bit (@pxref{Mode Structure,,, coreutils, GNU Core
+Utilities}). This feature is silently ignored on non-Unix platforms
+(e.g. Windows/NT and MS-DOS) which don't support similar functionality.
+This feature is enabled by default.
+
+@item dosnames
+@cindex 8.3 filenames, using
+@cindex DOS compatible names
+@flindex dpi@var{nnn} directories
+Use 8.3 names; e.g., @file{dpi600/cmr10.pk} instead of
+@file{cmr10.600pk}. Note that this feature only affects filenames that
+would otherwise clash with other TeX-related filenames; @file{mktex}
+scripts do nothing about filenames which exceed the 8+3 MS-DOS limits
+but remain unique when truncated (by the OS) to these limits, and nether
+do the scripts care about possible clashes with files which aren't
+related with TeX. For example, @file{cmr10.600pk} would clash with
+@file{cmr10.600gf} and is therefore changed when @samp{dosnames} is in
+effect, but @file{mf.pool} and @file{mp.base} don't clash with any
+TeX-related files and are therefore unchanged.
+
+This feature is turned on by default on MS-DOS. If you do not wish
+@samp{dosnames} to be set on an MS-DOS platform, you need to set the
+@code{MT_FEATURES} environment variable to a value that doesn't include
+@samp{dosnames}. You can also change the default setting by editing
+@file{mktex.opt}, but only if you use the @file{mktex} shell scripts;
+the emulation programs don't consult @file{mktex.opt}.
+
+@item fontmaps
+@cindex fontmaps
+@cindex fontname
+Instead of deriving the location of a font in the destination tree from
+the location of the sources, the aliases and directory names from the
+Fontname distribution are used. (@pxref{Top,, Introduction, fontname,
+Fontname}).
+
+@item nomfdrivers
+@cindex metafont driver files
+Let mktexpk and mktextfm create metafont driver files in a temporary
+directory. These will be used for just one metafont run and not
+installed permanently.
+
+@item nomode
+@cindex mode directory, omitting
+Omit the directory level for the mode name; this is fine as long as
+you generate fonts for only one mode.
+
+@item stripsupplier
+@cindex supplier directory, omitting
+Omit the font supplier name directory level.
+
+@item striptypeface
+@cindex typeface directory, omitting
+Omit the font typeface name directory level.
+
+@item strip
+@cindex supplier directory, omitting
+@cindex typeface directory, omitting
+Omit the font supplier and typeface name directory levels. This feature
+is deprecated in favour of @samp{stripsupplier} and @samp{striptypeface}.
+
+@item varfonts
+@flindex /var/tmp/texfonts
+@vindex VARTEXFONTS
+@cindex Linux File System Standard
+When this option is enabled, fonts that would otherwise be written in
+system texmf tree go to the @code{VARTEXFONTS} tree instead. The
+default value in @file{kpathsea/Makefile.in} is
+@file{/var/tmp/texfonts}. The @cite{Linux File System Standard}
+recommends @file{/var/tex/fonts}.
+
+@vindex USE_VARTEXFONTS
+The @samp{varfonts} setting in @code{MT_FEATURES} is overridden by the
+@code{USE_VARTEXFONTS} environment variable: if set to @samp{1}, the
+feature is enabled, and if set to @samp{0}, the feature is disabled.
+
+@item texmfvar
+@vindex TEXMFVAR
+Force generated files that would go into a system tree (as defined by
+@code{SYSTEXMF}) into @code{TEXMFVAR}. Starting with te@TeX{}-3.0, the
+variable @code{TEXMFVAR} is always set. The @samp{varfonts} feature takes
+precedence if also set.
+
+@vindex USE_TEXMFVAR
+The @samp{texmfvar} setting in @code{MT_FEATURES} is overridden by the
+@code{USE_TEXMFVAR} environment variable: if set to @samp{1}, the
+feature is enabled, and if set to @samp{0}, the feature is disabled.
+@end vtable
+
+
+@node mktex script names
+@subsubsection @file{mktex} script names
+
+@cindex @file{mktex} script names
+@cindex names for @file{mktex} scripts
+
+@flindex tex-make.c
+@vindex kpse_make_specs
+The following table shows the default name of the script for each
+possible file types. (The source is the variable @code{kpse_make_specs}
+in @file{kpathsea/tex-make.c}.)
+
+@table @file
+@item mktexpk
+@pindex mktexpk
+Glyph fonts.
+
+@item mktextex
+@pindex mktextex
+@TeX{} input files.
+
+@item mktexmf
+@pindex mktexmf
+Metafont input files.
+
+@item mktextfm
+@pindex mktextfm
+TFM files.
+@end table
+
+@vindex DVIPSMAKEPK
+@vindex XDVIMAKEPK
+@vindex DVILJMAKEPK
+@noindent These names are overridden by an environment variable specific
+to the program---for example, @code{DVIPSMAKEPK} for Dvipsk.
+
+@comment next two paragraphs are repeated in dvips.texi
+@flindex missfont.log
+@cindex failed @code{mktex@dots{}} script invocation
+If a @code{mktex@dots{}} script fails, the invocation is appended to a
+file @file{missfont.log} (by default) in the current directory. You can
+then execute the log file to create the missing files after fixing the
+problem.
+
+@vindex TEXMFOUTPUT
+@vindex MISSFONT_LOG
+If the current directory is not writable and the environment variable or
+configuration file value @code{TEXMFOUTPUT} is set, its value is
+used. Otherwise, nothing is written. The name @samp{missfont.log} is
+overridden by the @code{MISSFONT_LOG} environment variable or
+configuration file value.
+
+
+@node mktex script arguments
+@subsubsection @file{mktex} script arguments
+
+@cindex arguments to @file{mktex}
+
+The first argument to a @file{mktex} script is always the name
+of the file to be created.
+
+In the default @file{mktexpk} implementation, additional arguments may
+also be passed:
+
+@table @samp
+@item --dpi @var{num}
+Sets the resolution of the generated font to @var{num}.
+@item --mfmode @var{name}
+Sets the Metafont mode to @var{name}.
+@item --bdpi @var{num}
+Sets the the ``base dpi'' for the font. This must match the mode being
+used.
+@item --mag @var{string}
+A ``magstep'' string suitable for the Metafont @code{mag} variable.
+This must match the combination of @var{bdpi} and @var{dpi} being used.
+@item --destdir @var{string}
+A directory name. If the directory is absolute, it is used as-is.
+Otherwise, it is appended to the root destination directory set in the
+script.
+@end table
+
+@c The feature mentioned here doesn't seem to be implemented.
+@c Worse, the variable name clashed with the "switch" used to select
+@c whether a mktex program is run at all. However, a dearth of
+@c complains suggests that no-one was using it anyway.
+@c
+@c @vindex MKTEXPK @r{environment variable}
+@c @cindex specification for @code{mktexpk}
+@c You can change the specification for the arguments passed to the
+@c external script by setting the environment variable named as the script
+@c name, but all capitals---@code{MKTEXPK}, for example. If you've
+@c changed the script name by setting (say) @code{DVIPSMAKEPK} to
+@c @samp{foo}, then the spec is taken from the environment variable
+@c @code{FOO}.
+@c
+@c The spec can contain any variable references, to the above variables or
+@c any others. As an example, the default spec for @code{mktexpk} is:
+@c @example
+@c $KPATHSEA_DPI $MAKETEX_BASE_DPI $MAKETEX_MAG $MAKETEX_MODE
+@c @end example
+@c
+@c @noindent The convention of passing the name of the file to be created
+@c as the first argument cannot be changed.
+
+
+@node Installation testing
+@subsection Installation testing
+
+@cindex testing, post-installation
+@cindex installation testing
+
+Besides the tests listed in @ref{Simple installation}, you can try
+running @samp{make check}. This includes the torture tests (trip, trap,
+and mptrap) that come with Web2c (@pxref{Triptrap,,, web2c, Web2c}).
+
+
+@node Security
+@section Security
+
+@cindex security considerations
+
+None of the programs in the @TeX{} system require any special system
+privileges, so there's no first-level security concern of people gaining
+illegitimate root access.
+
+@cindex trojan horse attack
+@flindex .rhosts@r{, writable by @TeX{}}
+A @TeX{} document, however, can write to arbitrary files, e.g.,
+@file{~/.rhosts}, and thus an unwitting user who runs @TeX{} on a random
+document is vulnerable to a trojan horse attack. This loophole is
+closed by default, but you can be permissive if you so desire in
+@file{texmf.cnf}. @xref{tex invocation,,, web2c, Web2c}. MetaPost has
+the same issue.
+
+Dvips, Xdvi, and @TeX{} can also execute shell commands under some
+circumstances. To disable this, see the @samp{-R} option in @ref{Option
+details,,, dvips, Dvips}, the xdvi man page, and @ref{tex
+invocation,,, web2c, Web2c}, respectively.
+
+@cindex local cache of fonts
+@cindex cache of fonts, local
+Another security issue arises because it's very useful---almost
+necessary---to make arbitrary fonts on user demand with @code{mktexpk}
+and friends. Where do these files get installed? By default, the
+@code{mktexpk} distributed with Kpathsea assumes a world-writable
+@file{/var/tmp} directory; this is a simple and convenient approach, but
+it may not suit your situation because it means that a local cache of
+fonts is created on every machine.
+
+@cindex globally writable directories
+To avoid this duplication, many people consider a shared, globally
+writable font tree desirable, in spite of the potential security
+problems. To do this you should change the value of @code{VARTEXFONTS}
+in @file{texmf.cnf} to refer to some globally known directory.
+@xref{mktex configuration}.
+
+@cindex append-only directories and @code{mktexpk}
+The first restriction you can apply is to make newly-created directories
+under @file{texmf} be append-only with an option in @file{mktex.cnf}.
+@xref{mktex configuration}.
+
+@cindex group-writable directories
+@cindex setgid scripts
+Another approach is to establish a group (or user) for @TeX{} files,
+make the @file{texmf} tree writable only to that group (or user), and
+make @code{mktexpk} et al.@: setgid to that group (or setuid to that
+user). Then users must invoke the scripts to install things. (If
+you're worried about the inevitable security holes in scripts, then you
+could write a C wrapper to exec the script.)
+
+@cindex file permissions
+@cindex permissions, file
+The @file{mktex@dots{}} scripts install files with the same read and
+write permissions as the directory they are installed in. The
+executable, sgid, suid, and sticky bits are always cleared.
+
+@cindex directory permissions
+@cindex permissions, directory
+Any directories created by the @file{mktex@dots{}} scripts have the
+same permissions as their parent directory, unless the
+@code{appendonlydir} feature is used, in which case the sticky bit is
+always set.
diff --git a/Build/source/texk/kpathsea/kdefault.c b/Build/source/texk/kpathsea/kdefault.c
new file mode 100644
index 00000000000..805084a5d52
--- /dev/null
+++ b/Build/source/texk/kpathsea/kdefault.c
@@ -0,0 +1,124 @@
+/* kdefault.c: Expand extra colons.
+ (This is not named default.c because then the OSF/1 make tries to
+ make a program `default' from it, since we have a target `default';
+ and OSF/1 make doesn't understand .PHONY.)
+
+ Copyright 2002, 2005 Olaf Weber.
+ Copyright 1993, 94, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/default.h>
+
+
+/* Check for leading colon first, then trailing, then doubled, since
+ that is fastest. Usually it will be leading or trailing. */
+
+string
+kpse_expand_default P2C(const_string, path, const_string, fallback)
+{
+ unsigned path_length;
+ string expansion;
+
+ /* The default path better not be null. */
+ assert (fallback);
+
+ if (path == NULL)
+ expansion = xstrdup (fallback);
+
+ /* Solitary or leading :? */
+ else if (IS_ENV_SEP (*path))
+ {
+ expansion = path[1] == 0 ? xstrdup (fallback) : concat (fallback, path);
+ }
+
+ /* Sorry about the assignment in the middle of the expression, but
+ conventions were made to be flouted and all that. I don't see the
+ point of calling strlen twice or complicating the logic just to
+ avoid the assignment (especially now that I've pointed it out at
+ such great length). */
+ else if (path[(path_length = strlen (path)) - 1] == ENV_SEP)
+ expansion = concat (path, fallback);
+
+ /* OK, not leading or trailing. Check for doubled. */
+ else
+ {
+ const_string loc;
+
+ for (loc = path; *loc; loc++)
+ if (IS_ENV_SEP (loc[0]) && IS_ENV_SEP (loc[1]))
+ break;
+ if (*loc)
+ { /* We have a doubled colon. */
+ expansion = (string)xmalloc (path_length + strlen(fallback) + 1);
+
+ /* Copy stuff up to and including the first colon. */
+ strncpy (expansion, path, loc - path + 1);
+ expansion[loc - path + 1] = 0;
+
+ /* Copy in FALLBACK, and then the rest of PATH. */
+ strcat (expansion, fallback);
+ strcat (expansion, loc + 1);
+ }
+ else
+ { /* No doubled colon. */
+ expansion = xstrdup(path);
+ }
+ }
+
+ return expansion;
+}
+
+#ifdef TEST
+
+void
+test_expand_default (const_string path, const_string def)
+{
+ string answer;
+
+ printf ("Expansion of `%s':\t", path ? path : "(nil)");
+ answer = kpse_expand_default (path, def);
+ puts (answer);
+}
+
+int
+main ()
+{
+ string default_path = "default";
+
+ test_expand_default (NULL, default_path);
+ test_expand_default ("", default_path);
+ test_expand_default ("none", default_path);
+ test_expand_default (ENV_SEP_STRING, default_path);
+ test_expand_default (ENV_SEP_STRING "first", default_path);
+ test_expand_default ("last" ENV_SEP_STRING, default_path);
+ test_expand_default ("middle" ENV_SEP_STRING ENV_SEP_STRING "elddim", default_path);
+
+ return 0;
+}
+
+#endif /* TEST */
+
+
+/*
+Local variables:
+standalone-compile-command: "gcc -g -I. -I.. -DTEST default.c kpathsea.a"
+End:
+*/
diff --git a/Build/source/texk/kpathsea/kpathsea.cps b/Build/source/texk/kpathsea/kpathsea.cps
new file mode 100644
index 00000000000..09492b4abaf
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpathsea.cps
@@ -0,0 +1,820 @@
+\initial {!}
+\entry {\code {!! \r {in path specifications}}}{34}
+\initial {$}
+\entry {\code {$ \r {expansion}}}{31}
+\initial {-}
+\entry {\code {--color=tty}}{33}
+\entry {\code {--debug=\var {num}}}{38}
+\entry {\code {--disable-static}}{7}
+\entry {\code {--dpi=\var {num}}}{35}
+\entry {\code {--enable \r {options}}}{7}
+\entry {\code {--enable-maintainer-mode}}{8}
+\entry {\code {--enable-shared}}{7, 9}
+\entry {\code {--engine=\var {name}}}{35}
+\entry {\code {--expand-braces=\var {string}}}{38}
+\entry {\code {--expand-path=\var {string}}}{38}
+\entry {\code {--expand-var=\var {string}}}{38}
+\entry {\code {--format=\var {name}}}{36}
+\entry {\code {--help}}{38}
+\entry {\code {--interactive}}{37}
+\entry {\code {--mode=\var {string}}}{37}
+\entry {\code {--must-exist}}{37}
+\entry {\code {--path=\var {string}}}{37}
+\entry {\code {--progname=\var {name}}}{37}
+\entry {\code {--show-path=\var {name}}}{38}
+\entry {\code {--srcdir\r {, for building multiple architectures}}}{8}
+\entry {\code {--var-value=\var {variable}}}{38}
+\entry {\code {--version}}{38}
+\entry {\code {--with \r {options}}}{7}
+\entry {\code {--with-mktextex-default}}{11}
+\entry {\code {--without-mktexmf-default}}{11}
+\entry {\code {--without-mktexpk-default}}{11}
+\entry {\code {--without-mktextfm-default}}{11}
+\entry {\code {-1 \r {debugging value}}}{21}
+\entry {\code {-A \r {option to \code {ls}}}}{33}
+\entry {\code {-Bdynamic}}{27}
+\entry {\code {-Bstatic}}{27}
+\entry {\code {-D \var {num}}}{35}
+\entry {\code {-dynamic}}{27}
+\entry {\code {-g\r {, compiling without}}}{9}
+\entry {\code {-L \r {option to \code {ls}}}}{33}
+\entry {\code {-mktex=\var {filetype}}}{37}
+\entry {\code {-no-mktex=\var {filetype}}}{37}
+\entry {\code {-O\r {, compiling with}}}{9}
+\entry {\code {-static}}{27}
+\initial {.}
+\entry {\code {. \r {directories, ignored}}}{33}
+\entry {\code {. \r {files}}}{33}
+\entry {\code {.2602gf}}{25}
+\entry {\code {.afm}}{39}
+\entry {\code {.base}}{39}
+\entry {\code {.bib}}{39}
+\entry {\code {.bst}}{39}
+\entry {\code {.cmap}}{39}
+\entry {\code {.cnf}}{39}
+\entry {\code {.enc}}{39}
+\entry {\code {.eps}}{40}
+\entry {\code {.epsi}}{40}
+\entry {\code {.fmt}}{39}
+\entry {\code {.ist}}{40}
+\entry {\code {.lig}}{40}
+\entry {\code {.map}}{40}
+\entry {\code {.mem}}{40}
+\entry {\code {.mf}}{40}
+\entry {\code {.mft}}{40}
+\entry {\code {.mp}}{40}
+\entry {\code {.ocp}}{40}
+\entry {\code {.ofm}}{40}
+\entry {\code {.opl}}{40}
+\entry {\code {.otp}}{40}
+\entry {\code {.ovf}}{40}
+\entry {\code {.ovp}}{40}
+\entry {\code {.pfa}}{41}
+\entry {\code {.pfb}}{41}
+\entry {\code {.pk}}{41}
+\entry {\code {.pool}}{40, 41}
+\entry {\code {.pro}}{41}
+\entry {\code {.rhosts\r {, writable by \TeX {}}}}{14}
+\entry {\code {.sfd}}{41}
+\entry {\code {.tex}}{41}
+\entry {\code {.tex \r {file, included in \file {ls-R}}}}{33}
+\entry {\code {.tfm}}{41}
+\entry {\code {.ttc}}{41}
+\entry {\code {.ttf}}{41}
+\entry {\code {.vf}}{41}
+\entry {\code {.w}}{39}
+\entry {\code {.web}}{39, 41}
+\initial {/}
+\entry {\code {/ \r {may not be /}}}{28}
+\entry {\code {/\r {, trailing in home directory}}}{31}
+\entry {\code {//}}{32}
+\entry {\code {/afs/\dots {} \r {, installing into}}}{10}
+\entry {\code {/etc/profile}}{23}
+\entry {\code {/etc/profile \r {and aliases}}}{33}
+\entry {\code {/var/tmp/texfonts}}{13}
+\initial {:}
+\entry {\code {: \r {may not be :}}}{28}
+\entry {\code {:: \r {expansion}}}{30}
+\initial {@}
+\entry {@\var {var}@ substitutions}{6}
+\initial {{\tt \char 123}}
+\entry {\code {{\tt \char 123} \r {expansion}}}{32}
+\initial {{\tt \indexbackslash }}
+\entry {\code {{\tt \backslashcurfont }\r {, line continuation in \file {texmf.cnf}}}}{29}
+\entry {\code {{\tt \backslashcurfont }openin}}{28}
+\entry {\code {{\tt \backslashcurfont }special\r {, suppressing warnings about}}}{44}
+\initial {~}
+\entry {\code {~ \r {expansion}}}{31}
+\initial {2}
+\entry {\code {2602gf}}{25}
+\initial {8}
+\entry {8.3 filenames, using}{12}
+\initial {A}
+\entry {absolute filenames}{28}
+\entry {\code {ac_include\r {, Autoconf extension}}}{6}
+\entry {access warnings}{28}
+\entry {Acorn \TeX {} implementations}{19}
+\entry {\code {AFMFONTS}}{39}
+\entry {AFS}{10}
+\entry {AIX 4.1 \code {configure} error}{26}
+\entry {AIX shells and \code {configure}}{7}
+\entry {aliases for fonts}{43}
+\entry {aliases, for filenames}{34}
+\entry {\code {all}}{44}
+\entry {alphabetical order, not}{32}
+\entry {Amiga support}{4}
+\entry {Amiga \TeX {} implementations}{19}
+\entry {Andrew File System, installing with}{10}
+\entry {announcement mailing list}{21}
+\entry {ANSI C}{26}
+\entry {append-only directories and \code {mktexpk}}{15}
+\entry {\code {appendonlydir}}{12}
+\entry {architecture-(in)dependent files, installing only}{10}
+\entry {architectures, compiling multiple}{8}
+\entry {arguments to \file {mktex}}{14}
+\entry {\code {argv[0]}}{46, 47}
+\entry {\code {ash\r {, losing with \code {configure}}}}{7}
+\entry {\code {autoconf\r {, recommended}}}{47}
+\entry {automounter, and configuration}{9}
+\entry {automounter, and \file {ls-R}}{34}
+\entry {auxiliary tasks}{37}
+\initial {B}
+\entry {Babel}{5, 10}
+\entry {Bach, Johann Sebastian}{30}
+\entry {backbone of CTAN}{17}
+\entry {backslash-newline}{29}
+\entry {\code {bash\r {, recommended for running \code {configure}}}}{7}
+\entry {basic glyph lookup}{43}
+\entry {Berry, Karl}{1}
+\entry {\code {BIBINPUTS}}{39}
+\entry {binary mode, for file transfers}{17}
+\entry {blank lines, in \file {texmf.cnf}}{29}
+\entry {brace expansion}{32}
+\entry {BSD universe}{10}
+\entry {\code {bsh\r {, ok with \code {configure}}}}{7}
+\entry {\code {BSTINPUTS}}{39}
+\entry {bug address}{19}
+\entry {bug checklist}{19}
+\entry {bug mailing list}{21}
+\entry {bugs, reporting}{19}
+\initial {C}
+\entry {\code {c-*.h}}{47}
+\entry {\code {c-auto.h}}{46}
+\entry {\code {c-auto.in}}{6}
+\entry {cache of fonts, local}{14}
+\entry {calling sequence}{46}
+\entry {\code {CC}}{8}
+\entry {\code {cc \r {warnings}}}{27}
+\entry {\code {cc\r {, compiling with}}}{8}
+\entry {CD-ROM distributions}{19}
+\entry {\code {CFLAGS}}{8}
+\entry {\code {ChangeLog \r {entry}}}{20}
+\entry {checklist for bug reports}{19}
+\entry {\code {checksum}}{44}
+\entry {circle fonts}{43}
+\entry {\code {clean \r {Make target}}}{11}
+\entry {\code {client_path \r {in \code {kpse_format_info}}}}{47}
+\entry {\code {CMAPFONTS}}{39}
+\entry {\code {cmr10\r {, as fallback font}}}{44}
+\entry {\code {cmr10.vf}}{28}
+\entry {\code {cnf.c}}{30}
+\entry {\code {cnf.h}}{48}
+\entry {code sharing}{9}
+\entry {color printers, configuring}{4}
+\entry {comments, in fontmap files}{43}
+\entry {comments, in \file {texmf.cnf}}{29}
+\entry {comments, making}{1}
+\entry {common features in glyph lookup}{43}
+\entry {common problems}{23}
+\entry {\code {comp.sys.sun.admin \r {FAQ}}}{27}
+\entry {\code {comp.text.tex}}{21}
+\entry {compilation}{3}
+\entry {compilation value, source for path}{29}
+\entry {compiler bugs}{25}
+\entry {compiler bugs, finding}{25}
+\entry {compiler options, additional}{9}
+\entry {compiler options, specifying}{8}
+\entry {compiler, changing}{10}
+\entry {compiling on HP-UX}{26}
+\entry {conditions for use}{1}
+\entry {config files}{29}
+\entry {config files, for Kpathsea-using programs}{47}
+\entry {config files, programming with}{48}
+\entry {\code {config.h}}{46}
+\entry {\code {config.log}}{20}
+\entry {\code {config.ps\r {, search path for}}}{39}
+\entry {\code {config.status}}{20}
+\entry {configuration}{3}
+\entry {configuration bugs}{20}
+\entry {configuration compiler options}{8}
+\entry {configuration file, source for path}{29}
+\entry {configuration files as shell scripts.}{30}
+\entry {configuration of \file {mktex} scripts}{11}
+\entry {configuration of optional features}{7}
+\entry {\code {configure \r {error from \code {sed}}}}{26}
+\entry {\code {configure} options}{7}
+\entry {\code {configure} options for \file {mktex} scripts}{11}
+\entry {\code {configure\r {, running}}}{6}
+\entry {context diff}{20}
+\entry {continuation character}{29}
+\entry {core dumps, reporting}{20}
+\entry {\code {CPPFLAGS}}{8}
+\entry {crashes, reporting}{20}
+\entry {CTAN, defined}{17}
+\entry {\code {CTAN.sites}}{17}
+\entry {custom installation}{4}
+\entry {\code {CWEBINPUTS}}{39}
+\initial {D}
+\entry {database search}{28}
+\entry {database, for filenames}{33}
+\entry {database, format of}{34}
+\entry {\code {debug.h}}{21}
+\entry {debugger}{20}
+\entry {debugging}{21}
+\entry {debugging options, in Kpathsea-using program}{47}
+\entry {debugging output}{21}
+\entry {debugging with \samp {-g}, disabling}{9}
+\entry {DEC shells and \code {configure}}{7}
+\entry {default expansion}{30}
+\entry {default path features}{5}
+\entry {default paths, changing}{6}
+\entry {default paths, how they're made}{6}
+\entry {\code {default_texsizes}}{44}
+\entry {\code {DEFS}}{8}
+\entry {\code {depot}}{9}
+\entry {device, wrong}{25}
+\entry {directories, changing default installation}{6}
+\entry {directories, making append-only}{12}
+\entry {directory permissions}{15}
+\entry {directory structure, for \TeX {} files}{15}
+\entry {disabling \file {mktex} scripts}{11}
+\entry {disk search}{28}
+\entry {disk searching, avoiding}{34}
+\entry {disk space, needed}{4}
+\entry {disk usage, reducing}{23}
+\entry {\code {distclean \r {Make target}}}{11}
+\entry {distributions, compiling simultaneously}{5}
+\entry {distributions, not compiling}{5}
+\entry {distributions, on CD-ROM}{19}
+\entry {distributions, via ftp}{17}
+\entry {\code {dlclose}}{26}
+\entry {\code {dlopen}}{26}
+\entry {\code {dlsym}}{26}
+\entry {\code {dlsym.c}}{27}
+\entry {\code {doc files}}{41}
+\entry {DOS compatible names}{12}
+\entry {DOS support}{4}
+\entry {DOS \TeX {} implementations}{19}
+\entry {\code {dosnames}}{12}
+\entry {dot files}{33}
+\entry {doubled colons}{30}
+\entry {\code {dpi\var {nnn} directories}}{12}
+\entry {DVI drivers}{5}
+\entry {\code {DVILJMAKEPK}}{14}
+\entry {\code {DVILJSIZES}}{44}
+\entry {\code {DVIPSFONTS}}{42}
+\entry {\code {DVIPSHEADERS}}{41}
+\entry {\code {DVIPSMAKEPK}}{14}
+\entry {\code {DVIPSSIZES}}{44}
+\entry {dynamic creation of files}{11}
+\entry {dynamic linking problems with OpenWin libraries}{27}
+\initial {E}
+\entry {EC fonts, and dynamic source creation}{11}
+\entry {\code {elt-dirs.c}}{33}
+\entry {email CTAN access}{17}
+\entry {enabling \file {mktex} scripts}{11}
+\entry {\code {ENCFONTS}}{39}
+\entry {engine name}{35}
+\entry {environment variable, source for path}{29}
+\entry {environment variables for \TeX {}}{39}
+\entry {environment variables in paths}{31}
+\entry {environment variables, old}{23}
+\entry {epoch, seconds since}{23}
+\entry {error message macros}{46}
+\entry {excessive startup time}{24}
+\entry {\code {expand.c}}{32}
+\entry {expanding symlinks}{46}
+\entry {expansion, default}{30}
+\entry {expansion, path element}{28}
+\entry {expansion, search path}{30}
+\entry {expansion, subdirectory}{32}
+\entry {expansion, tilde}{31}
+\entry {expansion, variable}{31}
+\entry {explicitly relative filenames}{28}
+\entry {externally-built filename database}{33}
+\entry {extra colons}{30}
+\entry {\code {extraclean \r {Make target}}}{11}
+\initial {F}
+\entry {failed \code {mktex\dots {}} script invocation}{14}
+\entry {fallback font}{44}
+\entry {fallback resolutions}{44}
+\entry {fallback resolutions, overriding}{9}
+\entry {FAQ, \t {comp.sys.sun.admin}}{27}
+\entry {FAQ, Kpathsea}{23}
+\entry {Farwell, Matthew}{32}
+\entry {features, of default paths}{5}
+\entry {file formats, supported}{39}
+\entry {file lookup}{42}
+\entry {file permissions}{15}
+\entry {file types, registering new}{46}
+\entry {filename aliases}{34}
+\entry {filename database}{33}
+\entry {filename database generation}{11}
+\entry {filenames, absolute or explicitly relative}{28}
+\entry {files, unable to find}{23}
+\entry {filesystem search}{28}
+\entry {floating directories}{28}
+\entry {font alias files}{43}
+\entry {font generation failures}{24}
+\entry {font of last resort}{44}
+\entry {font set, infinite}{11}
+\entry {fontmap files}{43}
+\entry {\code {fontmaps}}{13}
+\entry {fontname}{13}
+\entry {fontnames, arbitrary length}{43}
+\entry {fonts, being created}{4}
+\entry {\code {FOOINPUTS}}{42}
+\entry {\code {fopen\r {, redefined}}}{22}
+\entry {format of external database}{34}
+\entry {Free Software Foundation}{19}
+\entry {FreeBSD \code {configure} error}{26}
+\entry {FreeBSD shells and \code {configure}}{7}
+\entry {FSF Source Code CD-ROM}{19}
+\entry {ftp retrieval}{17}
+\entry {\code {ftp.tug.org}}{17}
+\entry {fundamental purpose of Kpathsea}{1}
+\initial {G}
+\entry {\code {gcc\r {, compiling with}}}{8}
+\entry {\code {gdb\r {, recommended}}}{20}
+\entry {generation of filename database}{11}
+\entry {\code {get_applicationShellWidgetClass}}{27}
+\entry {\code {get_wmShellWidgetClass}}{27}
+\entry {\code {gf}}{40}
+\entry {\code {GFFONTS}}{40}
+\entry {globally writable directories}{15}
+\entry {glyph lookup}{42}
+\entry {glyph lookup bitmap tolerance}{43}
+\entry {\code {GLYPHFONTS}}{40, 41}
+\entry {GNU C compiler bugs}{25}
+\entry {GNU General Public License}{1}
+\entry {group-writable directories}{15}
+\entry {\code {GSFTOPK_DEBUG \r {(128)}}}{22}
+\initial {H}
+\entry {hash table buckets, printing}{23}
+\entry {hash table routines}{47}
+\entry {\code {hash_summary_only \r {variable for debugging}}}{23}
+\entry {help, mailing list for general \TeX {}}{21}
+\entry {\code {HIER}}{6}
+\entry {history of Kpathsea}{1}
+\entry {home directories in paths}{31}
+\entry {\code {HOME\r {, as ~ expansion}}}{31}
+\entry {HP-UX, compiling on}{26}
+\initial {I}
+\entry {identifiers, characters valid in}{29}
+\entry {illegal pointer combination warnings}{27}
+\entry {\code {include \r {fontmap directive}}}{43}
+\entry {\code {INDEXSTYLE}}{40}
+\entry {\code {info-tex@shsu.edu}}{21}
+\entry {input lines, reading}{47}
+\entry {\code {install-data \r {Make target}}}{10}
+\entry {\code {install-exec \r {Make target}}}{10}
+\entry {installation}{3}
+\entry {installation testing}{14}
+\entry {installation, architecture-(in)dependent files only}{10}
+\entry {installation, changing default directories}{6}
+\entry {installation, customized}{4}
+\entry {installation, getting executables instead of}{3}
+\entry {installation, simple}{3}
+\entry {installing files}{10}
+\entry {interactive query}{37}
+\entry {interface, not frozen}{1}
+\entry {introduction}{1}
+\initial {K}
+\entry {\samp {kdebug:}}{23}
+\entry {\code {kdefault.c}}{31}
+\entry {Knuth, Donald E.}{1}
+\entry {Knuth, Donald E., archive of programs by}{19}
+\entry {Knuth, Donald E., original author}{18}
+\entry {Korn shell\r {, losing with \code {configure}}}{7}
+\entry {Kpathsea config file, source for path}{29}
+\entry {Kpathsea version number}{5}
+\entry {\code {kpathsea.h}}{46}
+\entry {\code {kpathsea/HIER}}{6}
+\entry {\code {kpathsea/README.CONFIGURE}}{7}
+\entry {\code {kpathsea_debug}}{21}
+\entry {\code {KPATHSEA_DEBUG}}{21, 46}
+\entry {\code {kpathsea_debug \r {variable}}}{47}
+\entry {\code {KPSE_BITMAP_TOLERANCE}}{43}
+\entry {\code {kpse_cnf_get}}{48}
+\entry {\code {KPSE_DEBUG_EXPAND \r {(16)}}}{22}
+\entry {\code {KPSE_DEBUG_FOPEN \r {(4)}}}{22}
+\entry {\code {KPSE_DEBUG_HASH \r {(2)}}}{22}
+\entry {\code {KPSE_DEBUG_PATHS \r {(8)}}}{22}
+\entry {\code {KPSE_DEBUG_SEARCH \r {(32)}}}{22}
+\entry {\code {KPSE_DEBUG_STAT \r {(1)}}}{21}
+\entry {\code {KPSE_DEBUG_VARS \r {(64)}}}{22}
+\entry {\code {KPSE_DOT \r {expansion}}}{32}
+\entry {\code {kpse_fallback_font}}{44}
+\entry {\code {kpse_find_*}}{47}
+\entry {\code {kpse_find_file}}{42, 47}
+\entry {\code {kpse_find_glyph_format}}{42}
+\entry {\code {kpse_format_info}}{47}
+\entry {\code {kpse_format_info_type}}{22}
+\entry {\code {kpse_init_prog}}{47}
+\entry {\code {kpse_init_prog\r {, and \code {MAKETEX_MODE}}}}{6}
+\entry {\code {kpse_make_specs}}{13}
+\entry {\code {kpse_open_file}}{47}
+\entry {\code {kpse_program_name}}{46}
+\entry {\code {kpse_set_progname}}{47}
+\entry {\code {kpse_set_program_name}}{46}
+\entry {\code {kpse_var_value}}{48}
+\entry {\code {kpsewhich}}{35}
+\entry {Kpsewhich, and debugging}{21}
+\entry {\code {ksh\r {, losing with \code {configure}}}}{7}
+\initial {L}
+\entry {\code {labrea.stanford.edu}}{19}
+\entry {LaserJet drive}{5}
+\entry {last-resort font}{44}
+\entry {La\TeX {} help mailing list}{21}
+\entry {\code {lcircle10}}{43}
+\entry {\code {LDFLAGS}}{8}
+\entry {leading colons}{30}
+\entry {leaf directories wrongly guessed}{24}
+\entry {leaf directory trick}{32}
+\entry {\code {libdl.a}}{26}
+\entry {libraries, changing}{10}
+\entry {libraries, specifying additional}{8}
+\entry {\code {LIBS}}{8}
+\entry {\code {libucb\r {, avoiding}}}{10}
+\entry {license for using the library}{1}
+\entry {\code {LIGFONTS}}{40}
+\entry {lines, reading arbitrary-length}{47}
+\entry {Linux File System Standard}{13}
+\entry {Linux shells and \code {configure}}{7}
+\entry {Linux, using Web2c}{19}
+\entry {\code {lndir \r {for building symlink trees}}}{8}
+\entry {loader options}{8}
+\entry {loader options, final}{10}
+\entry {loader options, initial}{9}
+\entry {local cache of fonts}{14}
+\entry {log file}{23}
+\entry {logging successful searches}{23}
+\entry {\code {lost+found \r {directory}}}{28}
+\entry {\code {lostchar}}{44}
+\entry {\code {ls-R}}{40}
+\entry {\code {ls-R \r {and AFS}}}{10}
+\entry {\code {ls-R \r {database file}}}{33}
+\entry {\code {ls-R\r {, simplest build}}}{33}
+\initial {M}
+\entry {Mach10 \code {configure} error}{26}
+\entry {Macintosh \TeX {} implementations}{19}
+\entry {MacKenzie, David}{2, 32}
+\entry {magic characters}{28}
+\entry {mailing lists}{21}
+\entry {\code {maintainer-clean \r {Make target}}}{11}
+\entry {Make arguments, additional}{10}
+\entry {\code {make\r {, running}}}{9}
+\entry {\code {Makefile.in}}{6}
+\entry {Makefiles, empty}{26}
+\entry {\code {MAKETEX_DEBUG \r {(512)}}}{22}
+\entry {\code {MAKETEX_FINE_DEBUG \r {(1024)}}}{23}
+\entry {\code {MAKETEX_MODE}}{6}
+\entry {memory allocation routines}{47}
+\entry {metafont driver files}{13}
+\entry {Metafont failures}{25}
+\entry {Metafont installation}{25}
+\entry {Metafont making too-large fonts}{25}
+\entry {Metafont using the wrong device}{25}
+\entry {\code {MFBASES}}{39}
+\entry {\code {MFINPUTS}}{40}
+\entry {\code {MFPOOL}}{40}
+\entry {\code {MFTINPUTS}}{40}
+\entry {mirrors, FTP}{17}
+\entry {\code {MISCFONTS}}{40}
+\entry {mismatched checksum warnings}{44}
+\entry {\code {missfont.log}}{14}
+\entry {\code {MISSFONT_LOG}}{14}
+\entry {missing character warnings}{44}
+\entry {\file {mktex} script configuration}{11}
+\entry {\file {mktex} script names}{13}
+\entry {\file {mktex} scripts}{11}
+\entry {\code {mktex.cnf}}{12}
+\entry {\code {mktex.opt}}{12}
+\entry {\code {mktexdir}}{12}
+\entry {\code {mktexmf}}{13}
+\entry {\code {mktexpk}}{13}
+\entry {\code {mktexpk \r {, initial runs}}}{4}
+\entry {\code {mktexpk} can't guess mode}{24}
+\entry {\code {mktextex}}{13}
+\entry {\code {mktextfm}}{13}
+\entry {mode directory, omitting}{13}
+\entry {Morgan, Tim}{1}
+\entry {\code {mostlyclean \r {Make target}}}{11}
+\entry {\code {MPINPUTS}}{40}
+\entry {\code {MPMEMS}}{40}
+\entry {\code {MPPOOL}}{40}
+\entry {\code {MPSUPPORT}}{40}
+\entry {\code {MT_FEATURES}}{12}
+\entry {multiple architectures, compiling on}{8}
+\entry {multiple architectures, directories for}{8}
+\entry {multiple architectures, installing on}{10}
+\entry {multiple \TeX {} hierarchies}{32}
+\entry {must exist}{28}
+\initial {N}
+\entry {names for \file {mktex} scripts}{13}
+\entry {NetBSD \code {configure} error}{26}
+\entry {NetBSD shells and \code {configure}}{7}
+\entry {Neumann, Gustaf}{2}
+\entry {newsgroup for \TeX {}}{21}
+\entry {NeXT \code {sed} error}{26}
+\entry {NeXT, lacking X11}{5}
+\entry {NFS and \file {ls-R}}{34}
+\entry {NFS CTAN access}{17}
+\entry {\code {nomfdrivers}}{13}
+\entry {\code {nomode}}{13}
+\entry {non-English typesetting}{5}
+\entry {non-Unix operating systems}{4}
+\entry {\code {none}}{44}
+\entry {null pointers, dereferencing}{20}
+\entry {numeric debugging values}{21}
+\initial {O}
+\entry {obtaining \TeX {}}{17}
+\entry {obtaining Web2c by ftp}{17}
+\entry {obtaining Web2c on CD-ROM}{19}
+\entry {\code {OCPINPUTS}}{40}
+\entry {\code {OFMFONTS}}{40}
+\entry {online Metafont display, spurious}{25}
+\entry {\code {OPENTYPEFONTS}}{40}
+\entry {OpenWin libraries, dynamic linking problems}{27}
+\entry {optimization caveat}{25}
+\entry {optimization, enabling}{9}
+\entry {options for debugging}{21}
+\entry {options to \code {configure}}{7}
+\entry {OS/2 support}{4}
+\entry {other \TeX {} distributions}{19}
+\entry {\code {OTPINPUTS}}{40}
+\entry {overview of path searching}{28}
+\entry {overview of programming with Kpathsea}{46}
+\entry {\code {OVFFONTS}}{40}
+\entry {\code {OVPFONTS}}{40}
+\initial {P}
+\entry {patches, Sun OpenWin}{27}
+\entry {path expansion}{30}
+\entry {path searching}{28}
+\entry {path searching options}{35}
+\entry {path searching, overview}{28}
+\entry {path searching, standalone}{35}
+\entry {path sources}{29}
+\entry {paths, changing default}{5, 6}
+\entry {paths, device name included in}{6}
+\entry {\code {paths.h}}{6}
+\entry {\code {paths.h\r {, creating}}}{9}
+\entry {\code {pathsearch.h}}{46}
+\entry {\code {pc \r {Pascal compiler}}}{1}
+\entry {PCL driver}{5}
+\entry {PDF generation}{5}
+\entry {\code {PDFTEXCONFIG}}{40}
+\entry {permission denied}{28}
+\entry {permissions, directory}{15}
+\entry {permissions, file}{15}
+\entry {\code {PKFONTS}}{41}
+\entry {\code {plain.base}}{25}
+\entry {pointer combination warnings}{27}
+\entry {PostScript driver}{5}
+\entry {PostScript fonts, additional}{4}
+\entry {precompiled executables, instead of installation}{3}
+\entry {precompiled Unix binaries}{19}
+\entry {preprocessor options}{8}
+\entry {preprocessor options, additional}{9}
+\entry {printer configuration files}{4}
+\entry {privacy, semblance of}{23}
+\entry {problems, common}{23}
+\entry {\code {proginit.c}}{6}
+\entry {\code {proginit.h}}{47}
+\entry {program-varying paths}{39}
+\entry {\code {program_invocation_name}}{46}
+\entry {\code {program_invocation_short_name}}{46}
+\entry {programming overview}{46}
+\entry {programming with config files}{48}
+\entry {programming with Kpathsea}{46}
+\entry {programs using the library}{1}
+\entry {proof mode}{25}
+\entry {\code {PSHEADERS}}{41}
+\entry {\code {pxp \r {Pascal preprocessor}}}{1}
+\initial {Q}
+\entry {quoting variable values}{31}
+\initial {R}
+\entry {\code {readable}}{44}
+\entry {reading arbitrary-length lines}{47}
+\entry {\code {README.CONFIGURE}}{7}
+\entry {\code {README.mirrors}}{17}
+\entry {recording successful searches}{23}
+\entry {relative filenames}{28}
+\entry {relative filenames in \file {ls-R}}{10}
+\entry {reporting bugs}{19}
+\entry {\code {resident.c}}{47}
+\entry {resolution, setting}{35}
+\entry {resolutions, last-resort}{44}
+\entry {retrieving \TeX {}}{17}
+\entry {right-hand side of variable assignments}{29}
+\entry {Rokicki, Tom}{1}
+\entry {\t {root} user}{31}
+\entry {runtime configuration files}{29}
+\entry {runtime debugging}{21}
+\initial {S}
+\entry {Sauter fonts, and dynamic source creation}{11}
+\entry {scripts for file creation}{11}
+\entry {search path, defined}{28}
+\entry {search paths, changing default}{5}
+\entry {searching for files}{42}
+\entry {searching for glyphs}{42}
+\entry {searching overview}{28}
+\entry {searching the database}{28}
+\entry {searching the disk}{28}
+\entry {security considerations}{14}
+\entry {\code {sed \r {error from \code {configure}}}}{26}
+\entry {SELFAUTODIR}{46}
+\entry {SELFAUTOLOC}{46}
+\entry {SELFAUTOPARENT}{46}
+\entry {sending patches}{20}
+\entry {setgid scripts}{15}
+\entry {\code {SFDFONTS}}{41}
+\entry {\code {sh5\r {, ok with \code {configure}}}}{7}
+\entry {shar\r {, recommended}}{20}
+\entry {shared library, making}{9}
+\entry {shell scripts as configuration files}{30}
+\entry {shell variables}{31}
+\entry {\code {shell_escape\r {, example for code}}}{48}
+\entry {shells and \code {configure}}{7}
+\entry {simple installation}{3}
+\entry {site overrides for \code {mktex\dots {}}}{12}
+\entry {size of distribution archives}{4}
+\entry {skeleton \TeX {} directory}{15}
+\entry {slow startup time}{24}
+\entry {Solaris BSD compatibility, not}{10}
+\entry {\code {source files}}{41}
+\entry {sources for search paths}{29}
+\entry {\code {special}}{44}
+\entry {\code {st_nlink}}{32}
+\entry {stack trace}{20}
+\entry {standalone path searching}{35}
+\entry {standard error and debugging output}{21}
+\entry {standard options}{38}
+\entry {startup time, excessive}{24}
+\entry {static linking}{27}
+\entry {static linking and \code {dlsym}}{26}
+\entry {string routines}{47}
+\entry {\code {strip}}{13}
+\entry {\code {stripsupplier}}{13}
+\entry {\code {striptypeface}}{13}
+\entry {subdirectory searching}{32}
+\entry {suggestions, making}{1}
+\entry {Sun 2}{1}
+\entry {Sun OpenWin patches}{27}
+\entry {supplier directory, omitting}{13}
+\entry {supported file formats}{39}
+\entry {suppressing warnings}{44}
+\entry {symbolic link trees, for multiple architectures}{8}
+\entry {symbolic links not found}{24}
+\entry {symbolic links, and \file {ls-R}}{33}
+\entry {symlinks, resolving}{46}
+\entry {system C compiler bugs}{25}
+\entry {system dependencies}{6}
+\entry {system V universe}{10}
+\initial {T}
+\entry {\code {T1FONTS}}{41}
+\entry {\code {T1INPUTS}}{41}
+\entry {\code {T42FONTS}}{41}
+\entry {TDS}{15}
+\entry {testing, post-installation}{14}
+\entry {tests, simple}{4}
+\entry {te\TeX {}}{19}
+\entry {\code {tex-archive@math.utah.edu}}{21}
+\entry {\code {tex-file.c}}{42}
+\entry {\code {tex-file.h}}{46}
+\entry {\code {tex-glyph.c}}{42}
+\entry {\code {tex-glyph.h}}{46}
+\entry {\code {tex-k-request@mail.tug.org}}{21}
+\entry {\code {tex-k@mail.tug.org \r {(bug address)}}}{19}
+\entry {\code {tex-make.c}}{13}
+\entry {\code {TEX_HUSH}}{28, 44}
+\entry {\TeX {} directory structure}{15}
+\entry {\TeX {} distributions besides Web2c}{19}
+\entry {\TeX {} environment variables}{39}
+\entry {\TeX {} failures}{25}
+\entry {\TeX {} file lookup}{42}
+\entry {\TeX {} glyph lookup}{42}
+\entry {\TeX {} help mailing list}{21}
+\entry {\TeX {} hierarchy, one}{8}
+\entry {\TeX {} Live CD-ROM}{19}
+\entry {\TeX {} support}{39}
+\entry {\TeX {} Users Group}{1}
+\entry {\code {TEXBIB}}{39}
+\entry {\code {TEXCONFIG}}{39}
+\entry {\code {TEXDOCS}}{41}
+\entry {\code {TEXFONTMAPS}}{40}
+\entry {\code {TEXFONTS}}{40, 41}
+\entry {\code {texfonts.map}}{43}
+\entry {\code {TEXFORMATS}}{39}
+\entry {\code {TEXINDEXSTYLE}}{40}
+\entry {\code {TEXINPUTS}}{40, 41}
+\entry {\code {TEXMF}}{15}
+\entry {\code {texmf.cnf\r {, and variable expansion}}}{31}
+\entry {\code {texmf.cnf\r {, creating}}}{9}
+\entry {\code {texmf.cnf\r {, definition for}}}{29}
+\entry {\code {texmf.cnf\r {, generated}}}{6}
+\entry {\code {texmf.cnf\r {, source for path}}}{29}
+\entry {\code {texmf.in}}{6}
+\entry {\code {texmf.in\r {, editing}}}{5}
+\entry {\code {texmf.sed}}{6}
+\entry {\code {TEXMFCNF}}{29, 39}
+\entry {\code {TEXMFDBS}}{33, 40}
+\entry {\code {TEXMFINI}}{39, 40}
+\entry {\code {TEXMFLOG}}{23}
+\entry {\code {TEXMFOUTPUT}}{14}
+\entry {\code {TEXMFSCRIPTS}}{41}
+\entry {\code {texmfvar}}{13}
+\entry {\code {TEXMFVAR}}{13}
+\entry {\code {TEXPICTS}}{40}
+\entry {\code {TEXPKS}}{41}
+\entry {\code {TEXPOOL}}{41}
+\entry {\code {TEXPSHEADERS}}{41}
+\entry {\code {TEXSIZES}}{44}
+\entry {\code {TEXSOURCES}}{41}
+\entry {\code {TFMFONTS}}{41}
+\entry {tilde expansion}{31}
+\entry {\code {tilde.c}}{31}
+\entry {\code {time \r {system call}}}{23}
+\entry {tolerance for glyph lookup}{43}
+\entry {total disk space}{4}
+\entry {trailing \samp {/} in home directory}{31}
+\entry {trailing colons}{30}
+\entry {\code {TRFONTS}}{41}
+\entry {trick for detecting leaf directories}{32}
+\entry {trojan horse attack}{14}
+\entry {\code {TTFONTS}}{41}
+\entry {\code {tug.org}}{17}
+\entry {\code {tug@tug.org}}{1}
+\entry {typeface directory, omitting}{13}
+\initial {U}
+\entry {\code {ucbinclude\r {, avoiding}}}{10}
+\entry {Ultrix shells and \code {configure}}{7}
+\entry {unable to find files}{23}
+\entry {unable to generate fonts}{24}
+\entry {\code {uname}}{20}
+\entry {universe, BSD vs.\: system V}{10}
+\entry {\code {UNIX_ST_LINK}}{32}
+\entry {\code {unixtex.ftp}}{17}
+\entry {unknown special warnings}{44}
+\entry {unreadable file warnings}{44}
+\entry {unreadable files}{28}
+\entry {unusable \file {ls-R} warning}{34}
+\entry {usage patterns, finding}{23}
+\entry {\code {USE_TEXMFVAR}}{13}
+\entry {\code {USE_VARTEXFONTS}}{13}
+\entry {Usenet \TeX {} newsgroup}{21}
+\initial {V}
+\entry {\code {varfonts}}{13}
+\entry {variable expansion}{31}
+\entry {\code {variable.c}}{31}
+\entry {\code {variable.h}}{48}
+\entry {\code {VARTEXFONTS}}{13}
+\entry {VAX 11/750}{1}
+\entry {version number, of Kpathsea}{5}
+\entry {version numbers, determining}{20}
+\entry {VF files, not found}{28}
+\entry {\code {VFFONTS}}{41}
+\entry {VMS support}{4}
+\entry {VMS \TeX {} implementations}{19}
+\entry {Vojta, Paul}{2}
+\initial {W}
+\entry {Walsh, Norman}{2}
+\entry {warning about unusable \file {ls-R}}{34}
+\entry {warnings, file access}{28}
+\entry {warnings, pointer combinations}{27}
+\entry {warnings, suppressing}{44}
+\entry {\code {wcstombs}}{26}
+\entry {\code {WEB2C}}{41}
+\entry {Weber, Olaf}{2}
+\entry {\code {WEBINPUTS}}{41}
+\entry {whitespace, in fontmap files}{43}
+\entry {whitespace, not ignored on continuation lines}{29}
+\entry {Windows \TeX {} implementations}{19}
+\entry {World Wide Web CTAN access}{17}
+\entry {\code {www.tug.org}}{17}
+\initial {X}
+\entry {X11 previewer}{5}
+\entry {X11, lacking on NeXT}{5}
+\entry {\code {XCFLAGS}}{9}
+\entry {\code {XCPPFLAGS}}{9}
+\entry {\code {XDEFS}}{9}
+\entry {\code {XDVIFONTS}}{42}
+\entry {\code {XDVIMAKEPK}}{14}
+\entry {\code {XDVISIZES}}{44}
+\entry {\code {XLDFLAGS}}{9}
+\entry {\code {XLOADLIBES}}{10}
+\entry {\code {XMAKEARGS}}{10}
+\entry {\code {Xmu \r {library problems}}}{27}
+\entry {\code {XtStrings}}{26}
+\initial {Z}
+\entry {zuhn, david}{2}
diff --git a/Build/source/texk/kpathsea/kpathsea.h b/Build/source/texk/kpathsea/kpathsea.h
new file mode 100644
index 00000000000..4256cb155e2
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpathsea.h
@@ -0,0 +1,51 @@
+/* This is a generated file */
+/* collecting all kpathsea headers. */
+#include <kpathsea/config.h>
+#include <kpathsea/absolute.h>
+#include <kpathsea/c-auto.h>
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/c-dir.h>
+#include <kpathsea/c-errno.h>
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/c-limits.h>
+#include <kpathsea/c-memstr.h>
+#include <kpathsea/c-minmax.h>
+#include <kpathsea/c-namemx.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/c-pathmx.h>
+#include <kpathsea/c-proto.h>
+#include <kpathsea/c-stat.h>
+#include <kpathsea/c-std.h>
+#include <kpathsea/c-unistd.h>
+#include <kpathsea/c-vararg.h>
+#include <kpathsea/cnf.h>
+#include <kpathsea/concatn.h>
+#include <kpathsea/db.h>
+#include <kpathsea/debug.h>
+#include <kpathsea/default.h>
+#include <kpathsea/expand.h>
+#include <kpathsea/fn.h>
+#include <kpathsea/fontmap.h>
+#include <kpathsea/getopt.h>
+#include <kpathsea/hash.h>
+#include <kpathsea/lib.h>
+#include <kpathsea/line.h>
+#include <kpathsea/magstep.h>
+#include <kpathsea/paths.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/proginit.h>
+#include <kpathsea/progname.h>
+#include <kpathsea/readable.h>
+#include <kpathsea/str-list.h>
+#include <kpathsea/str-llist.h>
+#include <kpathsea/systypes.h>
+#include <kpathsea/tex-file.h>
+#include <kpathsea/tex-glyph.h>
+#include <kpathsea/tex-hush.h>
+#include <kpathsea/tex-make.h>
+#include <kpathsea/tilde.h>
+#include <kpathsea/truncate.h>
+#include <kpathsea/types.h>
+#include <kpathsea/variable.h>
+#include <kpathsea/xopendir.h>
+#include <kpathsea/xstat.h>
diff --git a/Build/source/texk/kpathsea/kpathsea.info b/Build/source/texk/kpathsea/kpathsea.info
new file mode 100644
index 00000000000..3719f12a44f
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpathsea.info
@@ -0,0 +1,4647 @@
+This is kpathsea.info, produced by makeinfo version 4.8 from
+kpathsea.texi.
+
+INFO-DIR-SECTION TeX
+START-INFO-DIR-ENTRY
+* Kpathsea: (kpathsea). File lookup along search paths.
+* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
+* mktexmf: (kpathsea)mktex scripts. MF source generation.
+* mktexpk: (kpathsea)mktex scripts. PK bitmap generation.
+* mktextex: (kpathsea)mktex scripts. TeX source generation.
+* mktextfm: (kpathsea)mktex scripts. TeX font metric generation.
+* mktexlsr: (kpathsea)Filename database. Update ls-R.
+END-INFO-DIR-ENTRY
+
+ This file documents the Kpathsea library for path searching.
+
+ Copyright (C) 1993-2005 Karl Berry & Olaf Weber.
+
+ Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+ Permission is granted to copy and distribute modified versions of
+this manual under the conditions for verbatim copying, provided that the
+entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+
+ Permission is granted to copy and distribute translations of this
+manual into another language, under the above conditions for modified
+versions, except that this permission notice may be stated in a
+translation approved by the Free Software Foundation.
+
+
+File: kpathsea.info, Node: Top, Next: Introduction, Up: (dir)
+
+Kpathsea library
+****************
+
+This manual documents how to install and use the Kpathsea library for
+filename lookup. It corresponds to version 3.5.5, released in
+June 2005.
+
+* Menu:
+
+* Introduction:: Overview.
+* Installation:: Compilation, installation, and bug reporting.
+
+* Path searching:: How filename lookups work.
+* TeX support:: Special support for TeX-related file lookups.
+
+* Programming:: How to use Kpathsea features in your program.
+
+* Index:: General index.
+
+
+File: kpathsea.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top
+
+1 Introduction
+**************
+
+This manual corresponds to version 3.5.5 of the Kpathsea library,
+released in June 2005.
+
+ The library's fundamental purpose is to return a filename from a
+list of directories specified by the user, similar to what shells do
+when looking up program names to execute.
+
+ The following software, all of which we maintain, uses this library:
+
+ * Dviljk (see the `dvilj' man page)
+
+ * Dvipsk (*note Introduction: (dvips)Top.)
+
+ * GNU font utilities (*note Introduction: (fontu)Top.)
+
+ * Web2c (*note Introduction: (web2c)Top.)
+
+ * Xdvik (see the `xdvi' man page)
+
+Other software that we do not maintain also uses it.
+
+ We are still actively maintaining the library (and probably always
+will be, despite our hopes). If you have comments or suggestions,
+please send them to us (*note Reporting bugs::).
+
+ We distribute the library under the GNU Library General Public
+License (LGPL). In short, this means if you write a program using the
+library, you must (offer to) distribute the source to the library,
+along with any changes you have made, and allow anyone to modify the
+library source and distribute their modifications. It does not mean
+you have to distribute the source to your program, although we hope you
+will. See the files `GPL' and `LGPL' for the text of the GNU licenses.
+
+ If you know enough about TeX to be reading this manual, then you (or
+your institution) should consider joining the TeX Users Group (if
+you're already a member, great!). TUG produces the periodical
+`TUGboat', sponsors an annual meeting and publishes the proceedings,
+and arranges courses on TeX for all levels of users throughout the
+world. Anyway, here is the address:
+
+ TeX Users Group
+ P.O. Box 2311
+ Portland OR 97208-2311
+ USA
+ phone: +1 503 223-9994
+ fax: +1 503 223-3960
+ email: <tug@tug.org>
+
+* Menu:
+
+* History::
+
+
+File: kpathsea.info, Node: History, Up: Introduction
+
+1.1 History
+===========
+
+(This section is for those people who are curious about how the library
+came about.) (If you like to read historical accounts of software, we
+urge you to seek out the GNU Autoconf manual and the "Errors of TeX"
+paper by Don Knuth, published in `Software--Practice and Experience'
+19(7), July 1989.)
+
+ [Karl writes.] My first ChangeLog entry for Web2c seems to be
+February 1990, but I may have done some work before then. In any case,
+Tim Morgan and I were jointly maintaining it for a time. (I should
+mention here that Tim had made Web2c into a real distribution long
+before I had ever used it or even heard of it, and Tom Rokicki did the
+original implementation. I was using `pxp' and `pc' on VAX 11/750's
+and the hot new Sun 2 machines.)
+
+ It must have been later in 1990 and 1991 that I started working on
+`TeX for the Impatient'. Dvips, Xdvi, Web2c, and the GNU fontutils
+(which I was also writing at the time) all used different environment
+variables, and, more importantly, had different bugs in their path
+searching. This became extremely painful, as I was stressing everything
+to the limit working on the book. I also desperately wanted to
+implement subdirectory searching, since I couldn't stand putting
+everything in one big directory, and also couldn't stand having to
+explicitly specify `cm', `pandora', ... in a path.
+
+ In the first incarnation, I just hacked separately on each
+program--that was the original subdirectory searching code in both Xdvi
+and Dvips, though I think Paul Vojta has completely rewritten Xdvi's
+support by now. That is, I tried to go with the flow in each program,
+rather than changing the program's calling sequences to conform to
+common routines.
+
+ Then, as bugs inevitably appeared, I found I was fixing the same
+thing three times (Web2c and fontutils were always sharing code, since I
+maintained those--there was no Dvipsk or Xdvik or Dviljk at this
+point). After a while, I finally started sharing source files. They
+weren't yet a library, though. I just kept things up to date with shell
+scripts. (I was developing on a 386 running ISC 2.2 at the time, and so
+didn't have symbolic links. An awful experience.)
+
+ The ChangeLogs for Xdvik and Dvipsk record initial releases of those
+distributions in May and June 1992. I think it was because I was tired
+of the different configuration strategies of each program, not so much
+because of the path searching. (Autoconf was being developed by David
+MacKenzie and others, and I was adapting it to TeX and friends.)
+
+ I started to make a separate library that other programs could link
+with on my birthday in April 1993, according to the ChangeLog. I don't
+remember exactly why I finally took the time to make it a separate
+library; a conversation with david zuhn that initiated it. Just seemed
+like it was time.
+
+ Dviljk got started in March 1994 after I bought a Laserjet 4.
+(Kpathsea work got suspended while Norm Walsh and I, with Gustaf
+Neumann's help, implemented a way for TeX to get at all those neat
+builtin LJ4 fonts ... such a treat to have something to typeset in
+besides Palatino!)
+
+ By spring of 1995, I had implemented just about all the
+path-searching features in Kpathsea that I plan to, driven beyond my
+initial goals by Thomas Esser and others. I then started to integrate
+Web2c with Kpathsea. After the release of a stable Web2c, I hope to be
+able to stop development, and turn most of my attention back to making
+fonts for GNU. (Always assuming Micros**t hasn't completely
+obliterated Unix by then, or that software patents haven't stopped
+software development by anybody smaller than a company with a
+million-dollar-a-year legal budget. Which is actually what I think is
+likely to happen, but that's another story...)
+
+ [Olaf writes.] At the end of 1997, UNIX is still alive and kicking,
+individuals still develop software, and Web2c development still
+continues. Karl had been looking for some time for someone to take up
+part of the burden, and I volunteered.
+
+
+File: kpathsea.info, Node: Installation, Next: Path searching, Prev: Introduction, Up: Top
+
+2 Installation
+**************
+
+(A copy of this chapter is in the distribution file `kpathsea/INSTALL'.)
+
+The procedure for Kpathsea (and Web2c, etc.) configuration and
+installation follows. If you encounter trouble, see *Note Common
+problems::, a copy of which is in the file `kpathsea/BUGS'.
+
+* Menu:
+
+* Simple installation:: If you just want to do it.
+* Custom installation:: If you want to change things around.
+* Security:: Who can write what files, etc.
+* TeX directory structure:: Managing the horde of TeX input files.
+* unixtex.ftp:: Getting software via FTP, on CD-ROM, or on tape.
+* Reporting bugs:: Where and how to report bugs.
+
+
+File: kpathsea.info, Node: Simple installation, Next: Custom installation, Up: Installation
+
+2.1 Simple installation
+=======================
+
+Installing TeX and friends for the first time can be a daunting
+experience. Thus, you may prefer to skip this whole thing and just get
+precompiled executables: see *Note unixtex.ftp::.
+
+ This section explains what to do if you wish to take the defaults for
+everything, and generally to install in the simplest possible way. Most
+steps here refer to corresponding subsection in the next section which
+explains how to override defaults and generally gives more details.
+
+ By default everything will be installed under `/usr/local' and the
+following discussion assumes this. However, if you already have TeX
+installed, its location is used to derive the directory under which
+everything is to be installed.
+
+ 1. Be sure you have enough disk space: approximately 8 megabytes for
+ the compressed archives, 15MB for sources, 50MB for compilation,
+ 40MB for the (initial) installed system (including library files).
+ *Note Disk space::.
+
+ 2. Retrieve these distribution archives:
+ `ftp://ftp.tug.org/tex/texk.tar.gz'
+ These are the sources, which you will be compiling.
+
+ `ftp://ftp.tug.org/tex/texklib.tar.gz'
+ This is a basic set of input files. You should unpack it in
+ the directory `/usr/local/share'; doing so will create a
+ `texmf' subdirectory there.
+
+ These archives are mirrored on the CTAN hosts, in the
+ `systems/web2c' directory.
+
+ *Note Kpathsea application distributions::.
+
+ 3. When using the default search paths, there is no need to edit any
+ distribution files. *Note Changing search paths::.
+
+ 4. At the top level of the distribution, run `sh configure'. (If you
+ have the GNU Bash shell installed, run `bash configure'.) *Note
+ Running configure::.
+
+ 5. `make'. *Note Running make::. If you are using a BSD 4.4 system
+ such as FreeBSD or NetBSD, you may have to use GNU make (often
+ installed in `/usr/local/bin'), not the BSD make.
+
+ 6. `make install'. *Note Installing files::.
+
+ 7. `make distclean'. *Note Cleaning up::.
+
+ 8. Set up a cron job to rebuild the filename database that makes
+ searching faster. This line will rebuild it every midnight:
+ 0 0 * * * cd /usr/local/share/texmf && /BINDIR/mktexlsr
+ *Note Filename database generation::, and *Note Filename
+ database::.
+
+ 9. If you're installing Dvips, you also need to set up configuration
+ files for your printers and make any additional PostScript fonts
+ available. *Note Installation: (dvips)Installation. If you have
+ any color printers, see *Note Color device configuration:
+ (dvips)Color device configuration.
+
+ 10. The first time you run a DVI driver, a bunch of PK fonts will be
+ built by Metafont via `mktexpk' (and added to the filename
+ database). This will take some time. Don't be alarmed; they will
+ created only this first time (unless something is wrong with your
+ path definitions).
+
+ By default, `mktexpk' will create these fonts in a hierarchy under
+ `/var/tmp/texfonts'; it simply assumes that `/var/tmp' exists and
+ is globally writable. If you need a different arrangement, see
+ *Note mktex configuration::.
+
+ *Note mktex scripts::.
+
+ 11. For some simple tests, try `tex story \\bye' and `latex sample2e'.
+ Then run `xdvi story' or `dvips sample2e' on the resulting DVI
+ files to preview/print the documents. *Note Installation
+ testing::.
+
+
+File: kpathsea.info, Node: Custom installation, Next: Security, Prev: Simple installation, Up: Installation
+
+2.2 Custom installation
+=======================
+
+Most sites need to modify the default installation procedure in some
+way, perhaps merely changing the prefix from `/usr/local', perhaps
+adding extra compiler or loader options to work around `configure'
+bugs. This section explains how to override default choices. For
+additional distribution-specific information:
+ * `dviljk/INSTALL'.
+
+ * *Note Installation: (dvips)Installation.
+
+ * *Note Installation: (web2c)Installation.
+
+ * `xdvik/INSTALL'.
+
+ These instructions are for Unix systems. Other operating-system
+specific distributions have their own instructions. The code base
+itself supports Amiga, DOS, OS/2, and VMS.
+
+ Following are the same steps as in the previous section (which
+describes the simplest installation), but with much more detail.
+
+* Menu:
+
+* Disk space::
+* Kpathsea application distributions::
+* Changing search paths::
+* Running configure::
+* Running make::
+* Installing files::
+* Cleaning up::
+* Filename database generation::
+* mktex scripts::
+* Installation testing::
+
+
+File: kpathsea.info, Node: Disk space, Next: Kpathsea application distributions, Up: Custom installation
+
+2.2.1 Disk space
+----------------
+
+Here is a table showing the disk space needed for each distribution
+(described in the next section). The `(totals)' line reflects the
+`texk' source distribution and `texklib'; the individual distributions
+don't enter into it. Sizes are in megabytes. All numbers are
+approximate.
+
+Distribution .tar.gz Unpacked Compiled Installed
+dviljk .9 3.8
+dvipsk .9 3.2
+xdvik .7 2.5
+web2c 1.3 5.0
+web 1.9 6.5 - -
+texk 7.5 32.1 95.3 33.5
+texklib 6.3 15.0 - 15.0
+(totals) 14.6 47.1 95.3 48.5
+
+
+File: kpathsea.info, Node: Kpathsea application distributions, Next: Changing search paths, Prev: Disk space, Up: Custom installation
+
+2.2.2 Kpathsea application distributions
+----------------------------------------
+
+The archive `ftp://ftp.tug.org/tex/texk.tar.gz' contains all of the
+Kpathsea applications I maintain, and the library itself. For example,
+since NeXT does not generally support X11, you'd probably want to skip
+`xdvik' (or simply remove it after unpacking `texk.tar.gz'. If you are
+not interested in all of them, you can also retrieve them separately:
+
+`dviljk.tar.gz'
+ DVI to PCL, for LaserJet printers.
+
+`dvipsk.tar.gz'
+ DVI to PostScript, for previewers, printers, or PDF generation.
+
+`web2c.tar.gz'
+ The software needed to compile TeX and friends.
+
+`web.tar.gz'
+ The original WEB source files, also used in compilation.
+
+`xdvik.tar.gz'
+ DVI previewing under the X window system.
+
+
+ If you want to use the Babel LaTeX package for support of non-English
+typesetting, you may need to retrieve additional files. See the file
+`install.txt' in the Babel distribution.
+
+
+File: kpathsea.info, Node: Changing search paths, Next: Running configure, Prev: Kpathsea application distributions, Up: Custom installation
+
+2.2.3 Changing search paths
+---------------------------
+
+If the search paths for your installation differ from the standard TeX
+directory structure (*note Introduction: (tds)Top.), edit the file
+`kpathsea/texmf.in' as desired, before running `configure'. For
+example, if you have all your fonts or macros in one big directory.
+
+ You may also wish to edit the file `mktex.cnf', either before or
+after installation, to control various aspects of `mktexpk' and
+friends. *Note mktex configuration::.
+
+ You do not need to edit `texmf.in' to change the default top-level
+or other installation _directories_ (only the paths). You can and
+should do that when you run `configure' (next step).
+
+ You also do not need to edit `texmf.in' if you are willing to rely
+on `texmf.cnf' at runtime to define the paths, and let the compile-time
+default paths be incorrect. Usually there is no harm in doing this.
+
+ The section below explains default generation in more detail.
+
+* Menu:
+
+* Default path features::
+* Default path generation::
+
+
+File: kpathsea.info, Node: Default path features, Next: Default path generation, Up: Changing search paths
+
+2.2.3.1 Default path features
+.............................
+
+The purpose of having all the different files described in the section
+above is to avoid having the same information in more than one place. If
+you change the installation directories or top-level prefix at
+`configure'-time, those changes will propagate through the whole
+sequence. And if you change the default paths in `texmf.in', those
+changes are propagated to the compile-time defaults.
+
+ The Make definitions are all repeated in several Makefile's; but
+changing the top-level `Makefile' should suffice, as it passes down all
+the variable definitions, thus overriding the submakes. (The
+definitions are repeated so you can run Make in the subdirectories, if
+you should have occasion to.)
+
+ By default, the bitmap font paths end with `/$MAKETEX_MODE', thus
+including the device name (usually a Metafont mode name such as
+`ljfour'). This distinguishes two different devices with the same
+resolution--a write/white from a write/black 300dpi printer, for
+example.
+
+ However, since most sites don't have this complication, Kpathsea
+(specifically, the `kpse_init_prog' function in `kpathsea/proginit.c')
+has a special case: if the mode has not been explicitly set by the user
+(or in a configuration file), it sets `MAKETEX_MODE' to `/'. This
+makes the default PK path, for example, expand into `.../pk//', so
+fonts will be found even if there is no subdirectory for the mode (if
+you arranged things that way because your site has only one printer,
+for example) or if the program is mode-independent (e.g., `pktype').
+
+ To make the paths independent of the mode, simply edit `texmf.in'
+before installation, or the installed `texmf.cnf', and remove the
+`$MAKETEX_MODE'.
+
+ *Note mktex script arguments::, for how this interacts with
+`mktexpk'.
+
+ *Note TeX directory structure: TeX directory structure, for a
+description of the default arrangement of the input files that comprise
+the TeX system. The file `kpathsea/HIER' is a copy of that section.
+
+
+File: kpathsea.info, Node: Default path generation, Prev: Default path features, Up: Changing search paths
+
+2.2.3.2 Default path generation
+...............................
+
+This section describes how the default paths are constructed.
+
+ You may wish to ignore the whole mess and simply edit `texmf.cnf'
+after it is installed, perhaps even copying it into place beforehand so
+you can complete the installation, if it seems necessary.
+
+ To summarize the chain of events that go into defining the default
+paths:
+
+ 1. `configure' creates a `Makefile' from each `Makefile.in'.
+
+ 2. When Make runs in the `kpathsea' directory, it creates a file
+ `texmf.sed' that substitutes the Make value of `$(var)' for a
+ string `@var@'. The variables in question are the one that define
+ the installation directories.
+
+ 3. `texmf.sed' (together with a little extra magic--see
+ `kpathsea/Makefile') is applied to `texmf.in' to generate
+ `texmf.cnf'. This is the file that will eventually be installed
+ and used.
+
+ 4. The definitions in `texmf.cnf' are recast as C `#define''s in
+ `paths.h'. These values will be the compile-time defaults; they
+ are not used at runtime unless no `texmf.cnf' file can be found.
+
+ (That's a lie: the compile-time defaults are what any extra :'s in
+ `texmf.cnf' expand into; but the paths as distributed have no extra
+ :'s, and there's no particular reason for them to.)
+
+
+File: kpathsea.info, Node: Running configure, Next: Running make, Prev: Changing search paths, Up: Custom installation
+
+2.2.4 Running `configure'
+-------------------------
+
+Run `sh configure OPTIONS' (in the top-level directory, the one
+containing `kpathsea/'), possibly using a shell other than `sh' (*note
+configure shells::).
+
+ `configure' adapts the source distribution to the present system via
+`#define''s in `*/c-auto.h', which are created from the corresponding
+`c-auto.in'. It also creates a `Makefile' from the corresponding
+`Makefile.in', doing `@VAR@' and `ac_include' substitutions).
+
+ `configure' is the best place to control the configuration,
+compilation, and installed location of the software, either via
+command-line options, or by setting environment variables before
+invoking it. For example, you can disable `mktexpk' by default with
+the option `--disable-mktexpk'. *Note configure options::.
+
+* Menu:
+
+* configure shells::
+* configure options::
+* configure environment::
+* configure scenarios::
+* Shared library::
+
+
+File: kpathsea.info, Node: configure shells, Next: configure options, Up: Running configure
+
+2.2.4.1 `configure' shells
+..........................
+
+Considerable effort has gone into trying to ensure that the `configure'
+scripts can be run by most Bourne shell variants. If `sh' runs into
+trouble, your best bet is to use Bash, the GNU Bourne-again shell
+(*note Top: (bash)Top.).
+
+ Bourne shell variants for which problems have been reported in the
+past are:
+`ksh'
+ Old versions of the Korn shell may fail to handle the scripts.
+ The Korn shell may be installed as `/bin/sh' on AIX, in which case
+ `/bin/bsh' may serve instead.
+
+`ash'
+ Old versions of ash are unable to handle the scripts. Ash is
+ sometimes installed as `/bin/sh' on NetBSD, FreeBSD, and Linux
+ systems. `/bin/bash' should be available for those systems, but
+ might not be part of a default installation.
+
+`Ultrix /bin/sh'
+ `/bin/sh' under Ultrix is a DEC-grown shell that is notably
+ deficient in many ways. `/bin/sh5' may be necessary.
+
+
+File: kpathsea.info, Node: configure options, Next: configure environment, Prev: configure shells, Up: Running configure
+
+2.2.4.2 `configure' options
+...........................
+
+For a complete list of all `configure' options, run `configure --help'
+or see *Note Running `configure' scripts: (autoconf)Invoking configure,
+(a copy is in the file `kpathsea/README.CONFIGURE'). The generic
+options are listed first in the `--help' output, and the
+package-specific options come last. The environment variables
+`configure' pays attention to are listed below.
+
+ Options particularly likely to be useful are `--prefix',
+`--datadir', and the like; see *Note configure scenarios::.
+
+ This section gives pointers to descriptions of the `--with' and
+`--enable' options to `configure' that Kpathsea-using programs accept.
+
+`--without-mktexmf-default'
+`--without-mktexpk-default'
+`--without-mktextfm-default'
+`--with-mktextex-default'
+ Enable or disable the dynamic generation programs. *Note mktex
+ configuration::.
+
+`--enable-shared'
+ Build Kpathsea as a shared library, and link against it. Also
+ build the usual static library. *Note Shared library::.
+
+`--disable-static'
+ Build only the shared library. Implies `--enable-shared'.
+
+`--enable-maintainer-mode'
+ Enables make targets that are useful for the maintainer and likely
+ to be a pain for anyone else; the makefiles created when this
+ option is enabled may not work at all for you. You have been
+ warned.
+
+
+File: kpathsea.info, Node: configure environment, Next: configure scenarios, Prev: configure options, Up: Running configure
+
+2.2.4.3 `configure' environment
+...............................
+
+`configure' uses the value of the following environment variables in
+determining your system's characteristics, and substitutes for them in
+Makefile's:
+
+`CC'
+ The compiler to use: default is `gcc' if it's installed, otherwise
+ `cc'.
+
+`CFLAGS'
+ Options to give the compiler: default is `-g -O2' for `gcc', `-g'
+ otherwise. `CFLAGS' comes after any other options. You may need
+ to include `-w' here if your compilations commonly have useless
+ warnings (e.g., `NULL redefined'), or `configure' may fail to
+ detect the presence of header files (it takes the messages on
+ standard error to mean the header file doesn't exist).
+
+`CPPFLAGS'
+ Options to pass to the compiler preprocessor; this matters most for
+ configuration, not the actual source compilation. The `configure'
+ script often does only preprocessing (e.g., to check for the
+ existence of #include files), and `CFLAGS' is not used for this.
+ You may need to set this to something like
+ `-I/usr/local/include/wwwhatever' if you have the libwww library
+ installed for hyper-xdvik (see `xdvik/INSTALL').
+
+`DEFS'
+ Additional preprocessor options, but not used by `configure'.
+ Provided for enabling or disabling program features, as documented
+ in the various program-specific installation instructions. `DEFS'
+ comes before any compiler options included by the distribution
+ `Makefile's or by `configure'.
+
+`LDFLAGS'
+ Additional options to give to the loader. `LDFLAGS' comes before
+ any other linker options.
+
+`LIBS'
+ Additional libraries to link with.
+
+
+File: kpathsea.info, Node: configure scenarios, Next: Shared library, Prev: configure environment, Up: Running configure
+
+2.2.4.4 `configure' scenarios
+.............................
+
+Here are some common installation scenarios:
+
+ * Including X support in Metafont. This is disabled by default,
+ since many sites have no use for it, and it's a leading cause of
+ configuration problems.
+ configure --with-x
+
+ * Putting the binaries, TeX files, GNU info files, etc. into a single
+ TeX hierarchy, say `/here/texmf', requires overriding defaults in
+ `configure':
+ configure --prefix=/here/texmf --datadir=/here
+
+ * You can compile on multiple architectures simultaneously either by
+ building symbolic link trees with the `lndir' script from the X11
+ distribution, or with the `--srcdir' option:
+ configure --srcdir=SRCDIR
+
+ * If you are installing binaries for multiple architectures into a
+ single hierarchy, you will probably want to override the default
+ `bin' and `lib' directories, something like this:
+ configure --prefix=TEXMF --datadir=TEXMF \
+ --bindir=TEXMF/ARCH/bin --libdir=TEXMF/ARCH/lib
+ make texmf=TEXMF
+ (Unless you make provisions for architecture-specific files in
+ other ways, e.g., with Depot or an automounter.)
+
+ * To compile with optimization (to compile without debugging, remove
+ the `-g'):
+ env CFLAGS="-g -O" sh configure ...
+ For a potential problem if you optimize, see *Note TeX or Metafont
+ failing: TeX or Metafont failing.
+
+
+File: kpathsea.info, Node: Shared library, Prev: configure scenarios, Up: Running configure
+
+2.2.4.5 Shared library
+......................
+
+You can compile Kpathsea as a shared library on a few systems, by
+specifying the option `--enable-shared' when you run `configure'.
+
+ The main advantage in doing this is that the executables can then
+share the code, thus decreasing memory and disk space requirements.
+
+ On some systems, you can record the location of shared libraries in a
+binary, usually by giving certain options to the linker. Then
+individual users do not need to set their system's environment variable
+(e.g., `LD_LIBRARY_PATH') to find shared libraries. If you want to do
+this, you will need to add the necessary options to `LDFLAGS' yourself;
+for example, on Solaris, include something like `-R${prefix}/lib', on
+IRIX or Linux, use `-rpath${prefix}/lib'. (Unfortunately, making this
+happen by default is very difficult, because of interactions with an
+existing installed shared library.)
+
+ Currently, shared library support is implemented only on Linux,
+SunOS 4 (Solaris 1), SunOS 5 (Solaris 2), IRIX 5, and IRIX 6. If you're
+interested and willing in adding support for other systems, please see
+the `configure' mode in the `klibtool' script, especially the
+host-specific case statement around line 250.
+
+
+File: kpathsea.info, Node: Running make, Next: Installing files, Prev: Running configure, Up: Custom installation
+
+2.2.5 Running `make'
+--------------------
+
+`make' (still in the top-level directory). This also creates the
+`texmf.cnf' and `paths.h' files that define the default search paths,
+and (by default) the `plain' and `latex' TeX formats.
+
+ You can override directory names and other values at `make'-time.
+`make/paths.make' lists the variables most commonly reset. For
+example, `make default_texsizes=600' changes the list of fallback
+resolutions.
+
+ You can also override each of `configure''s environment variables
+(*note configure environment::). The Make variables have the same
+names.
+
+ Finally, you can supply additional options via the following
+variables. (`configure' does not use these.)
+
+`XCPPFLAGS'
+`XDEFS'
+ Preprocessor options.
+
+`XCFLAGS'
+ Compiler options.
+
+`XLDFLAGS'
+ Loader options (included at beginning of link commands).
+
+`XLOADLIBES'
+ More loader options (included at end of link commands).
+
+`XMAKEARGS'
+ Additional Make arguments passed to all sub-`make''s. You may need
+ to include assignments to the other variables here via `XMAKEARGS';
+ for example: `make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"'.
+
+ It's generally a bad idea to use a different compiler (`CC') or
+libraries (`LIBS') for compilation than you did for configuration,
+since the values `configure' determined may then be incorrect.
+
+ Adding compiler options to change the "universe" you are using
+(typically BSD vs. system V) is generally a cause of trouble. It's
+best to use the native environment, whatever that is; `configure' and
+the software usually adapt best to that. In particular, under Solaris
+2.x, you should not use the BSD-compatibility library (`libucb') or
+include files (`ucbinclude').
+
+ If you want to use the Babel LaTeX package for support of non-English
+typesetting, you need to modify some files before making the LaTeX
+format. See the file `install.txt' in the Babel distribution.
+
+
+File: kpathsea.info, Node: Installing files, Next: Cleaning up, Prev: Running make, Up: Custom installation
+
+2.2.6 Installing files
+----------------------
+
+The basic command is the usual `make install'. For security issues,
+*note Security::.
+
+ The first time you install any manual in the GNU Info system, you
+should add a line (you choose where) to the file `dir' in your
+`$(infodir)' directory. Sample text for this is given near the top of
+the Texinfo source files (`kpathsea/kpathsea.texi',
+`dvipsk/dvips.texi', and `web2c/doc/web2c.texi'). If you have a recent
+version of the GNU Texinfo distribution installed
+(`ftp://prep.ai.mit.edu/pub/gnu/texinfo-3.9.tar.gz' or later), this
+should happen automatically.
+
+ On the offchance that this is your first Info installation, the
+`dir' file I use is included in the distribution as `etc/dir-example'.
+
+ You may wish to use one of the following targets, especially if you
+are installing on multiple architectures:
+ * `make install-exec' to install in architecture-dependent
+ directories, i.e., ones that depend on the `$(exec_prefix)' Make
+ variable. This includes links to binaries, libraries, etc., not
+ just "executables".
+
+ * `make install-data' to install in architecture-independent
+ directories, such as documentation, configuration files, pool
+ files, etc.
+
+ If you use the Andrew File System, the normal path (e.g.,
+PREFIX/bin) only gets you to a read-only copy of the files, and you
+must specify a different path for installation. The best way to do this
+is by setting the `prefix' variable on the `make' command line. The
+sequence becomes something like this:
+ configure --prefix=/whatever
+ make
+ make install prefix=/afs/.SYSTEM.NAME/system/1.3/@sys/whatever
+ With AFS, you will definitely want to use relative filenames in
+`ls-R' (*note Filename database::), not absolute filenames. This is
+done by default, but check anyway.
+
+
+File: kpathsea.info, Node: Cleaning up, Next: Filename database generation, Prev: Installing files, Up: Custom installation
+
+2.2.7 Cleaning up
+-----------------
+
+The basic command is `make distclean'. This removes all files created
+by the build.
+
+ Alternatively,
+ * `make mostlyclean' if you intend to compile on another
+ architecture. For Web2C, since the generated C files are portable,
+ they are not removed. If the `lex' vs. `flex' situation is going
+ to be different on the next machine, `rm web2c/lex.yy.c'.
+
+ * `make clean' to remove files created by compiling, but leave
+ configuration files and Makefiles.
+
+ * `make maintainer-clean' to remove everything that the Makefiles can
+ rebuild. This is more than `distclean' removes, and you should
+ only use it if you are thoroughly conversant with (and have the
+ necessary versions of) Autoconf.
+
+ * `make extraclean' to remove other junk, e.g., core files, log
+ files, patch rejects. This is independent of the other `clean'
+ targets.
+
+
+File: kpathsea.info, Node: Filename database generation, Next: mktex scripts, Prev: Cleaning up, Up: Custom installation
+
+2.2.8 Filename database generation
+----------------------------------
+
+You will probably want to set up a `cron' entry on the appropriate
+machine(s) to rebuild the filename database nightly or so, as in:
+ 0 0 * * * cd TEXMF && /BINDIR/mktexlsr
+ *Note Filename database::.
+
+ Although the `mktex...' scripts make every effort to add
+newly-created files on the fly, it can't hurt to make sure you get a
+fresh version every so often.
+
+
+File: kpathsea.info, Node: mktex scripts, Next: Installation testing, Prev: Filename database generation, Up: Custom installation
+
+2.2.9 `mktex' scripts
+---------------------
+
+If Kpathsea cannot otherwise find a file, for some file types it is
+configured by default to invoke an external program to create it
+dynamically (*note mktex configuration::). This is most useful for
+fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as
+the Sauter and EC fonts), since any given document can use fonts never
+before referenced. Trying to build all fonts in advance is therefore
+impractical, if not impossible.
+
+ The script is passed the name of the file to create and possibly
+other arguments, as explained below. It must echo the full pathname of
+the file it created (and nothing else) to standard output; it can write
+diagnostics to standard error.
+
+* Menu:
+
+* mktex configuration::
+* mktex script names::
+* mktex script arguments::
+
+
+File: kpathsea.info, Node: mktex configuration, Next: mktex script names, Up: mktex scripts
+
+2.2.9.1 `mktex' configuration
+.............................
+
+The following file types can run an external program to create missing
+files: `pk', `tfm', `mf', `tex'; the scripts are named `mktexpk',
+`mktextfm', `mktexmf', and `mktextex'.
+
+ In the absence of `configure' options specifying otherwise,
+everything but `mktextex' will be enabled by default. The `configure'
+options to change the defaults are:
+
+ --without-mktexmf-default
+ --without-mktexpk-default
+ --without-mktextfm-default
+ --with-mktextex-default
+
+ The `configure' setting is overridden if the environment variable or
+configuration file value named for the script is set; e.g., `MKTEXPK'
+(*note mktex script arguments::).
+
+ As distributed, all the scripts source a file
+`texmf/web2c/mktex.cnf' if it exists, so you can override various
+defaults. See `mktex.opt', for instance, which defines the default
+mode, resolution, some special directory names, etc. If you prefer not
+to change the distributed scripts, you can simply create `mktex.cnf'
+with the appropriate definitions (you do not need to create it if you
+have nothing to put in it). `mktex.cnf' has no special syntax; it's an
+arbitrary Bourne shell script. The distribution contains a sample
+`mktex.cnf' for you to copy and modify as you please (it is not
+installed anywhere).
+
+ In addition, you can configure a number of features with the
+`MT_FEATURES' variable, which you can define:
+ * in `mktex.opt', as just mentioned;
+
+ * by editing the file `mktex.opt', either before `make install' (in
+ the source hierarchy) or after (in the installed hierarchy);
+
+ * or in the environment.
+
+ If none of the options below are enabled, `mktexpk', `mktextfm', and
+`mktexmf' follow the following procedure to decide where fonts should
+be installed. Find the tree where the font's sources are, and test the
+permissions of the `fonts' directory of that tree to determine whether
+it is writable. If it is, put the files in the tree in appropriate
+locations. If it isn't writable, see whether the tree is a system tree
+(named in `SYSTEXMF'). If so, the `VARTEXFONTS' tree is used. In all
+other cases the working directory is used.
+
+ The `appendonlydir' option is enabled by default.
+
+`appendonlydir'
+ Tell `mktexdir' to create directories append-only, i.e., set their
+ sticky bit (*note Mode Structure: (coreutils)Mode Structure.).
+ This feature is silently ignored on non-Unix platforms (e.g.
+ Windows/NT and MS-DOS) which don't support similar functionality.
+ This feature is enabled by default.
+
+`dosnames'
+ Use 8.3 names; e.g., `dpi600/cmr10.pk' instead of `cmr10.600pk'.
+ Note that this feature only affects filenames that would otherwise
+ clash with other TeX-related filenames; `mktex' scripts do nothing
+ about filenames which exceed the 8+3 MS-DOS limits but remain
+ unique when truncated (by the OS) to these limits, and nether do
+ the scripts care about possible clashes with files which aren't
+ related with TeX. For example, `cmr10.600pk' would clash with
+ `cmr10.600gf' and is therefore changed when `dosnames' is in
+ effect, but `mf.pool' and `mp.base' don't clash with any
+ TeX-related files and are therefore unchanged.
+
+ This feature is turned on by default on MS-DOS. If you do not wish
+ `dosnames' to be set on an MS-DOS platform, you need to set the
+ `MT_FEATURES' environment variable to a value that doesn't include
+ `dosnames'. You can also change the default setting by editing
+ `mktex.opt', but only if you use the `mktex' shell scripts; the
+ emulation programs don't consult `mktex.opt'.
+
+`fontmaps'
+ Instead of deriving the location of a font in the destination tree
+ from the location of the sources, the aliases and directory names
+ from the Fontname distribution are used. (*note Introduction:
+ (fontname)Top.).
+
+`nomfdrivers'
+ Let mktexpk and mktextfm create metafont driver files in a
+ temporary directory. These will be used for just one metafont run
+ and not installed permanently.
+
+`nomode'
+ Omit the directory level for the mode name; this is fine as long as
+ you generate fonts for only one mode.
+
+`stripsupplier'
+ Omit the font supplier name directory level.
+
+`striptypeface'
+ Omit the font typeface name directory level.
+
+`strip'
+ Omit the font supplier and typeface name directory levels. This
+ feature is deprecated in favour of `stripsupplier' and
+ `striptypeface'.
+
+`varfonts'
+ When this option is enabled, fonts that would otherwise be written
+ in system texmf tree go to the `VARTEXFONTS' tree instead. The
+ default value in `kpathsea/Makefile.in' is `/var/tmp/texfonts'.
+ The `Linux File System Standard' recommends `/var/tex/fonts'.
+
+ The `varfonts' setting in `MT_FEATURES' is overridden by the
+ `USE_VARTEXFONTS' environment variable: if set to `1', the feature
+ is enabled, and if set to `0', the feature is disabled.
+
+`texmfvar'
+ Force generated files that would go into a system tree (as defined
+ by `SYSTEXMF') into `TEXMFVAR'. Starting with teTeX-3.0, the
+ variable `TEXMFVAR' is always set. The `varfonts' feature takes
+ precedence if also set.
+
+ The `texmfvar' setting in `MT_FEATURES' is overridden by the
+ `USE_TEXMFVAR' environment variable: if set to `1', the feature is
+ enabled, and if set to `0', the feature is disabled.
+
+
+File: kpathsea.info, Node: mktex script names, Next: mktex script arguments, Prev: mktex configuration, Up: mktex scripts
+
+2.2.9.2 `mktex' script names
+............................
+
+The following table shows the default name of the script for each
+possible file types. (The source is the variable `kpse_make_specs' in
+`kpathsea/tex-make.c'.)
+
+`mktexpk'
+ Glyph fonts.
+
+`mktextex'
+ TeX input files.
+
+`mktexmf'
+ Metafont input files.
+
+`mktextfm'
+ TFM files.
+
+These names are overridden by an environment variable specific to the
+program--for example, `DVIPSMAKEPK' for Dvipsk.
+
+ If a `mktex...' script fails, the invocation is appended to a file
+`missfont.log' (by default) in the current directory. You can then
+execute the log file to create the missing files after fixing the
+problem.
+
+ If the current directory is not writable and the environment
+variable or configuration file value `TEXMFOUTPUT' is set, its value is
+used. Otherwise, nothing is written. The name `missfont.log' is
+overridden by the `MISSFONT_LOG' environment variable or configuration
+file value.
+
+
+File: kpathsea.info, Node: mktex script arguments, Prev: mktex script names, Up: mktex scripts
+
+2.2.9.3 `mktex' script arguments
+................................
+
+The first argument to a `mktex' script is always the name of the file
+to be created.
+
+ In the default `mktexpk' implementation, additional arguments may
+also be passed:
+
+`--dpi NUM'
+ Sets the resolution of the generated font to NUM.
+
+`--mfmode NAME'
+ Sets the Metafont mode to NAME.
+
+`--bdpi NUM'
+ Sets the the "base dpi" for the font. This must match the mode
+ being used.
+
+`--mag STRING'
+ A "magstep" string suitable for the Metafont `mag' variable. This
+ must match the combination of BDPI and DPI being used.
+
+`--destdir STRING'
+ A directory name. If the directory is absolute, it is used as-is.
+ Otherwise, it is appended to the root destination directory set in
+ the script.
+
+
+File: kpathsea.info, Node: Installation testing, Prev: mktex scripts, Up: Custom installation
+
+2.2.10 Installation testing
+---------------------------
+
+Besides the tests listed in *Note Simple installation::, you can try
+running `make check'. This includes the torture tests (trip, trap, and
+mptrap) that come with Web2c (*note Triptrap: (web2c)Triptrap.).
+
+
+File: kpathsea.info, Node: Security, Next: TeX directory structure, Prev: Custom installation, Up: Installation
+
+2.3 Security
+============
+
+None of the programs in the TeX system require any special system
+privileges, so there's no first-level security concern of people gaining
+illegitimate root access.
+
+ A TeX document, however, can write to arbitrary files, e.g.,
+`~/.rhosts', and thus an unwitting user who runs TeX on a random
+document is vulnerable to a trojan horse attack. This loophole is
+closed by default, but you can be permissive if you so desire in
+`texmf.cnf'. *Note tex invocation: (web2c)tex invocation. MetaPost has
+the same issue.
+
+ Dvips, Xdvi, and TeX can also execute shell commands under some
+circumstances. To disable this, see the `-R' option in *Note Option
+details: (dvips)Option details, the xdvi man page, and *Note tex
+invocation: (web2c)tex invocation, respectively.
+
+ Another security issue arises because it's very useful--almost
+necessary--to make arbitrary fonts on user demand with `mktexpk' and
+friends. Where do these files get installed? By default, the
+`mktexpk' distributed with Kpathsea assumes a world-writable `/var/tmp'
+directory; this is a simple and convenient approach, but it may not
+suit your situation because it means that a local cache of fonts is
+created on every machine.
+
+ To avoid this duplication, many people consider a shared, globally
+writable font tree desirable, in spite of the potential security
+problems. To do this you should change the value of `VARTEXFONTS' in
+`texmf.cnf' to refer to some globally known directory. *Note mktex
+configuration::.
+
+ The first restriction you can apply is to make newly-created
+directories under `texmf' be append-only with an option in `mktex.cnf'.
+*Note mktex configuration::.
+
+ Another approach is to establish a group (or user) for TeX files,
+make the `texmf' tree writable only to that group (or user), and make
+`mktexpk' et al. setgid to that group (or setuid to that user). Then
+users must invoke the scripts to install things. (If you're worried
+about the inevitable security holes in scripts, then you could write a
+C wrapper to exec the script.)
+
+ The `mktex...' scripts install files with the same read and write
+permissions as the directory they are installed in. The executable,
+sgid, suid, and sticky bits are always cleared.
+
+ Any directories created by the `mktex...' scripts have the same
+permissions as their parent directory, unless the `appendonlydir'
+feature is used, in which case the sticky bit is always set.
+
+
+File: kpathsea.info, Node: TeX directory structure, Next: unixtex.ftp, Prev: Security, Up: Installation
+
+2.4 TeX directory structure
+===========================
+
+This section describes the default installation hierarchy of the
+distribution. It conforms to both the GNU coding standards and the TeX
+directory structure (TDS) standard. For rationale and further
+explanation, please see those documents. The GNU standard is available
+as `ftp://prep.ai.mit.edu/pub/gnu/standards/standards.texi' and
+mirrors. The TDS document is available from `CTAN:/tex-archive/tds'
+(*note unixtex.ftp::).
+
+ You can change the default paths in many ways (*note Changing search
+paths::). One common desire is to put everything (binaries and all)
+under a single top-level directory such as `/usr/local/texmf' or
+`/opt/texmf'--in the terms used below, make PREFIX and TEXMF the same.
+For specific instructions on doing that, see *Note configure
+scenarios::.
+
+ Here is a skeleton of the default directory structure, extracted from
+the TDS document:
+
+ PREFIX/ installation root (`/usr/local' by default)
+ bin/ executables
+ man/ man pages
+ include/ C header files
+ info/ GNU info files
+ lib/ libraries (`libkpathsea.*')
+ share/ architecture-independent files
+ texmf/ TDS root
+ bibtex/ BibTeX input files
+ bib/ BibTeX databases
+ base/ base distribution (e.g., `xampl.bib')
+ misc/ single-file databases
+ PKG/ name of a package
+ bst/ BibTeX style files
+ base/ base distribution (e.g., `plain.bst', `acm.bst')
+ misc/ single-file styles
+ PKG/ name of a package
+ doc/ additional documentation
+ dvips/ `.pro', `.ps', `psfonts.map'
+ fonts/ font-related files
+ TYPE/ file type (e.g., `tfm', `pk')
+ MODE/ type of output device (types `pk' and `gf' only)
+ SUPPLIER/ name of a font supplier (e.g., `public')
+ TYPEFACE/ name of a typeface (e.g., `cm')
+ dpiNNN/ font resolution (types `pk' and `gf' only)
+ metafont/ Metafont (non-font) input files
+ base/ base distribution (e.g., `plain.mf')
+ misc/ single-file packages (e.g., `modes.mf')
+ PKG/ name of a package (e.g., `mfpic')
+ metapost/ MetaPost input files
+ base/ base distribution (e.g., `plain.mp')
+ misc/ single-file packages
+ PKG/ name of a package
+ support/ support files for MetaPost-related utilities (e.g., `trfonts.map')
+ mft/ `MFT' inputs (e.g., `plain.mft')
+ tex/ TeX input files
+ FORMAT/ name of a format (e.g., `plain')
+ base/ base distribution for FORMAT (e.g., `plain.tex')
+ misc/ single-file packages (e.g., `webmac.tex')
+ local/ local additions to or local configuration files for FORMAT
+ PKG/ name of a package (e.g., `graphics', `mfnfss')
+ generic/ format-independent packages
+ hyphen/ hyphenation patterns (e.g., `hyphen.tex')
+ images/ image input files (e.g., Encapsulated PostScript)
+ misc/ single-file format-independent packages (e.g., `null.tex').
+ PKG/ name of a package (e.g., `babel')
+ web2c/ implementation-dependent files (`.pool', `.fmt', `texmf.cnf', etc.)
+
+ Some concrete examples for most file types:
+
+ /usr/local/bin/tex
+ /usr/local/man/man1/xdvi.1
+ /usr/local/info/kpathsea.info
+ /usr/local/lib/libkpathsea.a
+ /usr/local/share/texmf/bibtex/bst/base/plain.bst
+ /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk
+ /usr/local/share/texmf/fonts/source/public/pandora/pnr10.mf
+ /usr/local/share/texmf/fonts/tfm/public/cm/cmr10.tfm
+ /usr/local/share/texmf/fonts/type1/adobe/utopia/putr.pfa
+ /usr/local/share/texmf/metafont/base/plain.mf
+ /usr/local/share/texmf/metapost/base/plain.mp
+ /usr/local/share/texmf/tex/plain/base/plain.tex
+ /usr/local/share/texmf/tex/generic/hyphen/hyphen.tex
+ /usr/local/share/texmf/web2c/tex.pool
+ /usr/local/share/texmf/web2c/tex.fmt
+ /usr/local/share/texmf/web2c/texmf.cnf
+
+
+File: kpathsea.info, Node: unixtex.ftp, Next: Reporting bugs, Prev: TeX directory structure, Up: Installation
+
+2.5 `unixtex.ftp': Obtaining TeX
+================================
+
+This is `ftp://ftp.tug.org/tex/unixtex.ftp', last updated 26 December
+2003. Also available as `http://www.tug.org/unixtex.ftp'. The IP
+address is currently `[130.225.2.178]'. It is also in Kpathsea source
+distributions as `etc/unixtex.ftp' (although the network version is
+usually newer). Mail <tex-k@mail.tug.org> with comments or questions.
+
+ Following are general instructions for Unix or other sites who wish
+to acquire the Web2c distribution, (plain) TeX, LaTeX (2e), BibTeX,
+Metafont, MetaPost, DVI processors for the X window system, PostScript,
+the PCL language in the HP LaserJet, and related programs. They are
+oriented towards building from the original sources, though some
+information on alternative packages is included in the last section.
+See also `http://www.tug.org/web2c/', the Web2c and Kpathsea home page.
+
+ Please note that the Web2c distribution is a bare-bones distribution
+in source form, and building a complete installation from it is a
+non-trivial matter. For most uses, it is a better idea to install a
+distribution with pre-packaged binaries for your platform. The
+principal example of such a distribution is TeX Live
+(`http://www.tug.org/texlive/'), which is based on the Web2c sources.
+
+ Please consider joining the TeX Users Group (TUG) or another user
+group of your choice to help support the maintenance and development of
+the programs you retrieve. See `http://www.tug.org/join.html' for
+information and the membership registration form, and
+`http://www.tug.org/usergroups.html' for a listing of all user groups.
+
+ For actual installation instructions after obtaining the necessary
+sources, see *Note Installation::. A copy is in the distribution file
+`kpathsea/INSTALL'.
+
+* Menu:
+
+* Electronic distribution:: CTAN and so forth.
+* CD-ROM distribution::
+* Other TeX packages::
+
+
+File: kpathsea.info, Node: Electronic distribution, Next: CD-ROM distribution, Up: unixtex.ftp
+
+2.5.1 Electronic distribution
+-----------------------------
+
+In many places we refer to CTAN:. This is _both_ a host name and a
+directory name. Here are the primary locations:
+
+ `ftp://ctan.tug.org/tex-archive/' (Vermont, USA)
+ `ftp://ftp.dante.de/tex-archive/' (Germany)
+ `ftp://ftp.tex.ac.uk/tex-archive/' (England)
+
+CTAN has many mirrors worldwide; see the top-level file
+`README.mirrors' from one of the sites above or see
+`http://www.tug.org/CTAN.sites'.
+
+ You can also access CTAN via the World Wide Web, electronic mail, or
+NFS. The same `README.mirrors' file explains how.
+
+ You will need to retrieve some or all of the following archives,
+depending on your needs (don't forget to set binary mode for file
+transfers):
+
+`CTAN:/systems/web2c/web.tar.gz'
+ The original WEB source files, written primarily by Don Knuth.
+ Required unless you already have this `web' version. (The WEB
+ sources change irregularly with respect to Web2c itself.) Unpacks
+ into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/web2c.tar.gz'
+ The Web2c system. Required. Also unpacks into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/web2c-etex.tar.gz'
+ Additions to the Web2c system for building e-TeX. Optional.
+ Unpacks into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/etexlib.tar.gz'
+ Additions to the texmf tree needed to build e-TeX. Optional.
+ Unpacks into `texmf/'.
+
+`CTAN:/systems/web2c/etexdoc.tar.gz'
+ Documentation for e-TeX as an addition to the texmf tree.
+ Optional. Unpacks into `texmf/'.
+
+`CTAN:/systems/web2c/web2c-omega.tar.gz'
+ Additions to the Web2c system for building Omega. Optional.
+ Unpacks into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/omegalib.tar.gz'
+ Additions to the texmf tree needed to build Omega. Optional.
+ Unpacks into `texmf/'.
+
+`CTAN:/systems/web2c/omegadoc.tar.gz'
+ Documentation for Omega as an addition to the texmf tree.
+ Optional. Unpacks into `texmf/'.
+
+`CTAN:/systems/web2c/web2c-pdftex.tar.gz'
+ Additions to the Web2c system for building pdfTeX. Optional.
+ Unpacks into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/pdftexlib.tar.gz'
+ Additions to the texmf tree needed to build pdfTeX. Optional.
+ Unpacks into `texmf/'.
+
+`CTAN:/dviware/xdvik/xdvik.tar.gz'
+ X window system DVI previewer. Unpacks into `xdvik-VERSION'.
+ Optional.
+
+ Additional drivers, macro files, and other support are needed to
+build a working system. These are available in teTeX.
+
+ All that said, the originating host for the software above is
+`ftp.tug.org'. You can retrieve these distributions (but not much
+else) from the `tex/' directory on that host.
+
+
+File: kpathsea.info, Node: CD-ROM distribution, Next: Other TeX packages, Prev: Electronic distribution, Up: unixtex.ftp
+
+2.5.2 CD-ROM distribution
+-------------------------
+
+Numerous organizations distribute various TeX CD-ROM's (and DVD's):
+
+ * Virtually all the TeX user groups collaborate to produce the `TeX
+ Live' distribution once a year; see `http://www.tug.org/texlive/'
+ for more information.
+
+ * The Free Software Foundation's `Source Code CD-ROM' contains the
+ minimal TeX source distribution described in the previous section
+ (i.e., enough to print GNU documentation); email <gnu@gnu.org>.
+
+ * Most Linux distributions include some TeX package based on Web2c;
+ see the Linux documentation file `Distribution-HOWTO' for a
+ comparison of Linux distributions, available (for example) via
+ `http://www.linux.org'.
+
+ If you know of additional TeX distributions to add to this list,
+please inform <tex-k@mail.tug.org>.
+
+
+File: kpathsea.info, Node: Other TeX packages, Prev: CD-ROM distribution, Up: unixtex.ftp
+
+2.5.3 Other TeX packages
+------------------------
+
+Many other TeX implementations are available in `CTAN:/systems',
+including ready-to-run distributions for Unix, Amiga, Acorn, VMS,
+Macintosh, DOS, and Windows (in various forms). Although Web2c has
+support in the source code for many operating systems, and in fact some
+of the other distributions are based on it, it's unlikely to work as
+distributed on anything but Unix. (Please contribute improvements!)
+
+ The principal user-oriented Unix distribution based on Web2c is the
+teTeX distribution. It includes complete sources, and runs on all
+modern Unix variants, including Linux. It contains many TeX-related
+programs besides those in the core Web2c.
+
+ The host labrea.stanford.edu is the original source for the files
+for which Donald Knuth is directly responsible: `tex.web', `plain.tex',
+etc. However, unless you want to build your TeX library tree ab initio,
+it is more reliable and less work to retrieve these files as part of
+the above packages. In any case, labrea is not the canonical source for
+anything except what was created by Stanford TeX project, so do not
+rely on all the files available at that ftp site being up-to-date.
+
+
+File: kpathsea.info, Node: Reporting bugs, Prev: unixtex.ftp, Up: Installation
+
+2.6 Reporting bugs
+==================
+
+(A copy of this chapter is in the file `kpathsea/BUGS'.)
+
+If you have problems or suggestions, please report them to
+<tex-k@mail.tug.org> using the bug checklist below.
+
+ Please report bugs in the documentation; not only factual errors or
+inconsistent behavior, but unclear or incomplete explanations, typos,
+wrong fonts, ...
+
+* Menu:
+
+* Bug checklist:: What to include in a good bug report.
+* Mailing lists:: Joining the bugs or announcements mailing lists.
+* Debugging:: Analyzing runtime problems.
+* Logging:: Recording searches.
+* Common problems:: When things go wrong.
+
+
+File: kpathsea.info, Node: Bug checklist, Next: Mailing lists, Up: Reporting bugs
+
+2.6.1 Bug checklist
+-------------------
+
+Before reporting a bug, please check below to be sure it isn't already
+known (*note Common problems::).
+
+ Bug reports should be sent via electronic mail to
+<tex-k@mail.tug.org>, or by postal mail to 135 Center Hill Road /
+Plymouth, MA 02360 / USA.
+
+ The general principle is that a good bug report includes all the
+information necessary for reproduction. Therefore, to enable
+investigation, your report should include the following:
+
+ * The version number(s) of the program(s) involved, and of Kpathsea
+ itself. You can get the former by giving a sole option `--version'
+ to the program, and the latter by running `kpsewhich --version'.
+ The `NEWS' and `ChangeLog' files also contain the version number.
+
+ * The hardware, operating system (including version number),
+ compiler, and `make' program you are using (the output of `uname
+ -a' is a start on the first two, though often incomplete). If the
+ bug involves the X window system, include X version and supplier
+ information as well (examples: X11R6 from MIT; X11R4 from HP;
+ OpenWindows 3.3 bundled with SunOS 4.1.4).
+
+ * Any options you gave to `configure'. This is recorded in the
+ `config.status' files.
+
+ If you are reporting a bug in `configure' itself, it's probably
+ system-dependent, and it will be unlikely the maintainers can do
+ anything useful if you merely report that thus-and-such is broken.
+ Therefore, you need to do some additional work: for some bugs, you
+ can look in the file `config.log' where the test that failed should
+ appear, along with the compiler invocation and source program in
+ question. You can then compile it yourself by hand, and discover
+ why the test failed. Other `configure' bugs do not involve the
+ compiler; in that case, the only recourse is to inspect the
+ `configure' shell script itself, or the Autoconf macros that
+ generated `configure'.
+
+ * The log of all debugging output, if the bug is in path searching.
+ You can get this by setting the environment variable
+ `KPATHSEA_DEBUG' to `-1' before running the program. Please look
+ at the log yourself to make sure the behavior is really a bug
+ before reporting it; perhaps "old" environment variable settings
+ are causing files not to be found, for example.
+
+ * The contents of any input files necessary to reproduce the bug.
+ For bugs in DVI-reading programs, for example, this generally
+ means a DVI file (and any EPS or other files it uses)--TeX source
+ files are helpful, but the DVI file is necessary, because that's
+ the actual program input.
+
+ GNU `shar', available from `ftp://prep.ai.mit.edu/pub/gnu' is a
+ convenient way of packaging multiple (possibly binary) files for
+ electronic mail. If you feel your input files are too big to send
+ by email, you can ftp them to `ftp://ftp.tug.org/incoming' (that
+ directory is writable, but not readable).
+
+ * If you are sending a patch (do so if you can!), please do so in
+ the form of a context diff (`diff -c') against the original
+ distribution source. Any other form of diff is either not as
+ complete or harder for me to understand. Please also include a
+ `ChangeLog' entry.
+
+ * If the bug involved is an actual crash (i.e., core dump), it is
+ easy and useful to include a stack trace from a debugger (I
+ recommend the GNU debugger GDB, available from
+ `ftp://prep.ai.mit.edu/pub/gnu'). If the cause is apparent (a
+ `NULL' value being dereferenced, for example), please send the
+ details along. If the program involved is TeX or Metafont, and
+ the crash is happening at apparently-sound code, however, the bug
+ may well be in the compiler, rather than in the program or the
+ library (*note TeX or Metafont failing: TeX or Metafont failing.).
+
+ * Any additional information that will be helpful in reproducing,
+ diagnosing, or fixing the bug.
+
+
+File: kpathsea.info, Node: Mailing lists, Next: Debugging, Prev: Bug checklist, Up: Reporting bugs
+
+2.6.2 Mailing lists
+-------------------
+
+Web2c and Kpathsea in general are discussed on the mailing list
+<tex-k@mail.tug.org>. To join, email <tex-k-request@mail.tug.org> with
+a line consisting of
+
+ subscribe YOU@YOUR.PREFERRED.EMAIL.ADDRESS
+
+in the body of the message.
+
+ You do not need to join to submit a report, nor will it affect
+whether you get a response. There is no Usenet newsgroup equivalent
+(if you can be the one to set this up, email `tex-k-request'). Traffic
+on the list is fairly light, and is mainly bug reports and enhancement
+requests to the software. The best way to decide if you want to join
+or not is read some of the archives from
+`ftp://ftp.tug.org/mail/archives/tex-k/'.
+
+ Be aware that large data files are sometimes included in bug reports.
+If this is a problem for you, do not join the list.
+
+ If you only want announcements of new releases, not bug reports and
+discussion, join <tex-archive@math.utah.edu> (via mail to
+<tex-archive-request@math.utah.edu>).
+
+ If you are looking for general TeX help, such as how to use LaTeX,
+please use the mailing list <info-tex@shsu.edu> mailing list, which is
+gatewayed to the `comp.text.tex' Usenet newsgroup (or post to the
+newsgroup; the gateway is bidirectional).
+
+
+File: kpathsea.info, Node: Debugging, Next: Logging, Prev: Mailing lists, Up: Reporting bugs
+
+2.6.3 Debugging
+---------------
+
+Kpathsea provides a number of runtime debugging options, detailed below
+by their names and corresponding numeric values. When the files you
+expect aren't being found, the thing to do is enable these options and
+examine the output.
+
+ You can set these with some runtime argument (e.g., `-d') to the
+program; in that case, you should use the numeric values described in
+the program's documentation (which, for Dvipsk and Xdvik, are different
+than those below). It's best to give the `-d' (or whatever) option
+first, for maximal output. Dvipsk and Xdvik have additional
+program-specific debugging options as well.
+
+ You can also set the environment variable `KPATHSEA_DEBUG'; in this
+case, you should use the numbers below. If you run the program under a
+debugger and set the variable `kpathsea_debug', also use the numbers
+below.
+
+ In any case, by far the simplest value to use is `-1', which will
+turn on all debugging output. This is usually better than guessing
+which particular values will yield the output you need.
+
+ Debugging output always goes to standard error, so you can redirect
+it easily. For example, in Bourne-compatible shells:
+ dvips -d -1 ... 2>/tmp/debug
+
+ It is sometimes helpful to run the standalone Kpsewhich utility
+(*note Invoking kpsewhich::), instead of the original program.
+
+ In any case, you can _not_ use the _names_ below; you must always
+use somebody's numbers. (Sorry.) To set more than one option, just
+sum the corresponding numbers.
+
+`KPSE_DEBUG_STAT (1)'
+ Report `stat'(2) calls. This is useful for verifying that your
+ directory structure is not forcing Kpathsea to do many additional
+ file tests (*note Slow path searching::, and *note Subdirectory
+ expansion::). If you are using an up-to-date `ls-R' database
+ (*note Filename database::), this should produce no output unless a
+ nonexistent file that must exist is searched for.
+
+`KPSE_DEBUG_HASH (2)'
+ Report lookups in all hash tables: `ls-R' and `aliases' (*note
+ Filename database::); font aliases (*note Fontmap::); and config
+ file values (*note Config files::). Useful when expected values
+ are not being found, e.g.., file searches are looking at the disk
+ instead of using `ls-R'.
+
+`KPSE_DEBUG_FOPEN (4)'
+ Report file openings and closings. Especially useful when your
+ system's file table is full, for seeing which files have been
+ opened but never closed. In case you want to set breakpoints in a
+ debugger: this works by redefining `fopen' (`fclose') to be
+ `kpse_fopen_trace' (`kpse_fclose_trace').
+
+`KPSE_DEBUG_PATHS (8)'
+ Report general path information for each file type Kpathsea is
+ asked to search. This is useful when you are trying to track down
+ how a particular path got defined--from `texmf.cnf', `config.ps',
+ an environment variable, the compile-time default, etc. This is
+ the contents of the `kpse_format_info_type' structure defined in
+ `tex-file.h'.
+
+`KPSE_DEBUG_EXPAND (16)'
+ Report the directory list corresponding to each path element
+ Kpathsea searches. This is only relevant when Kpathsea searches
+ the disk, since `ls-R' searches don't look through directory lists
+ in this way.
+
+`KPSE_DEBUG_SEARCH (32)'
+ Report on each file search: the name of the file searched for, the
+ path searched in, whether or not the file must exist (when drivers
+ search for `cmr10.vf', it need not exist), and whether or not we
+ are collecting all occurrences of the file in the path (as with,
+ e.g., `texmf.cnf' and `texfonts.map'), or just the first (as with
+ most lookups). This can help you correlate what Kpathsea is doing
+ with what is in your input file.
+
+`KPSE_DEBUG_VARS (64)'
+ Report the value of each variable Kpathsea looks up. This is
+ useful for verifying that variables do indeed obtain their correct
+ values.
+
+`GSFTOPK_DEBUG (128)'
+ Activates debugging printout specific to `gsftopk' program.
+
+`MAKETEX_DEBUG (512)'
+ If you use the optional `mktex' programs instead of the
+ traditional shell scripts, this will report the name of the site
+ file (`mktex.cnf' by default) which is read, directories created by
+ `mktexdir', the full path of the `ls-R' database built by
+ `mktexlsr', font map searches, `MT_FEATURES' in effect, parameters
+ from `mktexnam', filenames added by `mktexupd', and some
+ subsidiary commands run by the programs.
+
+`MAKETEX_FINE_DEBUG (1024)'
+ When the optional `mktex' programs are used, this will print
+ additional debugging info from functions internal to these
+ programs.
+
+ Debugging output from Kpathsea is always written to standard error,
+and begins with the string `kdebug:'. (Except for hash table buckets,
+which just start with the number, but you can only get that output
+running under a debugger. See comments at the `hash_summary_only'
+variable in `kpathsea/db.c'.)
+
+
+File: kpathsea.info, Node: Logging, Next: Common problems, Prev: Debugging, Up: Reporting bugs
+
+2.6.4 Logging
+-------------
+
+Kpathsea can record the time and filename found for each successful
+search. This may be useful in finding good candidates for deletion when
+your filesystem is full, or in discovering usage patterns at your site.
+
+ To do this, define the environment or config file variable
+`TEXMFLOG'. The value is the name of the file to append the
+information to. The file is created if it doesn't exist, and appended
+to if it does.
+
+ Each successful search turns into one line in the log file: two words
+separated by a space. The first word is the time of the search, as the
+integer number of seconds since "the epoch", i.e., UTC midnight 1
+January 1970 (more precisely, the result of the `time' system call).
+The second word is the filename.
+
+ For example, after `setenv TEXMFLOG /tmp/log', running Dvips on
+`story.dvi' appends the following lines:
+
+ 774455887 /usr/local/share/texmf/dvips/config.ps
+ 774455887 /usr/local/share/texmf/dvips/psfonts.map
+ 774455888 /usr/local/share/texmf/dvips/texc.pro
+ 774455888 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmbx10.600pk
+ 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmsl10.600pk
+ 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk
+ 774455889 /usr/local/share/texmf/dvips/texc.pro
+
+Only filenames that are absolute are recorded, to preserve some
+semblance of privacy.
+
+
+File: kpathsea.info, Node: Common problems, Prev: Logging, Up: Reporting bugs
+
+2.6.5 Common problems
+---------------------
+
+Here are some common problems with configuration, compilation, linking,
+execution, ...
+
+* Menu:
+
+* Unable to find files:: If your program can't find fonts (or whatever).
+* Slow path searching:: If it takes forever to find anything.
+* Unable to generate fonts:: If mktexpk fails.
+* TeX or Metafont failing:: Likely compiler bugs.
+
+* Empty Makefiles:: When configure produces empty makefiles.
+* XtStrings:: When _XtStrings is undefined.
+* dlopen:: When dlopen is undefined.
+* ShellWidgetClass:: For dynamic linking troubles under OpenWindows.
+* Pointer combination warnings:: For old compilers that don't grok char *.
+
+
+File: kpathsea.info, Node: Unable to find files, Next: Slow path searching, Up: Common problems
+
+2.6.5.1 Unable to find files
+............................
+
+If a program complains it cannot find fonts (or other input files), any
+of several things might be wrong. In any case, you may find the
+debugging options helpful. *Note Debugging::.
+
+ * Perhaps you simply haven't installed all the necessary files; the
+ basic fonts and input files are distributed separately from the
+ programs. *Note unixtex.ftp::.
+
+ * You have (perhaps unknowingly) told Kpathsea to use search paths
+ that don't reflect where the files actually are. One common cause
+ is having environment variables set from a previous installation,
+ thus overriding what you carefully set in `texmf.cnf' (*note
+ Supported file formats::). System `/etc/profile' or other files
+ such may be the culprit.
+
+ * Your files reside in a directory that is only pointed to via a
+ symbolic link, in a leaf directory and is not listed in `ls-R'.
+
+ Unfortunately, Kpathsea's subdirectory searching has an
+ irremediable deficiency: If a directory D being searched for
+ subdirectories contains plain files and symbolic links to other
+ directories, but no true subdirectories, D will be considered a
+ leaf directory, i.e., the symbolic links will not be followed.
+ *Note Subdirectory expansion::.
+
+ You can work around this problem by creating an empty dummy
+ subdirectory in D. Then D will no longer be a leaf, and the
+ symlinks will be followed.
+
+ The directory immediately followed by the `//' in the path
+ specification, however, is always searched for subdirectories,
+ even if it is a leaf. Presumably you would not have asked for the
+ directory to be searched for subdirectories if you didn't want it
+ to be.
+
+ * If the fonts (or whatever) don't already exist, `mktexpk' (or
+ `mktexmf' or `mktextfm') will try to create them. If these rather
+ complicated shell scripts fail, you'll eventually get an error
+ message saying something like `Can't find font FONTNAME'. The best
+ solution is to fix (or at least report) the bug in `mktexpk'; the
+ workaround is to generate the necessary fonts by hand with
+ Metafont, or to grab them from a CTAN site (*note unixtex.ftp::).
+
+ * There is a bug in the library. *Note Reporting bugs::.
+
+
+File: kpathsea.info, Node: Slow path searching, Next: Unable to generate fonts, Prev: Unable to find files, Up: Common problems
+
+2.6.5.2 Slow path searching
+...........................
+
+If your program takes an excessively long time to find fonts or other
+input files, but does eventually succeed, here are some possible
+culprits:
+
+ * Most likely, you just have a lot of directories to search, and that
+ takes a noticeable time. The solution is to create and maintain a
+ separate `ls-R' file that lists all the files in your main TeX
+ hierarchy. *Note Filename database::. Kpathsea always uses `ls-R'
+ if it's present; there's no need to recompile or reconfigure any
+ of the programs.
+
+ * Your recursively-searched directories (e.g.,
+ `/usr/local/share/texmf/fonts//'), contain a mixture of files and
+ directories. This prevents Kpathsea from using a useful
+ optimization (*note Subdirectory expansion::).
+
+ It is best to have only directories (and perhaps a `README') in the
+ upper levels of the directory structure, and it's very important
+ to have _only_ files, and no subdirectories, in the leaf
+ directories where the dozens of TFM, PK, or whatever files reside.
+
+ In any case, you may find the debugging options helpful in
+determining precisely when the disk or network is being pounded. *Note
+Debugging::.
+
+
+File: kpathsea.info, Node: Unable to generate fonts, Next: TeX or Metafont failing, Prev: Slow path searching, Up: Common problems
+
+2.6.5.3 Unable to generate fonts
+................................
+
+Metafont outputs fonts in bitmap format, tuned for a particular device
+at a particular resolution, in order to allow for the highest-possible
+quality of output. Some DVI-to-whatever programs, such as Dvips, try
+to generate these on the fly when they are needed, but this generation
+may fail in several cases.
+
+ If `mktexpk' runs, but fails with this error:
+ mktexpk: Can't guess mode for NNN dpi devices.
+ mktexpk: Use a config file to specify the mode, or update me.
+ you need to ensure the resolution and mode match; just specifying
+the resolution, as in `-D 360', is not enough.
+
+ You can specify the mode name with the `-mode' option on the Dvips
+command line, or in a Dvips configuration file (*note Config files:
+(dvips)Config files.), such as `config.ps' in your document directory,
+`~/.dvipsrc' in your home directory, or in a system directory (again
+named `config.ps'). (Other drivers use other files, naturally.)
+
+ For example, if you need 360dpi fonts, you could include this in a
+configuration file:
+ D 360
+ M lqmed
+
+ If Metafont runs, but generates fonts at the wrong resolution or for
+the wrong device, most likely `mktexpk''s built-in guess for the mode
+is wrong, and you should override it as above.
+
+ See `ftp://ftp.tug.org/tex/modes.mf' for a list of resolutions and
+mode names for most devices (additional submissions are welcome).
+
+ If Metafont runs but generates fonts at a resolution of 2602dpi (and
+prints out the name of each character as well as just a character
+number, and maybe tries to display the characters), then your Metafont
+base file probably hasn't been made properly. (It's using the default
+`proof' mode, instead of an actual device mode.) To make a proper
+`plain.base', assuming the local mode definitions are contained in a
+file `modes.mf', run the following command (assuming Unix):
+
+ inimf "plain; input modes; dump"
+
+Then copy the `plain.base' file from the current directory to where the
+base files are stored on your system (`/usr/local/share/texmf/web2c' by
+default), and make a link (either hard or soft) from `plain.base' to
+`mf.base' in that directory. *Note inimf invocation: (web2c)inimf
+invocation.
+
+ If `mf' is a command not found at all by `mktexpk', then you need to
+install Metafont (*note unixtex.ftp::).
+
+
+File: kpathsea.info, Node: TeX or Metafont failing, Next: Empty Makefiles, Prev: Unable to generate fonts, Up: Common problems
+
+2.6.5.4 TeX or Metafont failing
+...............................
+
+If TeX or Metafont get a segmentation fault or otherwise fail while
+running a normal input file, the problem is usually a compiler bug
+(unlikely as that may sound). Even if the trip and trap tests are
+passed, problems may lurk. Optimization occasionally causes trouble in
+programs other than TeX and Metafont themselves, too.
+
+ Insufficient swap space may also cause core dumps or other erratic
+behavior.
+
+ For a workaround, if you enabled any optimization flags, it's best to
+omit optimization entirely. In any case, the way to find the facts is
+to run the program under the debugger and see where it's failing.
+
+ Also, if you have trouble with a system C compiler, I advise trying
+the GNU C compiler. And vice versa, unfortunately; but in that case I
+also recommend reporting a bug to the GCC mailing list; see *Note Bugs:
+(gcc)Bugs.
+
+ To report compiler bugs effectively requires perseverance and
+perspicacity: you must find the miscompiled line, and that usually
+involves delving backwards in time from the point of error, checking
+through TeX's (or whatever program's) data structures. Things are not
+helped by all-too-common bugs in the debugger itself. Good luck.
+
+ One known cause of trouble is the way arrays are handled. Some of
+the Pascal arrays have a lower index other than 0, and the C code will
+take the pointer to the allocated memory, subtract the lower index, and
+use the resulting pointer for the array. While this trick often works,
+ANSI C doesn't guarantee that it will. It it known to fail on HP-UX 10
+mchines when the native compiler is used, unless the `+u' compiler
+switch was specified. Using GCC will work on this platform as well.
+
+
+File: kpathsea.info, Node: Empty Makefiles, Next: XtStrings, Prev: TeX or Metafont failing, Up: Common problems
+
+2.6.5.5 Empty Makefiles
+.......................
+
+On some systems (NetBSD, FreeBSD, AIX 4.1, and Mach10), `configure' may
+fail to properly create the Makefiles. Instead, you get an error which
+looks something like this:
+
+ prompt$ ./configure
+ ...
+ creating Makefile
+ sed: 1: "\\@^ac_include make/pat ...": \ can not be used as a string delimiter
+
+ So far as I know, the bug here is in `/bin/sh' on these systems. I
+don't have access to a machine running any of them, so if someone can
+find a workaround that avoids the quoting bug, I'd be most grateful.
+(Search for `ac_include' in the `configure' script to get to the
+problematic code.)
+
+ It should work to run `bash configure', instead of using `/bin/sh'.
+You can get Bash from `ftp://prep.ai.mit.edu/pub/gnu' and mirrors.
+
+ Another possible cause (reported for NeXT) is a bug in the `sed'
+command. In that case the error may look like this:
+
+ Unrecognized command: \@^ac_include make/paths.make@r make/paths.make
+
+ In this case, installing GNU `sed' should solve the problem. You
+can get GNU `sed' from the same places as Bash.
+
+
+File: kpathsea.info, Node: XtStrings, Next: dlopen, Prev: Empty Makefiles, Up: Common problems
+
+2.6.5.6 `XtStrings'
+...................
+
+You may find that linking X programs results in an error from the linker
+that `XtStrings' is undefined, something like this:
+
+ gcc -o virmf ...
+ .../x11.c:130: undefined reference to `XtStrings'
+
+ This generally happens because of a mismatch between the X include
+files with which you compiled and the X libraries with which you linked;
+often, the include files are from MIT and the libraries from Sun.
+
+ The solution is to use the same X distribution for compilation and
+linking. Probably `configure' was unable to guess the proper
+directories from your installation. You can use the `configure'
+options `--x-includes=PATH' and `--x-libraries=PATH' to explicitly
+specify them.
+
+
+File: kpathsea.info, Node: dlopen, Next: ShellWidgetClass, Prev: XtStrings, Up: Common problems
+
+2.6.5.7 `dlopen'
+................
+
+(This section adapted from the file `dlsym.c' in the X distribution.)
+
+ The `Xlib' library uses the standard C function `wcstombs'. Under
+SunOS 4.1, `wcstombs' uses the `dlsym' interface defined in `libdl.so'.
+Unfortunately, the SunOS 4.1 distribution does not include a static
+`libdl.a' library.
+
+ As a result, if you try to link an X program statically under SunOS,
+you may get undefined references to `dlopen', `dlsym', and `dlclose'.
+One workaround is to include these definitions when you link:
+
+ void *dlopen() { return 0; }
+ void *dlsym() { return 0; }
+ int dlclose() { return -1; }
+
+These are contained in the `dlsym.c' file in the MIT X distribution.
+
+
+File: kpathsea.info, Node: ShellWidgetClass, Next: Pointer combination warnings, Prev: dlopen, Up: Common problems
+
+2.6.5.8 `ShellWidgetClass'
+..........................
+
+(This section adapted from the comp.sys.sun.admin FAQ.)
+
+ If you are linking with Sun's OpenWindows libraries in SunOS 4.1.x,
+you may get undefined symbols `_get_wmShellWidgetClass' and
+`_get_applicationShellWidgetClass' when linking. This problem does not
+arise using the standard MIT X libraries under SunOS.
+
+ The cause is bugs in the `Xmu' shared library as shipped from Sun.
+There are several fixes:
+
+ * Install the free MIT distribution from `ftp.x.org' and mirrors.
+
+ * Get the OpenWindows patches listed below.
+
+ * Statically link the `Xmu' library into the executable.
+
+ * Avoid using `Xmu' at all. If you are compiling Metafont, see *Note
+ Online Metafont graphics: (web2c)Online Metafont graphics. If you
+ are compiling Xdvi, see the `-DNOTOOL' option in `xdvik/INSTALL'.
+
+ * Ignore the errors. The binary runs fine regardless.
+
+
+ Here is the information for getting the two patches:
+
+ Patch ID: 100512-02
+ Bug ID's: 1086793, 1086912, 1074766
+ Description: 4.1.x OpenWindows 3.0 `libXt' jumbo patch
+
+ Patch ID: 100573-03
+ Bug ID: 1087332
+ Description: 4.1.x OpenWindows 3.0 undefined symbols when using shared `libXmu'.
+
+ The way to statically link with `libXmu' depends on whether you are
+using a Sun compiler (e.g., `cc') or `gcc'. If the latter, alter the
+`x_libs' Make variable to include
+
+ -static -lXmu -dynamic
+
+ If you are using the Sun compiler, use `-Bstatic' and `-Bdynamic'.
+
+
+File: kpathsea.info, Node: Pointer combination warnings, Prev: ShellWidgetClass, Up: Common problems
+
+2.6.5.9 Pointer combination warnings
+....................................
+
+When compiling with old C compilers, you may get some warnings about
+"illegal pointer combinations". These are spurious; just ignore them.
+I decline to clutter up the source with casts to get rid of them.
+
+
+File: kpathsea.info, Node: Path searching, Next: TeX support, Prev: Installation, Up: Top
+
+3 Path searching
+****************
+
+This chapter describes the generic path searching mechanism Kpathsea
+provides. For information about searching for particular file types
+(e.g., TeX fonts), see the next chapter.
+
+* Menu:
+
+* Searching overview:: Basic scheme for searching.
+* Path sources:: Where search paths can be defined.
+* Path expansion:: Special constructs in search paths.
+* Filename database:: Using an externally-built list to search.
+* Invoking kpsewhich:: Standalone path lookup.
+
+
+File: kpathsea.info, Node: Searching overview, Next: Path sources, Up: Path searching
+
+3.1 Searching overview
+======================
+
+A "search path" is a colon-separated list of "path elements", which are
+directory names with a few extra frills. A search path can come from
+(a combination of) many sources; see below. To look up a file `foo'
+along a path `.:/dir', Kpathsea checks each element of the path in
+turn: first `./foo', then `/dir/foo', returning the first match (or
+possibly all matches).
+
+ The "colon" and "slash" mentioned here aren't necessarily `:' and
+`/' on non-Unix systems. Kpathsea tries to adapt to other operating
+systems' conventions.
+
+ To check a particular path element E, Kpathsea first sees if a
+prebuilt database (*note Filename database::) applies to E, i.e., if
+the database is in a directory that is a prefix of E. If so, the path
+specification is matched against the contents of the database.
+
+ If the database does not exist, or does not apply to this path
+element, or contains no matches, the filesystem is searched (if this
+was not forbidden by the specification with `!!' and if the file being
+searched for must exist). Kpathsea constructs the list of directories
+that correspond to this path element, and then checks in each for the
+file being searched for. (To help speed future lookups of files in the
+same directory, the directory in which a file is found is floated to the
+top of the directory list.)
+
+ The "file must exist" condition comes into play with VF files and
+input files read by the TeX `\openin' command. These files may not
+exist (consider `cmr10.vf'), and so it would be wrong to search the
+disk for them. Therefore, if you fail to update `ls-R' when you
+install a new VF file, it will never be found.
+
+ Each path element is checked in turn: first the database, then the
+disk. If a match is found, the search stops and the result is
+returned. This avoids possibly-expensive processing of path
+specifications that are never needed on a particular run. (Unless the
+search explicitly requested all matches.)
+
+ Although the simplest and most common path element is a directory
+name, Kpathsea supports additional features in search paths: layered
+default values, environment variable names, config file values, users'
+home directories, and recursive subdirectory searching. Thus, we say
+that Kpathsea "expands" a path element, meaning transforming all the
+magic specifications into the basic directory name or names. This
+process is described in the sections below. It happens in the same
+order as the sections.
+
+ Exception to all of the above: If the filename being searched for is
+absolute or explicitly relative, i.e., starts with `/' or `./' or
+`../', Kpathsea simply checks if that file exists.
+
+ Ordinarily, if Kpathsea tries to access a file or directory that
+cannot be read, it gives a warning. This is so you will be alerted to
+directories or files that accidentally lack read permission (for
+example, a `lost+found'). If you prefer not to see these warnings,
+include the value `readable' in the `TEX_HUSH' environment variable or
+config file value.
+
+ This generic path searching algorithm is implemented in
+`kpathsea/pathsearch.c'. It is employed by a higher-level algorithm
+when searching for a file of a particular type (*note File lookup::,
+and *Note Glyph lookup::).
+
+
+File: kpathsea.info, Node: Path sources, Next: Path expansion, Prev: Searching overview, Up: Path searching
+
+3.2 Path sources
+================
+
+A search path can come from many sources. In the order in which
+Kpathsea uses them:
+
+ 1. A user-set environment variable, e.g., `TEXINPUTS'. Environment
+ variables with an underscore and the program name appended
+ override; for example, `TEXINPUTS_latex' overrides `TEXINPUTS' if
+ the program being run is named `latex'.
+
+ 2. A program-specific configuration file, e.g., an `S /a:/b' line in
+ Dvips' `config.ps' (*note Config files: (dvips)Config files.).
+
+ 3. A line in a Kpathsea configuration file `texmf.cnf', e.g.,
+ `TEXINPUTS=/c:/d' (see below).
+
+ 4. The compile-time default (specified in `kpathsea/paths.h').
+
+ You can see each of these values for a given search path by using the
+debugging options (*note Debugging::).
+
+ These sources may be combined via default expansion (*note Default
+expansion::).
+
+* Menu:
+
+* Config files:: Kpathsea's runtime config files (texmf.cnf).
+
+
+File: kpathsea.info, Node: Config files, Up: Path sources
+
+3.2.1 Config files
+------------------
+
+As mentioned above, Kpathsea reads "runtime configuration files" named
+`texmf.cnf' for search path and other definitions. The search path
+used to look for these configuration files is named `TEXMFCNF', and is
+constructed in the usual way, as described above, except that
+configuration files cannot be used to define the path, naturally; also,
+an `ls-R' database is not used to search for them.
+
+ Kpathsea reads _all_ `texmf.cnf' files in the search path, not just
+the first one found; definitions in earlier files override those in
+later files. Thus, if the search path is `.:$TEXMF', values from
+`./texmf.cnf' override those from `$TEXMF/texmf.cnf'.
+
+ While (or instead of) reading this description, you may find it
+helpful to look at the distributed `texmf.cnf', which uses or at least
+mentions most features. The format of `texmf.cnf' files follows:
+
+ * Comments start with `%' and continue to the end of the line.
+
+ * Blank lines are ignored.
+
+ * A `\' at the end of a line acts as a continuation character, i.e.,
+ the next line is appended. Whitespace at the beginning of
+ continuation lines is not ignored.
+
+ * Each remaining line must look like
+
+ VARIABLE [. PROGNAME] [=] VALUE
+
+ where the `=' and surrounding whitespace is optional.
+
+ * The VARIABLE name may contain any character other than whitespace,
+ `=', or `.', but sticking to `A-Za-z_' is safest.
+
+ * If `.PROGNAME' is present, the definition only applies if the
+ program that is running is named (i.e., the last component of
+ `argv[0]' is) PROGNAME or `PROGNAME.exe'. This allows different
+ flavors of TeX to have different search paths, for example.
+
+ * VALUE may contain any characters except `%' and `@'. (These
+ restrictions are only necessary because of the processing done on
+ `texmf.cnf' at build time, so you can stick those characters in
+ after installation if you have to.) The `$VAR.PROG' feature is
+ not available on the right-hand side; instead, you must use an
+ additional variable (see below for example). A `;' in VALUE is
+ translated to `:' if running under Unix; this is useful to write a
+ single `texmf.cnf' which can be used under both Unix and NT.
+
+ * All definitions are read before anything is expanded, so you can
+ use variables before they are defined (like Make, unlike most other
+ programs).
+
+Here is a configuration file fragment illustrating most of these points:
+
+ % TeX input files -- i.e., anything to be found by \input or \openin ...
+ latex209_inputs = .:$TEXMF/tex/latex209//:$TEXMF/tex//
+ latex2e_inputs = .:$TEXMF/tex/latex//:$TEXMF/tex//
+ TEXINPUTS = .:$TEXMF/tex//
+ TEXINPUTS.latex209 = $latex209_inputs
+ TEXINPUTS.latex2e = $latex2e_inputs
+ TEXINPUTS.latex = $latex2e_inputs
+
+ Although this format has obvious similarities to Bourne shell
+scripts--change the comment character to `#', disallow spaces around
+the `=', and get rid of the `.NAME' convention, and it could be run
+through the shell. But there seemed little advantage to doing this,
+since all the information would have to passed back to Kpathsea and
+parsed there anyway, since the `sh' process couldn't affect its
+parent's environment.
+
+ The implementation of all this is in `kpathsea/cnf.c'.
+
+
+File: kpathsea.info, Node: Path expansion, Next: Filename database, Prev: Path sources, Up: Path searching
+
+3.3 Path expansion
+==================
+
+Kpathsea recognizes certain special characters and constructions in
+search paths, similar to that in shells. As a general example:
+`~$USER/{foo,bar}//baz' expands to all subdirectories under directories
+`foo' and `bar' in $USER's home directory that contain a directory or
+file `baz'. These expansions are explained in the sections below.
+
+* Menu:
+
+* Default expansion:: a: or :a or a::b expands to a default.
+* Variable expansion:: $foo and ${foo} expand to environment values.
+* Tilde expansion:: ~ and ~user expand to home directories.
+* Brace expansion:: a{foo,bar}b expands to afoob abarb.
+* KPSE_DOT expansion:: . is replaced with $KPSE_DOT if it is defined.
+* Subdirectory expansion:: a// and a//b recursively expand to subdirs.
+
+
+File: kpathsea.info, Node: Default expansion, Next: Variable expansion, Up: Path expansion
+
+3.3.1 Default expansion
+-----------------------
+
+If the highest-priority search path (*note Path sources::) contains an
+"extra colon" (i.e., leading, trailing, or doubled), Kpathsea inserts
+at that point the next-highest-priority search path that is defined.
+If that inserted path has an extra colon, the same happens with the
+next-highest. (An extra colon in the compile-time default value has
+unpredictable results, so installers beware.)
+
+ For example, given an environment variable setting
+
+ setenv TEXINPUTS /home/karl:
+
+and a `TEXINPUTS' value from `texmf.cnf' of
+
+ .:$TEXMF//tex
+
+then the final value used for searching will be:
+
+ /home/karl:.:$TEXMF//tex
+
+ Put another way, default expansion works on "formats" (search
+paths), and not directly on environment variables. Example, showing
+the trailing `:' ignored in the first case and expanded in the second:
+
+ $ env TTFONTS=/tmp: kpsewhich --expand-path '$TTFONTS'
+ /tmp
+ $ env TTFONTS=/tmp: kpsewhich --show-path=.ttf
+ /tmp:.:/home/olaf/texmf/fonts/truetype//:...
+
+ Since Kpathsea looks for multiple configuration files, it would be
+natural to expect that (for example) an extra colon in `./texmf.cnf'
+would expand to the path in `$TEXMF/texmf.cnf'. Or, with Dvips'
+configuration files, that an extra colon in `config.$PRINTER' would
+expand to the path in `config.ps'. This doesn't happen. It's not
+clear this would be desirable in all cases, and trying to devise a way
+to specify the path to which the extra colon should expand seemed truly
+baroque.
+
+ Technicality: Since it would be useless to insert the default value
+in more than one place, Kpathsea changes only one extra `:' and leaves
+any others in place (they will eventually be ignored). Kpathsea checks
+first for a leading `:', then a trailing `:', then a doubled `:'.
+
+ You can trace this by debugging "paths" (*note Debugging::).
+Default expansion is implemented in the source file
+`kpathsea/kdefault.c'.
+
+
+File: kpathsea.info, Node: Variable expansion, Next: Tilde expansion, Prev: Default expansion, Up: Path expansion
+
+3.3.2 Variable expansion
+------------------------
+
+`$foo' or `${foo}' in a path element is replaced by (1) the value of an
+environment variable `foo' (if defined); (2) the value of `foo' from
+`texmf.cnf' (if defined); (3) the empty string.
+
+ If the character after the `$' is alphanumeric or `_', the variable
+name consists of all consecutive such characters. If the character
+after the `$' is a `{', the variable name consists of everything up to
+the next `}' (braces may not be nested around variable names).
+Otherwise, Kpathsea gives a warning and ignores the `$' and its
+following character.
+
+ You must quote the $'s and braces as necessary for your shell.
+_Shell_ variable values cannot be seen by Kpathsea, i.e., ones defined
+by `set' in C shells and without `export' in Bourne shells.
+
+ For example, given
+ setenv tex /home/texmf
+ setenv TEXINPUTS .:$tex:${tex}prev
+ the final `TEXINPUTS' path is the three directories:
+ .:/home/texmf:/home/texmfprev
+
+ The `.PROGNAME' suffix on variables and `_PROGNAME' on environment
+variable names are not implemented for general variable expansions.
+These are only recognized when search paths are initialized (*note Path
+sources::).
+
+ Variable expansion is implemented in the source file
+`kpathsea/variable.c'.
+
+
+File: kpathsea.info, Node: Tilde expansion, Next: Brace expansion, Prev: Variable expansion, Up: Path expansion
+
+3.3.3 Tilde expansion
+---------------------
+
+A leading `~' in a path element is replaced by the value of the
+environment variable `HOME', or `.' if `HOME' is not set.
+
+ A leading `~USER' in a path element is replaced by USER's home
+directory from the system `passwd' database.
+
+ For example,
+ setenv TEXINPUTS ~/mymacros:
+
+will prepend a directory `mymacros' in your home directory to the
+default path.
+
+ As a special case, if a home directory ends in `/', the trailing
+slash is dropped, to avoid inadvertently creating a `//' construct in
+the path. For example, if the home directory of the user `root' is
+`/', the path element `~root/mymacros' expands to just `/mymacros', not
+`//mymacros'.
+
+ Tilde expansion is implemented in the source file `kpathsea/tilde.c'.
+
+
+File: kpathsea.info, Node: Brace expansion, Next: KPSE_DOT expansion, Prev: Tilde expansion, Up: Path expansion
+
+3.3.4 Brace expansion
+---------------------
+
+`x{A,B}y' expands to `xAy:xBy'. For example:
+
+ foo/{1,2}/baz
+
+expands to `foo/1/baz:foo/2/baz'. `:' is the path separator on the
+current system; e.g., on a DOS system, it's `;'.
+
+ Braces can be nested; for example, `x{A,B{1,2}}y' expands to
+`xAy:xB1y:xB2y'.
+
+ Multiple non-nested braces are expanded from right to left; for
+example, `x{A,B}{1,2}y' expands to `x{A,B}1y:x{A,B}2y', which expands
+to `xA1y:xB1y:xA2y:xB2y'.
+
+ This feature can be used to implement multiple TeX hierarchies, by
+assigning a brace list to `$TEXMF', as mentioned in `texmf.in'.
+
+ You can also use the path separator in stead of the comma. The last
+example could have been written `x{A:B}{1:2}y'.
+
+ Brace expansion is implemented in the source file
+`kpathsea/expand.c'. It is a modification of the Bash sources, and is
+thus covered by the GNU General Public License, rather than the Library
+General Public License that covers the rest of Kpathsea.
+
+
+File: kpathsea.info, Node: KPSE_DOT expansion, Next: Subdirectory expansion, Prev: Brace expansion, Up: Path expansion
+
+3.3.5 `KPSE_DOT' expansion
+--------------------------
+
+When `KPSE_DOT' is defined in the environment, it names a directory
+that should be considered the current directory for the purpose of
+looking up files in the search paths. This feature is needed by the
+`mktex...' scripts *Note mktex scripts::, because these change the
+working directory. You should not ever define it yourself.
+
+
+File: kpathsea.info, Node: Subdirectory expansion, Prev: KPSE_DOT expansion, Up: Path expansion
+
+3.3.6 Subdirectory expansion
+----------------------------
+
+Two or more consecutive slashes in a path element following a directory
+D is replaced by all subdirectories of D: first those subdirectories
+directly under D, then the subsubdirectories under those, and so on.
+At each level, the order in which the directories are searched is
+unspecified. (It's "directory order", and definitely not alphabetical.)
+
+ If you specify any filename components after the `//', only
+subdirectories which match those components are included. For example,
+`/a//b' would expand into directories `/a/1/b', `/a/2/b', `/a/1/1/b',
+and so on, but not `/a/b/c' or `/a/1'.
+
+ You can include multiple `//' constructs in the path.
+
+ `//' at the beginning of a path is ignored; you didn't really want
+to search every directory on the system, did you?
+
+ I should mention one related implementation trick, which I took from
+GNU find. Matthew Farwell suggested it, and David MacKenzie
+implemented it.
+
+ The trick is that in every real Unix implementation (as opposed to
+the POSIX specification), a directory which contains no subdirectories
+will have exactly two links (namely, one for `.' and one for `..').
+That is to say, the `st_nlink' field in the `stat' structure will be
+two. Thus, we don't have to stat everything in the bottom-level (leaf)
+directories--we can just check `st_nlink', notice it's two, and do no
+more work.
+
+ But if you have a directory that contains a single subdirectory and
+500 regular files, `st_nlink' will be 3, and Kpathsea has to stat every
+one of those 501 entries. Therein lies slowness.
+
+ You can disable the trick by undefining `UNIX_ST_LINK' in
+`kpathsea/config.h'. (It is undefined by default except under Unix.)
+
+ Unfortunately, in some cases files in leaf directories are `stat''d:
+if the path specification is, say, `$TEXMF/fonts//pk//', then files in
+a subdirectory `.../pk', even if it is a leaf, are checked. The reason
+cannot be explained without reference to the implementation, so read
+`kpathsea/elt-dirs.c' (search for `may descend') if you are curious.
+And if you can find a way to _solve_ the problem, please let me know.
+
+ Subdirectory expansion is implemented in the source file
+`kpathsea/elt-dirs.c'.
+
+
+File: kpathsea.info, Node: Filename database, Next: Invoking kpsewhich, Prev: Path expansion, Up: Path searching
+
+3.4 Filename database (`ls-R')
+==============================
+
+Kpathsea goes to some lengths to minimize disk accesses for searches
+(*note Subdirectory expansion::). Nevertheless, at installations with
+enough directories, searching each possible directory for a given file
+can take an excessively long time (depending on the speed of the disk,
+whether it's NFS-mounted, how patient you are, etc.).
+
+ In practice, a font tree containing the standard PostScript and PCL
+fonts is large enough for searching to be noticeably slow on typical
+systems these days. Therefore, Kpathsea can use an externally-built
+"database" file named `ls-R' that maps files to directories, thus
+avoiding the need to exhaustively search the disk.
+
+ A second database file `aliases' allows you to give additional names
+to the files listed in `ls-R'. This can be helpful to adapt to "8.3"
+filename conventions in source files.
+
+ The `ls-R' and `aliases' features are implemented in the source file
+`kpathsea/db.c'.
+
+* Menu:
+
+* ls-R:: The main filename database.
+* Filename aliases:: Aliases for those names.
+* Database format:: Syntax details of the database file.
+
+
+File: kpathsea.info, Node: ls-R, Next: Filename aliases, Up: Filename database
+
+3.4.1 `ls-R'
+------------
+
+As mentioned above, you must name the main filename database `ls-R'.
+You can put one at the root of each TeX installation hierarchy you wish
+to search (`$TEXMF' by default); most sites have only one hierarchy.
+Kpathsea looks for `ls-R' files along the `TEXMFDBS' path, so that
+should presumably match the list of hierarchies.
+
+ The recommended way to create and maintain `ls-R' is to run the
+`mktexlsr' script, which is installed in `$(bindir)' (`/usr/local/bin'
+by default). That script goes to some trouble to follow symbolic links
+as necessary, etc. It's also invoked by the distributed `mktex...'
+scripts.
+
+ At its simplest, though, you can build `ls-R' with the command
+ cd /YOUR/TEXMF/ROOT && ls -LAR ./ >ls-R
+
+presuming your `ls' produces the right output format (see the section
+below). GNU `ls', for example, outputs in this format. Also presuming
+your `ls' hasn't been aliased in a system file (e.g., `/etc/profile')
+to something problematic, e.g., `ls --color=tty'. In that case, you
+will have to disable the alias before generating `ls-R'. For the
+precise definition of the file format, see *Note Database format::.
+
+ Regardless of whether you use the supplied script or your own, you
+will almost certainly want to invoke it via `cron', so when you make
+changes in the installed files (say if you install a new LaTeX
+package), `ls-R' will be automatically updated.
+
+ The `-A' option to `ls' includes files beginning with `.' (except
+for `.' and `..'), such as the file `.tex' included with the LaTeX
+tools package. (On the other hand, _directories_ whose names begin
+with `.' are always ignored.)
+
+ If your system does not support symbolic links, omit the `-L'.
+
+ `ls -LAR /YOUR/TEXMF/ROOT' will also work. But using `./' avoids
+embedding absolute pathnames, so the hierarchy can be easily
+transported. It also avoids possible trouble with automounters or
+other network filesystem conventions.
+
+ Kpathsea warns you if it finds an `ls-R' file, but the file does not
+contain any usable entries. The usual culprit is running plain `ls -R'
+instead of `ls -LR ./' or `ls -R /YOUR/TEXMF/ROOT'. Another
+possibility is some system directory name starting with a `.' (perhaps
+if you are using AFS); Kpathsea ignores everything under such
+directories.
+
+ Because the database may be out-of-date for a particular run, if a
+file is not found in the database, by default Kpathsea goes ahead and
+searches the disk. If a particular path element begins with `!!',
+however, _only_ the database will be searched for that element, never
+the disk. If the database does not exist, nothing will be searched.
+Because this can surprise users ("I see the font `foo.tfm' when I do an
+`ls'; why can't Dvips find it?"), it is not in any of the default
+search paths.
+
+
+File: kpathsea.info, Node: Filename aliases, Next: Database format, Prev: ls-R, Up: Filename database
+
+3.4.2 Filename aliases
+----------------------
+
+In some circumstances, you may wish to find a file under several names.
+For example, suppose a TeX document was created using a DOS system and
+tries to read `longtabl.sty'. But now it's being run on a Unix system,
+and the file has its original name, `longtable.sty'. The file won't be
+found. You need to give the actual file `longtable.sty' an alias
+`longtabl.sty'.
+
+ You can handle this by creating a file `aliases' as a companion to
+the `ls-R' for the hierarchy containing the file in question. (You
+must have an `ls-R' for the alias feature to work.)
+
+ The format of `aliases' is simple: two whitespace-separated words
+per line; the first is the real name `longtable.sty', and second is the
+alias (`longtabl.sty'). These must be base filenames, with no
+directory components. `longtable.sty' must be in the sibling `ls-R'.
+
+ Also, blank lines and lines starting with `%' or `#' are ignored in
+`aliases', to allow for comments.
+
+ If a real file `longtabl.sty' exists, it is used regardless of any
+aliases.
+
+
+File: kpathsea.info, Node: Database format, Prev: Filename aliases, Up: Filename database
+
+3.4.3 Database format
+---------------------
+
+The "database" read by Kpathsea is a line-oriented file of plain text.
+The format is that generated by GNU (and most other) `ls' programs
+given the `-R' option, as follows.
+
+ * Blank lines are ignored.
+
+ * If a line begins with `/' or `./' or `../' and ends with a colon,
+ it's the name of a directory. (`../' lines aren't useful,
+ however, and should not be generated.)
+
+ * All other lines define entries in the most recently seen directory.
+ /'s in such lines will produce possibly-strange results.
+
+ * Files with no preceding directory line are ignored.
+
+ For example, here's the first few lines of `ls-R' (which totals
+about 30K bytes) on my system:
+
+ bibtex
+ dvips
+ fonts
+ ls-R
+ metafont
+ metapost
+ tex
+ web2c
+
+ ./bibtex:
+ bib
+ bst
+ doc
+
+ ./bibtex/bib:
+ asi.bib
+ btxdoc.bib
+ ...
+
+
+File: kpathsea.info, Node: Invoking kpsewhich, Prev: Filename database, Up: Path searching
+
+3.5 `kpsewhich': Standalone path searching
+==========================================
+
+The Kpsewhich program exercises the path searching functionality
+independent of any particular application. This can also be useful as a
+sort of `find' program to locate files in your TeX hierarchies, perhaps
+in administrative scripts. It is used heavily in the distributed
+`mktex...' scripts.
+
+ Synopsis:
+ kpsewhich OPTION... FILENAME...
+
+ The options and filename(s) to look up can be intermixed. Options
+can start with either `-' or `--', and any unambiguous abbreviation is
+accepted.
+
+* Menu:
+
+* Path searching options:: Changing the mode, resolution, etc.
+* Auxiliary tasks:: Path and variable expansion.
+* Standard options:: --help and --version.
+
+
+File: kpathsea.info, Node: Path searching options, Next: Auxiliary tasks, Up: Invoking kpsewhich
+
+3.5.1 Path searching options
+----------------------------
+
+Kpsewhich looks up each non-option argument on the command line as a
+filename, and returns the first file found. There is no option to
+return all the files with a particular name (you can run the Unix
+`find' utility for that, *note Invoking find: (findutils)Invoking
+find.).
+
+ Various options alter the path searching behavior:
+
+`--dpi=NUM'
+ Set the resolution to NUM; this only affects `gf' and `pk'
+ lookups. `-D' is a synonym, for compatibility with Dvips.
+ Default is 600.
+
+`--engine=NAME'
+ Set the engine name to NAME. By default it is not set. The
+ engine name is used in some search paths to allow files with the
+ same name but used by different engines to coexist.
+
+`--format=NAME'
+ Set the format for lookup to NAME. By default, the format is
+ guessed from the filename, with `tex' being used if nothing else
+ fits. The recognized filename extensions (including any leading
+ `.') are also allowable NAMEs.
+
+ All formats also have a name, which is the only way to specify
+ formats with no associated suffix. For example, for Dvips
+ configuration files you can use `--format="dvips config"'. (The
+ quotes are for the sake of the shell.)
+
+ Here's the current list of recognized names and the associated
+ suffixes. *Note Supported file formats::, for more information on
+ each of these.
+ gf: gf
+ pk: pk
+ bitmap font
+ afm: .afm
+ base: .base
+ bib: .bib
+ bst: .bst
+ cnf: .cnf
+ ls-R: ls-R
+ fmt: .fmt
+ map: .map
+ mem: .mem
+ mf: .mf
+ mfpool: .pool
+ mft: .mft
+ mp: .mp
+ mppool: .pool
+ MetaPost support
+ ocp: .ocp
+ ofm: .ofm .tfm
+ opl: .opl
+ otp: .otp
+ ovf: .ovf
+ ovp: .ovp
+ graphic/figure: .eps .epsi
+ tex: .tex
+ TeX system documentation
+ texpool: .pool
+ TeX system sources
+ PostScript header/font: .pro
+ Troff fonts
+ tfm: .tfm
+ type1 fonts: .pfa .pfb
+ vf: .vf
+ dvips config
+ ist: .ist
+ truetype fonts: .ttf .ttc
+ type42 fonts
+ web2c files
+ other text files
+ other binary files
+ misc fonts
+ web: .web
+ cweb: .w .web
+ enc: .enc
+ cmap: .cmap
+ sfd: .sfd
+ opentype fonts
+ pdftex config
+ lig files: .lig
+ texmfscripts
+
+ This option and `--path' are mutually exclusive.
+
+`--interactive'
+ After processing the command line, read additional filenames to
+ look up from standard input.
+
+`-mktex=FILETYPE'
+`-no-mktex=FILETYPE'
+ Turn on or off the `mktex' script associated with FILETYPE. The
+ only values that make sense for FILETYPE are `pk', `mf', `tex',
+ and `tfm'. By default, all are off in Kpsewhich. *Note mktex
+ scripts::.
+
+`--mode=STRING'
+ Set the mode name to STRING; this also only affects `gf' and `pk'
+ lookups. No default: any mode will be found. *Note mktex script
+ arguments::.
+
+`--must-exist'
+ Do everything possible to find the files, notably including
+ searching the disk. By default, only the `ls-R' database is
+ checked, in the interest of efficiency.
+
+`--path=STRING'
+ Search along the path STRING (colon-separated as usual), instead
+ of guessing the search path from the filename. `//' and all the
+ usual expansions are supported (*note Path expansion::). This
+ option and `--format' are mutually exclusive. To output the
+ complete directory expansion of a path, instead of doing a
+ one-shot lookup, see `--expand-path' in the following section.
+
+`--progname=NAME'
+ Set the program name to NAME; default is `kpsewhich'. This can
+ affect the search paths via the `.PROGNAM' feature in
+ configuration files (*note Config files::).
+
+
+File: kpathsea.info, Node: Auxiliary tasks, Next: Standard options, Prev: Path searching options, Up: Invoking kpsewhich
+
+3.5.2 Auxiliary tasks
+---------------------
+
+Kpsewhich provides some additional features not strictly related to path
+lookup:
+
+ * `--debug=NUM' sets the debugging options to NUM. *Note
+ Debugging::.
+
+ * `--var-value=VARIABLE' output the value of VARIABLE.
+
+ * `--expand-braces=STRING' outputs the variable and brace expansion
+ of STRING. *Note Path expansion::.
+
+ * `--expand-var=STRING' outputs the variable expansion of STRING.
+ For example, the `mktex...' scripts run `kpsewhich
+ --expand-var='$TEXMF'' to find the root of the TeX system
+ hierarchy. *Note Path expansion::.
+
+ * `--expand-path=STRING' outputs the complete expansion of STRING as
+ a colon-separated path. This is useful to construct a search path
+ for a program that doesn't accept recursive subdirectory
+ specifications. Nonexistent directories are culled from the
+ output:
+
+ $ kpsewhich --expand-path '/tmp'
+ => /tmp
+ $ kpsewhich --expand-path '/nonesuch'
+ =>
+
+ For one-shot uses of an arbitrary (not built in to Kpathsea) path,
+ see `--path' in the previous section.
+
+ * `--show-path=NAME' shows the path that would be used for file
+ lookups of file type NAME. Either a filename extension (`pk',
+ `.vf', etc.) or an integer can be used, just as with `--format',
+ described in the previous section.
+
+
+File: kpathsea.info, Node: Standard options, Prev: Auxiliary tasks, Up: Invoking kpsewhich
+
+3.5.3 Standard options
+----------------------
+
+Kpsewhich accepts the standard GNU options:
+
+ * `--help' prints a help message on standard output and exits.
+
+ * `--version' prints the Kpathsea version number and exits.
+
+
+File: kpathsea.info, Node: TeX support, Next: Programming, Prev: Path searching, Up: Top
+
+4 TeX support
+*************
+
+Although the basic features in Kpathsea can be used for any type of path
+searching, it came about (like all libraries) with a specific
+application in mind: I wrote Kpathsea specifically for TeX system
+programs. I had been struggling with the programs I was using (Dvips,
+Xdvi, and TeX itself) having slightly different notions of how to
+specify paths; and debugging was painful, since no code was shared.
+
+ Therefore, Kpathsea provides some TeX-specific formats and features.
+Indeed, many of the supposedly generic path searching features were
+provided because they seemed useful in that conTeXt (font lookup,
+particularly).
+
+ Kpathsea provides a standard way to search for files of any of the
+supported file types; glyph fonts are a bit different than all the rest.
+Searches are based solely on filenames, not file contents--if a GF file
+is named `cmr10.600pk', it will be found as a PK file.
+
+* Menu:
+
+* Supported file formats:: File types Kpathsea knows about.
+* File lookup:: Searching for most kinds of files.
+* Glyph lookup:: Searching for bitmap fonts.
+* Suppressing warnings:: Avoiding warnings via TEX_HUSH.
+
+
+File: kpathsea.info, Node: Supported file formats, Next: File lookup, Up: TeX support
+
+4.1 Supported file formats
+==========================
+
+Kpathsea has support for a number of file types. Each file type has a
+list of environment and config file variables that are checked to define
+the search path, and most have a default suffix that plays a role in
+finding files (see the next section). Some also define additional
+suffixes, and/or a program to be run to create missing files on the fly.
+
+ Since environment variables containing periods, such as
+`TEXINPUTS.latex', are not allowed on some systems, Kpathsea looks for
+environment variables with an underscore, e.g., `TEXINPUTS_latex'
+(*note Config files::).
+
+ The following table lists the above information.
+
+`afm'
+ (Adobe font metrics, *note Metric files: (dvips)Metric files.)
+ `AFMFONTS'; suffix `.afm'.
+
+`base'
+ (Metafont memory dump, *note Memory dumps: (web2c)Memory dumps.)
+ `MFBASES', `TEXMFINI'; suffix `.base'.
+
+`bib'
+ (BibTeX bibliography source, *note bibtex invocation:
+ (web2c)bibtex invocation.) `BIBINPUTS', `TEXBIB'; suffix `.bib'.
+
+`bst'
+ (BibTeX style file, *note Basic BibTeX style files: (web2c)Basic
+ BibTeX style files.) `BSTINPUTS'; suffix `.bst'.
+
+`cmap'
+ (character map files) `CMAPFONTS'; suffix `.cmap'.
+
+`cnf'
+ (Runtime configuration files, *note Config files::) `TEXMFCNF';
+ suffix `.cnf'.
+
+`cweb'
+ (CWEB input files) `CWEBINPUTS'; suffixes `.w', `.web'; additional
+ suffix `.ch'.
+
+`dvips config'
+ (Dvips `config.*' files, such as `config.ps', *note Config files:
+ (dvips)Config files.) `TEXCONFIG'.
+
+`enc files'
+ (encoding vectors) `ENCFONTS'; suffix `.enc'.
+
+`fmt'
+ (TeX memory dump, *note Memory dumps: (web2c)Memory dumps.)
+ `TEXFORMATS', `TEXMFINI'; suffix `.fmt'.
+
+`gf'
+ (generic font bitmap, *note Glyph files: (dvips)Glyph files.)
+ `PROGRAMFONTS', `GFFONTS', `GLYPHFONTS', `TEXFONTS'; suffix `gf'.
+
+`graphic/figure'
+ (Encapsulated PostScript figures, *note PostScript figures:
+ (dvips)PostScript figures.) `TEXPICTS', `TEXINPUTS'; additional
+ suffixes: `.eps', `.epsi'.
+
+`ist'
+ (makeindex style files) `TEXINDEXSTYLE', `INDEXSTYLE'; suffix
+ `.ist'.
+
+`lig files'
+ (ligature definition files) `LIGFONTS'; suffix `.lig'.
+
+`ls-R'
+ (Filename databases, *note Filename database::) `TEXMFDBS'.
+
+`map'
+ (Fontmaps, *note Fontmap::) `TEXFONTMAPS'; suffix `.map'.
+
+`mem'
+ (MetaPost memory dump, *note Memory dumps: (web2c)Memory dumps.)
+ `MPMEMS', `TEXMFINI'; suffix `.mem'.
+
+`MetaPost support'
+ (MetaPost support files, used by DMP; *note dmp invocation:
+ (web2c)dmp invocation.) `MPSUPPORT'.
+
+`mf'
+ (Metafont source, *note mf invocation: (web2c)mf invocation.)
+ `MFINPUTS'; suffix `.mf'; dynamic creation program: `mktexmf'.
+
+`mfpool'
+ (Metafont program strings, *note pooltype invocation:
+ (web2c)pooltype invocation.) `MFPOOL', `TEXMFINI'; suffix `.pool'.
+
+`mft'
+ (`MFT' style file, *note mft invocation: (web2c)mft invocation.)
+ `MFTINPUTS'; suffix `.mft'.
+
+`misc fonts'
+ (font-related files that don't fit the other categories)
+ `MISCFONTS'
+
+`mp'
+ (MetaPost source, *note mpost invocation: (web2c)mpost invocation.)
+ `MPINPUTS'; suffix `.mp'.
+
+`mppool'
+ (MetaPost program strings, *note pooltype invocation:
+ (web2c)pooltype invocation.) `MPPOOL', `TEXMFINI'; suffix `.pool'.
+
+`ocp'
+ (Omega compiled process files) `OCPINPUTS';
+ suffix `.ocp'; dynamic creation program: `MakeOmegaOCP'.
+
+`ofm'
+ (Omega font metrics) `OFMFONTS', `TEXFONTS';
+ suffixes `.ofm', `.tfm'; dynamic creation program: `MakeOmegaOFM'.
+
+`opentype fonts'
+ (OpenType fonts) `OPENTYPEFONTS'.
+
+`opl'
+ (Omega property lists) `OPLFONTS', `TEXFONTS'; suffix `.opl'.
+
+`otp'
+ (Omega translation process files) `OTPINPUTS'; suffix `.otp'.
+
+`ovf'
+ (Omega virtual fonts) `OVFFONTS', `TEXFONTS'; suffix `.ovf'.
+
+`ovp'
+ (Omega virtual property lists) `OVPFONTS', `TEXFONTS'; suffix
+ `.ovp'.
+
+`pdftex config'
+ (PDFTeX-specific configuration files) `PDFTEXCONFIG'.
+
+`pk'
+ (packed bitmap fonts, *note Glyph files: (dvips)Glyph files.)
+ `PROGRAMFONTS' (PROGRAM being `XDVI', etc.), `PKFONTS', `TEXPKS',
+ `GLYPHFONTS', `TEXFONTS'; suffix `pk'; dynamic creation program:
+ `mktexpk'.
+
+`PostScript header'
+ (downloadable PostScript, *note Header files: (dvips)Header files.)
+ `TEXPSHEADERS', `PSHEADERS'; additional suffix `.pro'.
+
+`subfont definition files'
+ (subfont definition files) `SFDFONTS' suffix `.sfd'.
+
+`tex'
+ (TeX source, *note tex invocation: (web2c)tex invocation.)
+ `TEXINPUTS'; suffix `.tex'; additional suffixes: none, because
+ such a list cannot be complete; dynamic creation program:
+ `mktextex'.
+
+`TeX system documentation'
+ (Documentation files for the TeX system) `TEXDOCS'.
+
+`TeX system sources'
+ (Source files for the TeX system) `TEXSOURCES'.
+
+`texmfscripts'
+ (Architecture-independent executables distributed in the texmf
+ tree) `TEXMFSCRIPTS'.
+
+`texpool'
+ (TeX program strings, *note pooltype invocation: (web2c)pooltype
+ invocation.) `TEXPOOL', `TEXMFINI'; suffix `.pool'.
+
+`tfm'
+ (TeX font metrics, *note Metric files: (dvips)Metric files.)
+ `TFMFONTS', `TEXFONTS'; suffix `.tfm'; dynamic creation program:
+ `mktextfm'.
+
+`Troff fonts'
+ (Troff fonts, used by DMP; *note DMP invocation: (web2c)DMP
+ invocation.) `TRFONTS'.
+
+`truetype fonts'
+ (TrueType outline fonts) `TTFONTS'; suffixes `.ttf', `.ttc'.
+
+`type1 fonts'
+ (Type 1 PostScript outline fonts, *note Glyph files: (dvips)Glyph
+ files.) `T1FONTS', `T1INPUTS', `TEXPSHEADERS', `DVIPSHEADERS';
+ suffixes `.pfa', `.pfb'.
+
+`type42 fonts'
+ (Type 42 PostScript outline fonts) `T42FONTS'.
+
+`vf'
+ (virtual fonts, *note Virtual fonts: (dvips)Virtual fonts.)
+ `VFFONTS', `TEXFONTS'; suffix `.vf'.
+
+`web'
+ (WEB input files) `WEBINPUTS'; suffix `.web'; additional suffix
+ `.ch'.
+
+`web2c files'
+ (files specific to the web2c implementation) `WEB2C'.
+
+ There are two special cases, because the paths and environment
+variables always depend on the name of the program: the variable name is
+constructed by converting the program name to upper case, and then
+appending `INPUTS'. Assuming the program is called `foo', this gives
+us the following table.
+
+`other text files'
+ (text files used by `foo') `FOOINPUTS'.
+
+`other binary files'
+ (binary files used by `foo') `FOOINPUTS'.
+
+ If an environment variable by these names are set, the corresponding
+`texmf.cnf' definition won't be looked at (unless, as usual, the
+environment variable value has an extra `:'). *Note Default
+expansion::.
+
+ For the font variables, the intent is that:
+ * `TEXFONTS' is the default for everything.
+
+ * `GLYPHFONTS' is the default for bitmap (or, more precisely,
+ non-metric) files.
+
+ * Each font format has a variable of its own.
+
+ * Each program has its own font override path as well; e.g.,
+ `DVIPSFONTS' for Dvipsk. Again, this is for bitmaps, not metrics.
+
+
+
+File: kpathsea.info, Node: File lookup, Next: Glyph lookup, Prev: Supported file formats, Up: TeX support
+
+4.2 File lookup
+===============
+
+This section describes how Kpathsea searches for most files (bitmap font
+searches are the exception, as described in the next section).
+
+ Here is the search strategy for a file NAME:
+ 1. If the file format defines default suffixes, and the suffix of
+ NAME name is not already a known suffix for that format, try the
+ name with each default appended, and use alternative names found
+ in the fontmaps if necessary. We postpone searching the disk as
+ long as possible. Example: given `foo.sty', look for `foo.sty.tex'
+ before `foo.sty'. This is unfortunate, but allows us to find
+ `foo.bar.tex' before `foo.bar' if both exist and we were given
+ `foo.bar'.
+
+ 2. Search for NAME, and if necessary for alternative names found in
+ the fontmaps. Again we avoid searching the disk if possible.
+ Example: given `foo', we look for `foo'.
+
+ 3. If the file format defines a program to invoke to create missing
+ files, run it (*note mktex scripts::).
+
+ This is implemented in the routine `kpse_find_file' in
+`kpathsea/tex-file.c'. You can watch it in action with the debugging
+options (*note Debugging::).
+
+
+File: kpathsea.info, Node: Glyph lookup, Next: Suppressing warnings, Prev: File lookup, Up: TeX support
+
+4.3 Glyph lookup
+================
+
+This section describes how Kpathsea searches for a bitmap font in GF or
+PK format (or either) given a font name (e.g., `cmr10') and a
+resolution (e.g., 600).
+
+ Here is an outline of the search strategy (details in the sections
+below) for a file NAME at resolution DPI. The search stops at the
+first successful lookup.
+
+ 1. Look for an existing file NAME.DPIFORMAT in the specified
+ format(s).
+
+ 2. If NAME is an alias for a file F in the fontmap file
+ `texfonts.map', look for F.DPI.
+
+ 3. Run an external program (typically named `mktexpk') to generate
+ the font (*note mktex scripts::)
+
+ 4. Look for FALLBACK.DPI, where FALLBACK is some last-resort font
+ (typically `cmr10').
+
+ This is implemented in `kpse_find_glyph_format' in
+`kpathsea/tex-glyph.c'.
+
+* Menu:
+
+* Basic glyph lookup:: Features common to all glyph lookups.
+* Fontmap:: Aliases for fonts.
+* Fallback font:: Resolutions and fonts of last resort.
+
+
+File: kpathsea.info, Node: Basic glyph lookup, Next: Fontmap, Up: Glyph lookup
+
+4.3.1 Basic glyph lookup
+------------------------
+
+When Kpathsea looks for a bitmap font NAME at resolution DPI in a
+format FORMAT, it first checks each directory in the search path for a
+file `NAME.DPIFORMAT'; for example, `cmr10.600pk'. Kpathsea looks for
+a PK file first, then a GF file.
+
+ If that fails, Kpathsea looks for `dpiDPI/NAME.FORMAT'; for example,
+`dpi600/cmr10.pk'. This is how fonts are typically stored on
+filesystems (such as DOS) that permit only three-character extensions.
+
+ If that fails, Kpathsea looks for a font with a close-enough DPI.
+"Close enough" is defined by the macro `KPSE_BITMAP_TOLERANCE' in
+`kpathsea/tex-glyph.h' to be `DPI / 500 + 1'. This is slightly more
+than the 0.2% minimum allowed by the DVI standard
+(`CTAN:/dviware/driv-standard/level-0').
+
+
+File: kpathsea.info, Node: Fontmap, Next: Fallback font, Prev: Basic glyph lookup, Up: Glyph lookup
+
+4.3.2 Fontmap
+-------------
+
+If a bitmap font or metric file is not found with the original name (see
+the previous section), Kpathsea looks through any "fontmap" files for
+an "alias" for the original font name. These files are named
+`texfonts.map' and searched for along the `TEXFONTMAPS'
+environment/config file variable. All `texfonts.map' files that are
+found are read; earlier definitions override later ones.
+
+ This feature is intended to help in two respects:
+
+ 1. An alias name is limited in length only by available memory, not
+ by your filesystem. Therefore, if you want to ask for
+ `Times-Roman' instead of `ptmr', you can (you get `ptmr8r').
+
+ 2. A few fonts have historically had multiple names: specifically,
+ LaTeX's "circle font" has variously been known as `circle10',
+ `lcircle10', and `lcirc10'. Aliases can make all the names
+ equivalent, so that it no longer matters what the name of the
+ installed file is; TeX documents will find their favorite name.
+
+
+ The format of fontmap files is straightforward:
+
+ * Comments start with `%' and continue to the end of the line.
+
+ * Blank lines are ignored.
+
+ * Each nonblank line is broken up into a series of "words": a
+ sequence of non-whitespace characters.
+
+ * If the first word is `include', the second word is used as a
+ filename, and it is searched for and read.
+
+ * Otherwise, the first word on each line is the true filename;
+
+ * the second word is the alias;
+
+ * subsequent words are ignored.
+
+ If an alias has an extension, it matches only those files with that
+extension; otherwise, it matches anything with the same root, regardless
+of extension. For example, an alias `foo.tfm' matches only when
+`foo.tfm' is being searched for; but an alias `foo' matches `foo.vf',
+`foo.600pk', etc.
+
+ As an example, here is an excerpt from the `texfonts.map' in the
+Web2c distribution. It makes the circle fonts equivalent and includes
+automatically generated maps for most PostScript fonts available from
+various font suppliers.
+
+ circle10 lcircle10
+ circle10 lcirc10
+ lcircle10 circle10
+ lcircle10 lcirc10
+ lcirc10 circle10
+ lcirc10 lcircle10
+ ...
+ include adobe.map
+ include apple.map
+ include bitstrea.map
+ ...
+
+ Fontmaps are implemented in the file `kpathsea/fontmap.c'. The
+Fontname distribution has much more information on font naming (*note
+Introduction: (fontname)Introduction.).
+
+
+File: kpathsea.info, Node: Fallback font, Prev: Fontmap, Up: Glyph lookup
+
+4.3.3 Fallback font
+-------------------
+
+If a bitmap font cannot be found or created at the requested size,
+Kpathsea looks for the font at a set of "fallback resolutions". You
+specify these resolutions as a colon-separated list (like search paths).
+Kpathsea looks first for a program-specific environment variable (e.g.,
+`DVIPSSIZES' for Dvipsk), then the environment variable `TEXSIZES',
+then a default specified at compilation time (the Make variable
+`default_texsizes'). You can set this list to be empty if you prefer
+to find fonts at their stated size or not at all.
+
+ Finally, if the font cannot be found even at the fallback
+resolutions, Kpathsea looks for a fallback font, typically `cmr10'.
+Programs must enable this feature by assigning to the global variable
+`kpse_fallback_font' or calling `kpse_init_prog' (*note Calling
+sequence::); the default is no fallback font.
+
+
+File: kpathsea.info, Node: Suppressing warnings, Prev: Glyph lookup, Up: TeX support
+
+4.4 Suppressing warnings
+========================
+
+Kpathsea provides a way to suppress selected usually-harmless warnings;
+this is useful at large sites where most users are not administrators,
+and thus the warnings are merely a source of confusion, not a help. To
+do this, you set the environment variable or configuration file value
+`TEX_HUSH' to a colon-separated list of values. Here are the
+possibilities:
+
+`all'
+ Suppress everything possible.
+
+`checksum'
+ Suppress mismatched font checksum warnings.
+
+`lostchar'
+ Suppress warnings when a character is missing from a font that a
+ DVI or VF file tries to typeset.
+
+`none'
+ Don't suppress any warnings.
+
+`readable'
+ Suppress warnings about attempts to access a file whose permissions
+ render it unreadable.
+
+`special'
+ Suppresses warnings about an unimplemented or unparsable
+ `\special' command.
+
+`tex-hush.c' defines the function that checks the variable value. Each
+driver implements its own checks where appropriate.
+
+
+File: kpathsea.info, Node: Programming, Next: Index, Prev: TeX support, Up: Top
+
+5 Programming
+*************
+
+This chapter is for programmers who wish to use Kpathsea. *Note
+Introduction::, for the conditions under which you may do so.
+
+* Menu:
+
+* Overview: Programming overview. Introduction.
+* Calling sequence:: Specifics of what to call.
+* Program-specific files:: How to handle these.
+* Config: Programming with config files. Getting info from texmf.cnf.
+
+
+File: kpathsea.info, Node: Programming overview, Next: Calling sequence, Up: Programming
+
+5.1 Programming overview
+========================
+
+Aside from this manual, your best source of information is the source to
+the programs I've modified to use Kpathsea (*note Introduction::). Of
+those, Dviljk is probably the simplest, and hence a good place to start.
+Xdvik adds VF support and the complication of X resources. Dvipsk adds
+the complication of its own config files. Web2c is source code I also
+maintain, so it uses Kpathsea rather straightforwardly, but is of course
+complicated by the Web to C translation. Finally, Kpsewhich is a small
+utility program whose sole purpose is to exercise the main
+path-searching functionality.
+
+ Beyond these examples, the `.h' files in the Kpathsea source
+describe the interfaces and functionality (and of course the `.c' files
+define the actual routines, which are the ultimate documentation).
+`pathsearch.h' declares the basic searching routine. `tex-file.h' and
+`tex-glyph.h' define the interfaces for looking up particular kinds of
+files. In view of the way the headers depend on each other, it is
+recommended to use `#include <kpathsea/kpathsea.h>', which includes
+every Kpathsea header.
+
+ If you want to include only specific headers, you should still
+consider including `kpathsea/config.h' before including any other
+Kpathsea header, as it provides symbols used in the other headers.
+Note that `kpathsea/config.h' includes `kpathsea/c-auto.h', which is
+generated by Autoconf.
+
+ The library provides no way for an external program to register new
+file types: `tex-file.[ch]' must be modified to do this. For example,
+Kpathsea has support for looking up Dvips config files, even though no
+program other than Dvips will likely ever want to do so. I felt this
+was acceptable, since along with new file types should also come new
+defaults in `texmf.cnf' (and its descendant `paths.h'), since it's
+simplest for users if they can modify one configuration file for all
+kinds of paths.
+
+ Kpathsea does not parse any formats itself; it barely opens any
+files. Its primary purpose is to return filenames. The GNU font
+utilities does contain libraries to read TFM, GF, and PK files, as do
+the programs above, of course.
+
+
+File: kpathsea.info, Node: Calling sequence, Next: Program-specific files, Prev: Programming overview, Up: Programming
+
+5.2 Calling sequence
+====================
+
+The typical way to use Kpathsea in your program goes something like
+this:
+
+ 1. Call `kpse_set_program_name' with `argv[0]' as the first argument;
+ the second argument is a string or `NULL'. The second argument is
+ used by Kpathsea as the program name for the `.PROGRAM' feature of
+ config files (*note Config files::). If the second argument is
+ `NULL', the value of the first argument is used. This function
+ must be called before any other use of the Kpathsea library.
+
+ If necessary, `kpse_set_program_name' sets the global variables
+ `program_invocation_name' and `program_invocation_short_name'.
+ These variables are used in the error message macros defined in
+ `kpathsea/lib.h'. It sets the global variable `kpse_program_name'
+ to the program name it uses. It also initializes debugging
+ options based on the environment variable `KPATHSEA_DEBUG' (if
+ that is set). Finally, it sets the variables `SELFAUTOLOC',
+ `SELFAUTODIR' and `SELFAUTOPARENT' to the location, parent and
+ grandparent directory of the executable, removing `.' and `..'
+ path elements and resolving symbolic links. These are used in the
+ default configuration file to allow people to invoke TeX from
+ anywhere, specifically from a mounted CD-ROM. (You can use
+ `--expand-var=\$SELFAUTOLOC', etc., to see the values finds.)
+
+ 2. The `kpse_set_progname' is deprecated. A call to
+ `kpse_set_progname' with `argv[0]' is equivalent to a call of
+ `kpse_set_program_name' with first argument `argv[0]' and second
+ argument `NULL'. The function is deprecated because it cannot
+ ensure that the `.PROGRAM' feature of config files will always
+ work (*note Config files::).
+
+ 3. Set debugging options. *Note Debugging::. If your program doesn't
+ have a debugging option already, you can define one and set
+ `kpathsea_debug' to the number that the user supplies (as in Dviljk
+ and Web2c), or you can just omit this altogether (people can
+ always set `KPATHSEA_DEBUG'). If you do have runtime debugging
+ already, you need to merge Kpathsea's options with yours (as in
+ Dvipsk and Xdvik).
+
+ 4. If your program has its own configuration files that can define
+ search paths, you should assign those paths to the `client_path'
+ member in the appropriate element of the `kpse_format_info' array.
+ (This array is indexed by file type; see `tex-file.h'.) See
+ `resident.c' in Dvipsk for an example.
+
+ 5. Call `kpse_init_prog' (see `proginit.c'). It's useful for the DVI
+ drivers, at least, but for other programs it may be simpler to
+ extract the parts of it that actually apply. This does not
+ initialize any paths, it just looks for (and sets) certain
+ environment variables and other random information. (A search
+ path is always initialized at the first call to find a file of
+ that type; this eliminates much useless work, e.g., initializing
+ the BibTeX search paths in a DVI driver.)
+
+ 6. The routine to actually find a file of type FORMAT is
+ `kpse_find_FORMAT', defined in `tex-file.h'. These are macros that
+ expand to a call to `kpse_find_file'. You can call, say,
+ `kpse_find_tfm' after doing only the first of the initialization
+ steps above--Kpathsea automatically reads the `texmf.cnf' generic
+ config files, looks for environment variables, and does expansions
+ at the first lookup.
+
+ 7. To find PK and/or GF bitmap fonts, the routines are `kpse_find_pk',
+ `kpse_find_gf' and `kpse_find_glyph', defined in `tex-glyph.h'.
+ These return a structure in addition to the resultant filename,
+ because fonts can be found in so many ways. See the documentation
+ in the source.
+
+ 8. To actually open a file, not just return a filename, call
+ `kpse_open_file'. This function takes the name to look up and a
+ Kpathsea file format as arguments, and returns the usual `FILE *'.
+ It always assumes the file must exist, and thus will search the
+ disk if necessary (unless the search path specified `!!', etc.).
+ In other words, if you are looking up a VF or some other file that
+ need not exist, don't use this.
+
+
+ Kpathsea also provides many utility routines. Some are generic: hash
+tables, memory allocation, string concatenation and copying, string
+lists, reading input lines of arbitrary length, etc. Others are
+filename-related: default path, tilde, and variable expansion, `stat'
+calls, etc. (Perhaps someday I'll move the former to a separate
+library.)
+
+ The `c-*.h' header files can also help your program adapt to many
+different systems. You will almost certainly want to use Autoconf for
+configuring your software if you use Kpathsea; I strongly recommend
+using Autoconf regardless. It is available from
+`ftp://prep.ai.mit.edu/pub/gnu/'.
+
+
+File: kpathsea.info, Node: Program-specific files, Next: Programming with config files, Prev: Calling sequence, Up: Programming
+
+5.3 Program-specific files
+==========================
+
+Many programs will need to find some configuration files. Kpathsea
+contains some support to make it easy to place them in their own
+directories. The Standard TeX directory structure (*note Introduction:
+(tds)Top.), specifies that such files should go into a subdirectory
+named after the program, like `texmf/ttf2pk'.
+
+ Two special formats, `kpse_program_text_format' and
+`kpse_program_binary_format' exist, which use `.:$TEXMF/PROGRAM//' as
+their compiled-in search path. To override this default, you can use
+the variable `PROGRAMINPUTS' in the environment and/or `texmf.cnf'.
+That is to say, the name of the variable is constructed by converting
+the name of the program to upper case, and appending `INPUTS'.
+
+ The only difference between these two formats is whether
+`kpse_open_file' will open the files it finds in text or binary mode.
+
+
+File: kpathsea.info, Node: Programming with config files, Prev: Program-specific files, Up: Programming
+
+5.4 Programming with config files
+=================================
+
+You can (and probably should) use the same `texmf.cnf' configuration
+file that Kpathsea uses for your program. This helps installers by
+keeping all configuration in one place.
+
+ To retrieve a value VAR from config files, the best way is to call
+`kpse_var_value' on the string `VAR'. This will look first for an
+environment variable VAR, then a config file value. The result will be
+the value found or `NULL'. This function is declared in
+`kpathsea/variable.h'. For an example, see the `shell_escape' code in
+`web2c/lib/texmfmp.c'.
+
+ The routine to do variable expansion in the context of a search path
+(as opposed to simply retrieving a value) is `kpse_var_expand', also
+declared in `kpathsea/variable.h'. It's generally only necessary to
+set the search path structure components as explained in the previous
+section, rather than using this yourself.
+
+ If for some reason you want to retrieve a value _only_ from a config
+file, not automatically looking for a corresponding environment
+variable, call `kpse_cnf_get' (declared in `kpathsea/cnf.h') with the
+string VAR.
+
+ No initialization calls are needed.
+
+
+File: kpathsea.info, Node: Index, Prev: Programming, Up: Top
+
+Index
+*****
+
+
+* Menu:
+
+* !! in path specifications: ls-R. (line 52)
+* $ expansion: Variable expansion. (line 6)
+* --color=tty: ls-R. (line 21)
+* --debug=NUM: Auxiliary tasks. (line 9)
+* --disable-static: configure options. (line 31)
+* --dpi=NUM: Path searching options.
+ (line 15)
+* --enable options: configure options. (line 16)
+* --enable-maintainer-mode: configure options. (line 34)
+* --enable-shared <1>: Shared library. (line 6)
+* --enable-shared: configure options. (line 27)
+* --engine=NAME: Path searching options.
+ (line 20)
+* --expand-braces=STRING: Auxiliary tasks. (line 14)
+* --expand-path=STRING: Auxiliary tasks. (line 22)
+* --expand-var=STRING: Auxiliary tasks. (line 17)
+* --format=NAME: Path searching options.
+ (line 25)
+* --help: Standard options. (line 8)
+* --interactive: Path searching options.
+ (line 93)
+* --mode=STRING: Path searching options.
+ (line 104)
+* --must-exist: Path searching options.
+ (line 109)
+* --path=STRING: Path searching options.
+ (line 114)
+* --progname=NAME: Path searching options.
+ (line 122)
+* --show-path=NAME: Auxiliary tasks. (line 36)
+* --srcdir, for building multiple architectures: configure scenarios.
+ (line 18)
+* --var-value=VARIABLE: Auxiliary tasks. (line 12)
+* --version: Standard options. (line 10)
+* --with options: configure options. (line 16)
+* --with-mktextex-default: mktex configuration. (line 14)
+* --without-mktexmf-default: mktex configuration. (line 14)
+* --without-mktexpk-default: mktex configuration. (line 14)
+* --without-mktextfm-default: mktex configuration. (line 14)
+* -1 debugging value: Debugging. (line 23)
+* -A option to ls: ls-R. (line 33)
+* -Bdynamic: ShellWidgetClass. (line 45)
+* -Bstatic: ShellWidgetClass. (line 45)
+* -D NUM: Path searching options.
+ (line 15)
+* -dynamic: ShellWidgetClass. (line 43)
+* -g, compiling without: configure scenarios. (line 32)
+* -L option to ls: ls-R. (line 38)
+* -mktex=FILETYPE: Path searching options.
+ (line 98)
+* -no-mktex=FILETYPE: Path searching options.
+ (line 98)
+* -O, compiling with: configure scenarios. (line 32)
+* -static: ShellWidgetClass. (line 43)
+* . directories, ignored: ls-R. (line 33)
+* . files: ls-R. (line 33)
+* .2602gf: Unable to generate fonts.
+ (line 36)
+* .afm: Supported file formats.
+ (line 20)
+* .base: Supported file formats.
+ (line 24)
+* .bib: Supported file formats.
+ (line 28)
+* .bst: Supported file formats.
+ (line 32)
+* .cmap: Supported file formats.
+ (line 36)
+* .cnf: Supported file formats.
+ (line 39)
+* .enc: Supported file formats.
+ (line 51)
+* .eps: Supported file formats.
+ (line 62)
+* .epsi: Supported file formats.
+ (line 62)
+* .fmt: Supported file formats.
+ (line 54)
+* .ist: Supported file formats.
+ (line 67)
+* .lig: Supported file formats.
+ (line 71)
+* .map: Supported file formats.
+ (line 77)
+* .mem: Supported file formats.
+ (line 80)
+* .mf: Supported file formats.
+ (line 88)
+* .mft: Supported file formats.
+ (line 96)
+* .mp: Supported file formats.
+ (line 104)
+* .ocp: Supported file formats.
+ (line 112)
+* .ofm: Supported file formats.
+ (line 116)
+* .opl: Supported file formats.
+ (line 123)
+* .otp: Supported file formats.
+ (line 126)
+* .ovf: Supported file formats.
+ (line 129)
+* .ovp: Supported file formats.
+ (line 132)
+* .pfa: Supported file formats.
+ (line 184)
+* .pfb: Supported file formats.
+ (line 184)
+* .pk: Supported file formats.
+ (line 139)
+* .pool: Supported file formats.
+ (line 92)
+* .pro: Supported file formats.
+ (line 145)
+* .rhosts, writable by TeX: Security. (line 10)
+* .sfd: Supported file formats.
+ (line 149)
+* .tex: Supported file formats.
+ (line 152)
+* .tex file, included in ls-R: ls-R. (line 33)
+* .tfm: Supported file formats.
+ (line 172)
+* .ttc: Supported file formats.
+ (line 181)
+* .ttf: Supported file formats.
+ (line 181)
+* .vf: Supported file formats.
+ (line 192)
+* .w: Supported file formats.
+ (line 43)
+* .web: Supported file formats.
+ (line 43)
+* / may not be /: Searching overview. (line 13)
+* /, trailing in home directory: Tilde expansion. (line 18)
+* //: Subdirectory expansion.
+ (line 6)
+* /afs/... , installing into: Installing files. (line 32)
+* /etc/profile: Unable to find files.
+ (line 14)
+* /etc/profile and aliases: ls-R. (line 21)
+* /var/tmp/texfonts: mktex configuration. (line 107)
+* 2602gf: Unable to generate fonts.
+ (line 36)
+* 8.3 filenames, using: mktex configuration. (line 62)
+* : may not be :: Searching overview. (line 13)
+* :: expansion: Default expansion. (line 6)
+* @VAR@ substitutions: Running configure. (line 6)
+* \, line continuation in texmf.cnf: Config files. (line 26)
+* \openin: Searching overview. (line 31)
+* \special, suppressing warnings about: Suppressing warnings.
+ (line 31)
+* absolute filenames: Searching overview. (line 52)
+* ac_include, Autoconf extension: Running configure. (line 6)
+* access warnings: Searching overview. (line 56)
+* Acorn TeX implementations: Other TeX packages. (line 6)
+* AFMFONTS: Supported file formats.
+ (line 20)
+* AFS: Installing files. (line 32)
+* AIX 4.1 configure error: Empty Makefiles. (line 6)
+* AIX shells and configure: configure shells. (line 14)
+* aliases for fonts: Fontmap. (line 6)
+* aliases, for filenames: Filename aliases. (line 6)
+* all: Suppressing warnings.
+ (line 13)
+* alphabetical order, not: Subdirectory expansion.
+ (line 6)
+* Amiga support: Custom installation. (line 19)
+* Amiga TeX implementations: Other TeX packages. (line 6)
+* Andrew File System, installing with: Installing files. (line 32)
+* announcement mailing list: Mailing lists. (line 6)
+* ANSI C: TeX or Metafont failing.
+ (line 30)
+* append-only directories and mktexpk: Security. (line 36)
+* appendonlydir: mktex configuration. (line 54)
+* architecture-(in)dependent files, installing only: Installing files.
+ (line 21)
+* architectures, compiling multiple: configure scenarios. (line 18)
+* arguments to mktex: mktex script arguments.
+ (line 6)
+* argv[0]: Calling sequence. (line 9)
+* ash, losing with configure: configure shells. (line 19)
+* autoconf, recommended: Calling sequence. (line 90)
+* automounter, and configuration: configure scenarios. (line 29)
+* automounter, and ls-R: ls-R. (line 40)
+* auxiliary tasks: Auxiliary tasks. (line 6)
+* Babel <1>: Running make. (line 51)
+* Babel: Kpathsea application distributions.
+ (line 28)
+* Bach, Johann Sebastian: Default expansion. (line 41)
+* backbone of CTAN: Electronic distribution.
+ (line 6)
+* backslash-newline: Config files. (line 26)
+* bash, recommended for running configure: configure shells. (line 6)
+* basic glyph lookup: Basic glyph lookup. (line 6)
+* Berry, Karl: History. (line 12)
+* BIBINPUTS: Supported file formats.
+ (line 28)
+* binary mode, for file transfers: Electronic distribution.
+ (line 20)
+* blank lines, in texmf.cnf: Config files. (line 24)
+* brace expansion: Brace expansion. (line 6)
+* BSD universe: Running make. (line 44)
+* bsh, ok with configure: configure shells. (line 14)
+* BSTINPUTS: Supported file formats.
+ (line 32)
+* bug address: Reporting bugs. (line 8)
+* bug checklist: Bug checklist. (line 6)
+* bug mailing list: Mailing lists. (line 6)
+* bugs, reporting: Reporting bugs. (line 6)
+* c-*.h: Calling sequence. (line 90)
+* c-auto.h: Programming overview.
+ (line 25)
+* c-auto.in: Running configure. (line 6)
+* cache of fonts, local: Security. (line 22)
+* calling sequence: Calling sequence. (line 6)
+* CC: configure environment.
+ (line 10)
+* cc warnings: Pointer combination warnings.
+ (line 6)
+* cc, compiling with: configure environment.
+ (line 11)
+* CD-ROM distributions: CD-ROM distribution. (line 6)
+* CFLAGS: configure environment.
+ (line 14)
+* ChangeLog entry: Bug checklist. (line 63)
+* checklist for bug reports: Bug checklist. (line 6)
+* checksum: Suppressing warnings.
+ (line 16)
+* circle fonts: Fontmap. (line 19)
+* clean Make target: Cleaning up. (line 15)
+* client_path in kpse_format_info: Calling sequence. (line 45)
+* CMAPFONTS: Supported file formats.
+ (line 36)
+* cmr10, as fallback font: Fallback font. (line 15)
+* cmr10.vf: Searching overview. (line 31)
+* cnf.c: Config files. (line 75)
+* cnf.h: Programming with config files.
+ (line 23)
+* code sharing: Shared library. (line 9)
+* color printers, configuring: Simple installation. (line 60)
+* comments, in fontmap files: Fontmap. (line 28)
+* comments, in texmf.cnf: Config files. (line 22)
+* comments, making: Introduction. (line 27)
+* common features in glyph lookup: Basic glyph lookup. (line 6)
+* common problems: Common problems. (line 6)
+* comp.sys.sun.admin FAQ: ShellWidgetClass. (line 6)
+* comp.text.tex: Mailing lists. (line 29)
+* compilation: Installation. (line 6)
+* compilation value, source for path: Path sources. (line 20)
+* compiler bugs: TeX or Metafont failing.
+ (line 6)
+* compiler bugs, finding: TeX or Metafont failing.
+ (line 24)
+* compiler options, additional: Running make. (line 27)
+* compiler options, specifying: configure environment.
+ (line 15)
+* compiler, changing: Running make. (line 40)
+* compiling on HP-UX: TeX or Metafont failing.
+ (line 30)
+* conditions for use: Introduction. (line 31)
+* config files: Config files. (line 6)
+* config files, for Kpathsea-using programs: Calling sequence.
+ (line 45)
+* config files, programming with: Programming with config files.
+ (line 6)
+* config.h: Programming overview.
+ (line 25)
+* config.log: Bug checklist. (line 29)
+* config.ps, search path for: Supported file formats.
+ (line 47)
+* config.status: Bug checklist. (line 32)
+* configuration: Installation. (line 6)
+* configuration bugs: Bug checklist. (line 32)
+* configuration compiler options: configure environment.
+ (line 23)
+* configuration file, source for path: Path sources. (line 17)
+* configuration files as shell scripts.: Config files. (line 67)
+* configuration of mktex scripts: mktex configuration. (line 6)
+* configuration of optional features: configure options. (line 16)
+* configure error from sed: Empty Makefiles. (line 6)
+* configure options: configure options. (line 6)
+* configure options for mktex scripts: mktex configuration. (line 14)
+* configure, running: Running configure. (line 6)
+* context diff: Bug checklist. (line 63)
+* continuation character: Config files. (line 26)
+* core dumps, reporting: Bug checklist. (line 69)
+* CPPFLAGS: configure environment.
+ (line 22)
+* crashes, reporting: Bug checklist. (line 69)
+* CTAN, defined: Electronic distribution.
+ (line 6)
+* CTAN.sites: Electronic distribution.
+ (line 13)
+* custom installation: Custom installation. (line 6)
+* CWEBINPUTS: Supported file formats.
+ (line 43)
+* database search: Searching overview. (line 17)
+* database, for filenames: Filename database. (line 6)
+* database, format of: Database format. (line 6)
+* debug.h: Debugging. (line 6)
+* debugger: Bug checklist. (line 69)
+* debugging: Debugging. (line 6)
+* debugging options, in Kpathsea-using program: Calling sequence.
+ (line 37)
+* debugging output: Debugging. (line 27)
+* debugging with -g, disabling: configure scenarios. (line 32)
+* DEC shells and configure: configure shells. (line 25)
+* default expansion: Default expansion. (line 6)
+* default path features: Default path features.
+ (line 6)
+* default paths, changing: Default path generation.
+ (line 6)
+* default paths, how they're made: Default path generation.
+ (line 12)
+* default_texsizes: Fallback font. (line 6)
+* DEFS: configure environment.
+ (line 31)
+* depot: configure scenarios. (line 29)
+* device, wrong: Unable to generate fonts.
+ (line 29)
+* directories, changing default installation: Default path generation.
+ (line 6)
+* directories, making append-only: mktex configuration. (line 55)
+* directory permissions: Security. (line 51)
+* directory structure, for TeX files: TeX directory structure.
+ (line 6)
+* disabling mktex scripts: mktex configuration. (line 6)
+* disk search: Searching overview. (line 22)
+* disk searching, avoiding: ls-R. (line 52)
+* disk space, needed: Disk space. (line 6)
+* disk usage, reducing: Logging. (line 6)
+* distclean Make target: Cleaning up. (line 6)
+* distributions, compiling simultaneously: Kpathsea application distributions.
+ (line 6)
+* distributions, not compiling: Kpathsea application distributions.
+ (line 6)
+* distributions, on CD-ROM: CD-ROM distribution. (line 6)
+* distributions, via ftp: Electronic distribution.
+ (line 6)
+* dlclose: dlopen. (line 6)
+* dlopen: dlopen. (line 6)
+* dlsym: dlopen. (line 6)
+* dlsym.c: dlopen. (line 21)
+* doc files: Supported file formats.
+ (line 158)
+* DOS compatible names: mktex configuration. (line 62)
+* DOS support: Custom installation. (line 19)
+* DOS TeX implementations: Other TeX packages. (line 6)
+* dosnames: mktex configuration. (line 61)
+* dot files: ls-R. (line 33)
+* doubled colons: Default expansion. (line 6)
+* dpiNNN directories: mktex configuration. (line 62)
+* DVI drivers: Kpathsea application distributions.
+ (line 12)
+* DVILJMAKEPK: mktex script names. (line 22)
+* DVILJSIZES: Fallback font. (line 6)
+* DVIPSFONTS: Supported file formats.
+ (line 227)
+* DVIPSHEADERS: Supported file formats.
+ (line 184)
+* DVIPSMAKEPK: mktex script names. (line 22)
+* DVIPSSIZES: Fallback font. (line 6)
+* dynamic creation of files: mktex scripts. (line 6)
+* dynamic linking problems with OpenWin libraries: ShellWidgetClass.
+ (line 6)
+* EC fonts, and dynamic source creation: mktex scripts. (line 6)
+* elt-dirs.c: Subdirectory expansion.
+ (line 41)
+* email CTAN access: Electronic distribution.
+ (line 17)
+* enabling mktex scripts: mktex configuration. (line 6)
+* ENCFONTS: Supported file formats.
+ (line 51)
+* engine name: Path searching options.
+ (line 20)
+* environment variable, source for path: Path sources. (line 9)
+* environment variables for TeX: Supported file formats.
+ (line 6)
+* environment variables in paths: Variable expansion. (line 6)
+* environment variables, old: Unable to find files.
+ (line 14)
+* epoch, seconds since: Logging. (line 15)
+* error message macros: Calling sequence. (line 16)
+* excessive startup time: Slow path searching. (line 6)
+* expand.c: Brace expansion. (line 26)
+* expanding symlinks: Calling sequence. (line 16)
+* expansion, default: Default expansion. (line 6)
+* expansion, path element: Searching overview. (line 43)
+* expansion, search path: Path expansion. (line 6)
+* expansion, subdirectory: Subdirectory expansion.
+ (line 6)
+* expansion, tilde: Tilde expansion. (line 6)
+* expansion, variable: Variable expansion. (line 6)
+* explicitly relative filenames: Searching overview. (line 52)
+* externally-built filename database: Filename database. (line 6)
+* extra colons: Default expansion. (line 6)
+* extraclean Make target: Cleaning up. (line 23)
+* failed mktex... script invocation: mktex script names. (line 25)
+* fallback font: Fallback font. (line 6)
+* fallback resolutions: Fallback font. (line 6)
+* fallback resolutions, overriding: Running make. (line 10)
+* FAQ, comp.sys.sun.admin: ShellWidgetClass. (line 6)
+* FAQ, Kpathsea: Common problems. (line 6)
+* Farwell, Matthew: Subdirectory expansion.
+ (line 22)
+* features, of default paths: Default path features.
+ (line 6)
+* file formats, supported: Supported file formats.
+ (line 6)
+* file lookup: File lookup. (line 6)
+* file permissions: Security. (line 47)
+* file types, registering new: Programming overview.
+ (line 31)
+* filename aliases: Filename aliases. (line 6)
+* filename database: Filename database. (line 6)
+* filename database generation: Filename database generation.
+ (line 6)
+* filenames, absolute or explicitly relative: Searching overview.
+ (line 52)
+* files, unable to find: Unable to find files.
+ (line 6)
+* filesystem search: Searching overview. (line 22)
+* floating directories: Searching overview. (line 22)
+* font alias files: Fontmap. (line 6)
+* font generation failures: Unable to generate fonts.
+ (line 6)
+* font of last resort: Fallback font. (line 6)
+* font set, infinite: mktex scripts. (line 6)
+* fontmap files: Fontmap. (line 6)
+* fontmaps: mktex configuration. (line 80)
+* fontname: mktex configuration. (line 81)
+* fontnames, arbitrary length: Fontmap. (line 15)
+* fonts, being created: Simple installation. (line 79)
+* FOOINPUTS: Supported file formats.
+ (line 209)
+* fopen, redefined: Debugging. (line 54)
+* format of external database: Database format. (line 6)
+* Free Software Foundation: CD-ROM distribution. (line 12)
+* FreeBSD configure error: Empty Makefiles. (line 6)
+* FreeBSD shells and configure: configure shells. (line 19)
+* FSF Source Code CD-ROM: CD-ROM distribution. (line 12)
+* ftp retrieval: Electronic distribution.
+ (line 6)
+* ftp.tug.org: unixtex.ftp. (line 6)
+* fundamental purpose of Kpathsea: Introduction. (line 6)
+* gcc, compiling with: configure environment.
+ (line 11)
+* gdb, recommended: Bug checklist. (line 69)
+* generation of filename database: Filename database generation.
+ (line 6)
+* get_applicationShellWidgetClass: ShellWidgetClass. (line 6)
+* get_wmShellWidgetClass: ShellWidgetClass. (line 6)
+* gf: Supported file formats.
+ (line 58)
+* GFFONTS: Supported file formats.
+ (line 58)
+* globally writable directories: Security. (line 30)
+* glyph lookup: Glyph lookup. (line 6)
+* glyph lookup bitmap tolerance: Basic glyph lookup. (line 15)
+* GLYPHFONTS: Supported file formats.
+ (line 58)
+* GNU C compiler bugs: TeX or Metafont failing.
+ (line 19)
+* GNU General Public License: Introduction. (line 31)
+* group-writable directories: Security. (line 40)
+* GSFTOPK_DEBUG (128): Debugging. (line 88)
+* hash table buckets, printing: Debugging. (line 105)
+* hash table routines: Calling sequence. (line 83)
+* hash_summary_only variable for debugging: Debugging. (line 105)
+* help, mailing list for general TeX: Mailing lists. (line 29)
+* HIER: Default path features.
+ (line 41)
+* history of Kpathsea: History. (line 6)
+* home directories in paths: Tilde expansion. (line 6)
+* HOME, as ~ expansion: Tilde expansion. (line 6)
+* HP-UX, compiling on: TeX or Metafont failing.
+ (line 30)
+* identifiers, characters valid in: Config files. (line 36)
+* illegal pointer combination warnings: Pointer combination warnings.
+ (line 6)
+* include fontmap directive: Fontmap. (line 33)
+* INDEXSTYLE: Supported file formats.
+ (line 67)
+* info-tex@shsu.edu: Mailing lists. (line 29)
+* input lines, reading: Calling sequence. (line 83)
+* install-data Make target: Installing files. (line 28)
+* install-exec Make target: Installing files. (line 23)
+* installation: Installation. (line 6)
+* installation testing: Installation testing.
+ (line 6)
+* installation, architecture-(in)dependent files only: Installing files.
+ (line 21)
+* installation, changing default directories: Default path generation.
+ (line 6)
+* installation, customized: Custom installation. (line 6)
+* installation, getting executables instead of: Simple installation.
+ (line 6)
+* installation, simple: Simple installation. (line 6)
+* installing files: Installing files. (line 6)
+* interactive query: Path searching options.
+ (line 93)
+* interface, not frozen: Introduction. (line 27)
+* introduction: Introduction. (line 6)
+* kdebug:: Debugging. (line 105)
+* kdefault.c: Default expansion. (line 48)
+* Knuth, Donald E.: History. (line 6)
+* Knuth, Donald E., archive of programs by: Other TeX packages.
+ (line 18)
+* Knuth, Donald E., original author: Electronic distribution.
+ (line 25)
+* Korn shell, losing with configure: configure shells. (line 14)
+* Kpathsea config file, source for path: Path sources. (line 17)
+* Kpathsea version number: Kpathsea application distributions.
+ (line 6)
+* kpathsea.h: Programming overview.
+ (line 16)
+* kpathsea/HIER: Default path features.
+ (line 41)
+* kpathsea/README.CONFIGURE: Running configure. (line 15)
+* KPATHSEA_DEBUG: Calling sequence. (line 16)
+* kpathsea_debug: Debugging. (line 18)
+* KPATHSEA_DEBUG: Debugging. (line 18)
+* kpathsea_debug: Debugging. (line 6)
+* kpathsea_debug variable: Calling sequence. (line 37)
+* KPSE_BITMAP_TOLERANCE: Basic glyph lookup. (line 15)
+* kpse_cnf_get: Programming with config files.
+ (line 23)
+* KPSE_DEBUG_EXPAND (16): Debugging. (line 68)
+* KPSE_DEBUG_FOPEN (4): Debugging. (line 53)
+* KPSE_DEBUG_HASH (2): Debugging. (line 46)
+* KPSE_DEBUG_PATHS (8): Debugging. (line 60)
+* KPSE_DEBUG_SEARCH (32): Debugging. (line 74)
+* KPSE_DEBUG_STAT (1): Debugging. (line 38)
+* KPSE_DEBUG_VARS (64): Debugging. (line 83)
+* KPSE_DOT expansion: KPSE_DOT expansion. (line 6)
+* kpse_fallback_font: Fallback font. (line 15)
+* kpse_find_*: Calling sequence. (line 60)
+* kpse_find_file <1>: Calling sequence. (line 60)
+* kpse_find_file: File lookup. (line 26)
+* kpse_find_glyph_format: Glyph lookup. (line 26)
+* kpse_format_info: Calling sequence. (line 45)
+* kpse_format_info_type: Debugging. (line 61)
+* kpse_init_prog: Calling sequence. (line 51)
+* kpse_init_prog, and MAKETEX_MODE: Default path features.
+ (line 25)
+* kpse_make_specs: mktex script names. (line 6)
+* kpse_open_file: Calling sequence. (line 74)
+* kpse_program_name: Calling sequence. (line 16)
+* kpse_set_progname: Calling sequence. (line 30)
+* kpse_set_program_name: Calling sequence. (line 9)
+* kpse_var_value: Programming with config files.
+ (line 10)
+* kpsewhich: Invoking kpsewhich. (line 6)
+* Kpsewhich, and debugging: Debugging. (line 31)
+* ksh, losing with configure: configure shells. (line 14)
+* labrea.stanford.edu: Other TeX packages. (line 18)
+* LaserJet drive: Kpathsea application distributions.
+ (line 13)
+* last-resort font: Fallback font. (line 6)
+* LaTeX help mailing list: Mailing lists. (line 29)
+* lcircle10: Fontmap. (line 19)
+* LDFLAGS: configure environment.
+ (line 38)
+* leading colons: Default expansion. (line 6)
+* leaf directories wrongly guessed: Unable to find files.
+ (line 21)
+* leaf directory trick: Subdirectory expansion.
+ (line 22)
+* libdl.a: dlopen. (line 6)
+* libraries, changing: Running make. (line 40)
+* libraries, specifying additional: configure environment.
+ (line 43)
+* LIBS: configure environment.
+ (line 42)
+* libucb, avoiding: Running make. (line 44)
+* license for using the library: Introduction. (line 31)
+* LIGFONTS: Supported file formats.
+ (line 71)
+* lines, reading arbitrary-length: Calling sequence. (line 83)
+* Linux File System Standard: mktex configuration. (line 107)
+* Linux shells and configure: configure shells. (line 19)
+* Linux, using Web2c: CD-ROM distribution. (line 16)
+* lndir for building symlink trees: configure scenarios. (line 18)
+* loader options: configure environment.
+ (line 39)
+* loader options, final: Running make. (line 33)
+* loader options, initial: Running make. (line 30)
+* local cache of fonts: Security. (line 22)
+* log file: Logging. (line 6)
+* logging successful searches: Logging. (line 6)
+* lost+found directory: Searching overview. (line 56)
+* lostchar: Suppressing warnings.
+ (line 19)
+* ls-R: Supported file formats.
+ (line 74)
+* ls-R and AFS: Installing files. (line 40)
+* ls-R database file: ls-R. (line 6)
+* ls-R, simplest build: ls-R. (line 18)
+* Mach10 configure error: Empty Makefiles. (line 6)
+* Macintosh TeX implementations: Other TeX packages. (line 6)
+* MacKenzie, David <1>: Subdirectory expansion.
+ (line 22)
+* MacKenzie, David: History. (line 45)
+* magic characters: Searching overview. (line 13)
+* mailing lists: Mailing lists. (line 6)
+* maintainer-clean Make target: Cleaning up. (line 18)
+* Make arguments, additional: Running make. (line 36)
+* make, running: Running make. (line 6)
+* Makefile.in: Running configure. (line 6)
+* Makefiles, empty: Empty Makefiles. (line 6)
+* MAKETEX_DEBUG (512): Debugging. (line 91)
+* MAKETEX_FINE_DEBUG (1024): Debugging. (line 100)
+* MAKETEX_MODE: Default path features.
+ (line 19)
+* memory allocation routines: Calling sequence. (line 83)
+* metafont driver files: mktex configuration. (line 87)
+* Metafont failures: TeX or Metafont failing.
+ (line 6)
+* Metafont installation: Unable to generate fonts.
+ (line 52)
+* Metafont making too-large fonts: Unable to generate fonts.
+ (line 36)
+* Metafont using the wrong device: Unable to generate fonts.
+ (line 29)
+* MFBASES: Supported file formats.
+ (line 24)
+* MFINPUTS: Supported file formats.
+ (line 88)
+* MFPOOL: Supported file formats.
+ (line 92)
+* MFTINPUTS: Supported file formats.
+ (line 96)
+* mirrors, FTP: Electronic distribution.
+ (line 13)
+* MISCFONTS: Supported file formats.
+ (line 100)
+* mismatched checksum warnings: Suppressing warnings.
+ (line 17)
+* missfont.log: mktex script names. (line 25)
+* MISSFONT_LOG: mktex script names. (line 30)
+* missing character warnings: Suppressing warnings.
+ (line 20)
+* mktex script configuration: mktex configuration. (line 6)
+* mktex script names: mktex script names. (line 6)
+* mktex scripts: mktex scripts. (line 6)
+* mktex.cnf: mktex configuration. (line 23)
+* mktex.opt: mktex configuration. (line 34)
+* mktexdir: mktex configuration. (line 55)
+* mktexmf: mktex script names. (line 17)
+* mktexpk: mktex script names. (line 11)
+* mktexpk , initial runs: Simple installation. (line 79)
+* mktexpk can't guess mode: Unable to generate fonts.
+ (line 12)
+* mktextex: mktex script names. (line 14)
+* mktextfm: mktex script names. (line 20)
+* mode directory, omitting: mktex configuration. (line 92)
+* Morgan, Tim: History. (line 12)
+* mostlyclean Make target: Cleaning up. (line 10)
+* MPINPUTS: Supported file formats.
+ (line 104)
+* MPMEMS: Supported file formats.
+ (line 80)
+* MPPOOL: Supported file formats.
+ (line 108)
+* MPSUPPORT: Supported file formats.
+ (line 84)
+* MT_FEATURES: mktex configuration. (line 34)
+* multiple architectures, compiling on: configure scenarios. (line 18)
+* multiple architectures, directories for: configure scenarios.
+ (line 23)
+* multiple architectures, installing on: Installing files. (line 21)
+* multiple TeX hierarchies: Brace expansion. (line 20)
+* must exist: Searching overview. (line 31)
+* names for mktex scripts: mktex script names. (line 6)
+* NetBSD configure error: Empty Makefiles. (line 6)
+* NetBSD shells and configure: configure shells. (line 19)
+* Neumann, Gustaf: History. (line 57)
+* newsgroup for TeX: Mailing lists. (line 29)
+* NeXT sed error: Empty Makefiles. (line 6)
+* NeXT, lacking X11: Kpathsea application distributions.
+ (line 6)
+* NFS and ls-R: ls-R. (line 40)
+* NFS CTAN access: Electronic distribution.
+ (line 17)
+* nomfdrivers: mktex configuration. (line 86)
+* nomode: mktex configuration. (line 91)
+* non-English typesetting: Kpathsea application distributions.
+ (line 28)
+* non-Unix operating systems: Custom installation. (line 19)
+* none: Suppressing warnings.
+ (line 23)
+* null pointers, dereferencing: Bug checklist. (line 69)
+* numeric debugging values: Debugging. (line 34)
+* obtaining TeX: unixtex.ftp. (line 6)
+* obtaining Web2c by ftp: Electronic distribution.
+ (line 6)
+* obtaining Web2c on CD-ROM: CD-ROM distribution. (line 6)
+* OCPINPUTS: Supported file formats.
+ (line 112)
+* OFMFONTS: Supported file formats.
+ (line 116)
+* online Metafont display, spurious: Unable to generate fonts.
+ (line 36)
+* OPENTYPEFONTS: Supported file formats.
+ (line 120)
+* OpenWin libraries, dynamic linking problems: ShellWidgetClass.
+ (line 6)
+* optimization caveat: TeX or Metafont failing.
+ (line 15)
+* optimization, enabling: configure scenarios. (line 32)
+* options for debugging: Debugging. (line 6)
+* options to configure: configure options. (line 16)
+* OS/2 support: Custom installation. (line 19)
+* other TeX distributions: Other TeX packages. (line 6)
+* OTPINPUTS: Supported file formats.
+ (line 126)
+* overview of path searching: Searching overview. (line 6)
+* overview of programming with Kpathsea: Programming overview.
+ (line 6)
+* OVFFONTS: Supported file formats.
+ (line 129)
+* OVPFONTS: Supported file formats.
+ (line 132)
+* patches, Sun OpenWin: ShellWidgetClass. (line 29)
+* path expansion: Path expansion. (line 6)
+* path searching: Path searching. (line 6)
+* path searching options: Path searching options.
+ (line 6)
+* path searching, overview: Searching overview. (line 6)
+* path searching, standalone: Invoking kpsewhich. (line 6)
+* path sources: Path sources. (line 6)
+* paths, changing default <1>: Default path generation.
+ (line 6)
+* paths, changing default: Changing search paths.
+ (line 6)
+* paths, device name included in: Default path features.
+ (line 19)
+* paths.h: Default path generation.
+ (line 27)
+* paths.h, creating: Running make. (line 6)
+* pathsearch.h: Programming overview.
+ (line 16)
+* pc Pascal compiler: History. (line 12)
+* PCL driver: Kpathsea application distributions.
+ (line 13)
+* PDF generation: Kpathsea application distributions.
+ (line 16)
+* PDFTEXCONFIG: Supported file formats.
+ (line 136)
+* permission denied: Searching overview. (line 56)
+* permissions, directory: Security. (line 51)
+* permissions, file: Security. (line 47)
+* PKFONTS: Supported file formats.
+ (line 139)
+* plain.base: Unable to generate fonts.
+ (line 46)
+* pointer combination warnings: Pointer combination warnings.
+ (line 6)
+* PostScript driver: Kpathsea application distributions.
+ (line 16)
+* PostScript fonts, additional: Simple installation. (line 60)
+* precompiled executables, instead of installation: Simple installation.
+ (line 6)
+* precompiled Unix binaries: Other TeX packages. (line 13)
+* preprocessor options: configure environment.
+ (line 32)
+* preprocessor options, additional: Running make. (line 24)
+* printer configuration files: Simple installation. (line 60)
+* privacy, semblance of: Logging. (line 32)
+* problems, common: Common problems. (line 6)
+* proginit.c: Default path features.
+ (line 25)
+* proginit.h: Calling sequence. (line 51)
+* program-varying paths: Supported file formats.
+ (line 12)
+* program_invocation_name: Calling sequence. (line 16)
+* program_invocation_short_name: Calling sequence. (line 16)
+* programming overview: Programming overview.
+ (line 6)
+* programming with config files: Programming with config files.
+ (line 6)
+* programming with Kpathsea: Calling sequence. (line 6)
+* programs using the library: Introduction. (line 13)
+* proof mode: Unable to generate fonts.
+ (line 36)
+* PSHEADERS: Supported file formats.
+ (line 145)
+* pxp Pascal preprocessor: History. (line 12)
+* quoting variable values: Variable expansion. (line 17)
+* readable: Suppressing warnings.
+ (line 26)
+* reading arbitrary-length lines: Calling sequence. (line 83)
+* README.CONFIGURE: Running configure. (line 15)
+* README.mirrors: Electronic distribution.
+ (line 13)
+* recording successful searches: Logging. (line 6)
+* relative filenames: Searching overview. (line 52)
+* relative filenames in ls-R: Installing files. (line 40)
+* reporting bugs: Reporting bugs. (line 6)
+* resident.c: Calling sequence. (line 45)
+* resolution, setting: Path searching options.
+ (line 15)
+* resolutions, last-resort: Fallback font. (line 6)
+* retrieving TeX: unixtex.ftp. (line 6)
+* right-hand side of variable assignments: Config files. (line 44)
+* Rokicki, Tom: History. (line 12)
+* root user: Tilde expansion. (line 18)
+* runtime configuration files: Config files. (line 6)
+* runtime debugging: Debugging. (line 6)
+* Sauter fonts, and dynamic source creation: mktex scripts. (line 6)
+* scripts for file creation: mktex scripts. (line 6)
+* search path, defined: Searching overview. (line 6)
+* search paths, changing default: Changing search paths.
+ (line 6)
+* searching for files: File lookup. (line 6)
+* searching for glyphs: Glyph lookup. (line 6)
+* searching overview: Searching overview. (line 6)
+* searching the database: Searching overview. (line 17)
+* searching the disk: Searching overview. (line 22)
+* security considerations: Security. (line 6)
+* sed error from configure: Empty Makefiles. (line 6)
+* SELFAUTODIR: Calling sequence. (line 16)
+* SELFAUTOLOC: Calling sequence. (line 16)
+* SELFAUTOPARENT: Calling sequence. (line 16)
+* sending patches: Bug checklist. (line 63)
+* setgid scripts: Security. (line 40)
+* SFDFONTS: Supported file formats.
+ (line 149)
+* sh5, ok with configure: configure shells. (line 25)
+* shar, recommended: Bug checklist. (line 57)
+* shared library, making: Shared library. (line 6)
+* shell scripts as configuration files: Config files. (line 67)
+* shell variables: Variable expansion. (line 17)
+* shell_escape, example for code: Programming with config files.
+ (line 10)
+* shells and configure: configure shells. (line 6)
+* simple installation: Simple installation. (line 6)
+* site overrides for mktex...: mktex configuration. (line 23)
+* size of distribution archives: Disk space. (line 6)
+* skeleton TeX directory: TeX directory structure.
+ (line 6)
+* slow startup time: Slow path searching. (line 6)
+* Solaris BSD compatibility, not: Running make. (line 44)
+* source files: Supported file formats.
+ (line 161)
+* sources for search paths: Path sources. (line 6)
+* special: Suppressing warnings.
+ (line 30)
+* st_nlink: Subdirectory expansion.
+ (line 26)
+* stack trace: Bug checklist. (line 69)
+* standalone path searching: Invoking kpsewhich. (line 6)
+* standard error and debugging output: Debugging. (line 27)
+* standard options: Standard options. (line 6)
+* startup time, excessive: Slow path searching. (line 6)
+* static linking: ShellWidgetClass. (line 39)
+* static linking and dlsym: dlopen. (line 6)
+* string routines: Calling sequence. (line 83)
+* strip: mktex configuration. (line 101)
+* stripsupplier: mktex configuration. (line 95)
+* striptypeface: mktex configuration. (line 98)
+* subdirectory searching: Subdirectory expansion.
+ (line 6)
+* suggestions, making: Introduction. (line 27)
+* Sun 2: History. (line 12)
+* Sun OpenWin patches: ShellWidgetClass. (line 29)
+* supplier directory, omitting: mktex configuration. (line 96)
+* supported file formats: Supported file formats.
+ (line 6)
+* suppressing warnings: Suppressing warnings.
+ (line 6)
+* symbolic link trees, for multiple architectures: configure scenarios.
+ (line 18)
+* symbolic links not found: Unable to find files.
+ (line 21)
+* symbolic links, and ls-R: ls-R. (line 38)
+* symlinks, resolving: Calling sequence. (line 16)
+* system C compiler bugs: TeX or Metafont failing.
+ (line 19)
+* system dependencies: Running configure. (line 6)
+* system V universe: Running make. (line 44)
+* T1FONTS: Supported file formats.
+ (line 184)
+* T1INPUTS: Supported file formats.
+ (line 184)
+* T42FONTS: Supported file formats.
+ (line 189)
+* TDS: TeX directory structure.
+ (line 6)
+* testing, post-installation: Installation testing.
+ (line 6)
+* tests, simple: Simple installation. (line 79)
+* teTeX: Other TeX packages. (line 13)
+* TeX directory structure: TeX directory structure.
+ (line 6)
+* TeX distributions besides Web2c: Other TeX packages. (line 6)
+* TeX environment variables: Supported file formats.
+ (line 6)
+* TeX failures: TeX or Metafont failing.
+ (line 6)
+* TeX file lookup: File lookup. (line 6)
+* TeX glyph lookup: Glyph lookup. (line 6)
+* TeX help mailing list: Mailing lists. (line 29)
+* TeX hierarchy, one: configure scenarios. (line 13)
+* TeX Live CD-ROM: CD-ROM distribution. (line 8)
+* TeX support: TeX support. (line 6)
+* TeX Users Group: Introduction. (line 39)
+* tex-archive@math.utah.edu: Mailing lists. (line 25)
+* tex-file.c: File lookup. (line 26)
+* tex-file.h: Programming overview.
+ (line 16)
+* tex-glyph.c: Glyph lookup. (line 26)
+* tex-glyph.h: Programming overview.
+ (line 16)
+* tex-k-request@mail.tug.org: Mailing lists. (line 7)
+* tex-k@mail.tug.org (bug address): Reporting bugs. (line 8)
+* tex-make.c: mktex script names. (line 6)
+* TEX_HUSH <1>: Suppressing warnings.
+ (line 6)
+* TEX_HUSH: Searching overview. (line 56)
+* TEXBIB: Supported file formats.
+ (line 28)
+* TEXCONFIG: Supported file formats.
+ (line 47)
+* TEXDOCS: Supported file formats.
+ (line 158)
+* TEXFONTMAPS: Supported file formats.
+ (line 77)
+* TEXFONTS: Supported file formats.
+ (line 58)
+* texfonts.map: Fontmap. (line 6)
+* TEXFORMATS: Supported file formats.
+ (line 54)
+* TEXINDEXSTYLE: Supported file formats.
+ (line 67)
+* TEXINPUTS: Supported file formats.
+ (line 62)
+* TEXMF: TeX directory structure.
+ (line 6)
+* texmf.cnf, and variable expansion: Variable expansion. (line 6)
+* texmf.cnf, creating: Running make. (line 6)
+* texmf.cnf, definition for: Config files. (line 6)
+* texmf.cnf, generated: Default path generation.
+ (line 22)
+* texmf.cnf, source for path: Path sources. (line 17)
+* texmf.in: Default path generation.
+ (line 22)
+* texmf.in, editing: Changing search paths.
+ (line 6)
+* texmf.sed: Default path generation.
+ (line 17)
+* TEXMFCNF <1>: Supported file formats.
+ (line 39)
+* TEXMFCNF: Config files. (line 6)
+* TEXMFDBS <1>: Supported file formats.
+ (line 74)
+* TEXMFDBS: ls-R. (line 6)
+* TEXMFINI: Supported file formats.
+ (line 24)
+* TEXMFLOG: Logging. (line 10)
+* TEXMFOUTPUT: mktex script names. (line 30)
+* TEXMFSCRIPTS: Supported file formats.
+ (line 164)
+* TEXMFVAR: mktex configuration. (line 117)
+* texmfvar: mktex configuration. (line 116)
+* TEXPICTS: Supported file formats.
+ (line 62)
+* TEXPKS: Supported file formats.
+ (line 139)
+* TEXPOOL: Supported file formats.
+ (line 168)
+* TEXPSHEADERS: Supported file formats.
+ (line 145)
+* TEXSIZES: Fallback font. (line 6)
+* TEXSOURCES: Supported file formats.
+ (line 161)
+* TFMFONTS: Supported file formats.
+ (line 172)
+* tilde expansion: Tilde expansion. (line 6)
+* tilde.c: Tilde expansion. (line 24)
+* time system call: Logging. (line 15)
+* tolerance for glyph lookup: Basic glyph lookup. (line 15)
+* total disk space: Disk space. (line 6)
+* trailing / in home directory: Tilde expansion. (line 18)
+* trailing colons: Default expansion. (line 6)
+* TRFONTS: Supported file formats.
+ (line 177)
+* trick for detecting leaf directories: Subdirectory expansion.
+ (line 22)
+* trojan horse attack: Security. (line 10)
+* TTFONTS: Supported file formats.
+ (line 181)
+* tug.org: unixtex.ftp. (line 6)
+* tug@tug.org: Introduction. (line 46)
+* typeface directory, omitting: mktex configuration. (line 99)
+* ucbinclude, avoiding: Running make. (line 44)
+* Ultrix shells and configure: configure shells. (line 25)
+* unable to find files: Unable to find files.
+ (line 6)
+* unable to generate fonts: Unable to generate fonts.
+ (line 6)
+* uname: Bug checklist. (line 22)
+* universe, BSD vs. system V: Running make. (line 44)
+* UNIX_ST_LINK: Subdirectory expansion.
+ (line 38)
+* unixtex.ftp: unixtex.ftp. (line 6)
+* unknown special warnings: Suppressing warnings.
+ (line 31)
+* unreadable file warnings: Suppressing warnings.
+ (line 27)
+* unreadable files: Searching overview. (line 56)
+* unusable ls-R warning: ls-R. (line 45)
+* usage patterns, finding: Logging. (line 6)
+* USE_TEXMFVAR: mktex configuration. (line 122)
+* USE_VARTEXFONTS: mktex configuration. (line 112)
+* Usenet TeX newsgroup: Mailing lists. (line 29)
+* varfonts: mktex configuration. (line 106)
+* variable expansion: Variable expansion. (line 6)
+* variable.c: Variable expansion. (line 32)
+* variable.h: Programming with config files.
+ (line 10)
+* VARTEXFONTS: mktex configuration. (line 107)
+* VAX 11/750: History. (line 12)
+* version number, of Kpathsea: Kpathsea application distributions.
+ (line 6)
+* version numbers, determining: Bug checklist. (line 17)
+* VF files, not found: Searching overview. (line 31)
+* VFFONTS: Supported file formats.
+ (line 192)
+* VMS support: Custom installation. (line 19)
+* VMS TeX implementations: Other TeX packages. (line 6)
+* Vojta, Paul: History. (line 30)
+* Walsh, Norman: History. (line 57)
+* warning about unusable ls-R: ls-R. (line 45)
+* warnings, file access: Searching overview. (line 56)
+* warnings, pointer combinations: Pointer combination warnings.
+ (line 6)
+* warnings, suppressing: Suppressing warnings.
+ (line 6)
+* wcstombs: dlopen. (line 6)
+* WEB2C: Supported file formats.
+ (line 200)
+* Weber, Olaf: History. (line 74)
+* WEBINPUTS: Supported file formats.
+ (line 196)
+* whitespace, in fontmap files: Fontmap. (line 28)
+* whitespace, not ignored on continuation lines: Config files.
+ (line 26)
+* Windows TeX implementations: Other TeX packages. (line 6)
+* World Wide Web CTAN access: Electronic distribution.
+ (line 17)
+* www.tug.org: unixtex.ftp. (line 6)
+* X11 previewer: Kpathsea application distributions.
+ (line 25)
+* X11, lacking on NeXT: Kpathsea application distributions.
+ (line 6)
+* XCFLAGS: Running make. (line 26)
+* XCPPFLAGS: Running make. (line 22)
+* XDEFS: Running make. (line 23)
+* XDVIFONTS: Supported file formats.
+ (line 227)
+* XDVIMAKEPK: mktex script names. (line 22)
+* XDVISIZES: Fallback font. (line 6)
+* XLDFLAGS: Running make. (line 29)
+* XLOADLIBES: Running make. (line 32)
+* XMAKEARGS: Running make. (line 35)
+* Xmu library problems: ShellWidgetClass. (line 13)
+* XtStrings: XtStrings. (line 6)
+* zuhn, david: History. (line 51)
+* { expansion: Brace expansion. (line 6)
+* ~ expansion: Tilde expansion. (line 6)
+
+
+
+Tag Table:
+Node: Top1413
+Node: Introduction2056
+Node: History4032
+Node: Installation8124
+Node: Simple installation8914
+Node: Custom installation12497
+Node: Disk space13671
+Node: Kpathsea application distributions14555
+Node: Changing search paths15670
+Node: Default path features16852
+Node: Default path generation18988
+Node: Running configure20431
+Node: configure shells21482
+Node: configure options22534
+Node: configure environment24041
+Node: configure scenarios25843
+Node: Shared library27429
+Node: Running make28763
+Node: Installing files30810
+Node: Cleaning up32757
+Node: Filename database generation33805
+Node: mktex scripts34372
+Node: mktex configuration35329
+Node: mktex script names40873
+Node: mktex script arguments41971
+Node: Installation testing42861
+Node: Security43225
+Node: TeX directory structure45792
+Node: unixtex.ftp50214
+Node: Electronic distribution52229
+Node: CD-ROM distribution54994
+Node: Other TeX packages55964
+Node: Reporting bugs57260
+Node: Bug checklist58000
+Node: Mailing lists62101
+Node: Debugging63460
+Node: Logging68532
+Node: Common problems70043
+Node: Unable to find files70874
+Node: Slow path searching73285
+Node: Unable to generate fonts74662
+Node: TeX or Metafont failing77171
+Node: Empty Makefiles79049
+Node: XtStrings80279
+Node: dlopen81115
+Node: ShellWidgetClass81933
+Node: Pointer combination warnings83565
+Node: Path searching83954
+Node: Searching overview84601
+Node: Path sources87973
+Node: Config files89044
+Node: Path expansion92444
+Node: Default expansion93393
+Node: Variable expansion95463
+Node: Tilde expansion96866
+Node: Brace expansion97764
+Node: KPSE_DOT expansion98869
+Node: Subdirectory expansion99382
+Node: Filename database101731
+Node: ls-R103045
+Node: Filename aliases105939
+Node: Database format107117
+Node: Invoking kpsewhich108130
+Node: Path searching options109007
+Node: Auxiliary tasks113144
+Node: Standard options114652
+Node: TeX support114972
+Node: Supported file formats116263
+Node: File lookup123411
+Node: Glyph lookup124702
+Node: Basic glyph lookup125829
+Node: Fontmap126708
+Node: Fallback font129325
+Node: Suppressing warnings130290
+Node: Programming131395
+Node: Programming overview131908
+Node: Calling sequence134184
+Node: Program-specific files139213
+Node: Programming with config files140251
+Node: Index141551
+
+End Tag Table
diff --git a/Build/source/texk/kpathsea/kpathsea.rc b/Build/source/texk/kpathsea/kpathsea.rc
new file mode 100644
index 00000000000..bdf096299df
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpathsea.rc
@@ -0,0 +1,36 @@
+/* kpathsea.rc: kpathsea resources -*- C++ -*-
+
+ Copyright (C) 1996-2003 Fabrice Popineau <fabrice.popineau@supelec.fr>
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ This file 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 file; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#include <texlive-version.h>
+
+#define VER_FILEVERSION TEXLIVE_MAJOR_VERSION,TEXLIVE_MINOR_VERSION,TEXLIVE_BETA_NUMBER,TEXLIVE_ALPHA_NUMBER
+#define VER_FILEVERSION_STR TEXLIVE_PRODUCTVERSION_STR " kpathsea 3.4.4"
+
+#define VER_INTERNALNAME_STR TEXLIVE_LIBRARYPREFIX_STR "kpse"
+#define VER_ORIGINALFILENAME_STR TEXLIVE_LIBRARYPREFIX_STR "kpse.dll"
+
+#define VER_LEGALCOPYRIGHT_STR "Copyright (C) 1993-2003 Karl Berry, Olaf Weber and the Free Software Foundation"
+
+#define VER_FILEDESCRIPTION_STR "Kpathsea file searching library"
+
+#define VER_FILETYPE VFT_DLL
+
+#include <texlive.version>
+
+/* kpathsea.rc ends here */
diff --git a/Build/source/texk/kpathsea/kpathsea.texi b/Build/source/texk/kpathsea/kpathsea.texi
new file mode 100644
index 00000000000..3d8cd708867
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpathsea.texi
@@ -0,0 +1,2254 @@
+\input texinfo
+@setfilename kpathsea.info
+@settitle Kpathsea: A library for path searching
+
+@set version 3.5.5
+@set month-year June 2005
+
+@c Define new indices for commands, filenames, and options.
+@defcodeindex cm
+@defcodeindex fl
+@defcodeindex op
+
+@c Put everything in one index (arbitrarily chosen to be the concept index).
+@syncodeindex cm cp
+@syncodeindex fl cp
+@syncodeindex fn cp
+@syncodeindex ky cp
+@syncodeindex op cp
+@syncodeindex pg cp
+@syncodeindex tp cp
+@syncodeindex vr cp
+
+@dircategory TeX
+@direntry
+* Kpathsea: (kpathsea). File lookup along search paths.
+* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
+* mktexmf: (kpathsea)mktex scripts. MF source generation.
+* mktexpk: (kpathsea)mktex scripts. PK bitmap generation.
+* mktextex: (kpathsea)mktex scripts. TeX source generation.
+* mktextfm: (kpathsea)mktex scripts. TeX font metric generation.
+* mktexlsr: (kpathsea)Filename database. Update ls-R.
+@end direntry
+
+@copying
+This file documents the Kpathsea library for path searching.
+
+Copyright (C) 1993-2005 Karl Berry & Olaf Weber.
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries a copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+@end ignore
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the
+entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation
+approved by the Free Software Foundation.
+@end copying
+
+
+@titlepage
+
+@title Kpathsea library
+@subtitle for version @value{version}
+@subtitle @value{month-year}
+@author Karl Berry (@email{kb@@mail.tug.org})
+@author Olaf Weber (@email{infovore@@xs4all.nl})
+
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+
+@ifnottex
+@node Top
+@top Kpathsea library
+
+This manual documents how to install and use the Kpathsea library for
+filename lookup. It corresponds to version @value{version},
+released in @value{month-year}.
+
+@menu
+* Introduction:: Overview.
+* Installation:: Compilation, installation, and bug reporting.
+
+* Path searching:: How filename lookups work.
+* TeX support:: Special support for TeX-related file lookups.
+
+* Programming:: How to use Kpathsea features in your program.
+
+* Index:: General index.
+@end menu
+@end ifnottex
+
+
+@node Introduction
+@chapter Introduction
+
+@cindex introduction
+@cindex fundamental purpose of Kpathsea
+
+This manual corresponds to version @value{version} of the Kpathsea
+library, released in @value{month-year}.
+
+The library's fundamental purpose is to return a filename from a list of
+directories specified by the user, similar to what shells do when
+looking up program names to execute.
+
+@cindex programs using the library
+The following software, all of which we maintain, uses this library:
+
+@itemize @bullet
+@item Dviljk (see the @samp{dvilj} man page)
+@item Dvipsk (@pxref{Top, , Introduction, dvips, Dvips: A DVI driver})
+@item GNU font utilities (@pxref{Top, , Introduction, fontu, GNU font
+utilities})
+@item Web2c (@pxref{Top, , Introduction, web2c, Web2c: A @TeX{}
+implementation})
+@item Xdvik (see the @samp{xdvi} man page)
+@end itemize
+
+@noindent Other software that we do not maintain also uses it.
+
+@cindex interface, not frozen
+@cindex comments, making
+@cindex suggestions, making
+We are still actively maintaining the library (and probably always will
+be, despite our hopes). If you have comments or suggestions, please send
+them to us (@pxref{Reporting bugs}).
+
+@cindex conditions for use
+@cindex license for using the library
+@cindex GNU General Public License
+We distribute the library under the GNU Library General Public License
+(LGPL). In short, this means if you write a program using the library,
+you must (offer to) distribute the source to the library, along with any
+changes you have made, and allow anyone to modify the library source and
+distribute their modifications. It does not mean you have to distribute
+the source to your program, although we hope you will. See the files
+@file{GPL} and @file{LGPL} for the text of the GNU licenses.
+
+@cindex @TeX{} Users Group
+If you know enough about @TeX{} to be reading this manual, then you (or
+your institution) should consider joining the @TeX{} Users Group (if
+you're already a member, great!). TUG produces the periodical
+@cite{TUGboat}, sponsors an annual meeting and publishes the
+proceedings, and arranges courses on @TeX{} for all levels of users
+throughout the world. Anyway, here is the address:
+
+@flindex tug@@tug.org
+@display
+@TeX{} Users Group
+P.O. Box 2311
+Portland OR 97208-2311
+USA
+phone: +1 503 223-9994
+fax: +1 503 223-3960
+email: @email{tug@@tug.org}
+@end display
+
+@menu
+* History::
+@end menu
+
+
+@node History
+@section History
+
+@cindex history of Kpathsea
+
+@cindex Knuth, Donald E.
+(This section is for those people who are curious about how the library
+came about.) (If you like to read historical accounts of software, we
+urge you to seek out the GNU Autoconf manual and the ``Errors of
+@TeX{}'' paper by Don Knuth, published in @cite{Software---Practice and
+Experience} 19(7), July 1989.)
+
+@cindex Morgan, Tim
+@cindex Rokicki, Tom
+@cindex Berry, Karl
+@cindex VAX 11/750
+@cindex Sun 2
+@pindex pxp @r{Pascal preprocessor}
+@pindex pc @r{Pascal compiler}
+[Karl writes.] My first ChangeLog entry for Web2c seems to be February
+1990, but I may have done some work before then. In any case, Tim
+Morgan and I were jointly maintaining it for a time. (I should mention
+here that Tim had made Web2c into a real distribution long before I had
+ever used it or even heard of it, and Tom Rokicki did the original
+implementation. I was using @code{pxp} and @code{pc} on VAX 11/750's
+and the hot new Sun 2 machines.)
+
+It must have been later in 1990 and 1991 that I started working on
+@cite{@TeX{} for the Impatient}. Dvips, Xdvi, Web2c, and the GNU
+fontutils (which I was also writing at the time) all used different
+environment variables, and, more importantly, had different bugs in
+their path searching. This became extremely painful, as I was stressing
+everything to the limit working on the book. I also desperately wanted
+to implement subdirectory searching, since I couldn't stand putting
+everything in one big directory, and also couldn't stand having to
+explicitly specify @file{cm}, @file{pandora}, @dots{} in a path.
+
+@cindex Vojta, Paul
+In the first incarnation, I just hacked separately on each
+program---that was the original subdirectory searching code in both Xdvi
+and Dvips, though I think Paul Vojta has completely rewritten Xdvi's
+support by now. That is, I tried to go with the flow in each program,
+rather than changing the program's calling sequences to conform to
+common routines.
+
+Then, as bugs inevitably appeared, I found I was fixing the same thing
+three times (Web2c and fontutils were always sharing code, since I
+maintained those---there was no Dvipsk or Xdvik or Dviljk at this
+point). After a while, I finally started sharing source files. They
+weren't yet a library, though. I just kept things up to date with shell
+scripts. (I was developing on a 386 running ISC 2.2 at the time, and so
+didn't have symbolic links. An awful experience.)
+
+@cindex MacKenzie, David
+The ChangeLogs for Xdvik and Dvipsk record initial releases of those
+distributions in May and June 1992. I think it was because I was tired
+of the different configuration strategies of each program, not so much
+because of the path searching. (Autoconf was being developed by David
+MacKenzie and others, and I was adapting it to @TeX{} and friends.)
+
+@cindex zuhn, david
+I started to make a separate library that other programs could link with
+on my birthday in April 1993, according to the ChangeLog. I don't
+remember exactly why I finally took the time to make it a separate
+library; a conversation with david zuhn that initiated it. Just seemed
+like it was time.
+
+@cindex Walsh, Norman
+@cindex Neumann, Gustaf
+Dviljk got started in March 1994 after I bought a Laserjet 4. (Kpathsea
+work got suspended while Norm Walsh and I, with Gustaf Neumann's help,
+implemented a way for @TeX{} to get at all those neat builtin LJ4 fonts
+@dots{} such a treat to have something to typeset in besides Palatino!)
+
+By spring of 1995, I had implemented just about all the path-searching
+features in Kpathsea that I plan to, driven beyond my initial goals by
+Thomas Esser and others. I then started to integrate Web2c with
+Kpathsea. After the release of a stable Web2c, I hope to be able to stop
+development, and turn most of my attention back to making fonts for GNU.
+(Always assuming Micros**t hasn't completely obliterated Unix by then,
+or that software patents haven't stopped software development by anybody
+smaller than a company with a million-dollar-a-year legal budget. Which
+is actually what I think is likely to happen, but that's another
+story@dots{})
+
+@cindex Weber, Olaf
+[Olaf writes.] At the end of 1997, UNIX is still alive and kicking,
+individuals still develop software, and Web2c development still
+continues. Karl had been looking for some time for someone to take up
+part of the burden, and I volunteered.
+
+
+@include install.texi
+@include hier.texi
+@include unixtex.texi
+@include bugs.texi
+
+
+@node Path searching
+@chapter Path searching
+
+@cindex path searching
+
+This chapter describes the generic path searching mechanism Kpathsea
+provides. For information about searching for particular file types
+(e.g., @TeX{} fonts), see the next chapter.
+
+@menu
+* Searching overview:: Basic scheme for searching.
+* Path sources:: Where search paths can be defined.
+* Path expansion:: Special constructs in search paths.
+* Filename database:: Using an externally-built list to search.
+* Invoking kpsewhich:: Standalone path lookup.
+@end menu
+
+
+@node Searching overview
+@section Searching overview
+
+@cindex searching overview
+@cindex path searching, overview
+@cindex overview of path searching
+
+@cindex search path, defined
+A @dfn{search path} is a colon-separated list of @dfn{path elements},
+which are directory names with a few extra frills. A search path can
+come from (a combination of) many sources; see below. To look up a file
+@samp{foo} along a path @samp{.:/dir}, Kpathsea checks each element of
+the path in turn: first @file{./foo}, then @file{/dir/foo}, returning
+the first match (or possibly all matches).
+
+@cindex magic characters
+@kindex : @r{may not be :}
+@kindex / @r{may not be /}
+The ``colon'' and ``slash'' mentioned here aren't necessarily @samp{:}
+and @samp{/} on non-Unix systems. Kpathsea tries to adapt to other
+operating systems' conventions.
+
+@cindex database search
+@cindex searching the database
+To check a particular path element @var{e}, Kpathsea first sees if a
+prebuilt database (@pxref{Filename database}) applies to @var{e}, i.e.,
+if the database is in a directory that is a prefix of @var{e}. If so,
+the path specification is matched against the contents of the database.
+
+@cindex floating directories
+@cindex filesystem search
+@cindex disk search
+@cindex searching the disk
+If the database does not exist, or does not apply to this path element,
+or contains no matches, the filesystem is searched (if this was not
+forbidden by the specification with @samp{!!} and if the file being
+searched for must exist). Kpathsea constructs the list of directories
+that correspond to this path element, and then checks in each for the
+file being searched for. (To help speed future lookups of files in the
+same directory, the directory in which a file is found is floated to the
+top of the directory list.)
+
+@cindex must exist
+@cindex VF files, not found
+@flindex cmr10.vf
+@findex \openin
+The ``file must exist'' condition comes into play with VF files and
+input files read by the @TeX{} @samp{\openin} command. These files may
+not exist (consider @file{cmr10.vf}), and so it would be wrong to search
+the disk for them. Therefore, if you fail to update @file{ls-R} when
+you install a new VF file, it will never be found.
+
+Each path element is checked in turn: first the database, then the disk.
+If a match is found, the search stops and the result is returned. This
+avoids possibly-expensive processing of path specifications that are
+never needed on a particular run. (Unless the search explicitly
+requested all matches.)
+
+@cindex expansion, path element
+Although the simplest and most common path element is a directory name,
+Kpathsea supports additional features in search paths: layered default
+values, environment variable names, config file values, users' home
+directories, and recursive subdirectory searching. Thus, we say that
+Kpathsea @dfn{expands} a path element, meaning transforming all the
+magic specifications into the basic directory name or names. This
+process is described in the sections below. It happens in the same
+order as the sections.
+
+@cindex absolute filenames
+@cindex relative filenames
+@cindex explicitly relative filenames
+@cindex filenames, absolute or explicitly relative
+Exception to all of the above: If the filename being searched for is
+absolute or explicitly relative, i.e., starts with @samp{/} or @samp{./}
+or @samp{../}, Kpathsea simply checks if that file exists.
+
+@cindex permission denied
+@cindex unreadable files
+@cindex access warnings
+@cindex warnings, file access
+@flindex lost+found @r{directory}
+@vindex TEX_HUSH
+Ordinarily, if Kpathsea tries to access a file or directory that cannot
+be read, it gives a warning. This is so you will be alerted to
+directories or files that accidentally lack read permission (for
+example, a @file{lost+found}). If you prefer not to see these warnings,
+include the value @samp{readable} in the @code{TEX_HUSH} environment
+variable or config file value.
+
+This generic path searching algorithm is implemented in
+@file{kpathsea/pathsearch.c}. It is employed by a higher-level
+algorithm when searching for a file of a particular type (@pxref{File
+lookup}, and @ref{Glyph lookup}).
+
+
+@node Path sources
+@section Path sources
+
+@cindex path sources
+@cindex sources for search paths
+
+A search path can come from many sources. In the order in which
+Kpathsea uses them:
+
+@enumerate
+@item
+@cindex environment variable, source for path
+A user-set environment variable, e.g., @code{TEXINPUTS}.
+Environment variables with an underscore and the program name appended
+override; for example, @code{TEXINPUTS_latex} overrides @code{TEXINPUTS}
+if the program being run is named @samp{latex}.
+
+@item
+A program-specific configuration file, e.g., an @samp{S /a:/b} line in
+Dvips' @file{config.ps} (@pxref{Config files,,, dvips, Dvips}).
+
+@item
+@cindex configuration file, source for path
+@cindex Kpathsea config file, source for path
+@flindex texmf.cnf@r{, source for path}
+A line in a Kpathsea configuration file @file{texmf.cnf}, e.g.,
+@samp{TEXINPUTS=/c:/d} (see below).
+
+@item
+@cindex compilation value, source for path
+The compile-time default (specified in @file{kpathsea/paths.h}).
+@end enumerate
+
+You can see each of these values for a given search path by using the
+debugging options (@pxref{Debugging}).
+
+These sources may be combined via default expansion (@pxref{Default
+expansion}).
+
+@menu
+* Config files:: Kpathsea's runtime config files (texmf.cnf).
+@end menu
+
+
+@node Config files
+@subsection Config files
+
+@cindex config files
+@flindex texmf.cnf@r{, definition for}
+
+@cindex runtime configuration files
+@vindex TEXMFCNF
+As mentioned above, Kpathsea reads @dfn{runtime configuration files}
+named @file{texmf.cnf} for search path and other definitions. The
+search path used to look for these configuration files is named
+@code{TEXMFCNF}, and is constructed in the usual way, as described
+above, except that configuration files cannot be used to define the
+path, naturally; also, an @file{ls-R} database is not used to search for
+them.
+
+Kpathsea reads @emph{all} @file{texmf.cnf} files in the search path, not
+just the first one found; definitions in earlier files override those in
+later files. Thus, if the search path is @samp{.:$TEXMF}, values from
+@file{./texmf.cnf} override those from @file{$TEXMF/texmf.cnf}.
+
+While (or instead of) reading this description, you may find it helpful
+to look at the distributed @file{texmf.cnf}, which uses or at least
+mentions most features. The format of @file{texmf.cnf} files follows:
+
+@itemize @bullet
+@item
+@cindex comments, in @file{texmf.cnf}
+Comments start with @samp{%} and continue to the end of the line.
+
+@item
+@cindex blank lines, in @file{texmf.cnf}
+Blank lines are ignored.
+
+@item
+@cindex backslash-newline
+@cindex continuation character
+@cindex whitespace, not ignored on continuation lines
+@kindex \@r{, line continuation in @file{texmf.cnf}}
+A @samp{\} at the end of a line acts as a continuation character, i.e.,
+the next line is appended. Whitespace at the beginning of continuation
+lines is not ignored.
+
+@item Each remaining line must look like
+
+@example
+@var{variable} @r{[}. @var{progname}@r{]} @r{[}=@r{]} @var{value}
+@end example
+
+@noindent where the @samp{=} and surrounding whitespace is optional.
+
+@item
+@cindex identifiers, characters valid in
+The @var{variable} name may contain any character other than whitespace,
+@samp{=}, or @samp{.}, but sticking to @samp{A-Za-z_} is safest.
+
+@item If @samp{.@var{progname}} is present, the definition only
+applies if the program that is running is named (i.e., the last
+component of @code{argv[0]} is) @var{progname} or
+@file{@var{progname}.exe}. This allows different flavors of @TeX{} to
+have different search paths, for example.
+
+@item
+@cindex right-hand side of variable assignments
+@var{value} may contain any characters except @samp{%} and @samp{@@}.
+(These restrictions are only necessary because of the processing done on
+@file{texmf.cnf} at build time, so you can stick those characters in
+after installation if you have to.) The @samp{$@var{var}.@var{prog}}
+feature is not available on the right-hand side; instead, you must use
+an additional variable (see below for example). A @samp{;} in
+@var{value} is translated to @samp{:} if running under Unix; this is
+useful to write a single @file{texmf.cnf} which can be used under both
+Unix and NT.
+
+@item All definitions are read before anything is expanded, so you can
+use variables before they are defined (like Make, unlike most other
+programs).
+@end itemize
+
+@noindent Here is a configuration file fragment illustrating most of
+these points:
+
+@example
+% TeX input files -- i.e., anything to be found by \input or \openin ...
+latex209_inputs = .:$TEXMF/tex/latex209//:$TEXMF/tex//
+latex2e_inputs = .:$TEXMF/tex/latex//:$TEXMF/tex//
+TEXINPUTS = .:$TEXMF/tex//
+TEXINPUTS.latex209 = $latex209_inputs
+TEXINPUTS.latex2e = $latex2e_inputs
+TEXINPUTS.latex = $latex2e_inputs
+@end example
+
+@cindex shell scripts as configuration files
+@cindex configuration files as shell scripts.
+Although this format has obvious similarities to Bourne shell
+scripts---change the comment character to @code{#}, disallow spaces
+around the @code{=}, and get rid of the @code{.@var{name}} convention,
+and it could be run through the shell. But there seemed little
+advantage to doing this, since all the information would have to passed
+back to Kpathsea and parsed there anyway, since the @code{sh} process
+couldn't affect its parent's environment.
+
+@flindex cnf.c
+The implementation of all this is in @file{kpathsea/cnf.c}.
+
+
+@node Path expansion
+@section Path expansion
+
+@cindex path expansion
+@cindex expansion, search path
+
+Kpathsea recognizes certain special characters and constructions in
+search paths, similar to that in shells. As a general example:
+@samp{~$USER/@{foo,bar@}//baz} expands to all subdirectories under
+directories @file{foo} and @file{bar} in @t{$USER}'s home directory that
+contain a directory or file @file{baz}. These expansions are explained
+in the sections below.
+
+@menu
+* Default expansion:: a: or :a or a::b expands to a default.
+* Variable expansion:: $foo and $@{foo@} expand to environment values.
+* Tilde expansion:: ~ and ~user expand to home directories.
+* Brace expansion:: a@{foo,bar@}b expands to afoob abarb.
+* KPSE_DOT expansion:: . is replaced with $KPSE_DOT if it is defined.
+* Subdirectory expansion:: a// and a//b recursively expand to subdirs.
+@end menu
+
+
+@node Default expansion
+@subsection Default expansion
+
+@kindex :: @r{expansion}
+@cindex doubled colons
+@cindex leading colons
+@cindex trailing colons
+@cindex extra colons
+@cindex default expansion
+@cindex expansion, default
+
+If the highest-priority search path (@pxref{Path sources}) contains an
+@dfn{extra colon} (i.e., leading, trailing, or doubled), Kpathsea
+inserts at that point the next-highest-priority search path that is
+defined. If that inserted path has an extra colon, the same happens
+with the next-highest. (An extra colon in the compile-time default
+value has unpredictable results, so installers beware.)
+
+For example, given an environment variable setting
+
+@example
+setenv TEXINPUTS /home/karl:
+@end example
+
+@noindent and a @code{TEXINPUTS} value from @file{texmf.cnf} of
+
+@example
+.:$TEXMF//tex
+@end example
+
+@noindent then the final value used for searching will be:
+
+@example
+/home/karl:.:$TEXMF//tex
+@end example
+
+Put another way, default expansion works on ``formats'' (search
+paths), and not directly on environment variables. Example, showing
+the trailing @samp{:} ignored in the first case and expanded in the second:
+
+@example
+$ env TTFONTS=/tmp: kpsewhich --expand-path '$TTFONTS'
+/tmp
+$ env TTFONTS=/tmp: kpsewhich --show-path=.ttf
+/tmp:.:/home/olaf/texmf/fonts/truetype//:...
+@end example
+
+Since Kpathsea looks for multiple configuration files, it would be
+natural to expect that (for example) an extra colon in
+@file{./texmf.cnf} would expand to the path in @file{$TEXMF/texmf.cnf}.
+Or, with Dvips' configuration files, that an extra colon in
+@file{config.$PRINTER} would expand to the path in @file{config.ps}.
+This doesn't happen. It's not clear this would be desirable in all
+cases, and trying to devise a way to specify the path to which the extra
+colon should expand seemed truly baroque.
+@cindex Bach, Johann Sebastian
+
+Technicality: Since it would be useless to insert the default value in
+more than one place, Kpathsea changes only one extra @samp{:} and leaves
+any others in place (they will eventually be ignored). Kpathsea checks
+first for a leading @samp{:}, then a trailing @samp{:}, then a doubled
+@samp{:}.
+
+@flindex kdefault.c
+You can trace this by debugging ``paths'' (@pxref{Debugging}).
+Default expansion is implemented in the source file
+@file{kpathsea/kdefault.c}.
+
+
+@node Variable expansion
+@subsection Variable expansion
+
+@kindex $ @r{expansion}
+@cindex environment variables in paths
+@cindex variable expansion
+@cindex expansion, variable
+@flindex texmf.cnf@r{, and variable expansion}
+
+@samp{$foo} or @samp{$@{foo@}} in a path element is replaced by (1) the
+value of an environment variable @samp{foo} (if defined); (2) the value
+of @samp{foo} from @file{texmf.cnf} (if defined); (3) the empty string.
+
+If the character after the @samp{$} is alphanumeric or @samp{_}, the
+variable name consists of all consecutive such characters. If the
+character after the @samp{$} is a @samp{@{}, the variable name consists
+of everything up to the next @samp{@}} (braces may not be nested around
+variable names). Otherwise, Kpathsea gives a warning and ignores the
+@samp{$} and its following character.
+
+@cindex quoting variable values
+@cindex shell variables
+You must quote the @t{$}'s and braces as necessary for your shell.
+@emph{Shell} variable values cannot be seen by Kpathsea, i.e., ones
+defined by @code{set} in C shells and without @code{export} in Bourne
+shells.
+
+For example, given
+@example
+setenv tex /home/texmf
+setenv TEXINPUTS .:$tex:$@{tex@}prev
+@end example
+@noindent the final @code{TEXINPUTS} path is the three directories:
+@example
+.:/home/texmf:/home/texmfprev
+@end example
+
+The @samp{.@var{progname}} suffix on variables and
+@samp{_@var{progname}} on environment variable names are not implemented
+for general variable expansions. These are only recognized when search
+paths are initialized (@pxref{Path sources}).
+
+@flindex variable.c
+Variable expansion is implemented in the source file
+@file{kpathsea/variable.c}.
+
+
+@node Tilde expansion
+@subsection Tilde expansion
+
+@kindex ~ @r{expansion}
+@cindex home directories in paths
+@cindex tilde expansion
+@cindex expansion, tilde
+
+@vindex HOME@r{, as ~ expansion}
+A leading @samp{~} in a path element is replaced by the value of the
+environment variable @code{HOME}, or @file{.} if @code{HOME} is not set.
+
+A leading @samp{~@var{user}} in a path element is replaced by
+@var{user}'s home directory from the system @file{passwd} database.
+
+For example,
+@example
+setenv TEXINPUTS ~/mymacros:
+@end example
+
+@noindent will prepend a directory @file{mymacros} in your home
+directory to the default path.
+
+@cindex @t{root} user
+@cindex trailing @samp{/} in home directory
+@kindex /@r{, trailing in home directory}
+As a special case, if a home directory ends in @samp{/}, the trailing
+slash is dropped, to avoid inadvertently creating a @samp{//} construct
+in the path. For example, if the home directory of the user @samp{root}
+is @samp{/}, the path element @samp{~root/mymacros} expands to just
+@samp{/mymacros}, not @samp{//mymacros}.
+
+@flindex tilde.c
+Tilde expansion is implemented in the source file @file{kpathsea/tilde.c}.
+
+
+@node Brace expansion
+@subsection Brace expansion
+
+@kindex @{ @r{expansion}
+@cindex brace expansion
+
+@samp{x@{@var{a},@var{b}@}y} expands to @samp{x@var{a}y:x@var{b}y}.
+For example:
+
+@example
+foo/@{1,2@}/baz
+@end example
+
+@noindent expands to @samp{foo/1/baz:foo/2/baz}. @samp{:} is the path
+separator on the current system; e.g., on a DOS system, it's @samp{;}.
+
+Braces can be nested; for example, @samp{x@{A,B@{1,2@}@}y} expands to
+@samp{xAy:xB1y:xB2y}.
+
+Multiple non-nested braces are expanded from right to left; for example,
+@samp{x@{A,B@}@{1,2@}y} expands to @samp{x@{A,B@}1y:x@{A,B@}2y}, which
+expands to @samp{xA1y:xB1y:xA2y:xB2y}.
+
+@cindex multiple @TeX{} hierarchies
+This feature can be used to implement multiple @TeX{} hierarchies, by
+assigning a brace list to @code{$TEXMF}, as mentioned in
+@file{texmf.in}.
+
+You can also use the path separator in stead of the comma. The last
+example could have been written @samp{x@{A:B@}@{1:2@}y}.
+
+
+@flindex expand.c
+Brace expansion is implemented in the source file
+@file{kpathsea/expand.c}. It is a modification of the Bash sources, and
+is thus covered by the GNU General Public License, rather than the
+Library General Public License that covers the rest of Kpathsea.
+
+
+@node KPSE_DOT expansion
+@subsection @code{KPSE_DOT} expansion
+
+@kindex KPSE_DOT @r{expansion}
+
+When @code{KPSE_DOT} is defined in the environment, it names a directory
+that should be considered the current directory for the purpose of
+looking up files in the search paths. This feature is needed by the
+@samp{mktex@dots{}} scripts @ref{mktex scripts}, because these
+change the working directory. You should not ever define it yourself.
+
+
+@node Subdirectory expansion
+@subsection Subdirectory expansion
+
+@kindex //
+@cindex subdirectory searching
+@cindex expansion, subdirectory
+
+@cindex alphabetical order, not
+Two or more consecutive slashes in a path element following a directory
+@var{d} is replaced by all subdirectories of @var{d}: first those
+subdirectories directly under @var{d}, then the subsubdirectories under
+those, and so on. At each level, the order in which the directories are
+searched is unspecified. (It's ``directory order'', and definitely not
+alphabetical.)
+
+If you specify any filename components after the @samp{//}, only
+subdirectories which match those components are included. For example,
+@samp{/a//b} would expand into directories @file{/a/1/b}, @file{/a/2/b},
+@file{/a/1/1/b}, and so on, but not @file{/a/b/c} or @file{/a/1}.
+
+You can include multiple @samp{//} constructs in the path.
+
+@samp{//} at the beginning of a path is ignored; you didn't really want
+to search every directory on the system, did you?
+
+@cindex trick for detecting leaf directories
+@cindex leaf directory trick
+@cindex Farwell, Matthew
+@cindex MacKenzie, David
+I should mention one related implementation trick, which I took from GNU
+find. Matthew Farwell suggested it, and David MacKenzie implemented it.
+
+@vindex st_nlink
+The trick is that in every real Unix implementation (as opposed to the
+POSIX specification), a directory which contains no subdirectories will
+have exactly two links (namely, one for @file{.} and one for @file{..}).
+That is to say, the @code{st_nlink} field in the @samp{stat} structure
+will be two. Thus, we don't have to stat everything in the bottom-level
+(leaf) directories---we can just check @code{st_nlink}, notice it's two,
+and do no more work.
+
+But if you have a directory that contains a single subdirectory and 500
+regular files, @code{st_nlink} will be 3, and Kpathsea has to stat every
+one of those 501 entries. Therein lies slowness.
+
+@vindex UNIX_ST_LINK
+You can disable the trick by undefining @code{UNIX_ST_LINK} in
+@file{kpathsea/config.h}. (It is undefined by default except under Unix.)
+
+@flindex elt-dirs.c
+Unfortunately, in some cases files in leaf directories are
+@code{stat}'d: if the path specification is, say,
+@samp{$TEXMF/fonts//pk//}, then files in a subdirectory
+@samp{@dots{}/pk}, even if it is a leaf, are checked. The reason cannot
+be explained without reference to the implementation, so read
+@file{kpathsea/elt-dirs.c} (search for @samp{may descend}) if you are
+curious. And if you can find a way to @emph{solve} the problem, please
+let me know.
+
+@flindex elt-dirs.c
+Subdirectory expansion is implemented in the source file
+@file{kpathsea/elt-dirs.c}.
+
+
+@node Filename database
+@section Filename database (@code{ls-R})
+
+@cindex filename database
+@cindex database, for filenames
+@cindex externally-built filename database
+
+Kpathsea goes to some lengths to minimize disk accesses for searches
+(@pxref{Subdirectory expansion}). Nevertheless, at installations with
+enough directories, searching each possible directory for a given file
+can take an excessively long time (depending on the speed of the disk,
+whether it's NFS-mounted, how patient you are, etc.).
+
+In practice, a font tree containing the standard PostScript and PCL
+fonts is large enough for searching to be noticeably slow on typical
+systems these days. Therefore, Kpathsea can use an externally-built
+``database'' file named @file{ls-R} that maps files to directories, thus
+avoiding the need to exhaustively search the disk.
+
+A second database file @file{aliases} allows you to give additional
+names to the files listed in @file{ls-R}. This can be helpful to adapt
+to ``8.3'' filename conventions in source files.
+
+The @file{ls-R} and @file{aliases} features are implemented in the
+source file @file{kpathsea/db.c}.
+
+@menu
+* ls-R:: The main filename database.
+* Filename aliases:: Aliases for those names.
+* Database format:: Syntax details of the database file.
+@end menu
+
+
+@node ls-R
+@subsection @file{ls-R}
+
+@flindex ls-R @r{database file}
+@vindex TEXMFDBS
+
+As mentioned above, you must name the main filename database
+@file{ls-R}. You can put one at the root of each @TeX{} installation
+hierarchy you wish to search (@code{$TEXMF} by default); most sites have
+only one hierarchy. Kpathsea looks for @file{ls-R} files along the
+@code{TEXMFDBS} path, so that should presumably match the list of
+hierarchies.
+
+The recommended way to create and maintain @samp{ls-R} is to run the
+@code{mktexlsr} script, which is installed in @samp{$(bindir)}
+(@file{/usr/local/bin} by default). That script goes to some trouble to
+follow symbolic links as necessary, etc. It's also invoked by the
+distributed @samp{mktex@dots{}} scripts.
+
+@flindex ls-R@r{, simplest build}
+At its simplest, though, you can build @file{ls-R} with the command
+@example
+cd @var{/your/texmf/root} && ls -LAR ./ >ls-R
+@end example
+
+@noindent
+@opindex --color=tty
+@flindex /etc/profile @r{and aliases}
+presuming your @code{ls} produces the right output format (see the
+section below). GNU @code{ls}, for example, outputs in this format.
+Also presuming your @code{ls} hasn't been aliased in a system file
+(e.g., @file{/etc/profile}) to something problematic, e.g., @samp{ls
+--color=tty}. In that case, you will have to disable the alias before
+generating @file{ls-R}. For the precise definition of the file format,
+see @ref{Database format}.
+
+Regardless of whether you use the supplied script or your own, you will
+almost certainly want to invoke it via @code{cron}, so when you make
+changes in the installed files (say if you install a new La@TeX{}
+package), @file{ls-R} will be automatically updated.
+
+@opindex -A @r{option to @code{ls}}
+@cindex dot files
+@flindex . @r{files}
+@flindex . @r{directories, ignored}
+@flindex .tex @r{file, included in @file{ls-R}}
+The @samp{-A} option to @code{ls} includes files beginning with @samp{.}
+(except for @file{.} and @file{..}), such as the file @file{.tex}
+included with the La@TeX{} tools package. (On the other hand,
+@emph{directories} whose names begin with @samp{.} are always ignored.)
+
+@cindex symbolic links, and @file{ls-R}
+@opindex -L @r{option to @code{ls}}
+If your system does not support symbolic links, omit the @samp{-L}.
+
+@cindex automounter, and @file{ls-R}
+@cindex NFS and @file{ls-R}
+@code{ls -LAR @var{/your/texmf/root}} will also work. But using
+@samp{./} avoids embedding absolute pathnames, so the hierarchy can be
+easily transported. It also avoids possible trouble with automounters
+or other network filesystem conventions.
+
+@cindex warning about unusable @file{ls-R}
+@cindex unusable @file{ls-R} warning
+Kpathsea warns you if it finds an @file{ls-R} file, but the file does
+not contain any usable entries. The usual culprit is running plain
+@samp{ls -R} instead of @samp{ls -LR ./} or @samp{ls -R
+@var{/your/texmf/root}}. Another possibility is some system directory
+name starting with a @samp{.} (perhaps if you are using AFS); Kpathsea
+ignores everything under such directories.
+
+@kindex !! @r{in path specifications}
+@cindex disk searching, avoiding
+Because the database may be out-of-date for a particular run, if a file
+is not found in the database, by default Kpathsea goes ahead and
+searches the disk. If a particular path element begins with @samp{!!},
+however, @emph{only} the database will be searched for that element,
+never the disk. If the database does not exist, nothing will be
+searched. Because this can surprise users (``I see the font
+@file{foo.tfm} when I do an @code{ls}; why can't Dvips find it?''), it
+is not in any of the default search paths.
+
+
+@node Filename aliases
+@subsection Filename aliases
+
+@cindex filename aliases
+@cindex aliases, for filenames
+
+In some circumstances, you may wish to find a file under several names.
+For example, suppose a @TeX{} document was created using a DOS system
+and tries to read @file{longtabl.sty}. But now it's being run on a Unix
+system, and the file has its original name, @file{longtable.sty}. The
+file won't be found. You need to give the actual file
+@file{longtable.sty} an alias @samp{longtabl.sty}.
+
+@c As another example, suppose you are creating a @TeX{} distribution on a
+@c CD-ROM or a DOS system; then the file @file{mf.base} gets stored as
+@c @file{mf.bas}. But Metafont on Unix wants to find @file{mf.base}. Here
+@c you need to give the actual file @file{mf.bas} an alias @samp{mf.base}.
+
+You can handle this by creating a file @file{aliases} as a companion to
+the @file{ls-R} for the hierarchy containing the file in question. (You
+must have an @file{ls-R} for the alias feature to work.)
+
+The format of @file{aliases} is simple: two whitespace-separated words
+per line; the first is the real name @file{longtable.sty}, and second is
+the alias (@file{longtabl.sty}). These must be base filenames, with no
+directory components. @file{longtable.sty} must be in the sibling
+@file{ls-R}.
+
+Also, blank lines and lines starting with @samp{%} or @samp{#} are
+ignored in @file{aliases}, to allow for comments.
+
+If a real file @file{longtabl.sty} exists, it is used regardless of any
+aliases.
+
+
+@node Database format
+@subsection Database format
+
+@cindex format of external database
+@cindex database, format of
+
+The ``database'' read by Kpathsea is a line-oriented file of plain
+text. The format is that generated by GNU (and most other) @code{ls}
+programs given the @samp{-R} option, as follows.
+
+@itemize @bullet
+@item
+Blank lines are ignored.
+
+@item
+If a line begins with @samp{/} or @samp{./} or @samp{../} and ends with
+a colon, it's the name of a directory. (@samp{../} lines aren't useful,
+however, and should not be generated.)
+
+@item
+All other lines define entries in the most recently seen directory.
+@t{/}'s in such lines will produce possibly-strange results.
+
+@item
+Files with no preceding directory line are ignored.
+@end itemize
+
+For example, here's the first few lines of @file{ls-R} (which totals
+about 30K bytes) on my system:
+
+@example
+bibtex
+dvips
+fonts
+ls-R
+metafont
+metapost
+tex
+web2c
+
+./bibtex:
+bib
+bst
+doc
+
+./bibtex/bib:
+asi.bib
+btxdoc.bib
+@dots{}
+@end example
+
+
+@node Invoking kpsewhich
+@section @code{kpsewhich}: Standalone path searching
+
+@pindex kpsewhich
+@cindex path searching, standalone
+@cindex standalone path searching
+
+The Kpsewhich program exercises the path searching functionality
+independent of any particular application. This can also be useful as a
+sort of @code{find} program to locate files in your @TeX{} hierarchies,
+perhaps in administrative scripts. It is used heavily in the
+distributed @samp{mktex@dots{}} scripts.
+
+Synopsis:
+@example
+kpsewhich @var{option}@dots{} @var{filename}@dots{}
+@end example
+
+The options and filename(s) to look up can be intermixed.
+Options can start with either @samp{-} or @samp{--}, and any unambiguous
+abbreviation is accepted.
+
+@menu
+* Path searching options:: Changing the mode, resolution, etc.
+* Auxiliary tasks:: Path and variable expansion.
+* Standard options:: --help and --version.
+@end menu
+
+
+@node Path searching options
+@subsection Path searching options
+
+@cindex path searching options
+
+Kpsewhich looks up each non-option argument on the command line as a
+filename, and returns the first file found. There is no option to
+return all the files with a particular name (you can run the Unix
+@samp{find} utility for that, @pxref{Invoking find,,, findutils, GNU
+find utilities}).
+
+Various options alter the path searching behavior:
+
+@table @samp
+@item --dpi=@var{num}
+@opindex --dpi=@var{num}
+@opindex -D @var{num}
+@cindex resolution, setting
+Set the resolution to @var{num}; this only affects @samp{gf} and
+@samp{pk} lookups. @samp{-D} is a synonym, for compatibility with
+Dvips. Default is 600.
+
+@item --engine=@var{name}
+@opindex --engine=@var{name}
+@cindex engine name
+Set the engine name to @var{name}. By default it is not set. The
+engine name is used in some search paths to allow files with the same
+name but used by different engines to coexist.
+
+@item --format=@var{name}
+@opindex --format=@var{name}
+Set the format for lookup to @var{name}. By default, the format is
+guessed from the filename, with @samp{tex} being used if nothing else
+fits. The recognized filename extensions (including any leading
+@samp{.}) are also allowable @var{name}s.
+
+All formats also have a name, which is the only way to specify formats
+with no associated suffix. For example, for Dvips configuration files
+you can use @samp{--format="dvips config"}. (The quotes are for the
+sake of the shell.)
+
+Here's the current list of recognized names and the associated suffixes.
+@xref{Supported file formats}, for more information on each of these.
+@example
+gf: gf
+pk: pk
+bitmap font
+afm: .afm
+base: .base
+bib: .bib
+bst: .bst
+cnf: .cnf
+ls-R: ls-R
+fmt: .fmt
+map: .map
+mem: .mem
+mf: .mf
+mfpool: .pool
+mft: .mft
+mp: .mp
+mppool: .pool
+MetaPost support
+ocp: .ocp
+ofm: .ofm .tfm
+opl: .opl
+otp: .otp
+ovf: .ovf
+ovp: .ovp
+graphic/figure: .eps .epsi
+tex: .tex
+TeX system documentation
+texpool: .pool
+TeX system sources
+PostScript header/font: .pro
+Troff fonts
+tfm: .tfm
+type1 fonts: .pfa .pfb
+vf: .vf
+dvips config
+ist: .ist
+truetype fonts: .ttf .ttc
+type42 fonts
+web2c files
+other text files
+other binary files
+misc fonts
+web: .web
+cweb: .w .web
+enc: .enc
+cmap: .cmap
+sfd: .sfd
+opentype fonts
+pdftex config
+lig files: .lig
+texmfscripts
+@end example
+
+This option and @samp{--path} are mutually exclusive.
+
+@item --interactive
+@opindex --interactive
+@cindex interactive query
+After processing the command line, read additional filenames to look up
+from standard input.
+
+@item -mktex=@var{filetype}
+@itemx -no-mktex=@var{filetype}
+@opindex -mktex=@var{filetype}
+@opindex -no-mktex=@var{filetype}
+Turn on or off the @samp{mktex} script associated with @var{filetype}.
+The only values that make sense for @var{filetype} are @samp{pk},
+@samp{mf}, @samp{tex}, and @samp{tfm}. By default, all are off in
+Kpsewhich. @xref{mktex scripts}.
+
+@item --mode=@var{string}
+@opindex --mode=@var{string}
+Set the mode name to @var{string}; this also only affects @samp{gf} and
+@samp{pk} lookups. No default: any mode will be found. @xref{mktex
+script arguments}.
+
+@item --must-exist
+@opindex --must-exist
+Do everything possible to find the files, notably including searching
+the disk. By default, only the @file{ls-R} database is checked, in the
+interest of efficiency.
+
+@item --path=@var{string}
+@opindex --path=@var{string}
+Search along the path @var{string} (colon-separated as usual), instead
+of guessing the search path from the filename. @samp{//} and all the
+usual expansions are supported (@pxref{Path expansion}). This option
+and @samp{--format} are mutually exclusive. To output the complete
+directory expansion of a path, instead of doing a one-shot lookup, see
+@samp{--expand-path} in the following section.
+
+@item --progname=@var{name}
+@opindex --progname=@var{name}
+Set the program name to @var{name}; default is @samp{kpsewhich}. This
+can affect the search paths via the @samp{.@var{prognam}} feature in
+configuration files (@pxref{Config files}).
+@end table
+
+
+@node Auxiliary tasks
+@subsection Auxiliary tasks
+
+@cindex auxiliary tasks
+
+Kpsewhich provides some additional features not strictly related to path
+lookup:
+
+@itemize @bullet
+@item
+@opindex --debug=@var{num}
+@samp{--debug=@var{num}} sets the debugging options to @var{num}.
+@xref{Debugging}.
+
+@item
+@opindex --var-value=@var{variable}
+@samp{--var-value=@var{variable}} output the value of @var{variable}.
+
+@item
+@opindex --expand-braces=@var{string}
+@samp{--expand-braces=@var{string}} outputs the variable and brace
+expansion of @var{string}. @xref{Path expansion}.
+
+@item
+@opindex --expand-var=@var{string}
+@samp{--expand-var=@var{string}} outputs the variable expansion of
+@var{string}. For example, the @samp{mktex@dots{}} scripts run
+@samp{kpsewhich --expand-var='$TEXMF'} to find the root of the @TeX{} system
+hierarchy. @xref{Path expansion}.
+
+@item
+@opindex --expand-path=@var{string}
+@samp{--expand-path=@var{string}} outputs the complete expansion of
+@var{string} as a colon-separated path. This is useful to construct a
+search path for a program that doesn't accept recursive subdirectory
+specifications. Nonexistent directories are culled from the output:
+
+@example
+$ kpsewhich --expand-path '/tmp'
+@result{} /tmp
+$ kpsewhich --expand-path '/nonesuch'
+@result{}
+@end example
+
+For one-shot uses of an arbitrary (not built in to Kpathsea) path, see
+@samp{--path} in the previous section.
+
+@item
+@opindex --show-path=@var{name}
+@samp{--show-path=@var{name}} shows the path that would be used for file
+lookups of file type @var{name}. Either a filename extension
+(@samp{pk}, @samp{.vf}, etc.) or an integer can be used, just as with
+@samp{--format}, described in the previous section.
+@end itemize
+
+
+@node Standard options
+@subsection Standard options
+
+@cindex standard options
+
+Kpsewhich accepts the standard GNU options:
+
+@itemize @bullet
+@item
+@opindex --help
+@samp{--help} prints a help message on standard output and exits.
+
+@item
+@opindex --version
+@samp{--version} prints the Kpathsea version number and exits.
+@end itemize
+
+
+@node TeX support
+@chapter @TeX{} support
+
+@cindex @TeX{} support
+
+Although the basic features in Kpathsea can be used for any type of path
+searching, it came about (like all libraries) with a specific
+application in mind: I wrote Kpathsea specifically for @TeX{} system
+programs. I had been struggling with the programs I was using (Dvips,
+Xdvi, and @TeX{} itself) having slightly different notions of how to
+specify paths; and debugging was painful, since no code was shared.
+
+Therefore, Kpathsea provides some @TeX{}-specific formats and features.
+Indeed, many of the supposedly generic path searching features were
+provided because they seemed useful in that con@TeX{}t (font lookup,
+particularly).
+
+Kpathsea provides a standard way to search for files of any of the
+supported file types; glyph fonts are a bit different than all the rest.
+Searches are based solely on filenames, not file contents---if a GF
+file is named @file{cmr10.600pk}, it will be found as a PK file.
+
+@menu
+* Supported file formats:: File types Kpathsea knows about.
+* File lookup:: Searching for most kinds of files.
+* Glyph lookup:: Searching for bitmap fonts.
+* Suppressing warnings:: Avoiding warnings via TEX_HUSH.
+@end menu
+
+
+@node Supported file formats
+@section Supported file formats
+
+@cindex supported file formats
+@cindex file formats, supported
+
+@cindex environment variables for @TeX{}
+@cindex @TeX{} environment variables
+
+Kpathsea has support for a number of file types. Each file type has a
+list of environment and config file variables that are checked to define
+the search path, and most have a default suffix that plays a role in
+finding files (see the next section). Some also define additional
+suffixes, and/or a program to be run to create missing files on the fly.
+
+@cindex program-varying paths
+Since environment variables containing periods, such as
+@samp{TEXINPUTS.latex}, are not allowed on some systems, Kpathsea looks
+for environment variables with an underscore, e.g.,
+@samp{TEXINPUTS_latex} (@pxref{Config files}).
+
+The following table lists the above information.
+
+@table @samp
+@item afm
+@flindex .afm
+@vindex AFMFONTS
+(Adobe font metrics, @pxref{Metric files,,, dvips, Dvips})
+@code{AFMFONTS};
+suffix @samp{.afm}.
+
+@item base
+@flindex .base
+@vindex MFBASES
+@vindex TEXMFINI
+(Metafont memory dump, @pxref{Memory dumps,,, web2c, Web2c})
+@code{MFBASES}, @code{TEXMFINI};
+suffix @samp{.base}.
+
+@item bib
+@flindex .bib
+@vindex BIBINPUTS
+@vindex TEXBIB
+(Bib@TeX{} bibliography source, @pxref{bibtex invocation,,, web2c, Web2c})
+@code{BIBINPUTS}, @code{TEXBIB};
+suffix @samp{.bib}.
+
+@item bst
+@flindex .bst
+@vindex BSTINPUTS
+(Bib@TeX{} style file, @pxref{Basic BibTeX style files,, Basic Bib@TeX{}
+style files, web2c, Web2c})
+@code{BSTINPUTS};
+suffix @samp{.bst}.
+
+@item cmap
+@flindex .cmap
+@vindex CMAPFONTS
+(character map files)
+@code{CMAPFONTS};
+suffix @samp{.cmap}.
+
+@item cnf
+@flindex .cnf
+@vindex TEXMFCNF
+(Runtime configuration files, @pxref{Config files})
+@code{TEXMFCNF};
+suffix @samp{.cnf}.
+
+@item cweb
+@flindex .w
+@flindex .web
+@vindex CWEBINPUTS
+(CWEB input files)
+@code{CWEBINPUTS};
+suffixes @samp{.w}, @samp{.web};
+additional suffix @samp{.ch}.
+
+@item dvips config
+@vindex TEXCONFIG
+@flindex config.ps@r{, search path for}
+(Dvips @samp{config.*} files, such as @file{config.ps}, @pxref{Config
+files,,, dvips, Dvips})
+@code{TEXCONFIG}.
+
+@item enc files
+@flindex .enc
+@vindex ENCFONTS
+(encoding vectors)
+@code{ENCFONTS};
+suffix @samp{.enc}.
+
+@item fmt
+@flindex .fmt
+@vindex TEXFORMATS
+@vindex TEXMFINI
+(@TeX{} memory dump, @pxref{Memory dumps,,, web2c, Web2c})
+@code{TEXFORMATS}, @code{TEXMFINI};
+suffix @samp{.fmt}.
+
+@item gf
+@flindex gf
+@vindex GFFONTS
+@vindex GLYPHFONTS
+@vindex TEXFONTS
+(generic font bitmap, @pxref{Glyph files,,, dvips, Dvips})
+@code{@var{program}FONTS}, @code{GFFONTS}, @code{GLYPHFONTS}, @code{TEXFONTS};
+suffix @samp{gf}.
+
+@item graphic/figure
+@flindex .eps
+@flindex .epsi
+@vindex TEXPICTS
+@vindex TEXINPUTS
+(Encapsulated PostScript figures, @pxref{PostScript figures,,, dvips, Dvips})
+@code{TEXPICTS}, @code{TEXINPUTS};
+additional suffixes: @samp{.eps}, @samp{.epsi}.
+
+@item ist
+@flindex .ist
+@vindex TEXINDEXSTYLE
+@vindex INDEXSTYLE
+(makeindex style files)
+@code{TEXINDEXSTYLE}, @code{INDEXSTYLE};
+suffix @samp{.ist}.
+
+@item lig files
+@flindex .lig
+@vindex LIGFONTS
+(ligature definition files)
+@code{LIGFONTS};
+suffix @samp{.lig}.
+
+@item ls-R
+@flindex ls-R
+@vindex TEXMFDBS
+(Filename databases, @pxref{Filename database})
+@code{TEXMFDBS}.
+
+@item map
+@flindex .map
+@vindex TEXFONTMAPS
+(Fontmaps, @pxref{Fontmap})
+@code{TEXFONTMAPS};
+suffix @samp{.map}.
+
+@item mem
+@flindex .mem
+@vindex MPMEMS
+@vindex TEXMFINI
+(MetaPost memory dump, @pxref{Memory dumps,,, web2c, Web2c})
+@code{MPMEMS}, @code{TEXMFINI};
+suffix @samp{.mem}.
+
+@item @r{MetaPost support}
+@vindex MPSUPPORT
+(MetaPost support files, used by DMP; @pxref{dmp invocation,,, web2c, Web2c})
+@code{MPSUPPORT}.
+
+@item mf
+@flindex .mf
+@vindex MFINPUTS
+(Metafont source, @pxref{mf invocation,,, web2c, Web2c})
+@code{MFINPUTS};
+suffix @samp{.mf};
+dynamic creation program: @code{mktexmf}.
+
+@item mfpool
+@flindex .pool
+@vindex MFPOOL
+(Metafont program strings, @pxref{pooltype invocation,,, web2c, Web2c})
+@code{MFPOOL}, @code{TEXMFINI};
+suffix @samp{.pool}.
+
+@item mft
+@flindex .mft
+@vindex MFTINPUTS
+(@code{MFT} style file, @pxref{mft invocation,,, web2c, Web2c})
+@code{MFTINPUTS};
+suffix @samp{.mft}.
+
+@item misc fonts
+@vindex MISCFONTS
+(font-related files that don't fit the other categories)
+@code{MISCFONTS}
+
+@item mp
+@flindex .mp
+@vindex MPINPUTS
+(MetaPost source, @pxref{mpost invocation,,, web2c, Web2c})
+@code{MPINPUTS};
+suffix @samp{.mp}.
+
+@item mppool
+@flindex .pool
+@vindex MPPOOL
+(MetaPost program strings, @pxref{pooltype invocation,,, web2c, Web2c})
+@code{MPPOOL}, @code{TEXMFINI};
+suffix @samp{.pool}.
+
+@item ocp
+@flindex .ocp
+@vindex OCPINPUTS
+(Omega compiled process files)
+@code{OCPINPUTS}; @*
+suffix @samp{.ocp};
+dynamic creation program: @code{MakeOmegaOCP}.
+
+@item ofm
+@flindex .ofm
+@vindex OFMFONTS
+(Omega font metrics)
+@code{OFMFONTS}, @code{TEXFONTS}; @*
+suffixes @samp{.ofm}, @samp{.tfm};
+dynamic creation program: @code{MakeOmegaOFM}.
+
+@item opentype fonts
+@vindex OPENTYPEFONTS
+(OpenType fonts)
+@code{OPENTYPEFONTS}.
+
+@item opl
+@flindex .opl
+(Omega property lists)
+@code{OPLFONTS}, @code{TEXFONTS};
+suffix @samp{.opl}.
+
+@item otp
+@flindex .otp
+@vindex OTPINPUTS
+(Omega translation process files)
+@code{OTPINPUTS};
+suffix @samp{.otp}.
+
+@item ovf
+@flindex .ovf
+@vindex OVFFONTS
+(Omega virtual fonts)
+@code{OVFFONTS}, @code{TEXFONTS};
+suffix @samp{.ovf}.
+
+@item ovp
+@flindex .ovp
+@vindex OVPFONTS
+(Omega virtual property lists)
+@code{OVPFONTS}, @code{TEXFONTS};
+suffix @samp{.ovp}.
+
+@item pdftex config
+@vindex PDFTEXCONFIG
+(PDF@TeX{}-specific configuration files)
+@code{PDFTEXCONFIG}.
+
+@item pk
+@flindex .pk
+@vindex PKFONTS
+@vindex TEXPKS
+@vindex GLYPHFONTS
+@vindex TEXFONTS
+(packed bitmap fonts, @pxref{Glyph files,,, dvips, Dvips})
+@code{@var{PROGRAM}FONTS} (@var{program} being @samp{XDVI}, etc.),
+@code{PKFONTS}, @code{TEXPKS}, @code{GLYPHFONTS}, @code{TEXFONTS};
+suffix @samp{pk};
+dynamic creation program: @code{mktexpk}.
+
+@item PostScript header
+@flindex .pro
+@vindex TEXPSHEADERS
+@vindex PSHEADERS
+(downloadable PostScript, @pxref{Header files,,, dvips, Dvips})
+@code{TEXPSHEADERS}, @code{PSHEADERS};
+additional suffix @samp{.pro}.
+
+@item subfont definition files
+@flindex .sfd
+@vindex SFDFONTS
+(subfont definition files)
+@code{SFDFONTS}
+suffix @samp{.sfd}.
+
+@item tex
+@flindex .tex
+@vindex TEXINPUTS
+(@TeX{} source, @pxref{tex invocation,,, web2c, Web2c})
+@code{TEXINPUTS};
+suffix @samp{.tex};
+additional suffixes: none, because such a list cannot be complete;
+dynamic creation program: @code{mktextex}.
+
+@item TeX system documentation
+@flindex doc files
+@vindex TEXDOCS
+(Documentation files for the @TeX{} system)
+@code{TEXDOCS}.
+
+@item TeX system sources
+@flindex source files
+@vindex TEXSOURCES
+(Source files for the @TeX{} system)
+@code{TEXSOURCES}.
+
+@item texmfscripts
+@vindex TEXMFSCRIPTS
+(Architecture-independent executables distributed in the texmf tree)
+@code{TEXMFSCRIPTS}.
+
+@item texpool
+@flindex .pool
+@vindex TEXPOOL
+(@TeX{} program strings, @pxref{pooltype invocation,,, web2c, Web2c})
+@code{TEXPOOL}, @code{TEXMFINI};
+suffix @samp{.pool}.
+
+@item tfm
+@flindex .tfm
+@vindex TFMFONTS
+@vindex TEXFONTS
+(@TeX{} font metrics, @pxref{Metric files,,, dvips, Dvips})
+@code{TFMFONTS}, @code{TEXFONTS};
+suffix @samp{.tfm};
+dynamic creation program: @code{mktextfm}.
+
+@item Troff fonts
+@vindex TRFONTS
+(Troff fonts, used by DMP; @pxref{DMP invocation,,, web2c, Web2c})
+@code{TRFONTS}.
+
+@item truetype fonts
+@flindex .ttf
+@flindex .ttc
+@vindex TTFONTS
+(TrueType outline fonts) @code{TTFONTS}; suffixes @samp{.ttf},
+@samp{.ttc}.
+
+@item type1 fonts
+@flindex .pfa
+@flindex .pfb
+@vindex T1FONTS
+@vindex T1INPUTS
+@vindex TEXPSHEADERS
+@vindex DVIPSHEADERS
+(Type 1 PostScript outline fonts, @pxref{Glyph files,,, dvips, Dvips})
+@code{T1FONTS}, @code{T1INPUTS}, @code{TEXPSHEADERS}, @code{DVIPSHEADERS};
+suffixes @samp{.pfa}, @samp{.pfb}.
+
+@item type42 fonts
+@vindex T42FONTS
+(Type 42 PostScript outline fonts) @code{T42FONTS}.
+
+@item vf
+@flindex .vf
+@vindex VFFONTS
+@vindex TEXFONTS
+(virtual fonts, @pxref{Virtual fonts,,, dvips, Dvips})
+@code{VFFONTS}, @code{TEXFONTS};
+suffix @samp{.vf}.
+
+@item web
+@flindex .web
+@vindex WEBINPUTS
+(WEB input files)
+@code{WEBINPUTS};
+suffix @samp{.web};
+additional suffix @samp{.ch}.
+
+@item web2c files
+@vindex WEB2C
+(files specific to the web2c implementation)
+@code{WEB2C}.
+@end table
+
+There are two special cases, because the paths and environment variables
+always depend on the name of the program: the variable name is
+constructed by converting the program name to upper case, and then
+appending @samp{INPUTS}. Assuming the program is called @samp{foo},
+this gives us the following table.
+
+@table @samp
+@item other text files
+@vindex FOOINPUTS
+(text files used by @samp{foo})
+@code{FOOINPUTS}.
+
+@item other binary files
+@vindex FOOINPUTS
+(binary files used by @samp{foo})
+@code{FOOINPUTS}.
+@end table
+
+If an environment variable by these names are set, the corresponding
+@file{texmf.cnf} definition won't be looked at (unless, as usual, the
+environment variable value has an extra @samp{:}). @xref{Default
+expansion}.
+
+For the font variables, the intent is that:
+@itemize @bullet
+@item
+@code{TEXFONTS} is the default for everything.
+
+@item
+@code{GLYPHFONTS} is the default for bitmap (or, more precisely,
+non-metric) files.
+
+@item
+Each font format has a variable of its own.
+
+@item
+@vindex XDVIFONTS
+@vindex DVIPSFONTS
+Each program has its own font override path as well; e.g.,
+@code{DVIPSFONTS} for Dvipsk. Again, this is for bitmaps, not metrics.
+
+@end itemize
+
+
+@node File lookup
+@section File lookup
+
+@cindex file lookup
+@cindex searching for files
+@cindex @TeX{} file lookup
+
+This section describes how Kpathsea searches for most files (bitmap font
+searches are the exception, as described in the next section).
+
+Here is the search strategy for a file @var{name}:
+@enumerate
+@item
+If the file format defines default suffixes, and the suffix of
+@var{name} name is not already a known suffix for that format, try the
+name with each default appended, and use alternative names found in the
+fontmaps if necessary. We postpone searching the disk as long as
+possible. Example: given @samp{foo.sty}, look for @samp{foo.sty.tex}
+before @samp{foo.sty}. This is unfortunate, but allows us to find
+@samp{foo.bar.tex} before @samp{foo.bar} if both exist and we were given
+@samp{foo.bar}.
+
+@item
+Search for @var{name}, and if necessary for alternative names found in
+the fontmaps. Again we avoid searching the disk if possible. Example:
+given @samp{foo}, we look for @samp{foo}.
+
+@item
+If the file format defines a program to invoke to create missing files,
+run it (@pxref{mktex scripts}).
+@end enumerate
+
+@flindex tex-file.c
+@findex kpse_find_file
+This is implemented in the routine @code{kpse_find_file} in
+@file{kpathsea/tex-file.c}. You can watch it in action with the
+debugging options (@pxref{Debugging}).
+
+
+@node Glyph lookup
+@section Glyph lookup
+
+@cindex glyph lookup
+@cindex searching for glyphs
+@cindex @TeX{} glyph lookup
+
+This section describes how Kpathsea searches for a bitmap font in GF or
+PK format (or either) given a font name (e.g., @samp{cmr10}) and a
+resolution (e.g., 600).
+
+Here is an outline of the search strategy (details in the sections
+below) for a file @var{name} at resolution @var{dpi}. The search stops
+at the first successful lookup.
+
+@enumerate
+@item
+Look for an existing file @var{name}.@var{dpi}@var{format} in the
+specified format(s).
+
+@item If @var{name} is an alias for a file @var{f} in the fontmap
+file @file{texfonts.map}, look for @var{f}.@var{dpi}.
+
+@item Run an external program (typically named @samp{mktexpk}) to
+generate the font (@pxref{mktex scripts})
+
+@item Look for @var{fallback}.@var{dpi}, where @var{fallback} is some
+last-resort font (typically @samp{cmr10}).
+@end enumerate
+
+@flindex tex-glyph.c
+@findex kpse_find_glyph_format
+This is implemented in @code{kpse_find_glyph_format} in
+@file{kpathsea/tex-glyph.c}.
+
+@menu
+* Basic glyph lookup:: Features common to all glyph lookups.
+* Fontmap:: Aliases for fonts.
+* Fallback font:: Resolutions and fonts of last resort.
+@end menu
+
+
+@node Basic glyph lookup
+@subsection Basic glyph lookup
+
+@cindex basic glyph lookup
+@cindex common features in glyph lookup
+
+When Kpathsea looks for a bitmap font @var{name} at resolution @var{dpi}
+in a format @var{format}, it first checks each directory in the search
+path for a file @samp{@var{name}.@var{dpi}@var{format}}; for example,
+@samp{cmr10.600pk}. Kpathsea looks for a PK file first, then a GF file.
+
+If that fails, Kpathsea looks for
+@samp{dpi@var{dpi}/@var{name}.@var{format}}; for example,
+@samp{dpi600/cmr10.pk}. This is how fonts are typically stored on
+filesystems (such as DOS) that permit only three-character extensions.
+
+@cindex tolerance for glyph lookup
+@cindex glyph lookup bitmap tolerance
+@findex KPSE_BITMAP_TOLERANCE
+If that fails, Kpathsea looks for a font with a close-enough @var{dpi}.
+``Close enough'' is defined by the macro @code{KPSE_BITMAP_TOLERANCE} in
+@file{kpathsea/tex-glyph.h} to be @code{@var{dpi} / 500 + 1}. This is
+slightly more than the 0.2% minimum allowed by the DVI standard
+(@url{@var{CTAN:}/dviware/driv-standard/level-0}).
+
+
+@node Fontmap
+@subsection Fontmap
+
+@cindex fontmap files
+@cindex font alias files
+@cindex aliases for fonts
+
+@flindex texfonts.map
+If a bitmap font or metric file is not found with the original name (see
+the previous section), Kpathsea looks through any @dfn{fontmap} files
+for an @dfn{alias} for the original font name. These files are named
+@file{texfonts.map} and searched for along the @code{TEXFONTMAPS}
+environment/config file variable. All @file{texfonts.map} files that
+are found are read; earlier definitions override later ones.
+
+This feature is intended to help in two respects:
+
+@enumerate
+
+@item
+@cindex fontnames, arbitrary length
+An alias name is limited in length only by available memory, not by your
+filesystem. Therefore, if you want to ask for @samp{Times-Roman}
+instead of @file{ptmr}, you can (you get @samp{ptmr8r}).
+
+@item
+@cindex circle fonts
+@flindex lcircle10
+A few fonts have historically had multiple names: specifically,
+La@TeX{}'s ``circle font'' has variously been known as @file{circle10},
+@file{lcircle10}, and @file{lcirc10}. Aliases can make all the names
+equivalent, so that it no longer matters what the name of the installed
+file is; @TeX{} documents will find their favorite name.
+
+@end enumerate
+
+The format of fontmap files is straightforward:
+
+@itemize @bullet
+@cindex comments, in fontmap files
+@item Comments start with @samp{%} and continue to the end of the line.
+@cindex whitespace, in fontmap files
+@item Blank lines are ignored.
+@item Each nonblank line is broken up into a series of @dfn{words}:
+ a sequence of non-whitespace characters.
+@findex include @r{fontmap directive}
+@item If the first word is @samp{include}, the second word is used as
+ a filename, and it is searched for and read.
+@item Otherwise, the first word on each line is the true filename;
+@item the second word is the alias;
+@item subsequent words are ignored.
+@end itemize
+
+If an alias has an extension, it matches only those files with that
+extension; otherwise, it matches anything with the same root, regardless
+of extension. For example, an alias @samp{foo.tfm} matches only when
+@file{foo.tfm} is being searched for; but an alias @samp{foo} matches
+@file{foo.vf}, @file{foo.600pk}, etc.
+
+As an example, here is an excerpt from the @file{texfonts.map} in the
+Web2c distribution. It makes the circle fonts equivalent and includes
+automatically generated maps for most PostScript fonts available from
+various font suppliers.
+
+@example
+circle10 lcircle10
+circle10 lcirc10
+lcircle10 circle10
+lcircle10 lcirc10
+lcirc10 circle10
+lcirc10 lcircle10
+@dots{}
+include adobe.map
+include apple.map
+include bitstrea.map
+@dots{}
+@end example
+
+Fontmaps are implemented in the file @file{kpathsea/fontmap.c}.
+The Fontname distribution has much more information on font naming
+(@pxref{Introduction,,, fontname, Filenames for @TeX{} fonts}).
+
+
+@node Fallback font
+@subsection Fallback font
+
+@cindex fallback font
+@cindex fallback resolutions
+@cindex font of last resort
+@cindex resolutions, last-resort
+@cindex last-resort font
+
+@vindex DVIPSSIZES
+@vindex XDVISIZES
+@vindex DVILJSIZES
+@vindex TEXSIZES
+@vindex default_texsizes
+If a bitmap font cannot be found or created at the requested size,
+Kpathsea looks for the font at a set of @dfn{fallback resolutions}. You
+specify these resolutions as a colon-separated list (like search paths).
+Kpathsea looks first for a program-specific environment variable (e.g.,
+@code{DVIPSSIZES} for Dvipsk), then the environment variable
+@code{TEXSIZES}, then a default specified at compilation time (the Make
+variable @code{default_texsizes}). You can set this list to be empty if
+you prefer to find fonts at their stated size or not at all.
+
+@flindex cmr10@r{, as fallback font}
+@vindex kpse_fallback_font
+Finally, if the font cannot be found even at the fallback resolutions,
+Kpathsea looks for a fallback font, typically @file{cmr10}. Programs
+must enable this feature by assigning to the global variable
+@code{kpse_fallback_font} or calling @code{kpse_init_prog}
+(@pxref{Calling sequence}); the default is no fallback font.
+
+
+@node Suppressing warnings
+@section Suppressing warnings
+
+@cindex warnings, suppressing
+@cindex suppressing warnings
+
+@vindex TEX_HUSH
+Kpathsea provides a way to suppress selected usually-harmless warnings;
+this is useful at large sites where most users are not administrators,
+and thus the warnings are merely a source of confusion, not a help. To
+do this, you set the environment variable or configuration file value
+@code{TEX_HUSH} to a colon-separated list of values. Here are the
+possibilities:
+
+@vtable @samp
+@item all
+Suppress everything possible.
+
+@item checksum
+@cindex mismatched checksum warnings
+Suppress mismatched font checksum warnings.
+
+@item lostchar
+@cindex missing character warnings
+Suppress warnings when a character is missing from a font that a DVI or
+VF file tries to typeset.
+
+@item none
+Don't suppress any warnings.
+
+@item readable
+@cindex unreadable file warnings
+Suppress warnings about attempts to access a file whose permissions
+render it unreadable.
+
+@item special
+@cindex unknown special warnings
+@findex \special@r{, suppressing warnings about}
+Suppresses warnings about an unimplemented or unparsable
+@samp{\special} command.
+@end vtable
+
+@noindent @file{tex-hush.c} defines the function that checks the
+variable value. Each driver implements its own checks where
+appropriate.
+
+
+@node Programming
+@chapter Programming
+
+This chapter is for programmers who wish to use Kpathsea.
+@xref{Introduction}, for the conditions under which you may do so.
+
+@menu
+* Overview: Programming overview. Introduction.
+* Calling sequence:: Specifics of what to call.
+* Program-specific files:: How to handle these.
+* Config: Programming with config files. Getting info from texmf.cnf.
+@end menu
+
+
+@node Programming overview
+@section Programming overview
+
+@cindex programming overview
+@cindex overview of programming with Kpathsea
+
+Aside from this manual, your best source of information is the source to
+the programs I've modified to use Kpathsea (@pxref{Introduction}). Of
+those, Dviljk is probably the simplest, and hence a good place to start.
+Xdvik adds VF support and the complication of X resources. Dvipsk adds
+the complication of its own config files. Web2c is source code I also
+maintain, so it uses Kpathsea rather straightforwardly, but is of course
+complicated by the Web to C translation. Finally, Kpsewhich is a small
+utility program whose sole purpose is to exercise the main
+path-searching functionality.
+
+@flindex pathsearch.h
+@flindex tex-file.h
+@flindex tex-glyph.h
+@flindex kpathsea.h
+Beyond these examples, the @file{.h} files in the Kpathsea source
+describe the interfaces and functionality (and of course the @file{.c}
+files define the actual routines, which are the ultimate documentation).
+@file{pathsearch.h} declares the basic searching routine.
+@file{tex-file.h} and @file{tex-glyph.h} define the interfaces for
+looking up particular kinds of files. In view of the way the headers
+depend on each other, it is recommended to use @code{#include
+<kpathsea/kpathsea.h>}, which includes every Kpathsea header.
+
+@flindex config.h
+@flindex c-auto.h
+If you want to include only specific headers, you should still consider
+including @file{kpathsea/config.h} before including any other Kpathsea
+header, as it provides symbols used in the other headers. Note that
+@file{kpathsea/config.h} includes @file{kpathsea/c-auto.h}, which is
+generated by Autoconf.
+
+@cindex file types, registering new
+The library provides no way for an external program to register new file
+types: @file{tex-file.[ch]} must be modified to do this. For example,
+Kpathsea has support for looking up Dvips config files, even though no
+program other than Dvips will likely ever want to do so. I felt this
+was acceptable, since along with new file types should also come new
+defaults in @file{texmf.cnf} (and its descendant @file{paths.h}), since
+it's simplest for users if they can modify one configuration file for
+all kinds of paths.
+
+Kpathsea does not parse any formats itself; it barely opens any files.
+Its primary purpose is to return filenames. The GNU font utilities does
+contain libraries to read TFM, GF, and PK files, as do the programs
+above, of course.
+
+
+@node Calling sequence
+@section Calling sequence
+
+@cindex programming with Kpathsea
+@cindex calling sequence
+
+The typical way to use Kpathsea in your program goes something like this:
+
+@enumerate
+
+@item
+@findex kpse_set_program_name
+@vindex argv[0]
+Call @code{kpse_set_program_name} with @code{argv[0]} as the first
+argument; the second argument is a string or @code{NULL}. The second
+argument is used by Kpathsea as the program name for the
+@code{.@var{program}} feature of config files (@pxref{Config files}).
+If the second argument is @code{NULL}, the value of the first argument
+is used. This function must be called before any other use of the
+Kpathsea library.
+
+@vindex program_invocation_name
+@vindex program_invocation_short_name
+@vindex kpse_program_name
+@vindex KPATHSEA_DEBUG
+@cindex SELFAUTOLOC
+@cindex SELFAUTODIR
+@cindex SELFAUTOPARENT
+@cindex error message macros
+@cindex symlinks, resolving
+@cindex expanding symlinks
+If necessary, @code{kpse_set_program_name} sets the global variables
+@code{program_invocation_name} and @code{program_invocation_short_name}.
+These variables are used in the error message macros defined in
+@file{kpathsea/lib.h}. It sets the global variable
+@code{kpse_program_name} to the program name it uses. It also
+initializes debugging options based on the environment variable
+@code{KPATHSEA_DEBUG} (if that is set). Finally, it sets the variables
+@code{SELFAUTOLOC}, @code{SELFAUTODIR} and @code{SELFAUTOPARENT} to the
+location, parent and grandparent directory of the executable, removing
+@file{.} and @file{..} path elements and resolving symbolic links.
+These are used in the default configuration file to allow people to
+invoke TeX from anywhere, specifically from a mounted CD-ROM. (You can
+use @samp{--expand-var=\$SELFAUTOLOC}, etc., to see the values finds.)
+
+@item
+@findex kpse_set_progname
+@vindex argv[0]
+The @code{kpse_set_progname} is deprecated. A call to
+@code{kpse_set_progname} with @code{argv[0]} is equivalent to a call of
+@code{kpse_set_program_name} with first argument @code{argv[0]} and
+second argument @code{NULL}. The function is deprecated because it
+cannot ensure that the @code{.@var{program}} feature of config files
+will always work (@pxref{Config files}).
+
+@item
+@vindex kpathsea_debug @r{variable}
+@cindex debugging options, in Kpathsea-using program
+Set debugging options. @xref{Debugging}. If your program doesn't have a
+debugging option already, you can define one and set
+@code{kpathsea_debug} to the number that the user supplies (as in Dviljk
+and Web2c), or you can just omit this altogether (people can always set
+@code{KPATHSEA_DEBUG}). If you do have runtime debugging already, you
+need to merge Kpathsea's options with yours (as in Dvipsk and Xdvik).
+
+@item
+@vindex client_path @r{in @code{kpse_format_info}}
+@vindex kpse_format_info
+@flindex resident.c
+@cindex config files, for Kpathsea-using programs
+If your program has its own configuration files that can define search
+paths, you should assign those paths to the @code{client_path} member in
+the appropriate element of the @code{kpse_format_info} array. (This
+array is indexed by file type; see @file{tex-file.h}.) See
+@file{resident.c} in Dvipsk for an example.
+
+@item
+@findex kpse_init_prog
+@flindex proginit.h
+Call @code{kpse_init_prog} (see @file{proginit.c}). It's useful for the
+DVI drivers, at least, but for other programs it may be simpler to
+extract the parts of it that actually apply. This does not initialize
+any paths, it just looks for (and sets) certain environment variables
+and other random information. (A search path is always initialized at
+the first call to find a file of that type; this eliminates much useless
+work, e.g., initializing the Bib@TeX{} search paths in a DVI driver.)
+
+@item
+@findex kpse_find_*
+@findex kpse_find_file
+The routine to actually find a file of type @var{format} is
+@code{kpse_find_@var{format}}, defined in @file{tex-file.h}. These are
+macros that expand to a call to @file{kpse_find_file}. You can call,
+say, @code{kpse_find_tfm} after doing only the first of the
+initialization steps above---Kpathsea automatically reads the
+@file{texmf.cnf} generic config files, looks for environment variables,
+and does expansions at the first lookup.
+
+@item
+To find PK and/or GF bitmap fonts, the routines are @code{kpse_find_pk},
+@code{kpse_find_gf} and @code{kpse_find_glyph}, defined in
+@file{tex-glyph.h}. These return a structure in addition to the
+resultant filename, because fonts can be found in so many ways. See the
+documentation in the source.
+
+@item
+@findex kpse_open_file
+To actually open a file, not just return a filename, call
+@code{kpse_open_file}. This function takes the name to look up and a
+Kpathsea file format as arguments, and returns the usual @code{FILE *}.
+It always assumes the file must exist, and thus will search the disk if
+necessary (unless the search path specified @samp{!!}, etc.). In other
+words, if you are looking up a VF or some other file that need not
+exist, don't use this.
+
+@end enumerate
+
+@cindex hash table routines
+@cindex memory allocation routines
+@cindex string routines
+@cindex reading arbitrary-length lines
+@cindex input lines, reading
+@cindex lines, reading arbitrary-length
+Kpathsea also provides many utility routines. Some are generic: hash
+tables, memory allocation, string concatenation and copying, string
+lists, reading input lines of arbitrary length, etc. Others are
+filename-related: default path, tilde, and variable expansion,
+@code{stat} calls, etc. (Perhaps someday I'll move the former to a
+separate library.)
+
+@flindex c-*.h
+@pindex autoconf@r{, recommended}
+The @file{c-*.h} header files can also help your program adapt to many
+different systems. You will almost certainly want to use Autoconf for
+configuring your software if you use Kpathsea; I strongly recommend
+using Autoconf regardless. It is available from
+@url{ftp://prep.ai.mit.edu/pub/gnu/}.
+
+
+@node Program-specific files
+@section Program-specific files
+
+Many programs will need to find some configuration files. Kpathsea
+contains some support to make it easy to place them in their own
+directories. The Standard @TeX{} directory structure (@pxref{Top,,
+Introduction, tds, A Directory Structure for @TeX{} files}), specifies
+that such files should go into a subdirectory named after the program,
+like @samp{texmf/ttf2pk}.
+
+Two special formats, @samp{kpse_program_text_format} and
+@samp{kpse_program_binary_format} exist, which use
+@code{.:$TEXMF/@var{program}//} as their compiled-in search path. To
+override this default, you can use the variable
+@code{@var{PROGRAM}INPUTS} in the environment and/or @samp{texmf.cnf}.
+That is to say, the name of the variable is constructed by converting
+the name of the program to upper case, and appending @code{INPUTS}.
+
+The only difference between these two formats is whether
+@code{kpse_open_file} will open the files it finds in text or binary
+mode.
+
+
+@node Programming with config files
+@section Programming with config files
+
+@cindex programming with config files
+@cindex config files, programming with
+
+You can (and probably should) use the same @code{texmf.cnf}
+configuration file that Kpathsea uses for your program. This helps
+installers by keeping all configuration in one place.
+
+@findex kpse_var_value
+@flindex variable.h
+@vindex shell_escape@r{, example for code}
+To retrieve a value @var{var} from config files, the best way is to call
+@code{kpse_var_value} on the string @code{@var{var}}. This will look
+first for an environment variable @var{var}, then a config file value.
+The result will be the value found or @samp{NULL}. This function is
+declared in @file{kpathsea/variable.h}. For an example, see the
+@code{shell_escape} code in @file{web2c/lib/texmfmp.c}.
+
+The routine to do variable expansion in the context of a search path (as
+opposed to simply retrieving a value) is @code{kpse_var_expand}, also
+declared in @file{kpathsea/variable.h}. It's generally only necessary
+to set the search path structure components as explained in the previous
+section, rather than using this yourself.
+
+@findex kpse_cnf_get
+@flindex cnf.h
+If for some reason you want to retrieve a value @emph{only} from a
+config file, not automatically looking for a corresponding environment
+variable, call @code{kpse_cnf_get} (declared in @file{kpathsea/cnf.h})
+with the string @var{var}.
+
+No initialization calls are needed.
+
+
+@node Index
+@unnumbered Index
+
+@printindex cp
+
+@contents
+
+@bye
diff --git a/Build/source/texk/kpathsea/kpathsea.version b/Build/source/texk/kpathsea/kpathsea.version
new file mode 100644
index 00000000000..c726c646669
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpathsea.version
@@ -0,0 +1,3 @@
+# Version information for Klibtool.
+# MAJOR MINOR DELTA
+kpathsea 3 4 5
diff --git a/Build/source/texk/kpathsea/kpseaccess.man b/Build/source/texk/kpathsea/kpseaccess.man
new file mode 100644
index 00000000000..e446c2bd879
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpseaccess.man
@@ -0,0 +1,63 @@
+.TH KPSEACCESS 1 "4 January 1998" "Kpathsea @VERSION@"
+.\"=====================================================================
+.if n .ds MP MetaPost
+.if t .ds MP MetaPost
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.\"=====================================================================
+.SH NAME
+kpseaccess \- determine whether a file can be accessed
+.SH SYNOPSIS
+.B kpseaccess
+.I [-rwx]
+.I file
+.\"=====================================================================
+.SH DESCRIPTION
+Exit successfully if
+.I file
+can be accessed with the specified mode.
+The mode is one or more letters of
+.IR rwx ,
+where
+.I r
+is for readable,
+.I w
+is for writable, and
+.I x
+is for executable.
+.PP
+The difference between
+.B kpseaccess
+and
+.B test
+is that the latter looks at the permission bits, while the former
+checks using the
+.BR access (2)
+system call. This makes a difference when file systems have been
+mounted read-only.
+.\"=====================================================================
+.SH OPTIONS
+.B kpseaccess
+accepts the following additional options:
+.TP
+.B --help
+.rb
+Print help message and exit.
+.TP
+.B --version
+.rb
+Print version information and exit.
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR access (2)
diff --git a/Build/source/texk/kpathsea/kpsecheck.c b/Build/source/texk/kpathsea/kpsecheck.c
new file mode 100644
index 00000000000..02000df53d0
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpsecheck.c
@@ -0,0 +1,360 @@
+/* kpsecheck -- report about the files stored in ls-R databases.
+ Copyright (C) 1997, 2000 Fabrice Popineau.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <kpathsea/config.h>
+#include <kpathsea/lib.h>
+#include <kpathsea/hash.h>
+#include <kpathsea/getopt.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/proginit.h>
+#include <kpathsea/tex-file.h>
+#include "gs32lib.h"
+
+#include "fnmatch.h"
+
+
+/* Reading the options. */
+
+string progname = NULL;
+
+/* The device name, for $MAKETEX_MODE. (-mode) */
+string mode = NULL;
+/* Base resolution. (-D, -dpi) */
+unsigned dpi = 600;
+
+#define USAGE "\
+ Kpathsea checking about ls-R files.\n\
+\n\
+-debug=NUM set debugging flags.\n\
+\n\
+-multiple-occurences check for multiple occurences of the same file.\n\
+-exclude=<pattern> exclude any filename that matches the argument.\n\
+-include=<pattern> include only filenames that match the argument.\n\
+-file=<pattern> look for multiple occurences of the pattern.\n\
+\n\
+-shared-memory report about shared memory usage.\n\
+\n\
+-ghostscript report about the gs version installed.\n\
+\n\
+-help print this message and exit.\n\
+-version print version number and exit.\n\
+"
+
+/* Test whether getopt found an option ``A''.
+ Assumes the option index is in the variable `option_index', and the
+ option table in a variable `long_options'. */
+#define ARGUMENT_IS(a) STREQ (long_options[option_index].name, a)
+
+/* SunOS cc can't initialize automatic structs. */
+static struct option long_options[]
+ = { { "debug", 1, 0, 'd' },
+ { "exclude", 1, 0, 'x' },
+ { "include", 1, 0, 'i' },
+ { "file", 1, 0, 'f' },
+ { "multiple-occurences", 0, 0, 'm' },
+ { "shared-memory", 0, 0, 's' },
+ { "ghostscript", 0, 0, 'g' },
+ { "help", 0, 0, 'h' },
+ { "version", 0, 0, 'v' },
+ { 0, 0, 0, 0 } };
+
+boolean opt_doublons = FALSE;
+boolean opt_shared = FALSE;
+boolean opt_ghostscript = FALSE;
+
+const_string opt_file = NULL;
+
+#define CHUNK 4096
+
+string *file_list = NULL;
+int file_num = 0;
+int file_list_size = 0;
+
+#define MAX_EXCLUDE 1024
+#define MAX_INCLUDE 1024
+const_string exclude_list[MAX_EXCLUDE];
+const_string include_list[MAX_EXCLUDE];
+int nb_exclude = 0;
+int nb_include = 0;
+
+#ifdef WIN32
+#define FNM_FLAGS FNM_CASEFOLD
+#else
+#define FNM_FLAGS 0
+#endif
+
+void
+add_to_exclude_list(const_string exp)
+{
+ exclude_list[nb_exclude++] = exp;
+}
+
+void
+add_to_include_list(const_string exp)
+{
+ include_list[nb_include++] = exp;
+}
+
+void CDECL
+build_file_list P2C(const_string, key, const_string, value)
+{
+ int i;
+ string filename = concat(value, key);
+
+ if (dir_p(filename))
+ return;
+
+ for (i = 0; i < nb_exclude; i++) {
+ if (fnmatch(exclude_list[i], filename, FNM_FLAGS) == 0) {
+ return;
+ }
+ }
+
+ if (nb_include > 0) {
+ for (i = 0; i < nb_include; i++) {
+ if (fnmatch(include_list[i], filename, FNM_FLAGS) == FNM_NOMATCH)
+ return;
+ }
+ }
+
+ file_list[file_num] = filename;
+ dostounix_filename(file_list[file_num]);
+ file_num++;
+ if (file_num >= file_list_size) {
+ file_list_size += CHUNK;
+ file_list = xrealloc(file_list, file_list_size * sizeof(string));
+ }
+}
+
+int CDECL
+file_cmp(const_string s1, const_string s2)
+{
+ return FILESTRCASEEQ(xbasename(s1), xbasename(s2));
+}
+
+void
+check_for_doublons P1H(void)
+{
+ hash_table_type *db;
+ string s1 = NULL, s2 = NULL;
+ int i;
+
+ file_list = (string *)xmalloc(CHUNK * sizeof(string));
+ file_list_size = CHUNK;
+
+ db = hash_exists_p(hashtable_db);
+
+ hash_iter(db, &build_file_list);
+
+ printf("%d files in your databases.\nSorting ...\n", file_num);
+
+ qsort(file_list, file_num, sizeof(string), file_cmp);
+
+ puts("Multiple occurences :\n");
+
+ for (i = 0; i < file_num - 1; i++) {
+ if (file_cmp(file_list[i], file_list[i+1])) {
+ puts(file_list[i]);
+ puts(file_list[i+1]);
+ i++;
+ while (i < file_num - 1 && file_cmp(file_list[i], file_list[i+1])) {
+ puts(file_list[i+1]);
+ i++;
+ }
+ putchar('\n');
+ }
+ }
+ puts("End of list.\n");
+
+ for (i = 0; i < file_num; i++) free(file_list[i]);
+ free(file_list);
+}
+
+void
+check_for_shared_memory P1H(void)
+{
+ HANDLE hash_handle;
+
+ hash_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, TRUE, HASH_MAPPING_NAME);
+
+ if (hash_handle == 0) {
+ printf("No kpathsea file mapping set up.\n");
+ }
+ else {
+ printf("Kpathsea file mapping is set up.\n");
+ CloseHandle(hash_handle);
+ }
+}
+
+void
+check_for_ghostscript P1H(void)
+{
+ char *gs_path = gs_locate();
+
+ if (gs_path == NULL) {
+ printf("%s: no version of Ghostscript has been found.\n", progname);
+ return;
+ }
+
+ printf("%s: Ghostscript version %s has been found:\n",
+ progname, gs_revision);
+ printf("dll : %s\n", gs_dll);
+ printf("libpath : %s\n", gs_lib);
+}
+
+void
+usage P1H(void)
+{
+ extern KPSEDLL char *kpse_bug_address; /* from version.c */
+
+ printf ("Usage: %s [OPTION]... [FILENAME]...\n", progname);
+ fputs (USAGE, stdout);
+ putchar ('\n');
+ fputs (kpse_bug_address, stdout);
+}
+
+static void
+read_command_line P2C(int, argc, string *, argv)
+{
+ int g; /* `getopt' return code. */
+ int option_index;
+
+ for (;;) {
+ g = getopt_long_only (argc, argv, "d:mx:i:f:shv", long_options, &option_index);
+
+ if (g == -1)
+ break;
+
+ if (g == '?')
+ exit (1); /* Unknown option. */
+#if 0
+ if (ARGUMENT_IS ("debug")) {
+ kpathsea_debug |= atoi (optarg);
+
+ } else if (ARGUMENT_IS ("multiple-occurences")) {
+ opt_doublons = TRUE;
+
+ } else if (ARGUMENT_IS ("exclude")) {
+ add_to_exclude_list(optarg);
+
+ } else if (ARGUMENT_IS ("include")) {
+ add_to_include_list(optarg);
+
+ } else if (ARGUMENT_IS ("file")) {
+ opt_file = optarg;
+
+ } else if (ARGUMENT_IS ("shared-memory")) {
+ opt_shared = TRUE;
+
+ } else if (ARGUMENT_IS ("help")) {
+ usage();
+ exit (0);
+
+ } else if (ARGUMENT_IS ("version")) {
+ extern KPSEDLL char *kpathsea_version_string; /* from version.c */
+ puts (kpathsea_version_string);
+ puts ("Copyright (C) 1997 K. Berry.\n\
+There is NO warranty. You may redistribute this software\n\
+under the terms of the GNU General Public License.\n\
+For more information about these matters, see the files named COPYING.");
+ exit (0);
+ }
+#else
+ switch (g) {
+ case 'd':
+ kpathsea_debug |= atoi (optarg);
+ break;
+ case 'm':
+ opt_doublons = TRUE;
+ break;
+ case 'x':
+ add_to_exclude_list(optarg);
+ break;
+ case 'i':
+ add_to_include_list(optarg);
+ break;
+ case 'f':
+ opt_file = optarg;
+ break;
+ case 's':
+ opt_shared = TRUE;
+ break;
+ case 'g':
+ opt_ghostscript = TRUE;
+ break;
+ case 'h':
+ usage();
+ exit (0);
+ case 'v':
+ {
+ extern KPSEDLL char *kpathsea_version_string; /* from version.c */
+ puts (kpathsea_version_string);
+ puts ("Copyright (C) 1997 K. Berry.\n\
+There is NO warranty. You may redistribute this software\n\
+under the terms of the GNU General Public License.\n\
+For more information about these matters, see the files named COPYING.");
+ exit (0);
+ }
+ default:
+ fprintf(stderr, "%: unknown option.\n", progname);
+ usage();
+ exit(1);
+ }
+#endif
+
+ /* Else it was just a flag; getopt has already done the assignment. */
+ }
+
+ if (opt_doublons) {
+ for ( ; optind < argc; optind++) {
+ add_to_include_list(argv[optind]);
+ }
+ }
+ else {
+ if (optind < argc - 1) {
+ fprintf(stderr, "%s: warning, extra arguments.\n", progname);
+ }
+ }
+}
+
+int
+main P2C(int, argc, char **, argv)
+{
+ progname = argv[0];
+
+ read_command_line (argc, argv);
+
+ if (opt_shared) {
+ check_for_shared_memory();
+ }
+ else if (opt_ghostscript) {
+ check_for_ghostscript();
+ }
+ else if (opt_doublons) {
+
+ kpse_set_program_name (argv[0], progname);
+ /* NULL for no fallback font. */
+ kpse_init_prog (uppercasify (kpse_program_name), dpi, mode, NULL);
+
+ check_for_doublons();
+ }
+ else {
+ usage();
+ }
+
+ return 0;
+}
diff --git a/Build/source/texk/kpathsea/kpsecheck.rc b/Build/source/texk/kpathsea/kpsecheck.rc
new file mode 100644
index 00000000000..d7512dbb057
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpsecheck.rc
@@ -0,0 +1,34 @@
+/* kpsecheck.rc: kpsecheck resources -*- C++ -*-
+
+ Copyright (C) 1996-2003 Fabrice Popineau <fabrice.popineau@supelec.fr>
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ This file 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 file; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#include <texlive-version.h>
+
+#define VER_FILEVERSION TEXLIVE_MAJOR_VERSION,TEXLIVE_MINOR_VERSION,TEXLIVE_BETA_NUMBER,TEXLIVE_ALPHA_NUMBER
+#define VER_FILEVERSION_STR TEXLIVE_PRODUCTVERSION_STR " kpsecheck 3.4.4"
+
+#define VER_INTERNALNAME_STR "kpsecheck"
+#define VER_ORIGINALFILENAME_STR "kpsecheck.exe"
+
+#define VER_LEGALCOPYRIGHT_STR "Copyright (C) 1993-2003 Fabrice Popineau and the Free Software Foundation"
+
+#define VER_FILEDESCRIPTION_STR "Tool for win32 specific features of kpathsea"
+
+#include <texlive.version>
+
+/* kpsecheck.rc ends here */
diff --git a/Build/source/texk/kpathsea/kpsereadlink.man b/Build/source/texk/kpathsea/kpsereadlink.man
new file mode 100644
index 00000000000..79b86e3b4fd
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpsereadlink.man
@@ -0,0 +1,32 @@
+.TH KPSEREADLINK 1 "4 January 1998" "Kpathsea @VERSION@"
+.\"=====================================================================
+.SH NAME
+kpsereadlink \- print contents of symbolic link
+.SH SYNOPSIS
+.B kpsereadlink
+.I file
+.\"=====================================================================
+.SH DESCRIPTION
+If
+.I file
+is a symbolic link, print its contents (what it links to), and exit
+successfully. Exit with a failure otherwise.
+.PP
+On systems that do not support symbolic links,
+.B kpsereadlink
+will always fail.
+.\"=====================================================================
+.SH OPTIONS
+.B kpsereadlink
+accepts the following additional options:
+.TP
+.B --help
+.rb
+Print help message and exit.
+.TP
+.B --version
+.rb
+Print version information and exit.
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR readlink (2)
diff --git a/Build/source/texk/kpathsea/kpsestat.c b/Build/source/texk/kpathsea/kpsestat.c
new file mode 100644
index 00000000000..094dc331d57
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpsestat.c
@@ -0,0 +1,128 @@
+/* kpsestat -- show file permissions of a file in octal form.
+
+ Copyright 1997, 2000, 2001, 2005 Olaf Weber.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ * kpsestat mode x
+ * Print stat bits of file x on stdout, as modified by mode.
+ */
+
+int
+main P2C(int, argc, char **, argv)
+{
+ char * mode_string;
+ int to_set, to_keep, to_clear;
+ int result;
+ struct stat f;
+
+ if (argc > 1 && strcmp (argv[1], "--help") == 0) {
+ printf ("Usage: %s MODE FILE\n\
+ Print octal permissions of FILE as modified by MODE on standard output.\n\
+ MODE is a subset of the symbolic permissions accepted by chmod.\n\
+ Use MODE = to obtain the unchanged permissions.\n\
+\n\
+--help display this help and exit\n\
+--version output version information and exit\n\n", argv[0]);
+ fputs ("Email bug reports to tex-k@mail.tug.org.\n", stdout);
+ exit(0);
+ } else if (argc > 1 && strcmp (argv[1], "--version") == 0) {
+ printf ("%s (%s)\n\
+Copyright (C) 1997 Olaf Weber.\n\
+There is NO warranty. You may redistribute this software\n\
+under the terms of the GNU General Public License.\n\
+For more information about these matters, see the file named GPL.\n\
+Primary author of %s: Olaf Weber.\n",
+argv[0], KPSEVERSION, argv[0]);
+ exit (0);
+ }
+
+ /* insist on exactly two args */
+ if (argc != 3) {
+ fprintf (stderr, "%s: Need exactly two arguments.\n\
+Try `%s --help' for more information.\n", argv[0], argv[0]);
+ exit(1);
+ }
+
+ mode_string = argv[1];
+ to_set = to_keep = to_clear = 0;
+ for (;;++mode_string) {
+ int affected = 0;
+ int action = 0;
+ int value = 0;
+
+ for (;;++mode_string)
+ switch (*mode_string) {
+ case 'u': affected |= 04700; break;
+ case 'g': affected |= 02070; break;
+ case 'o': affected |= 01007; break;
+ case 'a': affected |= 07777; break;
+ default: goto no_more_affected;
+ }
+ no_more_affected:
+ if (affected == 0)
+ affected = 07777;
+ action = *mode_string;
+ ++mode_string;
+ for (;;++mode_string)
+ switch (*mode_string) {
+ case 'r': value |= 00444 & affected; break;
+ case 'w': value |= 00222 & affected; break;
+ case 'x': value |= 00111 & affected; break;
+ case 's': value |= 06000 & affected; break;
+ case 't': value |= 01000 & affected; break;
+ default: goto no_more_values;
+ }
+ no_more_values:
+ switch (action) {
+ case '-': to_clear |= value; break;
+ case '=': to_keep |= value; break;
+ case '+': to_set |= value; break;
+ default:
+ fprintf(stderr, "%s: Invalid mode\n", argv[0]);
+ exit(1);
+ }
+ if (*mode_string != ',')
+ break;
+ }
+ if (*mode_string != 0) {
+ fprintf(stderr, "%s: Invalid mode.\n", argv[0]);
+ exit(1);
+ }
+
+ /* does the file exist? */
+ if (stat (argv[2], &f) < 0) {
+ fprintf(stderr, "%s: ", argv[0]);
+ perror(argv[2]);
+ return 1;
+ }
+
+ result = f.st_mode & 07777;
+ result |= to_set;
+ result |= to_keep & result;
+ result &= ~to_clear;
+
+ printf("%o\n", result);
+
+ return 0;
+}
diff --git a/Build/source/texk/kpathsea/kpsestat.man b/Build/source/texk/kpathsea/kpsestat.man
new file mode 100644
index 00000000000..a78882f9d29
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpsestat.man
@@ -0,0 +1,53 @@
+.TH KPSESTAT 1 "4 January 1998" "Kpathsea @VERSION@"
+.\"=====================================================================
+.if n .ds MP MetaPost
+.if t .ds MP MetaPost
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.\"=====================================================================
+.SH NAME
+kpsestat \- compute octal mode from mode of existing file
+.SH SYNOPSIS
+.B kpsestat
+.I mode
+.I file
+.\"=====================================================================
+.SH DESCRIPTION
+.B kpsestat
+prints the octal permission of
+.I file
+modified according to
+.I mode
+on standard output. The
+.I mode
+parameter accepts a subset of the symbolic permissions accepted by
+.BR chmod (1).
+Use
+.I =
+as the mode to obtain the unchanged permissions.
+.\"=====================================================================
+.SH OPTIONS
+.B kpsestat
+accepts the following additional options:
+.TP
+.B --help
+.rb
+Print help message and exit.
+.TP
+.B --version
+.rb
+Print version information and exit.
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR chmod (1).
diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c
new file mode 100644
index 00000000000..1f79588e890
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpsewhich.c
@@ -0,0 +1,457 @@
+/* kpsewhich -- standalone path lookup and variable expansion for Kpathsea.
+ Ideas from Thomas Esser and Pierre MacKay.
+
+ Copyright (C) 1995 - 2005 Karl Berry & Olaf Weber.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/expand.h>
+#include <kpathsea/getopt.h>
+#include <kpathsea/line.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/proginit.h>
+#include <kpathsea/tex-file.h>
+#include <kpathsea/tex-glyph.h>
+#include <kpathsea/variable.h>
+#include <kpathsea/progname.h>
+
+
+/* Base resolution. (-D, -dpi) */
+unsigned dpi = 600;
+
+/* For variable and path expansion. (-expand-var, -expand-path,
+ -show-path, -separator) */
+string var_to_expand = NULL;
+string braces_to_expand = NULL;
+string path_to_expand = NULL;
+string path_to_show = NULL;
+string var_to_value = NULL;
+
+/* The file type and path for lookups. (-format, -path) */
+kpse_file_format_type user_format = kpse_last_format;
+string user_format_string;
+string user_path;
+
+/* Interactively ask for names to look up? (-interactive) */
+boolean interactive = false;
+
+/* Search the disk as well as ls-R? (-must-exist) */
+boolean must_exist = false;
+
+/* Return all matches, not just the first one? (-all) */
+boolean show_all = false;
+
+/* The device name, for $MAKETEX_MODE. (-mode) */
+string mode = NULL;
+
+/* The program name, for `.PROG' construct in texmf.cnf. (-program) */
+string progname = NULL;
+
+/* The engine name, for '$engine' construct in texmf.cnf. (-engine) */
+string engine = NULL;
+
+/* Return the <number> substring in `<name>.<number><stuff>', if S has
+ that form. If it doesn't, return 0. */
+
+static unsigned
+find_dpi P1C(string, s)
+{
+ unsigned dpi_number = 0;
+ string extension = find_suffix (s);
+
+ if (extension != NULL)
+ sscanf (extension, "%u", &dpi_number);
+
+ return dpi_number;
+}
+
+/* Use the file type from -format if that was specified, else guess
+ dynamically from NAME. Return kpse_last_format if undeterminable.
+ This function is also used to parse the -format string, a case which
+ we distinguish by setting is_filename to false.
+
+ Note that a few filenames have been hard-coded for format types that
+ differ from what would be inferred from their extensions. */
+
+static kpse_file_format_type
+find_format P2C(string, name, boolean, is_filename)
+{
+ kpse_file_format_type ret;
+
+ if (is_filename && user_format != kpse_last_format) {
+ ret = user_format;
+ } else if (FILESTRCASEEQ (name, "pdftex.cfg")) {
+ ret = kpse_pdftex_config_format;
+ } else {
+ int f; /* kpse_file_format_type */
+ unsigned name_len = strlen (name);
+
+/* Have to rely on `try_len' being declared here, since we can't assume
+ GNU C and statement expressions. */
+#define TRY_SUFFIX(ftry) (\
+ try_len = (ftry) ? strlen (ftry) : 0, \
+ (ftry) && try_len <= name_len \
+ && FILESTRCASEEQ (ftry, name + name_len - try_len))
+
+ f = 0;
+ while (f != kpse_last_format) {
+ unsigned try_len;
+ const_string *ext;
+ const_string ftry;
+ boolean found = false;
+
+ if (!kpse_format_info[f].type)
+ kpse_init_format ((kpse_file_format_type)f);
+
+ if (!is_filename) {
+ /* Allow the long name, but only in the -format option. We don't
+ want a filename confused with a format name. */
+ ftry = kpse_format_info[f].type;
+ found = TRY_SUFFIX (ftry);
+ }
+ for (ext = kpse_format_info[f].suffix; !found && ext && *ext; ext++){
+ found = TRY_SUFFIX (*ext);
+ }
+ for (ext = kpse_format_info[f].alt_suffix; !found && ext && *ext; ext++){
+ found = TRY_SUFFIX (*ext);
+ }
+
+ if (found)
+ break;
+
+ /* Some trickery here: the extensions for kpse_fmt_format can
+ * clash with other extensions in use, and we prefer for those
+ * others to be preferred. And we don't want to change the
+ * integer value of kpse_fmt_format. So skip it when first
+ * enountered, then use it when we've done everything else,
+ * and use it as the end-guard.
+ */
+ if (f == kpse_fmt_format) {
+ f = kpse_last_format;
+ } else if (++f == kpse_fmt_format) {
+ f++;
+ } else if (f == kpse_last_format) {
+ f = kpse_fmt_format;
+ }
+ }
+
+ /* If there was a match, f will be one past the correct value. */
+ ret = f;
+ }
+
+ return ret;
+}
+
+/* Look up a single filename NAME. Return 0 if success, 1 if failure. */
+
+static unsigned
+lookup P1C(string, name)
+{
+ string ret = NULL;
+ string *ret_list = NULL;
+ int i;
+ unsigned local_dpi;
+ kpse_glyph_file_type glyph_ret;
+
+ if (user_path) {
+ if (show_all) {
+ ret_list = kpse_all_path_search (user_path, name);
+ } else {
+ ret = kpse_path_search (user_path, name, must_exist);
+ }
+
+ } else {
+ /* No user-specified search path, check user format or guess from NAME. */
+ kpse_file_format_type fmt = find_format (name, true);
+
+ switch (fmt) {
+ case kpse_pk_format:
+ case kpse_gf_format:
+ case kpse_any_glyph_format:
+ /* Try to extract the resolution from the name. */
+ local_dpi = find_dpi (name);
+ if (!local_dpi)
+ local_dpi = dpi;
+ ret = kpse_find_glyph (remove_suffix (name), local_dpi, fmt, &glyph_ret);
+ break;
+
+ case kpse_last_format:
+ /* If the suffix isn't recognized, assume it's a tex file. */
+ fmt = kpse_tex_format;
+ /* fall through */
+
+ default:
+ ret = kpse_find_file (name, fmt, must_exist);
+ }
+ }
+
+ if (ret)
+ puts (ret);
+ if (ret_list) {
+ for (i = 0; ret_list[i]; i++)
+ puts (ret_list[i]);
+ /* Save whether we found anything */
+ ret = ret_list[0];
+ free (ret_list);
+ }
+
+ return ret == NULL;
+}
+
+/* Reading the options. */
+
+#define USAGE "\
+ Standalone path lookup and expansion for Kpathsea.\n\
+\n\
+-debug=NUM set debugging flags.\n\
+-D, -dpi=NUM use a base resolution of NUM; default 600.\n\
+-engine=STRING set engine name to STRING.\n\
+-expand-braces=STRING output variable and brace expansion of STRING.\n\
+-expand-path=STRING output complete path expansion of STRING.\n\
+-expand-var=STRING output variable expansion of STRING.\n\
+-format=NAME use file type NAME (see list below).\n\
+-help print this message and exit.\n\
+-interactive ask for additional filenames to look up.\n\
+[-no]-mktex=FMT disable/enable mktexFMT generation (FMT=pk/mf/tex/tfm).\n\
+-mode=STRING set device name for $MAKETEX_MODE to STRING;\n\
+ no default.\n\
+-must-exist search the disk as well as ls-R if necessary\n\
+-path=STRING search in the path STRING.\n\
+-progname=STRING set program name to STRING.\n\
+-show-path=NAME output search path for file type NAME (see list below).\n\
+-var-value=STRING output the value of variable $STRING.\n\
+-version print version number and exit.\n \
+"
+
+/* Test whether getopt found an option ``A''.
+ Assumes the option index is in the variable `option_index', and the
+ option table in a variable `long_options'. */
+#define ARGUMENT_IS(a) STREQ (long_options[option_index].name, a)
+
+/* SunOS cc can't initialize automatic structs. */
+static struct option long_options[]
+ = { { "D", 1, 0, 0 },
+ { "all", 0, (int *) &show_all, 1 },
+ { "debug", 1, 0, 0 },
+ { "dpi", 1, 0, 0 },
+ { "engine", 1, 0, 0 },
+ { "expand-braces", 1, 0, 0 },
+ { "expand-path", 1, 0, 0 },
+ { "expand-var", 1, 0, 0 },
+ { "format", 1, 0, 0 },
+ { "help", 0, 0, 0 },
+ { "interactive", 0, (int *) &interactive, 1 },
+ { "mktex", 1, 0, 0 },
+ { "mode", 1, 0, 0 },
+ { "must-exist", 0, (int *) &must_exist, 1 },
+ { "path", 1, 0, 0 },
+ { "no-mktex", 1, 0, 0 },
+ { "progname", 1, 0, 0 },
+ { "separator", 1, 0, 0 },
+ { "show-path", 1, 0, 0 },
+ { "var-value", 1, 0, 0 },
+ { "version", 0, 0, 0 },
+ { 0, 0, 0, 0 } };
+
+static void
+read_command_line P2C(int, argc, string *, argv)
+{
+ int g; /* `getopt' return code. */
+ int option_index;
+
+ for (;;) {
+ g = getopt_long_only (argc, argv, "", long_options, &option_index);
+
+ if (g == -1)
+ break;
+
+ if (g == '?')
+ exit (1); /* Unknown option. */
+
+ assert (g == 0); /* We have no short option names. */
+
+ if (ARGUMENT_IS ("debug")) {
+ kpathsea_debug |= atoi (optarg);
+
+ } else if (ARGUMENT_IS ("dpi") || ARGUMENT_IS ("D")) {
+ dpi = atoi (optarg);
+
+ } else if (ARGUMENT_IS ("engine")) {
+ engine = optarg;
+
+ } else if (ARGUMENT_IS ("expand-braces")) {
+ braces_to_expand = optarg;
+
+ } else if (ARGUMENT_IS ("expand-path")) {
+ path_to_expand = optarg;
+
+ } else if (ARGUMENT_IS ("expand-var")) {
+ var_to_expand = optarg;
+
+ } else if (ARGUMENT_IS ("format")) {
+ user_format_string = optarg;
+
+ } else if (ARGUMENT_IS ("help")) {
+ int f; /* kpse_file_format_type */
+ extern KPSEDLL char *kpse_bug_address; /* from version.c */
+
+ printf ("Usage: %s [OPTION]... [FILENAME]...\n", argv[0]);
+ fputs (USAGE, stdout);
+ putchar ('\n');
+ fputs (kpse_bug_address, stdout);
+
+ /* Have to set this for init_format to work. */
+ kpse_set_program_name (argv[0], progname);
+
+ puts ("\nRecognized format names and their suffixes:");
+ for (f = 0; f < kpse_last_format; f++) {
+ const_string *ext;
+ kpse_init_format ((kpse_file_format_type)f);
+ printf ("%s:", kpse_format_info[f].type);
+ for (ext = kpse_format_info[f].suffix; ext && *ext; ext++) {
+ putchar (' ');
+ fputs (*ext, stdout);
+ }
+ for (ext = kpse_format_info[f].alt_suffix; ext && *ext; ext++) {
+ putchar (' ');
+ fputs (*ext, stdout);
+ }
+ putchar ('\n');
+ }
+
+ exit (0);
+
+ } else if (ARGUMENT_IS ("mktex")) {
+ kpse_maketex_option (optarg, true);
+
+ } else if (ARGUMENT_IS ("mode")) {
+ mode = optarg;
+
+ } else if (ARGUMENT_IS ("no-mktex")) {
+ kpse_maketex_option (optarg, false);
+
+ } else if (ARGUMENT_IS ("path")) {
+ user_path = optarg;
+
+ } else if (ARGUMENT_IS ("progname")) {
+ progname = optarg;
+
+ } else if (ARGUMENT_IS ("show-path")) {
+ path_to_show = optarg;
+ user_format_string = optarg;
+
+ } else if (ARGUMENT_IS ("var-value")) {
+ var_to_value = optarg;
+
+ } else if (ARGUMENT_IS ("version")) {
+ extern KPSEDLL char *kpathsea_version_string; /* from version.c */
+ puts (kpathsea_version_string);
+ puts ("Copyright 2005 Karl Berry & Olaf Weber.\n\
+There is NO warranty. You may redistribute this software\n\
+under the terms of the GNU General Public License.\n\
+For more information about these matters, see the files named GPL and LGPL.");
+ exit (0);
+ }
+
+ /* Else it was just a flag; getopt has already done the assignment. */
+ }
+
+ if (user_path && user_format_string) {
+ fprintf (stderr, "-path (%s) and -format (%s) are mutually exclusive.\n",
+ user_path, user_format_string);
+ fputs ("Try `kpsewhich --help' for more information.\n", stderr);
+ exit (1);
+ }
+
+ if (optind == argc && !var_to_expand && !braces_to_expand && !path_to_expand
+ && !path_to_show && !var_to_value) {
+ fputs ("Missing argument. Try `kpsewhich --help' for more information.\n",
+ stderr);
+ exit (1);
+ }
+}
+
+int
+main P2C(int, argc, string *, argv)
+{
+ unsigned unfound = 0;
+
+ read_command_line (argc, argv);
+
+ kpse_set_program_name (argv[0], progname);
+
+ if (engine)
+ xputenv("engine", engine);
+
+ /* NULL for no fallback font. */
+ kpse_init_prog (uppercasify (kpse_program_name), dpi, mode, NULL);
+
+ /* Have to do this after setting the program name. */
+ if (user_format_string)
+ user_format = find_format (user_format_string, false);
+
+ /* Variable expansion. */
+ if (var_to_expand)
+ puts (kpse_var_expand (var_to_expand));
+
+ /* Brace expansion. */
+ if (braces_to_expand)
+ puts (kpse_brace_expand (braces_to_expand));
+
+ /* Path expansion. */
+ if (path_to_expand)
+ puts (kpse_path_expand (path_to_expand));
+
+ /* Show a search path. */
+ if (path_to_show) {
+ if (user_format != kpse_last_format) {
+ if (!kpse_format_info[user_format].type) /* needed if arg was numeric */
+ kpse_init_format (user_format);
+ puts (kpse_format_info[user_format].path);
+ } else {
+ WARNING1 ("kpsewhich: Ignoring unknown file type `%s'", path_to_show);
+ }
+ }
+
+ /* Var to value. */
+ if (var_to_value) {
+ string value = kpse_var_value (var_to_value);
+ if (!value) {
+ unfound++;
+ value="";
+ }
+ puts (value);
+ }
+
+ for (; optind < argc; optind++) {
+ unfound += lookup (argv[optind]);
+ }
+
+ if (interactive) {
+ for (;;) {
+ string name = read_line (stdin);
+ if (!name || STREQ (name, "q") || STREQ (name, "quit")) break;
+ unfound += lookup (name);
+ free (name);
+ }
+ }
+
+ return unfound > 255 ? 1 : unfound;
+}
diff --git a/Build/source/texk/kpathsea/kpsewhich.man b/Build/source/texk/kpathsea/kpsewhich.man
new file mode 100644
index 00000000000..7606275a3c4
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpsewhich.man
@@ -0,0 +1,160 @@
+.TH KPSEWHICH 1 "4 January 1998" "Kpathsea @VERSION@"
+.\"=====================================================================
+.if n .ds MP MetaPost
+.if t .ds MP MetaPost
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.\"=====================================================================
+.SH NAME
+kpsewhich \- standalone path lookup and and expansion for kpathsea
+.SH SYNOPSIS
+.B kpsewhich
+.RI [ options ]
+.RI [ filenames ]
+.\"=====================================================================
+.SH DESCRIPTION
+This manual page is not meant to be exhaustive. The complete
+documentation for this version of \*(TX can be found in the info file
+or manual
+.IR "Kpathsea: A library for path searching" .
+.PP
+.B kpsewhich
+is used as a standalone front-end of the kpathsea library that can be
+used to examine variables and find files. When the
+.B -format
+option is not given, the search path used when looking for a file is
+inferred from the name given, by looking for a known extension. If
+no known extension is found, the search path for \*(TX source files is
+used.
+.\"=====================================================================
+.SH OPTIONS
+.B kpsewhich
+accepts the following options:
+.TP
+.BI -debug \ num
+.rb
+Set debugging flags.
+.TP
+.BI -D \ num
+.rb
+Use a base resolution of
+.IR num ;
+the default, set by the installer, is typically 600.
+.TP
+.BI -dpi \ num
+As
+.BR -D.
+.TP
+.BI -engine \ string
+.rb
+Set
+.I $engine
+in the environment, which is used in some search paths.
+.TP
+.BI -expand-braces \ string
+.rb
+Print variable and brace expansion of
+.IR string .
+.TP
+.BI -expand-path \ string
+.rb
+Print complete path expansion of
+.IR string .
+.TP
+.BI -expand-var \ string
+.rb
+Print variable expansion of
+.IR string .
+.TP
+.BI -format \ name
+.rb
+Use file type
+.IR name .
+See the info manual for a list of valid names, or use the
+.B -help
+option to print the list.
+.TP
+.B -help
+.rb
+Print help message and exit.
+.TP
+.B -interactive
+.rb
+Ask for additional filenames to look up.
+.TP
+.BI -mktex \ fmt
+.rb
+enable
+.RI mktex fmt
+generation.
+.RI ( fmt =pk/mf/tex/tfm)
+.TP
+.BI -mode \ string
+.rb
+Set device name for
+.I $MAKETEX_MODE
+to
+.IR string ;
+no default.
+.TP
+.B -must-exist
+.rb
+Search the disk as well as ls-R if necessary.
+.TP
+.BI -no-mktex \ fmt
+.rb
+disable
+.RI mktex fmt
+generation.
+.RI ( fmt =pk/mf/tex/tfm)
+.TP
+.BI -path \ string
+Search in the path
+.IR string .
+.TP
+.BI -progname \ string
+.rb
+Set program name to
+.IR string .
+.\" .TP
+.\" .BI -separator \ string
+.\" .rb
+.\" .I string
+.\" separates components in
+.\" .B -path
+.\" output; default is
+.\" .I :
+.\" on UNIX systems.
+.TP
+.BI -show-path \ name
+.rb
+Output search path for file type
+.IR name .
+See the info manual for a list of valid names, or use the
+.B -help
+option to print the list.
+.TP
+.BI -var-value \ variable
+.rb
+Print the expansion of
+.IR variable .
+.B -version
+.rb
+Print version information and exit.
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR mktexlsr (1),
+.BR mktexmf (1),
+.BR mktexpk (1),
+.BR mktextfm (1).
diff --git a/Build/source/texk/kpathsea/kpsewhich.rc b/Build/source/texk/kpathsea/kpsewhich.rc
new file mode 100644
index 00000000000..179bd9b5905
--- /dev/null
+++ b/Build/source/texk/kpathsea/kpsewhich.rc
@@ -0,0 +1,34 @@
+/* kpsewhich.rc: kpsewhich resources -*- C++ -*-
+
+ Copyright (C) 1996-2003 Fabrice Popineau <fabrice.popineau@supelec.fr>
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ This file 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 file; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#include <texlive-version.h>
+
+#define VER_FILEVERSION TEXLIVE_MAJOR_VERSION,TEXLIVE_MINOR_VERSION,TEXLIVE_BETA_NUMBER,TEXLIVE_ALPHA_NUMBER
+#define VER_FILEVERSION_STR TEXLIVE_PRODUCTVERSION_STR " kpsewhich 3.4.4"
+
+#define VER_INTERNALNAME_STR "kpsewhich"
+#define VER_ORIGINALFILENAME_STR "kpsewhich.exe"
+
+#define VER_LEGALCOPYRIGHT_STR "Copyright (C) 1993-2003 Karl Berry, Olaf Weber and the Free Software Foundation"
+
+#define VER_FILEDESCRIPTION_STR "Standalone path lookup and variable expansion for kpathsea"
+
+#include <texlive.version>
+
+/* kpsewhich.rc ends here */
diff --git a/Build/source/texk/kpathsea/lib.h b/Build/source/texk/kpathsea/lib.h
new file mode 100644
index 00000000000..68c987f3a8d
--- /dev/null
+++ b/Build/source/texk/kpathsea/lib.h
@@ -0,0 +1,184 @@
+/* lib.h: declarations for common, low-level routines in kpathsea.
+
+ Copyright 1999, 2000, 2003, 2005 Olaf Weber.
+ Copyright 1992, 93, 94, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_LIB_H
+#define KPATHSEA_LIB_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+/* Define common sorts of messages. */
+
+/* This should be called only after a system call fails. Don't exit
+ with status `errno', because that might be 256, which would mean
+ success (exit statuses are truncated to eight bits). */
+#define FATAL_PERROR(str) do { \
+ fprintf (stderr, "%s: ", program_invocation_name); \
+ perror (str); exit (EXIT_FAILURE); } while (0)
+
+#define START_FATAL() do { \
+ fprintf (stderr, "%s: fatal: ", program_invocation_name);
+#define END_FATAL() fputs (".\n", stderr); exit (1); } while (0)
+
+#define FATAL(str) \
+ START_FATAL (); fputs (str, stderr); END_FATAL ()
+#define FATAL1(str, e1) \
+ START_FATAL (); fprintf (stderr, str, e1); END_FATAL ()
+#define FATAL2(str, e1, e2) \
+ START_FATAL (); fprintf (stderr, str, e1, e2); END_FATAL ()
+#define FATAL3(str, e1, e2, e3) \
+ START_FATAL (); fprintf (stderr, str, e1, e2, e3); END_FATAL ()
+#define FATAL4(str, e1, e2, e3, e4) \
+ START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4); END_FATAL ()
+#define FATAL5(str, e1, e2, e3, e4, e5) \
+ START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5); END_FATAL ()
+#define FATAL6(str, e1, e2, e3, e4, e5, e6) \
+ START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5, e6); END_FATAL ()
+
+
+#define START_WARNING() do { fputs ("warning: ", stderr)
+#define END_WARNING() fputs (".\n", stderr); fflush (stderr); } while (0)
+
+#define WARNING(str) \
+ START_WARNING (); fputs (str, stderr); END_WARNING ()
+#define WARNING1(str, e1) \
+ START_WARNING (); fprintf (stderr, str, e1); END_WARNING ()
+#define WARNING2(str, e1, e2) \
+ START_WARNING (); fprintf (stderr, str, e1, e2); END_WARNING ()
+#define WARNING3(str, e1, e2, e3) \
+ START_WARNING (); fprintf (stderr, str, e1, e2, e3); END_WARNING ()
+#define WARNING4(str, e1, e2, e3, e4) \
+ START_WARNING (); fprintf (stderr, str, e1, e2, e3, e4); END_WARNING ()
+
+
+/* I find this easier to read. */
+#define STREQ(s1, s2) ((s1) && (s2) && (strcmp (s1, s2) == 0))
+#define STRNEQ(s1, s2, n) ((s1) && (s2) && (strncmp (s1, s2, n) == 0))
+
+/* Support for FAT/ISO-9660 filesystems. Theoretically this should be
+ done at runtime, per filesystem, but that's painful to program. */
+#ifdef MONOCASE_FILENAMES
+#define FILESTRCASEEQ(s1, s2) ((s1) && (s2) && (strcasecmp (s1, s2) == 0))
+#define FILESTRNCASEEQ(s1, s2, l) ((s1) && (s2) && (strncasecmp (s1, s2, l) == 0))
+#define FILECHARCASEEQ(c1, c2) (toupper (c1) == toupper (c2))
+#else
+#define FILESTRCASEEQ STREQ
+#define FILESTRNCASEEQ STRNEQ
+#define FILECHARCASEEQ(c1, c2) ((c1) == (c2))
+#endif
+
+/* This is the maximum number of numerals that result when a 64-bit
+ integer is converted to a string, plus one for a trailing null byte,
+ plus one for a sign. */
+#define MAX_INT_LENGTH 21
+
+/* If the environment variable TEST is set, return it; otherwise,
+ DEFAULT. This is useful for paths that use more than one envvar. */
+#define ENVVAR(test, default) (getenv (test) ? (test) : (default))
+
+/* Return a fresh copy of S1 followed by S2, et al. */
+extern KPSEDLL string concat P2H(const_string s1, const_string s2);
+extern KPSEDLL string concat3 P3H(const_string, const_string, const_string);
+/* `concatn' is declared in its own include file, to avoid pulling in
+ all the varargs stuff. */
+
+/* A fresh copy of just S. */
+extern KPSEDLL string xstrdup P1H(const_string s);
+
+/* Convert all lowercase characters in S to uppercase. */
+extern KPSEDLL string uppercasify P1H(const_string s);
+
+/* Like `atoi', but disallow negative numbers. */
+extern KPSEDLL unsigned atou P1H(const_string);
+
+/* True if FILENAME1 and FILENAME2 are the same file. If stat fails on
+ either name, return false, no error message.
+ Cf. `SAME_FILE_P' in xstat.h. */
+extern KPSEDLL boolean same_file_p P2H(const_string filename1,
+ const_string filename2);
+
+/* Return NAME with any leading path stripped off. This returns a
+ pointer into NAME. */
+extern KPSEDLL const_string xbasename P1H(const_string name);
+
+/* Return directory part of NAME. This returns a new string. */
+extern KPSEDLL string xdirname P1H(const_string name);
+
+#ifndef HAVE_STRSTR
+extern string strstr P2H(const_string haystack, const_string needle);
+#endif
+
+/* If NAME has a suffix, return a pointer to its first character (i.e.,
+ the one after the `.'); otherwise, return NULL. */
+extern KPSEDLL string find_suffix P1H(const_string name);
+
+/* Return NAME with any suffix removed. */
+extern KPSEDLL string remove_suffix P1H(const_string name);
+
+/* Return S with the suffix SUFFIX, removing any suffix already present.
+ For example, `make_suffix ("/foo/bar.baz", "quux")' returns
+ `/foo/bar.quux'. Returns a string allocated with malloc. */
+extern KPSEDLL string make_suffix P2H(const_string s, const_string suffix);
+
+/* Return NAME with STEM_PREFIX prepended to the stem. For example,
+ `make_prefix ("/foo/bar.baz", "x")' returns `/foo/xbar.baz'.
+ Returns a string allocated with malloc. */
+extern KPSEDLL string make_prefix P2H(string stem_prefix, string name);
+
+/* If NAME has a suffix, simply return it; otherwise, return
+ `NAME.SUFFIX'. */
+extern KPSEDLL string extend_filename P2H(const_string name,
+ const_string suffix);
+
+/* Call putenv with the string `VAR=VALUE' and abort on error. */
+extern KPSEDLL void xputenv P2H(const_string var, const_string value);
+extern KPSEDLL void xputenv_int P2H(const_string var, int value);
+
+/* Return the current working directory. */
+extern KPSEDLL string xgetcwd P1H(void);
+
+/* Returns true if FN is a directory or a symlink to a directory. */
+extern KPSEDLL boolean dir_p P1H(const_string fn);
+
+/* If FN is a readable directory, return the number of links it has.
+ Otherwise, return -1. The nlinks parameter is a dummy on UNIX. */
+extern KPSEDLL int dir_links P2H(const_string fn, long nlinks);
+
+/* Like their stdio counterparts, but abort on error, after calling
+ perror(3) with FILENAME as its argument. */
+extern KPSEDLL FILE *xfopen P2H(const_string filename, const_string mode);
+extern KPSEDLL void xfclose P2H(FILE *, const_string filename);
+extern KPSEDLL void xfseek P4H(FILE *, long, int, string filename);
+extern KPSEDLL unsigned long xftell P2H(FILE *, string filename);
+
+/* These call the corresponding function in the standard library, and
+ abort if those routines fail. Also, `xrealloc' calls `xmalloc' if
+ OLD_ADDRESS is null. */
+extern KPSEDLL address xmalloc P1H(unsigned size);
+extern KPSEDLL address xrealloc P2H(address old_address, unsigned new_size);
+extern KPSEDLL address xcalloc P2H(unsigned nelem, unsigned elsize);
+
+/* (Re)Allocate N items of type T using xmalloc/xrealloc. */
+#define XTALLOC(n, t) ((t *) xmalloc ((n) * sizeof (t)))
+#define XTALLOC1(t) XTALLOC (1, t)
+#define XRETALLOC(addr, n, t) ((addr) = (t *) xrealloc (addr, (n) * sizeof(t)))
+
+#endif /* not KPATHSEA_LIB_H */
diff --git a/Build/source/texk/kpathsea/line.c b/Build/source/texk/kpathsea/line.c
new file mode 100644
index 00000000000..30b8fc3f405
--- /dev/null
+++ b/Build/source/texk/kpathsea/line.c
@@ -0,0 +1,68 @@
+/* line.c: return the next line from a file, or NULL.
+
+ Copyright 1998, 1999, 2001, 2005 Olaf Weber
+ Copyright 1992, 93, 95, 96 Karl Berry
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/line.h>
+
+/* Allocate in increments of this size. */
+#define BLOCK_SIZE 75
+
+char *
+read_line P1C(FILE*, f)
+{
+ int c;
+ unsigned limit = BLOCK_SIZE;
+ unsigned loc = 0;
+ char *line = (char*)xmalloc(limit);
+
+ while ((c = getc (f)) != EOF && c != '\n' && c != '\r') {
+ line[loc] = c;
+ loc++;
+
+ /* By testing after the assignment, we guarantee that we'll always
+ have space for the null we append below. We know we always
+ have room for the first char, since we start with BLOCK_SIZE. */
+ if (loc == limit) {
+ limit += BLOCK_SIZE;
+ line = (char*)xrealloc(line, limit);
+ }
+ }
+
+ /* If we read anything, return it. This can't represent a last
+ ``line'' which doesn't end in a newline, but so what. */
+ if (c != EOF) {
+ /* Terminate the string. We can't represent nulls in the file,
+ either. Again, it doesn't matter. */
+ line[loc] = 0;
+ /* Absorb LF of a CRLF pair. */
+ if (c == '\r') {
+ c = getc (f);
+ if (c != '\n')
+ ungetc (c, f);
+ }
+ } else { /* At end of file. */
+ free(line);
+ line = NULL;
+ }
+
+ return line;
+}
+
diff --git a/Build/source/texk/kpathsea/line.h b/Build/source/texk/kpathsea/line.h
new file mode 100644
index 00000000000..03175861400
--- /dev/null
+++ b/Build/source/texk/kpathsea/line.h
@@ -0,0 +1,34 @@
+/* line.h: read an arbitrary-length input line.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1992-93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef LINE_H
+#define LINE_H
+
+#include <stdio.h>
+#include <kpathsea/types.h>
+
+
+/* Return NULL if we are at EOF, else the next line of F. The newline
+ character at the end of string is removed. The string is allocated
+ with malloc. */
+extern KPSEDLL string read_line P1H(FILE *f);
+
+#endif /* not LINE_H */
diff --git a/Build/source/texk/kpathsea/magstep.c b/Build/source/texk/kpathsea/magstep.c
new file mode 100644
index 00000000000..1f3bc144006
--- /dev/null
+++ b/Build/source/texk/kpathsea/magstep.c
@@ -0,0 +1,105 @@
+/* magstep.c: fix up fixed-point vs. floating-point.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1994, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/magstep.h>
+
+
+/* Return true magstep N, where the lsb of N means ``half'' (see
+ magstep.h) for resolution BDPI. From Tom Rokicki's dvips. */
+
+static int
+magstep P2C(int, n, int, bdpi)
+{
+ double t;
+ int step;
+ int neg = 0;
+
+ if (n < 0)
+ {
+ neg = 1;
+ n = -n;
+ }
+
+ if (n & 1)
+ {
+ n &= ~1;
+ t = 1.095445115;
+ }
+ else
+ t = 1.0;
+
+ while (n > 8)
+ {
+ n -= 8;
+ t = t * 2.0736;
+ }
+
+ while (n > 0)
+ {
+ n -= 2;
+ t = t * 1.2;
+ }
+
+ /* Unnecessary casts to shut up stupid compilers. */
+ step = (int)(0.5 + (neg ? bdpi / t : bdpi * t));
+ return step;
+}
+
+/* This is adapted from code written by Tom Rokicki for dvips. It's
+ part of Kpathsea now so all the drivers can use it. The idea is to
+ return the true dpi corresponding to DPI with a base resolution of
+ BDPI. If M_RET is non-null, we also set that to the mag value. */
+
+/* Don't bother trying to use fabs or some other ``standard'' routine
+ which can only cause trouble; just roll our own simple-minded
+ absolute-value function that is all we need. */
+#undef ABS /* be safe */
+#define ABS(expr) ((expr) < 0 ? -(expr) : (expr))
+
+#define MAGSTEP_MAX 40
+
+unsigned
+kpse_magstep_fix P3C(unsigned, dpi, unsigned, bdpi, int *, m_ret)
+{
+ int m;
+ int mdpi = -1;
+ unsigned real_dpi = 0;
+ int sign = dpi < bdpi ? -1 : 1; /* negative or positive magsteps? */
+
+ for (m = 0; !real_dpi && m < MAGSTEP_MAX; m++) /* don't go forever */
+ {
+ mdpi = magstep (m * sign, bdpi);
+ if (ABS (mdpi - (int) dpi) <= 1) /* if this magstep matches, quit */
+ real_dpi = mdpi;
+ else if ((mdpi - (int) dpi) * sign > 0) /* if gone too far, quit */
+ real_dpi = dpi;
+ }
+
+ /* If requested, return the encoded magstep (the loop went one too far). */
+ /* More unnecessary casts. */
+ if (m_ret)
+ *m_ret = real_dpi == (unsigned)(mdpi ? (m - 1) * sign : 0);
+
+ /* Always return the true dpi found. */
+ return real_dpi ? real_dpi : dpi;
+}
diff --git a/Build/source/texk/kpathsea/magstep.h b/Build/source/texk/kpathsea/magstep.h
new file mode 100644
index 00000000000..78672d8a25f
--- /dev/null
+++ b/Build/source/texk/kpathsea/magstep.h
@@ -0,0 +1,48 @@
+/* magstep.h: declaration for magstep fixing.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1994 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_MAGSTEP_H
+#define KPATHSEA_MAGSTEP_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+/* If DPI is close enough to some magstep of BDPI, return the true dpi
+ value, and the magstep found (or zero) in M_RET (if
+ non-null). ``Close enough'' means within one pixel.
+
+ M_RET is slightly encoded: the least significant bit is on for a
+ half-magstep, off otherwise. Thus, a returned M_RET of 1 means
+ \magstephalf, i.e., sqrt(1.2), i.e., 1.09544. Put another way,
+ return twice the number of magsteps.
+
+ In practice, this matters for magstephalf. Floating-point computation
+ with the fixed-point DVI representation leads to 328 (for BDPI ==
+ 300); specifying `at 11pt' yields 330; the true \magstephalf is 329
+ (that's what you get if you run Metafont with mag:=magstep(.5)).
+
+ The time to call this is after you read the font spec from the DVI
+ file, but before you look up any files -- do the usual floating-point
+ computations, and then fix up the result. */
+
+extern KPSEDLL unsigned kpse_magstep_fix P3H(unsigned dpi, unsigned bdpi, int *m_ret);
+
+#endif /* not KPATHSEA_MAGSTEP_H */
diff --git a/Build/source/texk/kpathsea/make-suffix.c b/Build/source/texk/kpathsea/make-suffix.c
new file mode 100644
index 00000000000..4bb25dab375
--- /dev/null
+++ b/Build/source/texk/kpathsea/make-suffix.c
@@ -0,0 +1,53 @@
+/* make-suffix.c: unconditionally add a filename suffix.
+
+ Copyright 2001, 05 Olaf Weber.
+ Copyright 1992, 93, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-pathch.h>
+
+/* Return a new string: S suffixed with SUFFIX, regardless of what it
+ was before. This returns a newly allocated string. */
+
+string
+make_suffix P2C(const_string, s, const_string, suffix)
+{
+ string new_s;
+ const_string dot_pos = strrchr (s, '.');
+ const_string slash_pos;
+
+ for (slash_pos = s + strlen (s) - 1; slash_pos > dot_pos && slash_pos > s;
+ slash_pos--) {
+ if (IS_DIR_SEP (*slash_pos))
+ break;
+ }
+
+ if (dot_pos == NULL || slash_pos > dot_pos )
+ new_s = concat3 (s, ".", suffix);
+ else
+ {
+ unsigned past_dot_index = dot_pos + 1 - s;
+
+ new_s = (string)xmalloc (past_dot_index + strlen (suffix) + 1);
+ strncpy (new_s, s, dot_pos + 1 - s);
+ strcpy (new_s + past_dot_index, suffix);
+ }
+
+ return new_s;
+}
diff --git a/Build/source/texk/kpathsea/mktex.cnf b/Build/source/texk/kpathsea/mktex.cnf
new file mode 100644
index 00000000000..385955b97d8
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktex.cnf
@@ -0,0 +1,15 @@
+# The mktex.cnf file, if it exists, can be used to tailor a setup to
+# local conditions. If you use the mktex scripts, this file can contain
+# generic bourne shell code. However, the C emulations of the scripts
+# do not handle anything beyond simple assignment of variables, and doing
+# more is not exactly recommended.
+#
+# To assign variables, use constructs like the examples below, which only
+# set unassigned variables. The scripts may malfunction if you do
+# otherwise.
+#
+# Some examples of what you can the mktex.cnf file for:
+# : ${MT_FEATURES=appendonlydir:varfonts}
+# : ${MODE=ljfour}
+# : ${BDPI=600}
+# : ${ps_to_pk=gsftopk}
diff --git a/Build/source/texk/kpathsea/mktex.opt b/Build/source/texk/kpathsea/mktex.opt
new file mode 100755
index 00000000000..58854e3f17e
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktex.opt
@@ -0,0 +1,120 @@
+# mktex.opt -- common mktex* options, etc.
+# Meant to be sourced after $usage, $version, and $MT_TEXMFMAIN have been set.
+#
+# te@dbs.uni-hannover.de and kb@mail.tug.org. Public domain.
+# $Id: mktex.opt,v 1.36 2005/01/21 19:17:01 olaf Exp $
+
+if test "x$1" = x--help || test "x$1" = x-help; then
+ echo "$usage"
+ exit 0
+elif test "x$1" = x--version || test "x$1" = x-version; then
+ echo "`basename $0` $version"
+ kpsewhich --version
+ exit 0
+elif test $# -lt ${mt_min_args-1}; then
+ echo "$0: Missing argument(s)." >&2
+ echo "Try \``basename $0` --help' for more information." >&2
+ exit 1
+elif test $# -gt ${mt_max_args-1}; then
+ num=$#
+ while test $# -gt `expr $num - ${mt_max_args-1}`; do shift; done
+ echo "$0: Extra arguments $*." >&2
+ echo "Try \``basename $0` --help' for more information." >&2
+ exit 1
+fi
+
+# MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate
+# directories in path lists whereas Unix uses `:'. Make an exception for
+# Cygwin, which pretends to be UNIX.
+# Create a variable that holds the right character to be used by the scripts.
+DOSISH=no
+case `uname -s` in
+ CYGWIN*|Cygwin*|cygwin*) ;;
+ *) if test -n "$COMSPEC" || test -n "$ComSpec"; then DOSISH=yes; fi
+esac
+if test "$DOSISH" = "no"; then SEP=':'; else SEP=';';fi
+
+# TEMPDIR needs to be unique to each process because of the possibility of two
+# people running dvips (or whatever) simultaneously.
+if test -n "$TMPDIR"; then
+ TEMPDIR="${TMPDIR}/mt$$.tmp"
+else
+ TEMPDIR="/tmp/mt$$.tmp"
+fi
+
+# We want to output only filenames to standard output, but it's too
+# error-prone to write the scripts that way, so we direct stdout here.
+STDOUT="$TEMPDIR/mt$$.out"
+
+# We will change search paths to include $KPSE_DOT. This is necessary
+# since we cd to $TEMPDIR.
+: ${KPSE_DOT=`pwd`}; export KPSE_DOT
+
+# Clean up on normal or abnormal exit.
+# The "cd /" is for MS-DOS and MS-Windows, where there is a separate
+# current directory on each drive, and therefore "cd $KPSE_DOT" might
+# still leave $TMPDIR current directory on its drive, in which case it
+# cannot be removed.
+trap 'rc=$?; cd /; cd "$KPSE_DOT"; test -f "$STDOUT" && cat "$STDOUT"; rm -rf "$TEMPDIR"; exit $rc' \
+ 0 1 2 3 7 13 15
+
+(umask 077 && mkdir "$TEMPDIR") || exit 1
+cd "$TEMPDIR" || exit 1
+
+# The alternative location for fonts. The directory need not exist,
+# so we use --expand-var here. We also perform a sanity check.
+: ${MT_VARTEXFONTS=`kpsewhich --expand-var='$VARTEXFONTS' | sed 's%^!!%%'`}
+if test -z "$MT_VARTEXFONTS"; then
+ echo "$0: VARTEXFONTS is not defined. Defaulting to \`$KPSE_DOT'." >&2
+ MT_VARTEXFONTS='$KPSE_DOT'
+fi
+
+# The supporting scripts:
+: ${MT_MKTEXNAM=`kpsewhich --format='web2c files' mktexnam`}
+test -n "$MT_MKTEXNAM" || MT_MKTEXNAM="$MT_TEXMFMAIN/web2c/mktexnam"
+: ${MT_MKTEXNAM_OPT=`kpsewhich --format='web2c files' mktexnam.opt`}
+test -n "$MT_MKTEXNAM_OPT" || MT_MKTEXNAM_OPT="$MT_TEXMFMAIN/web2c/mktexnam.opt"
+: ${MT_MKTEXDIR=`kpsewhich --format='web2c files' mktexdir`}
+test -n "$MT_MKTEXDIR" || MT_MKTEXDIR="$MT_TEXMFMAIN/web2c/mktexdir"
+: ${MT_MKTEXDIR_OPT=`kpsewhich --format='web2c files' mktexdir.opt`}
+test -n "$MT_MKTEXDIR_OPT" || MT_MKTEXDIR_OPT="$MT_TEXMFMAIN/web2c/mktexdir.opt"
+: ${MT_MKTEXUPD=`kpsewhich --format='web2c files' mktexupd`}
+test -n "$MT_MKTEXUPD" || MT_MKTEXUPD="$MT_TEXMFMAIN/web2c/mktexupd"
+
+# mktexupd and mktexlsr make sure they're coordinated via this. A copy of
+# the first string is found in mktexlsr.
+ls_R_magic='% ls-R -- filename database for kpathsea; do not change this line.'
+# Old ls-R files should continue to work.
+old_ls_R_magic='% ls-R -- maintained by MakeTeXls-R; do not change this line.'
+
+# Read defaults from mktex.cnf if that file exists. Can be used to
+# overwrite anything defined below. Please use the same syntax as
+# given here (e.g. ``: ${MODE=ljfour}'', not just ``MODE=ljfour'', as
+# this can cause trouble (e.g. when the mode for mktexnam is
+# already specified on the command line).
+: ${MT_MKTEX_CNF=`kpsewhich --format='web2c files' mktex.cnf`}
+test -n "$MT_MKTEX_CNF" && test -r "$MT_MKTEX_CNF" && . "$MT_MKTEX_CNF"
+
+# Possible features: appendonlydir dosnames fontmaps nomfdrivers nomode
+# stripsupplier striptypeface texmfvar varfonts.
+if test "$DOSISH" = "yes"; then
+ : ${MT_FEATURES=appendonlydir:dosnames}
+else
+ : ${MT_FEATURES=appendonlydir}
+fi
+: ${MODE=ljfour}
+: ${BDPI=600}
+: ${DPI=600}
+: ${MAG=1.0}
+: ${ps_to_pk=gsftopk} # some prefer ps2pk
+
+# Allow fonts to be read and written (especially in case we make
+# directories) by everyone.
+umask 0
+
+# Cache values that may be useful for recursive calls.
+export MT_MKTEX_OPT MT_MKTEX_CNF
+export MT_MKTEXNAM MT_MKTEXNAM_OPT
+export MT_MKTEXDIR MT_MKTEXDIR_OPT
+export MT_MKTEXUPD
+export MT_TEXMFMAIN MT_VARTEXFONTS
diff --git a/Build/source/texk/kpathsea/mktexdir b/Build/source/texk/kpathsea/mktexdir
new file mode 100755
index 00000000000..5d378ad4778
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexdir
@@ -0,0 +1,54 @@
+#!/bin/sh
+# mkinstalldirs --- make directory hierarchy (now mktexdir).
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>, created: 1993-05-16.
+# Public domain.
+#
+# Modified for sticky directory creation, --help, --version.
+# te@dbs.uni-hannover.de and kb@mail.tug.org.
+
+version='$Id: mktexdir,v 1.17 2004/12/29 13:38:45 olaf Exp $'
+usage="Usage: $0 DIRS...
+ Create each DIR, including any missing leading directories."
+mt_max_args=$#
+
+# Common code for all scripts.
+: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`}
+: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`}
+test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt"
+if test ! -f "$MT_MKTEX_OPT"; then
+ echo "$0: Cannot find mktex.opt; check your installation." >&2
+ exit 1
+fi
+
+. "$MT_MKTEX_OPT"
+
+test -n "$MT_MKTEXDIR_OPT" && . "$MT_MKTEXDIR_OPT"
+
+test -z "$MT_APPEND_MASK" && MT_APPEND_MASK="="
+
+errstatus=0
+
+for file
+do
+ case $file in
+ /*) cd /;;
+ *) cd $KPSE_DOT;;
+ esac
+ OLDIFS=$IFS; IFS=/; set fnord `echo "./$file"`; IFS=$OLDIFS; shift
+
+ pathcomp=
+ for d
+ do
+ test -z "$d" && continue
+ pathcomp="$pathcomp$d"
+
+ if test ! -d "./$pathcomp"; then
+ mkdir "./$pathcomp" || { errstatus=$?; break; }
+ chmod `kpsestat ${MT_APPEND_MASK} "$pathcomp"/..` "./$pathcomp"
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
diff --git a/Build/source/texk/kpathsea/mktexdir.opt b/Build/source/texk/kpathsea/mktexdir.opt
new file mode 100644
index 00000000000..c06cee31202
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexdir.opt
@@ -0,0 +1,10 @@
+# mktexdir.opt to determine various manipulations of the filenames.
+# Sourced from mktexdir.
+#
+# te@dbs.uni-hannover.de and kb@mail.tug.org. Public domain.
+# $Id: mktexdir.opt,v 1.4 2002/10/22 18:33:54 olaf Exp $
+
+# Set append-only bit on created directories.
+case "$MT_FEATURES" in
+ *appendonlydir*) MT_APPEND_MASK=+t;;
+esac
diff --git a/Build/source/texk/kpathsea/mktexlsr b/Build/source/texk/kpathsea/mktexlsr
new file mode 100755
index 00000000000..3d2523d875b
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexlsr
@@ -0,0 +1,150 @@
+#!/bin/sh
+# original mktexlsr -- create or rebuild ls-R.
+#
+# (If you change or delete the word `original' on the previous line,
+# installation won't write this script over yours.)
+#
+# Suitable for calling from cron, as in:
+# 0 * * * * cd /your/texmf/root && /usr/local/bin/mktexlsr
+# unless the scripts live in a different directory than the 'kpseaccess',
+# 'kpsestat', 'kpsereadlink', and 'kpsewhich' binaries.
+#
+# Originally written as `texhash' by Thomas Esser
+# <te@dbs.uni-hannover.de>, Okt., 1994.
+# Public domain.
+
+version='$Id: mktexlsr,v 1.46 2005/06/21 14:32:26 olaf Exp $'
+progname=`echo $0 | sed 's%.*/%%'`
+usage="Usage: $progname [DIRS ...]
+
+Rebuild all necessary ls-R filename databases completely. If one or
+more arguments DIRS are given, these are used as texmf directories to
+build ls-R for. Else all directories in the search path for ls-R files
+(\$TEXMFDBS) are used."
+
+# MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate
+# directories in path lists whereas Unix uses `:'. Make an exception for
+# Cygwin, which pretends to be UNIX.
+# Create a variable that holds the right character to be used by the scripts.
+DOSISH=no
+case `uname -s` in
+ CYGWIN*|Cygwin*|cygwin*) ;;
+ *) if test -n "$COMSPEC" || test -n "$ComSpec"; then DOSISH=yes; fi
+esac
+if test "$DOSISH" = "no"; then SEP=':'; else SEP=';';fi
+
+
+# Add the location of the script to the PATH if necessary. This must
+# be done before kpsewhich can be called, and thus cannot be put into
+# mktex.opt.
+dirname=`echo $0 | sed 's%/*[^/][^/]*$%%'`
+case $dirname in
+ "") # Do nothing
+ ;;
+ /* | [A-z]:/*) # Absolute name
+ PATH="$dirname$SEP$PATH"
+ export PATH ;;
+ *) # Relative name
+ PATH="`pwd`/$dirname$SEP$PATH"
+ export PATH ;;
+esac
+
+# A copy of some stuff from mktex.opt, so we can run in the presence of
+# terminally damaged ls-R files.
+if test "x$1" = x--help || test "x$1" = x-help; then
+ echo "$usage"
+ exit 0
+elif test "x$1" = x--version || test "x$1" = x-version; then
+ echo "`basename $0` $version"
+ kpsewhich --version
+ exit 0
+fi
+
+# mktexupd and mktexlsr make sure they're coordinated via this. A copy
+# is found mktex.opt.
+ls_R_magic='% ls-R -- filename database for kpathsea; do not change this line.'
+# The old string, which should continue to work.
+old_ls_R_magic='% ls-R -- maintained by MakeTeXls-R; do not change this line.'
+
+trap 'cd / ; test -z "$db_dir_tmp" || rm -rf "$db_dir_tmp"; exit' 0 1 2 3 7 13 15
+
+# Get list of directories from $TEXMFDBS; eliminate duplicates.
+test $# = 0 && {
+ OIFS=$IFS
+ IFS='
+'
+ set x `kpsewhich --show-path=ls-R | tr : '
+' | sort | uniq`; shift
+ IFS=$OIFS
+}
+
+for TEXMFLS_R in "$@"; do
+ # Prepend cwd if the directory was relative.
+ case "$TEXMFLS_R" in
+ "") continue ;; # Strictly speaking, it is an error if this case is taken.
+ /* | [A-z]:/*) ;;
+ *) TEXMFLS_R="`pwd`/$TEXMFLS_R"
+ esac
+ # Allow for ls-R and ls-r to exist. But create ls-R if we're working
+ # from scratch.
+ if test -f "$TEXMFLS_R/ls-R"; then
+ db_file="$TEXMFLS_R/ls-R"
+ elif test -f "$TEXMFLS_R/ls-r"; then
+ db_file="$TEXMFLS_R/ls-r"
+ else
+ db_file="$TEXMFLS_R/ls-R"
+ fi
+ # Follow a possible symlink to get the right filesystem.
+ # The '|| true' construct prevents an sh -e aborting.
+ db_readlink=`kpsereadlink "$TEXMFLS_R/ls-R" 2>/dev/null` || true
+ case "$db_readlink" in
+ "") ;;
+ /* | [A-z]:/*) db_file="$db_readlink" ;;
+ *) db_file="$TEXMFLS_R/$db_readlink"
+ esac
+ db_dir=`echo "$db_file" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname
+
+ test -d "$db_dir" || continue
+ test -w "$db_dir" || { echo "$progname: $db_dir: directory not writable. Skipping..." >&2; continue; }
+
+ if test ! -f "$db_file"; then
+ cp /dev/null "$db_file"
+ # Use same permissions as parent directory, minus x,s, or t bits.
+ chmod `kpsestat -xst "$db_dir"` "$db_file"
+ elif test -s "$db_file" \
+ && test "x`sed '1s/ $//;1q' \"$db_file\"`" != "x$ls_R_magic" \
+ && test "x`sed '1s/ $//;1q' \"$db_file\"`" != "x$old_ls_R_magic"; then
+ echo "$progname: $db_file lacks magic string. Skipping..." >&2
+ continue
+ fi
+
+ # Skip if we cannot write the file:
+ kpseaccess -w "$db_file" || { echo "$progname: $db_file: no write permission. Skipping..." >&2; continue; }
+
+ db_dir_tmp="$db_dir/lsR$$.tmp"
+ (umask 077 && mkdir "$db_dir_tmp" ) \
+ || { echo "$progname: could not create directory '$db_dir_tmp'. Skipping..." >&2; continue; }
+ db_file_tmp="$db_dir_tmp/lsR$$.tmp"
+ rm -f "$db_file_tmp"
+
+ tty -s && echo "$progname: Updating $db_file... " >&2
+ echo "$ls_R_magic" >"$db_file_tmp"
+
+ # The main task. We put ./: in the output, so top-level files can be
+ # found via ls-R. Probably irrelevant in practice.
+ # The sed command inserts the leading ./ for directory names, and
+ # removes . and .. from the list. Note that using colons in directory
+ # names results in nothing but grief.
+ echo "./:" >>"$db_file_tmp"
+ (cd "$TEXMFLS_R" && \ls -LRa 2>/dev/null) |
+ sed '/^$/{n;s%^\./%%;s%^%./%;}; /^\.$/d; /^\.\.$/d; /^[\.\/]*lsR[0-9]*\.tmp:*$/d' >>"$db_file_tmp"
+
+ # To be really safe, a loop.
+ until PERMS=`kpsestat = "$db_file"`; do sleep 1; done
+ chmod $PERMS "$db_file_tmp"
+ rm -f "$db_file"
+ mv "$db_file_tmp" "$db_file"
+ rm -rf "$db_dir_tmp"
+done
+tty -s && echo "$progname: Done." >&2
+exit 0
diff --git a/Build/source/texk/kpathsea/mktexlsr.man b/Build/source/texk/kpathsea/mktexlsr.man
new file mode 100644
index 00000000000..ad3cc2a1236
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexlsr.man
@@ -0,0 +1,46 @@
+.TH MKTEXLSR 1 "4 January 1998" "Kpathsea @VERSION@"
+.\"=====================================================================
+.if n .ds MP MetaPost
+.if t .ds MP MetaPost
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.\"=====================================================================
+.SH NAME
+mktexlsr \- create ls-R databases
+.SH SYNOPSIS
+.B mktexlsr
+.RI [ directories ]
+.\"=====================================================================
+.SH DESCRIPTION
+This manual page is not meant to be exhaustive. The complete
+documentation for this version of \*(TX can be found in the info file
+or manual
+.IR "Kpathsea: A library for path searching" .
+.PP
+.B mktexlsr
+is used to generate the ls-R databases used by the kpathsea library.
+It will create them for the specified directories, or for a default
+list if no directories are specified.
+.\"=====================================================================
+.SH OPTIONS
+.B mktexlsr
+accepts the following options:
+.TP
+.B --help
+.rb
+Print help message and exit.
+.TP
+.B --version
+.rb
+Print version information and exit.
diff --git a/Build/source/texk/kpathsea/mktexmf b/Build/source/texk/kpathsea/mktexmf
new file mode 100755
index 00000000000..32bb85ec3d8
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexmf
@@ -0,0 +1,139 @@
+#!/bin/sh
+# original mktexmf -- make a new MF file, because one wasn't found.
+#
+# (If you change or delete the word `original' on the previous line,
+# installation won't write this script over yours.)
+#
+# te@dbs.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl.
+# Public domain.
+
+version='$Id: mktexmf,v 1.27 2005/01/25 17:39:21 olaf Exp $'
+progname=`echo $0 | sed 's%.*/%%'`
+usage="Usage: $progname FONT.
+
+Makes the Metafont source file for FONT, if possible. For example,
+\`ecr12' or \`cmr11'."
+
+# Common code for all scripts.
+: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`}
+: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`}
+test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt"
+if test ! -f "$MT_MKTEX_OPT"; then
+ echo "$progname: Cannot find mktex.opt; check your installation." >&2
+ exit 1
+fi
+
+. "$MT_MKTEX_OPT"
+
+(
+# See comments in mktexpk.
+name="`echo $1 | sed 's%.*/%%; s%\.mf$%%'`"
+rootname=`echo "$name" | sed 's/[0-9]*$//'`
+pointsize=`echo "$name" | sed "s/^$rootname//"`
+
+sauterroot=`kpsewhich b-$rootname.mf 2>/dev/null`
+if test -n "$sauterroot"; then
+ rootfile=$sauterroot
+ rootname=b-$rootname
+else
+ case $rootname in
+ # csso12[0-5][0-9] from CJK package; unsupported by mktexmf
+ csso12[0-5][0-9])
+ rootfile=;;
+ cs*|lcsss*|icscsc*|icstt*|ilcsss*)
+ rootfile=`kpsewhich cscode.mf`;;
+ wn[bcdfirstuv]*|rx[bcdfiorstuvx][bcfhilmostx]|l[abcdhl][bcdfiorstuvx]*)
+ lhprefix=`echo "$name" | sed 's/^\(..\).*/\1/'`
+ rootfile=`kpsewhich ${lhprefix}codes.mf 2>/dev/null`;;
+ *)
+ rootfile=`kpsewhich $rootname.mf 2>/dev/null`;;
+ esac
+fi
+{ test -z "$rootfile" || test ! -f "$rootfile"; } && exit 1
+
+#if test -z "$MT_MFNAME"; then
+OIFS=$IFS; IFS=$SEP
+set x `"$MT_MKTEXNAM" $name`; shift
+IFS=$OIFS
+MT_MFNAME="$3"
+#fi
+
+destdir=`echo "$MT_MFNAME" | sed 's%/[^/][^/]*$%%'`
+test -d "$destdir" || "$MT_MKTEXDIR" "$destdir" || exit 1
+cd "$destdir" || exit 1
+
+case "$pointsize" in
+ "") echo "$progname: no pointsize."; exit 1;;
+ 11) realsize=10.95;; # \magstephalf
+ 14) realsize=14.4;; # \magstep2
+ 17) realsize=17.28;; # \magstep3
+ 20) realsize=20.74;; # \magstep4
+ 25) realsize=24.88;; # \magstep5
+ 30) realsize=29.86;; # \magstep6
+ 36) realsize=35.83;; # \magstep7
+ # The new convention is to have three or four letters for the
+ # font name and four digits for the pointsize. The number is
+ # pointsize * 100. We effectively divide by 100 by ignoring the
+ # last two digits.
+ ????|?????) realsize=`echo "$pointsize" | sed 's/\(..\)$/.\1/'`;;
+ *) realsize="$pointsize";;
+esac
+
+mfname="$name.mf"
+if test -r "$mfname"; then
+ echo "$progname: $destdir/$mfname already exists."
+ echo "$destdir/$mfname" >$STDOUT
+ "$MT_MKTEXUPD" "$destdir" "$mfname"
+ exit 0
+fi
+
+case "$name" in
+ ec*|tc*)
+ cat > "mf$$.tmp" <<END
+if unknown exbase: input exbase fi;
+gensize:=$realsize;
+generate $rootname;
+END
+ ;;
+ dc*)
+ cat > "mf$$.tmp" <<END
+if unknown dxbase: input dxbase fi;
+gensize:=$realsize;
+generate $rootname;
+END
+ ;;
+ cs*|lcsss*|icscsc*|icstt*|ilcsss*)
+ cat > "mf$$.tmp" <<END
+input cscode
+use_driver;
+END
+ ;;
+ wn[bcdfirstuv]*|rx[bcdfiorstuvx][bcfhilmostx]*|l[abcdhl][bcdfiorstuvx]*)
+ cat > "mf$$.tmp" <<END
+input fikparm;
+END
+ ;;
+ g[lmorst][bijmtwx][cilnoru]*)
+ # A small superset of the names of the cbgreek fonts.
+ cat > "mf$$.tmp" <<END
+% generated by mktexmf
+input cbgreek;
+END
+ ;;
+ *)
+ cat > "mf$$.tmp" <<END
+design_size := $realsize;
+input $rootname;
+END
+ ;;
+esac
+
+chmod `kpsestat -xst,go-w .` "mf$$.tmp"
+rm -f "$mfname"
+mv "mf$$.tmp" "$mfname"
+
+echo "$destdir/$mfname" >$STDOUT
+echo "$progname: $destdir/$mfname: successfully generated." >&2
+"$MT_MKTEXUPD" "$destdir" "$mfname"
+exit 0
+) 1>&2 </dev/null
diff --git a/Build/source/texk/kpathsea/mktexmf.man b/Build/source/texk/kpathsea/mktexmf.man
new file mode 100644
index 00000000000..71de9049e44
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexmf.man
@@ -0,0 +1,59 @@
+.TH MKTEXMF 1 "4 January 1998" "Kpathsea @VERSION@"
+.\"=====================================================================
+.if n .ds MP MetaPost
+.if t .ds MP MetaPost
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.\"=====================================================================
+.SH NAME
+mktexmf \- create a Metafont source file
+.SH SYNOPSIS
+.B mktexmf
+.I font
+.\"=====================================================================
+.SH DESCRIPTION
+This manual page is not meant to be exhaustive. The complete
+documentation for this version of \*(TX can be found in the info file
+or manual
+.IR "Kpathsea: A library for path searching" .
+.PP
+.B mktexmf
+is used to generate the \*(MF source file for
+.IR font ,
+if possible. For example,
+.I ecrm1200
+or
+.IR cmr11 .
+.PP
+The name of the generated file is printed on standard output.
+.PP
+.B mktexmf
+is typically called by other programs, rather than from the command
+line.
+.\"=====================================================================
+.SH OPTIONS
+.B mktexmf
+accepts the following options:
+.TP
+.B --help
+.rb
+Print help message and exit.
+.TP
+.B --version
+.rb
+Print version information and exit.
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR mktexpk (1),
+.BR mktextfm (1).
diff --git a/Build/source/texk/kpathsea/mktexnam b/Build/source/texk/kpathsea/mktexnam
new file mode 100755
index 00000000000..f9ed6902a1b
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexnam
@@ -0,0 +1,216 @@
+#!/bin/sh
+# maketexnam -- find PK and TFM names.
+# te@dbs.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl.
+# Public domain.
+
+version='$Id: mktexnam,v 1.30 2004/12/28 20:55:56 olaf Exp $'
+usage="Usage: $0 NAME [DPI MODE] [DESTDIR].
+ Output the PK, TFM, and MF names for a font NAME."
+mt_max_args=4
+
+# Common code for all scripts.
+: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`}
+: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`}
+test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt"
+if test ! -f "$MT_MKTEX_OPT"; then
+ echo "$0: Cannot find mktex.opt; check your installation." >&2
+ exit 1
+fi
+
+. "$MT_MKTEX_OPT"
+
+NAME=$1
+case $# in
+ 1|2) DPI=$BDPI; DEST=$2;;
+ 3|4) DPI=$2; MODE=$3; DEST=$4;;
+ *) help;;
+esac
+
+: ${MT_PKDESTDIR='$MT_DESTROOT/$MT_PKDESTREL'}
+: ${MT_TFMDESTDIR='$MT_DESTROOT/$MT_TFMDESTREL'}
+: ${MT_MFDESTDIR='$MT_DESTROOT/$MT_MFDESTREL'}
+: ${MT_PKBASE='$NAME.${DPI}pk'}
+: ${MT_TFMBASE='$NAME.tfm'}
+: ${MT_MFBASE='$NAME.mf'}
+: ${MT_DEFAULT_SUPPLIER=unknown}
+: ${MT_DEFAULT_TYPEFACE=unknown}
+: ${MT_DEFAULT_NAMEPART='$MT_SUPPLIER/$MT_TYPEFACE'}
+: ${MT_DEFAULT_PKDESTREL='pk/modeless/$MT_NAMEPART'}
+: ${MT_DEFAULT_TFMDESTREL='tfm/$MT_NAMEPART'}
+: ${MT_DEFAULT_MFDESTREL='source/$MT_NAMEPART'}
+: ${MT_DEFAULT_DESTROOT=$KPSE_DOT}
+
+# Find the font: test tfm first, then mf, then possible sauterized mf.
+fullname=`kpsewhich "$NAME.tfm" 2>/dev/null`
+test -z "$fullname" && fullname=`kpsewhich "$NAME.mf" 2>/dev/null`
+if test -z "$fullname"; then
+ rootname=`echo $NAME | sed 's/[0-9]*$//'`
+ fullname=`kpsewhich "b-$rootname.mf" 2>/dev/null`
+ # LH fonts get special treatment:
+ if test -z "$fullname"; then
+ case $rootname in
+ # Czech/Slovak fonts get special treatment:
+ cs*|lcsss*|icscsc*|icstt*|ilcsss*)
+ fullname=`kpsewhich cscode.mf`
+ ;;
+ # LH fonts get special treatment:
+ wn[bcdfirstuv]*|rx[bcdfiorstuvx][bcfhilmostx]|l[abcdhl][bcdfiorstuvx]*)
+ lhprefix=`echo $NAME | sed 's/^\(..\).*/\1/'`
+ fullname=`kpsewhich "${lhprefix}codes.mf" 2>/dev/null`;;
+ *) fullname=`kpsewhich "$rootname.mf" 2>/dev/null`
+ ;;
+ esac
+ fi
+fi
+
+# After all this, do we _have_ a font?
+if test -z "$fullname"; then
+ : ${MT_DESTROOT="$MT_VARTEXFONTS"}
+else
+ # Normalize $fullname.
+ fullname=`echo "$fullname" | sed 's%//*%/%g'`
+ # See if $fullname comes from a standard location.
+ OIFS=$IFS;IFS=$SEP
+ set x `kpsewhich --expand-path='$TEXMF/fonts'"$SEP$MT_VARTEXFONTS"`
+ shift; IFS=$OIFS
+ for i
+ do
+ test -z "$i" && continue
+ case "$fullname" in
+ $i/*)
+ # We now have a preliminary value for the destination root.
+ : ${MT_DESTROOT="$i"}
+ # When we're done, relfmt contains one of these:
+ # "/source/$MT_NAMEPART/"
+ # "/$MT_NAMEPART/source/"
+ # while namepart contains the actual namepart.
+ relfmt=`echo "$fullname" | \
+ sed -e 's%^'"$i"'\(/.*/\)[^/]*$%\1%' \
+ -e 's%^/tfm/%/source/%' \
+ -e 's%/tfm/$%/source/%'`
+ namepart=`echo "$relfmt" | sed -e 's%/source/%/%'`
+ # See if namepart is empty.
+ if test "$namepart" != "/"; then
+ relfmt=`echo "$relfmt" | \
+ sed -e 's%'"$namepart"'%/$MT_NAMEPART/%'`
+ else
+ # Assume TDS.
+ relfmt='/source/$MT_NAMEPART/'
+ namepart=''
+ fi
+ # Determine supplier and typeface from namepart. If there is
+ # only one part in the namepart, we take it to be the typeface.
+ MT_SUPPLIER=`echo $namepart | sed 's%^/\([^/]*\)/\(.*\)$%\1%'`
+ MT_TYPEFACE=`echo $namepart | sed 's%^/\([^/]*\)/\(.*\)$%\2%'`
+ if test -z "$MT_TYPEFACE"; then
+ MT_TYPEFACE="$MT_SUPPLIER";
+ MT_SUPPLIER=''
+ fi
+ # Phew. Now we create the relative paths for pk, tfm and source.
+ : ${MT_NAMEPART='$MT_SUPPLIER/$MT_TYPEFACE'}
+ : ${MT_PKDESTREL=`echo "$relfmt" | sed 's%/source/%/pk/$MT_MODE/%'`}
+ : ${MT_TFMDESTREL=`echo "$relfmt" | sed 's%/source/%/tfm/%'`}
+ : ${MT_MFDESTREL=`echo "$relfmt"`}
+ break
+ esac
+ done
+fi
+
+# In case some variables remain unset.
+: ${MT_SUPPLIER=$MT_DEFAULT_SUPPLIER}
+: ${MT_TYPEFACE=$MT_DEFAULT_TYPEFACE}
+: ${MT_NAMEPART=$MT_DEFAULT_NAMEPART}
+: ${MT_PKDESTREL=$MT_DEFAULT_PKDESTREL}
+: ${MT_TFMDESTREL=$MT_DEFAULT_TFMDESTREL}
+: ${MT_MFDESTREL=$MT_DEFAULT_MFDESTREL}
+
+# We have found nothing, so force using the fontmaps as a last resort.
+# This also means mktexnam can be queried for advice on where to
+# place fonts.
+if test "x$MT_SUPPLIER" = xunknown \
+ || test "x$MT_TYPEFACE" = xunknown; then
+ MT_FEATURES="$MT_FEATURES:fontmaps"
+fi
+
+# Handle the options.
+test -n "$MT_MKTEXNAM_OPT" && . "$MT_MKTEXNAM_OPT"
+
+# Adjust MT_DESTROOT, if necessary.
+if test -n "${MT_DESTROOT}"; then
+ # We distinguish system trees from the rest.
+ systexmf="`kpsewhich --expand-path='{$SYSTEXMF}/fonts'`$SEP$MT_VARTEXFONTS"
+ case "$SEP$systexmf$SEP" in
+ *$SEP$MT_DESTROOT$SEP*) # A system tree.
+ # If the texmfvar option is set, use TEXMFVAR tree.
+ # Some additional uglyness handles the case where $TEXMFVAR exists
+ # but $TEXMFVAR/fonts doesn't (yet).
+ if test "x$USE_TEXMFVAR" = x1; then
+ : ${MT_TEXMFVAR=`kpsewhich --expand-path='$TEXMFVAR'`}
+ MT_DESTROOT=$MT_TEXMFVAR/fonts
+ if test -z "$MT_TEXMFVAR"; then
+ # Path expansion of $TEXMFVAR was empty.
+ FALLBACK=1
+ elif test -d "$MT_DESTROOT"; then
+ # Do we have write access and permission?
+ kpseaccess -w "$MT_DESTROOT" || FALLBACK=1
+ test -w "$MT_DESTROOT" || FALLBACK=1
+ elif test -d "$MT_TEXMFVAR"; then
+ # De we have write access and permission?
+ kpseaccess -w "$MT_TEXMFVAR" || FALLBACK=1
+ test -w "$MT_TEXMFVAR" || FALLBACK=1
+ else
+ # TEXMFVAR defined and exists, but it is not a directory?
+ FALLBACK=1
+ fi
+ else
+ # Do we have write access and permission?
+ kpseaccess -w "$MT_DESTROOT" || FALLBACK=1
+ test -w "$MT_DESTROOT" || FALLBACK=1
+ fi
+ # Fall back on VARTEXFONTS if the varfonts option is set, or
+ # we cannot write in the given tree.
+ if test "x$USE_VARTEXFONTS" = x1 || test "x$FALLBACK" = x1; then
+ MT_DESTROOT=$MT_VARTEXFONTS
+ fi ;;
+ *) # A non-system tree.
+ # Do we have write access and permission?
+ kpseaccess -w "$MT_DESTROOT" || FALLBACK=1
+ test -w "$MT_DESTROOT" || FALLBACK=1
+ # If we cannot write fall back of defaults.
+ test "x$FALLBACK" = x1 && MT_DESTROOT=;;
+ esac
+fi
+
+if test -z "$MT_DESTROOT"; then
+ MT_DESTROOT=$MT_DEFAULT_DESTROOT
+ MT_PKDESTDIR=$MT_DEFAULT_DESTROOT
+ MT_TFMDESTDIR=$MT_DEFAULT_DESTROOT
+ MT_MFDESTDIR=$MT_DEFAULT_DESTROOT
+fi
+
+case "$DEST" in
+ "") ;;
+ /* | [A-z]:/*) # Absolute, explicit destdir => use it.
+ MT_PKDESTDIR=$DEST
+ MT_TFMDESTDIR=$DEST
+ MT_MFDESTDIR=$DEST
+ MT_NAMEPART=;;
+ *) # Relative destdir => append to the default.
+ MT_NAMEPART=$DEST;;
+esac
+
+eval MT_MODE=\"$MODE\"
+eval MT_NAMEPART=\"$MT_NAMEPART\"
+eval MT_DESTROOT=\"$MT_DESTROOT\"
+eval MT_PKDESTREL=\"$MT_PKDESTREL\"
+eval MT_TFMDESTREL=\"$MT_TFMDESTREL\"
+eval MT_MFDESTREL=\"$MT_MFDESTREL\"
+eval MT_PKDESTDIR=\"$MT_PKDESTDIR\"
+eval MT_TFMDESTDIR=\"$MT_TFMDESTDIR\"
+eval MT_MFDESTDIR=\"$MT_MFDESTDIR\"
+eval MT_PKNAME=\"$MT_PKDESTDIR/$MT_PKBASE\"
+eval MT_TFMNAME=\"$MT_TFMDESTDIR/$MT_TFMBASE\"
+eval MT_MFNAME=\"$MT_MFDESTDIR/$MT_MFBASE\"
+
+echo "$MT_PKNAME$SEP$MT_TFMNAME$SEP$MT_MFNAME" | sed 's%//*%/%g'
+
diff --git a/Build/source/texk/kpathsea/mktexnam.opt b/Build/source/texk/kpathsea/mktexnam.opt
new file mode 100644
index 00000000000..d4c518bc450
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexnam.opt
@@ -0,0 +1,106 @@
+# mktexnam.opt to determine various manipulations of the filenames.
+# Sourced from mktexnam.
+#
+# te@dbs.uni-hannover.de and kb@mail.tug.org. Public domain.
+# $Id: mktexnam.opt,v 1.14 2004/12/28 20:58:18 olaf Exp $
+
+# Get 8.3 filenames like dpiNNN/NAME.pk.
+case "$MT_FEATURES" in
+ *dosnames*) MT_PKBASE='dpi$DPI/$NAME.pk';;
+esac
+
+# Omit the mode directory (e.g., ljfour):
+case "$MT_FEATURES" in
+ *nomode*) MODE="";;
+esac
+
+###########################################################################
+# Use this feature if you wish to use the alias files from the
+# ftp://ftp.tug.org/tex/fontname.tar.gz distribution.
+###########################################################################
+case "$MT_FEATURES" in
+*fontmaps*)
+ MT_NAMEPART='$MT_SUPPLIER/$MT_TYPEFACE'
+ MT_PKDESTREL='pk/$MT_MODE/$MT_NAMEPART'
+ MT_TFMDESTREL='tfm/$MT_NAMEPART'
+ MT_MFDESTREL='source/$MT_NAMEPART'
+ SPECIALMAP=`kpsewhich special.map`
+ TYPEFACEMAP=`kpsewhich typeface.map`
+ SUPPLIERMAP=`kpsewhich supplier.map`
+ if test -r "$SPECIALMAP"; then
+ set x `awk \
+ '{if ($1 == NAME || (substr (NAME, 1, length ($1)) == $1 \
+ && substr (NAME, length (NAME), 1) ~ /[0-9]/ \
+ && substr ($1, length ($1), 1) ~ /[^0-9]/)) \
+ { print $2 " " $3; exit; }}' NAME=$NAME "$SPECIALMAP"`
+ shift; SUPPLIER=$1; TYPEFACE=$2
+
+ if test -z "$SUPPLIER"; then
+ # Try the normal case. Source first.
+ # $NAME might be raw.
+ name=`echo $NAME | sed 's/^r//'`
+ s_abbrev=`echo $name | sed 's/^\(.\).*$/\1/'`
+ SUPPLIER=`awk '{ if ($1 == s_abbrev) { print $2; exit; }}' \
+ s_abbrev=$s_abbrev "$SUPPLIERMAP"`
+ if test -n "$SUPPLIER"; then
+ # We found the source. Try for the typeface.
+ t_abbrev=`echo $name | sed 's/^.//;s/\(..\).*$/\1/'`
+ TYPEFACE=`awk '{ if ($1 == t_abbrev) { print $2; exit; }}' \
+ t_abbrev=$t_abbrev "$TYPEFACEMAP"`
+ fi
+ fi
+ fi
+
+ if test -z "$SUPPLIER"; then
+ echo "$0: Could not map source abbreviation $s_abbrev for $NAME." >&2
+ echo "$0: Need to update $SPECIALMAP?" >&2
+ else
+ MT_SUPPLIER="$SUPPLIER"
+ if test -z "$TYPEFACE"; then
+ echo "$0: Could not map typeface abbreviation $t_abbrev for $NAME." >&2
+ echo "$0: Need to update $SPECIALMAP?" >&2
+ else
+ MT_TYPEFACE="$TYPEFACE"
+ fi
+ fi
+esac
+
+###########################################################################
+# Use this feature to strip the "supplier" part (e.g. ams)
+# of the target name:
+###########################################################################
+
+case "$MT_FEATURES" in
+*stripsupplier*)
+ MT_SUPPLIER=""
+esac
+
+###########################################################################
+# Use this feature to strip the "typeface" part (e.g. euler)
+# of the target name:
+###########################################################################
+
+case "$MT_FEATURES" in
+*striptypeface*)
+ MT_TYPEFACE=""
+esac
+
+# Put new fonts into the directory named by the VARTEXFONTS environment
+# variable or config file value. (A default value for VARTEXFONTS is
+# already set in the default texmf.cnf, q.v.)
+#
+# A user can override this setting in either direction by setting
+# USE_VARTEXFONTS to 1 or 0.
+case "$MT_FEATURES" in
+ *varfonts*) test "$USE_VARTEXFONTS" != 0 && USE_VARTEXFONTS=1;;
+esac
+
+# Force generated files that would go into a system tree (as defined by
+# SYSTEXMF) into TEXMFVAR. Starting with teTeX-3.0, the variable TEXMFVAR
+# is always set. The varfonts feature takes precedence if also set.
+#
+# A user can override this setting in either direction by setting
+# USE_TEXMFVAR to 1 or 0.
+case "$MT_FEATURES" in
+ *texmfvar*) test "$USE_TEXMFVAR" != 0 && USE_TEXMFVAR=1;;
+esac
diff --git a/Build/source/texk/kpathsea/mktexpk b/Build/source/texk/kpathsea/mktexpk
new file mode 100755
index 00000000000..d2736ea77dc
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexpk
@@ -0,0 +1,264 @@
+#!/bin/sh
+# original mktexpk -- make a new PK font, because one wasn't found.
+#
+# (If you change or delete the word `original' on the previous line,
+# installation won't write this script over yours.)
+#
+# te@dbs.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl.
+# Public domain.
+
+version='$Id: mktexpk,v 1.34 2005/06/21 10:49:10 olaf Exp $'
+progname=`echo $0 | sed 's%.*/%%'`
+usage="Usage: $progname [OPTIONS] NAME [REDIRECT],
+ Create a PK font.
+
+--dpi DPI use resolution DPI.
+--bdpi BDPI use base resolution BDPI.
+--mag MAG use magnificiation MAG.
+--mfmode MODE use MODE as the METAFONT mode.
+--destdir DESTDIR write fonts in DESTDIR.
+
+Try to create a PK file for NAME at resolution DPI, with an assumed
+device base resolution of BDPI, and a Metafont \`mag' of MAG. Use MODE
+for the METAFONT mode. Use DESTDIR for the root of where to install
+into, either the absolute directory name to use (if it starts with a
+/) or relative to the default DESTDIR (if not). REDIRECT, if supplied,
+is a string of the form '>&n', where n is the number of the file
+descriptor which is to receive, instead of stdout, the name of the
+newly created pk file."
+
+# Handle non-positional options, except for --version/--help
+while test $# -gt 0; do
+ case "$1" in
+ --destdir) shift; DEST="$1"; shift ;;
+ --destdir=*) DEST=`echo "$1" | sed 's/--destdir=//'`; shift ;;
+ --dpi) shift; DPI="$1"; shift ;;
+ --dpi=*) DPI=`echo "$1" | sed 's/--dpi=//'`; shift ;;
+ --bdpi) shift; BDPI="$1"; shift ;;
+ --bdpi=*) BDPI=`echo "$1" | sed 's/--bdpi=//'`; shift ;;
+ --mfmode) shift; test "x$1" != "x/" && MODE="$1"; shift ;;
+ --mfmode=*) test "x$1" != "x--mfmode/" \
+ && MODE=`echo "$1" | sed 's/--mfmode=//'`; shift ;;
+ --mag) shift; MAG="$1"; shift;;
+ --mag=*) MAG=`echo "$1" | sed '/s--mag=//'`; shift;;
+ --version|-version) break ;;
+ --help|-help) break ;;
+ *) break ;;
+ esac
+done
+
+if test "x$2" != x; then
+ tail="`echo \"x$2\" | sed 's/^x>&//' | grep '^[0-9]*$'`"
+ if test -z "$tail"; then
+ echo "$progname: argument '$2' ignored - bad file number" >&2
+ elif test "$tail" != 1; then
+ eval 'exec 1>&$tail'
+ fi
+fi
+
+mt_max_args=2
+
+# Common code for all scripts.
+: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`}
+: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`}
+test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt"
+if test ! -f "$MT_MKTEX_OPT"; then
+ echo "$progname: Cannot find mktex.opt; check your installation." >&2
+ exit 1
+fi
+
+. "$MT_MKTEX_OPT"
+
+# Where do potential driver files belong?
+case "$MT_FEATURES" in
+ *nomfdrivers*)
+ : ${MT_MFDESTDIR=`pwd`}
+ export MT_MFDESTDIR;;
+esac
+
+# Since we want to pass the generated filename and only that filename
+# back to the caller on standard output, we do some redirections so
+# regular echo's will end up on stderr, and do an echo >$STDOUT at the end.
+# Then the contents of $STDOUT will be echoed to stdout by a trap.
+
+# start of redirection stdout -> stderr, stdin <- /dev/null
+(
+
+NAME=$1
+
+if kpsewhich $NAME.mf >/dev/null 2>&1 || mktexmf $NAME >/dev/null 2>&1; then
+ # determine the progname of metafont to use; prefer mf-nowin.
+ if (mf-nowin --version) >/dev/null 2>&1; then
+ MF="mf-nowin -progname=mf"
+ else
+ MF=mf
+ fi
+
+ # Check that $BDPI and $MODE are consistent; if not, ignore the mode and
+ # hope we can correctly guess it from bdpi. (People like to specify the
+ # resolution on the command line, not the mode so much.)
+ if test -n "$MODE"; then
+ mf_bdpi=`$MF \
+'\mode:='$MODE';mode_setup;message"BDPI= "&decimal round pixels_per_inch;end.'\
+ </dev/null \
+ | awk '/DPI=/ {print $2}'`
+ if test "x$mf_bdpi" != x$BDPI; then
+ echo "$progname: Mismatched mode $MODE and resolution $BDPI; ignoring mode." >&2
+ MODE=
+ fi
+ fi
+
+ # If an explicit mode is not supplied, try to guess. You can get a
+ # list of extant modes from ftp://ftp.tug.org/tex/modes.mf.
+ if test -z "$MODE" || test "x$MODE" = xdefault; then
+ case "$BDPI" in
+ 85) MODE=sun;;
+ 100) MODE=nextscrn;;
+ 180) MODE=toshiba;;
+ 300) MODE=cx;;
+ 360) MODE=epstylus;;
+ 400) MODE=nexthi;;
+ 600) MODE=ljfour;;
+ 720) MODE=epsczz;;
+ 1200) MODE=ultre;;
+ 1270) MODE=linoone;;
+ 8000) MODE=dpdfezzz;;
+ *) echo "$progname: Can't guess mode for $BDPI dpi devices." >&2
+ echo "$progname: Use a config file or option to specify the mode; see:" >&2
+ echo "$progname: http://tug.org/texinfohtml/kpathsea.html#Unable-to-generate-fonts" >&2
+ exit 1
+ esac
+ fi
+
+ # Run Metafont. Always use plain Metafont, since reading cmbase.mf
+ # does not noticeably slow things down.
+ cmd="$MF \mode:=$MODE; mag:=$MAG; nonstopmode; input $NAME"
+else
+ MODE=modeless
+ # ps_to_pk is set in mktex.opt
+ case $ps_to_pk in
+ gsftopk)
+ if $ps_to_pk -t "$NAME"; then
+ cmd="$ps_to_pk $NAME $DPI"
+ fi;;
+ ps2pk)
+ # grep for the font in $PSMAPFILE. These are base font names, such as
+ # rpplr (the original) or pplr0 (an interim step) or pplr8r (current).
+ : ${PSMAPFILE=`kpsewhich --format=map psfonts.map ps2pk.map`}
+ pattern="^$NAME"'([ ]|$)'
+ psline=`egrep "$pattern" $PSMAPFILE | tail -1`
+ if test -n "$psline"; then
+ set x `echo "$psline" | sed 's%[<["]%%g'`
+ shift; shift; shift;
+ encoding=; psname=; slant=; extend=
+ while test ! -z "$1"; do
+ case "$1" in
+ *.enc) encoding="-e $1";;
+ *.pf[ab]) psname="$1";;
+ *SlantFont) slant="-S $lastopt";;
+ *ExtendFont) extend="-E $lastopt";;
+ esac
+ lastopt="$1"
+ shift
+ done
+ # Guessing the name of the type1 font file as fallback:
+ ANAME=`echo $NAME | sed 's/8r$/8a/'`
+ for i in $NAME.pfa $NAME.pfb $ANAME.pfa $ANAME.pfb; do
+ if kpsewhich $i >/dev/null 2>&1; then
+ psname=$i
+ break
+ fi
+ done
+
+ if [ -n "$psname" ]; then
+ cmd="ps2pk -v -X$DPI -R$BDPI $slant $extend $encoding $psname $NAME.${DPI}pk"
+ else
+ if gsftopk -t "$NAME"; then
+ echo "$progname: cannot find $NAME.pfa or $NAME.pfb. Trying gsftopk." >&2
+ cmd="gsftopk $NAME $DPI"
+ fi
+ fi
+ fi;;
+ esac
+
+ # unsupported by $ps_to_pk, try other conversions:
+ if test -z "$cmd"; then
+ if (ttf2pk -t -q $NAME) >/dev/null 2>&1; then
+ cmd="ttf2pk -q $NAME $DPI"
+ elif (hbf2gf -t -q $NAME) >/dev/null 2>&1; then
+ cmd="hbf2gf -q -p $NAME $DPI"
+ else
+ echo "$progname: don't know how to create bitmap font for $NAME." >&2
+ exit 1
+ fi
+ fi
+fi
+
+OIFS=$IFS; IFS=$SEP
+set x `"$MT_MKTEXNAM" $NAME $DPI $MODE $DEST`; shift
+IFS=$OIFS
+
+PKDEST="$1"
+PKDESTDIR=`echo "$PKDEST" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname
+PKNAME=`basename "$PKDEST"`
+GFNAME=$NAME.${DPI}gf
+
+if test -r "$PKDESTDIR/$PKNAME"; then
+ echo "$progname: $PKDESTDIR/$PKNAME already exists." >&2
+ echo "$PKDESTDIR/$PKNAME" >$STDOUT
+ "$MT_MKTEXUPD" "$PKDESTDIR" $PKNAME
+ exit 0
+fi
+
+"$MT_MKTEXDIR" "$PKDESTDIR"
+if test ! -d "$PKDESTDIR"; then
+ echo "$progname: mktexdir $PKDESTDIR failed." >&2
+ exit 1
+fi
+
+echo "$progname: Running $cmd"
+$cmd </dev/null || {
+ # Don't abort if only "Strange path", "bad pos" or "angle(0,0)"
+ # errors occurr.
+ grep '^!' $NAME.log | sort >$$.errs 2>/dev/null
+ grep '^! Strange path' $$.errs >$$.strange 2>/dev/null
+ grep '^! bad pos.' $$.errs >$$.badpos 2>/dev/null
+ grep '^! angle(0,0) is taken as zero.' $$.errs >$$.angle 2>/dev/null
+ cat $$.badpos $$.strange $$.angle | sort > $$.errs_accept
+ if cmp $$.errs $$.errs_accept >/dev/null 2>&1; then
+ test -s $$.strange >/dev/null 2>&1 \
+ && echo "$progname: warning: \`$cmd' caused strange path errors." >&2
+ test -s $$.badpos >/dev/null 2>&1 \
+ && echo "$progname: warning: \`$cmd' caused bad pos errors." >&2
+ test -s $$.angle >/dev/null 2>&1 \
+ && echo "$progname: warning: \`$cmd' caused angle(0,0) errors." >&2
+ else
+ echo "$progname: \`$cmd' failed." >&2
+ test -s $NAME.log && mv -f $NAME.log "$KPSE_DOT"
+ exit 1;
+ fi
+}
+
+test -r $GFNAME && { gftopk ./$GFNAME $PKNAME || exit 1; }
+test ! -f $PKNAME && test -f $NAME.${DPI}pk && mv $NAME.${DPI}pk $PKNAME
+if test ! -s $PKNAME; then
+ echo "$progname: \`$cmd' failed to make $PKNAME." >&2
+ exit 1
+fi
+
+# Install the PK file carefully, since others may be working simultaneously.
+# Use cp when mv fails, since DOS will fail mv for deeply-nested directories.
+mv $PKNAME "$PKDESTDIR/pk$$.tmp" 2>/dev/null \
+ || cp $PKNAME "$PKDESTDIR/pk$$.tmp" || exit 1
+cd $PKDESTDIR || exit 1
+chmod `kpsestat -xst,go-w .` pk$$.tmp
+test -r $PKNAME || mv pk$$.tmp $PKNAME || exit 1
+
+# Update ls-R if necessary.
+"$MT_MKTEXUPD" "$PKDESTDIR" $PKNAME
+
+# If this line (or an equivalent) is not present, dvipsk/xdvik/dviljk
+# will think mktexpk failed. Any other output to stdout will also lose.
+echo "$PKDESTDIR/$PKNAME" >$STDOUT
+echo "$progname: $PKDESTDIR/$PKNAME: successfully generated." >&2
+) 1>&2 </dev/null
diff --git a/Build/source/texk/kpathsea/mktexpk.man b/Build/source/texk/kpathsea/mktexpk.man
new file mode 100644
index 00000000000..1d455532236
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexpk.man
@@ -0,0 +1,122 @@
+.TH MKTEXPK 1 "4 January 1998" "Kpathsea @VERSION@"
+.\"=====================================================================
+.if n .ds MP MetaPost
+.if t .ds MP MetaPost
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.\"=====================================================================
+.SH NAME
+mktexpk \- create a PK file for a font
+.SH SYNOPSIS
+.B mktexpk
+.RI [ options ]
+.I font
+.RI [ redirect ]
+.\"=====================================================================
+.SH DESCRIPTION
+This manual page is not meant to be exhaustive. The complete
+documentation for this version of \*(TX can be found in the info file
+or manual
+.IR "Kpathsea: A library for path searching" .
+.PP
+.B mktexpk
+is used to generate a
+.I pk
+file from the \*(MF source files or type1 sources for
+.IR font ,
+if possible.
+.PP
+If
+.I redirect
+is given, it must be string of the form
+.I >&n
+where
+.I n
+is the number of the file descriptor which is to receive, instead of
+standard output, the name of the generated file.
+.PP
+.B mktexpk
+is typically called by other programs, rather than from the command
+line.
+.\"=====================================================================
+.SH OPTIONS
+.B mktexpk
+accepts the following options:
+.TP
+.BI --bdpi \ num
+Set the base device resolution.
+.rb
+.TP
+.BI --dpi \ num
+Generate the font at resolution
+.IR num .
+.rb
+.TP
+.B --help
+.rb
+Print help message and exit.
+.TP
+.BI --mag \ mag
+The \*(MF magnification that corresponds to the combination of
+.I bdpi
+and
+.I dpi
+that has been specified.
+.rb
+.TP
+.BI --mfmode \ mode
+The \*(MF mode to use.
+.rb
+.TP
+.BI --destdir \ dir
+A directory name. If the directory is absolute, it is used as-is.
+Otherwise, it is appended to the root destination directory set in the
+script.
+.rb
+.TP
+.B --version
+.rb
+Print version information and exit.
+.\"=====================================================================
+.SH BUGS
+If the
+.I mode
+is not specified,
+.B mktexpk
+tries to determine it from
+.IR bdpi .
+The manner in which this is done is primitive. Since
+.I bpdi
+doesn't provide sufficient information to uniquely determine a
+.I mode
+it is strongly recommended that it be specified explicitly.
+.PP
+If the
+.I mode
+and
+.I bpdi
+don't match, the
+.I mode
+is discarded.
+.PP
+The
+.I dpi
+parameter is redundant, but is not checked for consistency. Worse,
+the program will fail if the wrong
+.I dpi
+is specified.
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR mktexmf (1),
+.BR mktextfm (1).
diff --git a/Build/source/texk/kpathsea/mktextfm b/Build/source/texk/kpathsea/mktextfm
new file mode 100755
index 00000000000..a423d0309b0
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktextfm
@@ -0,0 +1,152 @@
+#!/bin/sh
+# original mktextfm -- make a new TFM file, because one wasn't found.
+#
+# (If you change or delete the word `original' on the previous line,
+# installation won't write this script over yours.)
+#
+# te@dbs.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl.
+# Public domain.
+
+version='$Id: mktextfm,v 1.27 2004/07/03 19:25:15 olaf Exp $'
+progname=`echo $0 | sed 's%.*/%%'`
+usage="Usage: $progname [--destdir DESTDIR] FONT.
+
+Makes a TFM file for FONT, if possible. Use DESTDIR for the root of where
+to install into, either the absolute directory name to use (if it starts
+with a /) or relative to the default DESTDIR (if not)."
+
+# Handle non-positional options, except for --version/--help
+while test $# -gt 0; do
+ case "$1" in
+ --destdir) shift; DEST="$1"; shift ;;
+ --destdir=*) DEST=`echo "$1" | sed 's/--destdir=//'`; shift ;;
+ --version|-version) break ;;
+ --help|-help) break ;;
+ *) break ;;
+ esac
+done
+
+# Common code for all scripts.
+: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`}
+: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`}
+test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt"
+if test ! -f "$MT_MKTEX_OPT"; then
+ echo "$progname: Cannot find mktex.opt; check your installation." >&2
+ exit 1
+fi
+
+. "$MT_MKTEX_OPT"
+
+# Where do potential mf driver files go?
+case "$MT_FEATURES" in
+ *nomfdrivers*)
+ : ${MT_MFDESTDIR=`pwd`}
+ export MT_MFDESTDIR;;
+esac
+
+# start of redirection stdout -> stderr, stdin <- /dev/null
+(
+
+NAME=`basename "$1" .tfm`
+MAG=1
+#DEST="$2"
+DPI=$BDPI
+
+OIFS=$IFS; IFS=$SEP
+set x `"$MT_MKTEXNAM" $NAME $DPI $MODE $DEST`; shift
+IFS=$OIFS
+
+PKDEST="$1"
+TFMDEST="$2"
+PKDESTDIR=`echo "$PKDEST" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname
+TFMDESTDIR=`echo "$TFMDEST" | sed 's%/[^/][^/]*$%%'`
+PKNAME=`basename "$PKDEST"`
+TFMNAME=$NAME.tfm
+GFNAME=$NAME.$DPI'gf'
+
+if test -r "$TFMDESTDIR/$TFMNAME"; then
+ echo "$progname: $TFMDESTDIR/$TFMNAME already exists." >&2
+ echo "$TFMDESTDIR/$TFMNAME" >$STDOUT
+ "$MT_MKTEXUPD" "$TFMDESTDIR" $TFMNAME
+ exit
+fi
+
+# Try to create the destdir first. Do not create fonts, if this fails.
+"$MT_MKTEXDIR" "$TFMDESTDIR"
+if test ! -d "$TFMDESTDIR"; then
+ echo "$progname: mktexdir $TFMDESTDIR failed."
+ exit 1
+fi
+
+# Check if this font is supported by hbf2gf else use metafont.
+if (hbf2gf -q -t $NAME) >/dev/null 2>&1; then
+ cmd="hbf2gf -g $NAME $DPI"
+else
+ # determine the progname of metafont to use; prefer mf-nowin.
+ if (mf-nowin --version) >/dev/null 2>&1; then
+ MF="mf-nowin -progname=mf"
+ else
+ MF=mf
+ fi
+
+ cmd="$MF \mode:=$MODE; mag:=$MAG; nonstopmode; input $NAME"
+fi
+
+echo "$progname: Running $cmd"
+$cmd </dev/null || {
+ # Don't abort if only "Strange path", "bad pos" or "angle(0,0)"
+ # errors occurr.
+ grep '^!' $NAME.log | sort >$$.errs 2>/dev/null
+ grep '^! Strange path' $$.errs >$$.strange 2>/dev/null
+ grep '^! bad pos.' $$.errs >$$.badpos 2>/dev/null
+ grep '^! angle(0,0) is taken as zero.' $$.errs >$$.angle 2>/dev/null
+ cat $$.badpos $$.strange $$.angle | sort > $$.errs_accept
+ if cmp $$.errs $$.errs_accept >/dev/null 2>&1; then
+ test -s $$.strange >/dev/null 2>&1 \
+ && echo "$progname: warning: \`$cmd' caused strange path errors." >&2
+ test -s $$.badpos >/dev/null 2>&1 \
+ && echo "$progname: warning: \`$cmd' caused bad pos errors." >&2
+ test -s $$.angle >/dev/null 2>&1 \
+ && echo "$progname: warning: \`$cmd' caused angle(0,0) errors." >&2
+ else
+ echo "$progname: \`$cmd' failed." >&2
+ test -s $NAME.log && mv -f $NAME.log "$KPSE_DOT"
+ exit 1;
+ fi
+}
+
+# hbf2gf just produces a .pl file:
+test -r ./$NAME.pl && pltotf ./$NAME.pl $TFMNAME
+test -r $TFMNAME || { echo "$progname: \`$cmd' failed to make $TFMNAME."; exit 1; }
+
+# Install the TFM file carefully, since others may be working simultaneously.
+# Use cp when mv fails, since DOS will fail mv for deeply-nested directories.
+mv $TFMNAME "$TFMDESTDIR/tfm$$.tmp" 2>/dev/null \
+ || cp $TFMNAME "$TFMDESTDIR/tfm$$.tmp" || exit 1
+cd "$TFMDESTDIR" || exit 1
+chmod `kpsestat -xst,go-w .` tfm$$.tmp
+test -r $TFMNAME || mv tfm$$.tmp $TFMNAME || exit 1
+
+# OK, success with the TFM.
+"$MT_MKTEXUPD" "$TFMDESTDIR" $TFMNAME
+echo "$TFMDESTDIR/$TFMNAME" >$STDOUT
+echo "$progname: $TFMDESTDIR/$TFMNAME: successfully generated." >&2
+
+# Since we probably made a GF(->PK) file, too, may as well install it if
+# it's needed.
+cd $TEMPDIR
+if test -r $GFNAME && test ! -f "$PKDESTDIR/$PKNAME"; then
+ gftopk ./$GFNAME $PKNAME || exit 1
+ "$MT_MKTEXDIR" "$PKDESTDIR"
+ mv $PKNAME "$PKDESTDIR/pk$$.tmp" 2>/dev/null \
+ || cp $PKNAME "$PKDESTDIR/pk$$.tmp" || exit 1
+ cd "$PKDESTDIR" || exit 1
+ if test -f $PKNAME; then
+ rm -f pk$$.tmp
+ else
+ chmod `kpsestat -xst,go-w .` pk$$.tmp
+ mv pk$$.tmp $PKNAME
+ "$MT_MKTEXUPD" "$PKDESTDIR" $PKNAME
+ fi
+fi
+) 1>&2 </dev/null
diff --git a/Build/source/texk/kpathsea/mktextfm.man b/Build/source/texk/kpathsea/mktextfm.man
new file mode 100644
index 00000000000..5ed015ade4b
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktextfm.man
@@ -0,0 +1,68 @@
+.TH MKTEXTFM 1 "4 January 1998" "Kpathsea @VERSION@"
+.\"=====================================================================
+.if n .ds MP MetaPost
+.if t .ds MP MetaPost
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.\"=====================================================================
+.SH NAME
+mktextfm \- create a TFM file for a font
+.SH SYNOPSIS
+.B mktextfm
+.RI [options]
+.I font
+.\"=====================================================================
+.SH DESCRIPTION
+This manual page is not meant to be exhaustive. The complete
+documentation for this version of \*(TX can be found in the info file
+or manual
+.IR "Kpathsea: A library for path searching" .
+.PP
+.B mktextfm
+is used to generate a
+.I tfm
+file from the \*(MF source files for
+.IR font ,
+if possible. If
+.I destdir
+is given, the generated file will be installed there, otherwise a
+(rather complicated) heuristic is used.
+.PP
+The name of the generated file is printed on standard output.
+.PP
+.B mktextfm
+is typically called by other programs, rather than from the command
+line.
+.\"=====================================================================
+.SH OPTIONS
+.B mktextfm
+accepts the following options:
+.TP
+.BI --destdir \ dir
+.rb
+A directory name. If the directory is absolute, it is used as-is.
+Otherwise, it is appended to the root destination directory set in the
+script.
+.TP
+.B --help
+.rb
+Print help message and exit.
+.TP
+.B --version
+.rb
+Print version information and exit.
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR mktexmf (1),
+.BR mktexpk (1).
diff --git a/Build/source/texk/kpathsea/mktexupd b/Build/source/texk/kpathsea/mktexupd
new file mode 100755
index 00000000000..317ec9eb8aa
--- /dev/null
+++ b/Build/source/texk/kpathsea/mktexupd
@@ -0,0 +1,56 @@
+#!/bin/sh
+# mktexupd -- update ls-R with a new entry.
+#
+# te@dbs.uni-hannover.de and kb@mail.tug.org. Public domain.
+
+version='$Id: mktexupd,v 1.20 2004/12/19 12:41:13 olaf Exp $'
+usage="Usage: $0 DIR FILE.
+ Update the ls-R file with an entry for FILE in DIR."
+mt_min_args=2
+mt_max_args=2
+
+# Common code for all scripts.
+: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`}
+: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`}
+test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt"
+if test ! -f "$MT_MKTEX_OPT"; then
+ echo "$0: Cannot find mktex.opt; check your installation." >&2
+ exit 1
+fi
+
+. "$MT_MKTEX_OPT"
+
+dir=$1
+file=$2
+test -d "$dir" || { echo "$0: $dir not a directory." >&2; exit 1; }
+test -f "$dir/$file" || { echo "$0: $dir/$file not a file." >&2; exit 1; }
+
+OIFS=$IFS; IFS=$SEP; set x `kpsewhich -show-path=ls-R`; shift; IFS=$OIFS
+TEXMFLS_R=
+for d in "$@"; do
+ case $dir in
+ "") continue;;
+ ${d}|${d}/*) TEXMFLS_R="$d"; break;;
+ esac
+done
+test -n "$TEXMFLS_R" || exit 0
+db_file="$TEXMFLS_R/ls-R"
+db_file_lc="$TEXMFLS_R/ls-r"
+
+test ! -f "$db_file" && test -f "$db_file_lc" && db_file="$db_file_lc"
+test -f "$db_file" || { mktexlsr "$TEXMFLS_R"; exit; }
+test -w "$db_file" || { echo "$0: $db_file unwritable." >&2; exit 1; }
+
+test "x`sed '1s/ $//;1q' \"$db_file\"`" = "x$ls_R_magic" \
+ || test "x`sed '1s/ $//;1q' \"$db_file\"`" = "x$old_ls_R_magic" \
+ || { echo "$0: $db_file lacks magic string \`$ls_R_magic'." >&2; exit 1; }
+
+# Change `$TEXMFLS_R/' to `./'.
+dir=`echo $dir | sed "s%^$TEXMFLS_R/%./%g"`
+
+# May as well always put in a new directory entry; presumably cron will
+# come along soon enough and clean things up.
+echo "$dir:" >>"$db_file"
+echo "$file" >>"$db_file"
+
+exit 0
diff --git a/Build/source/texk/kpathsea/path-elt.c b/Build/source/texk/kpathsea/path-elt.c
new file mode 100644
index 00000000000..ab2944f3ebd
--- /dev/null
+++ b/Build/source/texk/kpathsea/path-elt.c
@@ -0,0 +1,148 @@
+/* path-elt.c: Return the stuff between colons.
+
+ Copyright 1997, 2001, 2005 Olaf Weber.
+ Copyright 1993, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/pathsearch.h>
+
+
+/* The static (but dynamically allocated) area we return the answer in,
+ and how much we've currently allocated for it. */
+static string elt = NULL;
+static unsigned elt_alloc = 0;
+
+/* The path we're currently working on. */
+static const_string path = NULL;
+
+
+/* Upon entry, the static `path' is at the first (and perhaps last)
+ character of the return value, or else NULL if we're at the end (or
+ haven't been called). I make no provision for caching the results;
+ thus, we parse the same path over and over, on every lookup. If that
+ turns out to be a significant lose, it can be fixed, but I'm guessing
+ disk accesses overwhelm everything else. If ENV_P is true, use
+ IS_ENV_SEP; else use IS_DIR_SEP. */
+
+static string
+element P2C(const_string, passed_path, boolean, env_p)
+{
+ const_string p;
+ string ret;
+ int brace_level;
+ unsigned len;
+
+ if (passed_path)
+ path = passed_path;
+ /* Check if called with NULL, and no previous path (perhaps we reached
+ the end). */
+ else if (!path)
+ return NULL;
+
+ /* OK, we have a non-null `path' if we get here. */
+ assert (path);
+ p = path;
+
+ /* Find the next colon not enclosed by braces (or the end of the path). */
+ brace_level = 0;
+ while (*p != 0 && !(brace_level == 0
+ && (env_p ? IS_ENV_SEP (*p) : IS_DIR_SEP (*p)))) {
+ if (*p == '{') ++brace_level;
+ else if (*p == '}') --brace_level;
+ ++p;
+ }
+
+ /* Return the substring starting at `path'. */
+ len = p - path;
+
+ /* Make sure we have enough space (including the null byte). */
+ if (len + 1 > elt_alloc)
+ {
+ elt_alloc = len + 1;
+ elt = (string)xrealloc (elt, elt_alloc);
+ }
+
+ strncpy (elt, path, len);
+ elt[len] = 0;
+ ret = elt;
+
+ /* If we are at the end, return NULL next time. */
+ if (path[len] == 0)
+ path = NULL;
+ else
+ path += len + 1;
+
+ return ret;
+}
+
+string
+kpse_path_element P1C(const_string, p)
+{
+ return element (p, true);
+}
+
+string
+kpse_filename_component P1C(const_string, p)
+{
+ return element (p, false);
+}
+
+#ifdef TEST
+
+void
+print_path_elements (const_string path)
+{
+ string elt;
+ printf ("Elements of `%s':", path ? path : "(null)");
+
+ for (elt = kpse_path_element (path); elt != NULL;
+ elt = kpse_path_element (NULL))
+ {
+ printf (" %s", *elt ? elt : "`'");
+ }
+
+ puts (".");
+}
+
+int
+main ()
+{
+ /* All lists end with NULL. */
+ print_path_elements (NULL); /* */
+ print_path_elements (""); /* "" */
+ print_path_elements ("a"); /* a */
+ print_path_elements (ENV_SEP_STRING); /* "", "" */
+ print_path_elements (ENV_SEP_STRING ENV_SEP_STRING); /* "", "", "" */
+ print_path_elements ("a" ENV_SEP_STRING); /* a, "" */
+ print_path_elements (ENV_SEP_STRING "b"); /* "", b */
+ print_path_elements ("a" ENV_SEP_STRING "b"); /* a, b */
+
+ return 0;
+}
+
+#endif /* TEST */
+
+
+/*
+Local variables:
+standalone-compile-command: "gcc -g -I. -I.. -DTEST path-elt.c kpathsea.a"
+End:
+*/
diff --git a/Build/source/texk/kpathsea/pathsearch.c b/Build/source/texk/kpathsea/pathsearch.c
new file mode 100644
index 00000000000..90d21945556
--- /dev/null
+++ b/Build/source/texk/kpathsea/pathsearch.c
@@ -0,0 +1,644 @@
+/* pathsearch.c: look up a filename in a path.
+
+ Copyright 1997-2005 Olaf Weber.
+ Copyright 1993, 94, 95, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/absolute.h>
+#include <kpathsea/expand.h>
+#include <kpathsea/db.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/readable.h>
+#include <kpathsea/str-list.h>
+#include <kpathsea/str-llist.h>
+#include <kpathsea/variable.h>
+
+#include <time.h> /* for `time' */
+
+#ifdef __DJGPP__
+#include <sys/stat.h> /* for stat bits */
+#endif
+
+/* The very first search is for texmf.cnf, called when someone tries to
+ initialize the TFM path or whatever. init_path calls kpse_cnf_get
+ which calls kpse_all_path_search to find all the texmf.cnf's. We
+ need to do various special things in this case, since we obviously
+ don't yet have the configuration files when we're searching for the
+ configuration files. */
+static boolean first_search = true;
+
+
+
+/* This function is called after every search (except the first, since
+ we definitely want to allow enabling the logging in texmf.cnf) to
+ record the filename(s) found in $TEXMFLOG. */
+
+static void
+log_search P1C(str_list_type, filenames)
+{
+ static FILE *log_file = NULL;
+ static boolean first_time = true; /* Need to open the log file? */
+
+ if (first_time) {
+ /* Get name from either envvar or config file. */
+ string log_name = kpse_var_value ("TEXMFLOG");
+ first_time = false;
+ if (log_name) {
+ log_file = fopen (log_name, FOPEN_A_MODE);
+ if (!log_file)
+ perror (log_name);
+ free (log_name);
+ }
+ }
+
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH) || log_file) {
+ unsigned e;
+
+ /* FILENAMES should never be null, but safety doesn't hurt. */
+ for (e = 0; e < STR_LIST_LENGTH (filenames) && STR_LIST_ELT (filenames, e);
+ e++) {
+ string filename = STR_LIST_ELT (filenames, e);
+
+ /* Only record absolute filenames, for privacy. */
+ if (log_file && kpse_absolute_p (filename, false))
+ fprintf (log_file, "%lu %s\n", (long unsigned) time (NULL),
+ filename);
+
+ /* And show them online, if debugging. We've already started
+ the debugging line in `search', where this is called, so
+ just print the filename here, don't use DEBUGF. */
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) {
+ putc (' ', stderr);
+ fputs (filename, stderr);
+ }
+ }
+ }
+}
+
+/* Concatenate each element in DIRS with NAME (assume each ends with a
+ /, to save time). If SEARCH_ALL is false, return the first readable
+ regular file. Else continue to search for more. In any case, if
+ none, return a list containing just NULL.
+
+ We keep a single buffer for the potential filenames and reallocate
+ only when necessary. I'm not sure it's noticeably faster, but it
+ does seem cleaner. (We do waste a bit of space in the return
+ value, though, since we don't shrink it to the final size returned.) */
+
+#define INIT_ALLOC 75 /* Doesn't much matter what this number is. */
+
+static str_list_type
+dir_list_search P3C(str_llist_type *, dirs, const_string, name,
+ boolean, search_all)
+{
+ str_llist_elt_type *elt;
+ str_list_type ret;
+ unsigned name_len = strlen (name);
+ unsigned allocated = INIT_ALLOC;
+ string potential = (string)xmalloc (allocated);
+
+ ret = str_list_init ();
+
+ for (elt = *dirs; elt; elt = STR_LLIST_NEXT (*elt))
+ {
+ const_string dir = STR_LLIST (*elt);
+ unsigned dir_len = strlen (dir);
+
+ while (dir_len + name_len + 1 > allocated)
+ {
+ allocated += allocated;
+ XRETALLOC (potential, allocated, char);
+ }
+
+ strcpy (potential, dir);
+ strcat (potential, name);
+
+ if (kpse_readable_file (potential))
+ {
+ str_list_add (&ret, potential);
+
+ /* Move this element towards the top of the list. */
+ str_llist_float (dirs, elt);
+
+ /* If caller only wanted one file returned, no need to
+ terminate the list with NULL; the caller knows to only look
+ at the first element. */
+ if (!search_all)
+ return ret;
+
+ /* Start new filename. */
+ allocated = INIT_ALLOC;
+ potential = (string)xmalloc (allocated);
+ }
+ }
+
+ /* If we get here, either we didn't find any files, or we were finding
+ all the files. But we're done with the last filename, anyway. */
+ free (potential);
+
+ return ret;
+}
+
+static str_list_type
+dir_list_search_list P3C(str_llist_type *, dirs, const_string*, names,
+ boolean, search_all)
+{
+ str_llist_elt_type *elt;
+ str_list_type ret;
+ unsigned allocated = INIT_ALLOC;
+ string potential = XTALLOC(allocated, char);
+
+ ret = str_list_init ();
+
+ for (elt = *dirs; elt; elt = STR_LLIST_NEXT(*elt)) {
+ const_string dir = STR_LLIST (*elt);
+ unsigned dir_len = strlen (dir);
+ int i;
+
+ for (i = 0; names[i]; i++) {
+ const_string name = names[i];
+ unsigned name_len;
+
+ /* Don't bother with absolute & explicit relative. */
+ if (kpse_absolute_p(name, true))
+ continue;
+
+ name_len = strlen(name);
+
+ while (dir_len + name_len + 1 > allocated) {
+ allocated += allocated;
+ XRETALLOC (potential, allocated, char);
+ }
+
+ strcpy (potential, dir);
+ strcat (potential+dir_len, name);
+
+ if (kpse_readable_file (potential)) {
+ str_list_add (&ret, potential);
+
+ /* Move this element towards the top of the list. */
+ str_llist_float (dirs, elt);
+
+ /* If caller only wanted one file returned, no need to
+ terminate the list with NULL; the caller knows to only look
+ at the first element. */
+ if (!search_all)
+ return ret;
+
+ /* Start new filename. */
+ allocated = INIT_ALLOC;
+ potential = XTALLOC(allocated, char);
+ }
+ }
+ }
+
+ /* If we get here, either we didn't find any files, or we were finding
+ all the files. But we're done with the last filename, anyway. */
+ free (potential);
+
+ return ret;
+}
+
+/* This is called when NAME is absolute or explicitly relative; if it's
+ readable, return (a list containing) it; otherwise, return NULL. */
+
+static str_list_type
+absolute_search P1C(string, name)
+{
+ str_list_type ret_list;
+ string found = kpse_readable_file (name);
+
+ /* Some old compilers can't initialize structs. */
+ ret_list = str_list_init ();
+
+ /* If NAME wasn't found, free the expansion. */
+ if (name != found)
+ free (name);
+
+ /* Add `found' to the return list even if it's null; that tells
+ the caller we didn't find anything. */
+ str_list_add (&ret_list, found);
+
+ return ret_list;
+}
+
+/* This is the hard case -- look for NAME in PATH. If ALL is false,
+ return the first file found. Otherwise, search all elements of PATH. */
+
+static str_list_type
+path_search P4C(const_string, path, string, name,
+ boolean, must_exist, boolean, all)
+{
+ string elt;
+ str_list_type ret_list;
+ boolean done = false;
+ ret_list = str_list_init (); /* some compilers lack struct initialization */
+
+ for (elt = kpse_path_element (path); !done && elt;
+ elt = kpse_path_element (NULL)) {
+ str_list_type *found;
+ boolean allow_disk_search = true;
+
+ if (*elt == '!' && *(elt + 1) == '!') {
+ /* Those magic leading chars in a path element means don't search the
+ disk for this elt. And move past the magic to get to the name. */
+ allow_disk_search = false;
+ elt += 2;
+ }
+
+ /* See elt-dirs.c for side effects of this function */
+ kpse_normalize_path(elt);
+
+ /* Try ls-R, unless we're searching for texmf.cnf. Our caller
+ (search), also tests first_search, and does the resetting. */
+ found = first_search ? NULL : kpse_db_search (name, elt, all);
+
+ /* Search the filesystem if (1) the path spec allows it, and either
+ (2a) we are searching for texmf.cnf ; or
+ (2b) no db exists; or
+ (2c) no db's are relevant to this elt; or
+ (3) MUST_EXIST && NAME was not in the db.
+ In (2*), `found' will be NULL.
+ In (3), `found' will be an empty list. */
+ if (allow_disk_search && (!found || (must_exist && !STR_LIST (*found)))) {
+ str_llist_type *dirs = kpse_element_dirs (elt);
+ if (dirs && *dirs) {
+ if (!found)
+ found = XTALLOC1 (str_list_type);
+ *found = dir_list_search (dirs, name, all);
+ }
+ }
+
+ /* Did we find anything anywhere? */
+ if (found && STR_LIST (*found))
+ if (all)
+ str_list_concat (&ret_list, *found);
+ else {
+ str_list_add (&ret_list, STR_LIST_ELT (*found, 0));
+ done = true;
+ }
+
+ /* Free the list space, if any (but not the elements). */
+ if (found) {
+ str_list_free (found);
+ free (found);
+ }
+ }
+
+ /* Free the expanded name we were passed. It can't be in the return
+ list, since the path directories got unconditionally prepended. */
+ free (name);
+
+ return ret_list;
+}
+
+/* Search PATH for ORIGINAL_NAME. If ALL is false, or ORIGINAL_NAME is
+ absolute_p, check ORIGINAL_NAME itself. Otherwise, look at each
+ element of PATH for the first readable ORIGINAL_NAME.
+
+ Always return a list; if no files are found, the list will
+ contain just NULL. If ALL is true, the list will be
+ terminated with NULL. */
+
+static string *
+search P4C(const_string, path, const_string, original_name,
+ boolean, must_exist, boolean, all)
+{
+ str_list_type ret_list;
+ string name;
+ boolean absolute_p;
+
+#ifdef __DJGPP__
+ /* We will use `stat' heavily, so let's request for
+ the fastest possible version of `stat', by telling
+ it what members of struct stat do we really need.
+
+ We need to set this on each call because this is a
+ library function; the caller might need other options
+ from `stat'. Thus save the flags and restore them
+ before exit.
+
+ This call tells `stat' that we do NOT need to recognize
+ executable files (neither by an extension nor by a magic
+ signature); that we do NOT need time stamp of root directories;
+ and that we do NOT need the write access bit in st_mode.
+
+ Note that `kpse_set_progname' needs the EXEC bits,
+ but it was already called by the time we get here. */
+ unsigned short save_djgpp_flags = _djstat_flags;
+
+ _djstat_flags = _STAT_EXEC_MAGIC | _STAT_EXEC_EXT
+ | _STAT_ROOT_TIME | _STAT_WRITEBIT;
+#endif
+
+ /* Make a leading ~ count as an absolute filename, and expand $FOO's. */
+ name = kpse_expand (original_name);
+
+ /* If the first name is absolute or explicitly relative, no need to
+ consider PATH at all. */
+ absolute_p = kpse_absolute_p (name, true);
+
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH))
+ DEBUGF4 ("start search(file=%s, must_exist=%d, find_all=%d, path=%s).\n",
+ name, must_exist, all, path);
+
+ /* Find the file(s). */
+ ret_list = absolute_p ? absolute_search (name)
+ : path_search (path, name, must_exist, all);
+
+ /* Append NULL terminator if we didn't find anything at all, or we're
+ supposed to find ALL and the list doesn't end in NULL now. */
+ if (STR_LIST_LENGTH (ret_list) == 0
+ || (all && STR_LIST_LAST_ELT (ret_list) != NULL))
+ str_list_add (&ret_list, NULL);
+
+ /* The very first search is for texmf.cnf. We can't log that, since
+ we want to allow setting TEXMFLOG in texmf.cnf. */
+ if (first_search) {
+ first_search = false;
+ } else {
+ /* Record the filenames we found, if desired. And wrap them in a
+ debugging line if we're doing that. */
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH))
+ DEBUGF1 ("search(%s) =>", original_name);
+ log_search (ret_list);
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH))
+ putc ('\n', stderr);
+ }
+
+#ifdef __DJGPP__
+ /* Undo any side effects. */
+ _djstat_flags = save_djgpp_flags;
+#endif
+
+ return STR_LIST (ret_list);
+}
+
+/* Search PATH for NAMES.
+
+ Always return a list; if no files are found, the list will
+ contain just NULL. If ALL is true, the list will be
+ terminated with NULL. */
+static string *
+search_list P4C(const_string, path, const_string*, names,
+ boolean, must_exist, boolean, all)
+{
+ str_list_type ret_list;
+ const_string* namep;
+ string elt;
+ boolean done = false;
+ boolean all_absolute = true;
+
+#ifdef __DJGPP__
+ /* We will use `stat' heavily, so let's request for
+ the fastest possible version of `stat', by telling
+ it what members of struct stat do we really need.
+
+ We need to set this on each call because this is a
+ library function; the caller might need other options
+ from `stat'. Thus save the flags and restore them
+ before exit.
+
+ This call tells `stat' that we do NOT need to recognize
+ executable files (neither by an extension nor by a magic
+ signature); that we do NOT need time stamp of root directories;
+ and that we do NOT need the write access bit in st_mode.
+
+ Note that `kpse_set_progname' needs the EXEC bits,
+ but it was already called by the time we get here. */
+ unsigned short save_djgpp_flags = _djstat_flags;
+
+ _djstat_flags = _STAT_EXEC_MAGIC | _STAT_EXEC_EXT
+ | _STAT_ROOT_TIME | _STAT_WRITEBIT;
+#endif
+
+ ret_list = str_list_init();
+
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) {
+ DEBUGF1 ("start search(files=[%s", *names);
+ for (namep = names+1; *namep != NULL; namep++) {
+ fputc(' ', stderr);
+ fputs(*namep, stderr);
+ }
+ fprintf (stderr, "], must_exist=%d, find_all=%d, path=%s).\n",
+ must_exist, all, path);
+ }
+
+ /* FIXME: is this really true? No need to do any expansion on names. */
+
+ /* First catch any absolute or explicit relative names. */
+ for (namep = names; *namep; namep++) {
+ if (kpse_absolute_p(*namep, true)) {
+ if (kpse_readable_file(*namep)) {
+ str_list_add(&ret_list, xstrdup(*namep));
+ /* I know, I know... */
+ if (!all)
+ goto out;
+ }
+ } else {
+ all_absolute = false;
+ }
+ }
+ /* Shortcut: if we were only given absolute/explicit relative names,
+ we can skip the rest. Typically, if one name is absolute, they
+ all are, because our caller derived them from each other. */
+ if (all_absolute)
+ goto out;
+
+ /* Look at each path element in turn. */
+ for (elt = kpse_path_element (path); !done && elt;
+ elt = kpse_path_element (NULL))
+ {
+ str_list_type *found;
+ boolean allow_disk_search = true;
+ if (elt[0] == '!' && elt[1] == '!') {
+ /* !! magic -> disallow disk searches. */
+ allow_disk_search = false;
+ elt += 2;
+ }
+
+ /* See elt-dirs.c for side effects of this function. */
+ kpse_normalize_path(elt);
+
+ /* Try ls-R, unless we're searching for texmf.cnf. */
+ found = first_search ? NULL : kpse_db_search_list(names, elt, all);
+
+ /* Search the filesystem if (1) the path spec allows it, and either
+ (2a) we are searching for texmf.cnf ; or
+ (2b) no db exists; or
+ (2c) no db's are relevant to this elt; or
+ (3) MUST_EXIST && NAME was not in the db.
+ In (2*), `found' will be NULL.
+ In (3), `found' will be an empty list. */
+ if (allow_disk_search && (!found || (must_exist && !STR_LIST(*found)))) {
+ str_llist_type *dirs = kpse_element_dirs (elt);
+ if (dirs && *dirs) {
+ if (!found)
+ found = XTALLOC1 (str_list_type);
+ *found = dir_list_search_list (dirs, names, all);
+ }
+ }
+
+ /* Did we find anything? */
+ if (found && STR_LIST (*found)) {
+ if (all) {
+ str_list_concat (&ret_list, *found);
+ } else {
+ str_list_add (&ret_list, STR_LIST_ELT (*found, 0));
+ done = true;
+ }
+ }
+ }
+
+ out:
+ if (STR_LIST_LENGTH (ret_list) == 0
+ || (all && STR_LIST_LAST_ELT (ret_list) != NULL))
+ str_list_add (&ret_list, NULL);
+
+ if (first_search) {
+ first_search = false;
+ } else {
+ /* Record the filenames we found, if desired. And wrap them in a
+ debugging line if we're doing that. */
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) {
+ DEBUGF1 ("search([%s", *names);
+ for (namep = names+1; *namep != NULL; namep++) {
+ fputc(' ', stderr);
+ fputs(*namep, stderr);
+ }
+ fputs ("]) =>", stderr);
+ }
+ log_search (ret_list);
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH))
+ putc ('\n', stderr);
+ }
+
+#ifdef __DJGPP__
+ /* Undo any side effects. */
+ _djstat_flags = save_djgpp_flags;
+#endif
+
+ return STR_LIST (ret_list);
+}
+
+/* Search PATH for the first NAME. */
+
+string
+kpse_path_search P3C(const_string, path, const_string, name,
+ boolean, must_exist)
+{
+ string *ret_list = search (path, name, must_exist, false);
+ string ret = *ret_list;
+ free (ret_list);
+ return ret;
+}
+
+/* Search PATH for the first occurence of one of the NAMES. */
+
+string
+kpse_path_search_list P3C(const_string, path, const_string*, names,
+ boolean, must_exist)
+{
+ string *ret_list = search_list (path, names, must_exist, false);
+ string ret = *ret_list;
+ free (ret_list);
+ return ret;
+}
+
+/* Search all elements of PATH for files named NAME. Not sure if it's
+ right to assert `must_exist' here, but it suffices now. */
+
+string *
+kpse_all_path_search P2C(const_string, path, const_string, name)
+{
+ string *ret = search (path, name, true, true);
+ return ret;
+}
+
+string *
+kpse_all_path_search_list P2C(const_string, path, const_string*, names)
+{
+ string *ret = search_list (path, names, true, true);
+ return ret;
+}
+
+#ifdef TEST
+
+void
+test_path_search (const_string path, const_string file)
+{
+ string answer;
+ string *answer_list;
+
+ printf ("\nSearch %s for %s:\t", path, file);
+ answer = kpse_path_search (path, file);
+ puts (answer ? answer : "(nil)");
+
+ printf ("Search %s for all %s:\t", path, file);
+ answer_list = kpse_all_path_search (path, file);
+ putchar ('\n');
+ while (*answer_list)
+ {
+ putchar ('\t');
+ puts (*answer_list);
+ answer_list++;
+ }
+}
+
+#define TEXFONTS "/usr/local/lib/tex/fonts"
+
+int
+main ()
+{
+ /* All lists end with NULL. */
+ test_path_search (".", "nonexistent");
+ test_path_search (".", "/nonexistent");
+ test_path_search ("/k" ENV_SEP_STRING ".", "kpathsea.texi");
+ test_path_search ("/k" ENV_SEP_STRING ".", "/etc/fstab");
+ test_path_search ("." ENV_SEP_STRING TEXFONTS "//", "cmr10.tfm");
+ test_path_search ("." ENV_SEP_STRING TEXFONTS "//", "logo10.tfm");
+ test_path_search (TEXFONTS "//times" ENV_SEP_STRING "."
+ ENV_SEP_STRING ENV_SEP_STRING, "ptmr.vf");
+ test_path_search (TEXFONTS "/adobe//" ENV_SEP_STRING
+ "/usr/local/src/TeX+MF/typefaces//", "plcr.pfa");
+
+ test_path_search ("~karl", ".bashrc");
+ test_path_search ("/k", "~karl/.bashrc");
+
+ xputenv ("NONEXIST", "nonexistent");
+ test_path_search (".", "$NONEXISTENT");
+ xputenv ("KPATHSEA", "kpathsea");
+ test_path_search ("/k" ENV_SEP_STRING ".", "$KPATHSEA.texi");
+ test_path_search ("/k" ENV_SEP_STRING ".", "${KPATHSEA}.texi");
+ test_path_search ("$KPATHSEA" ENV_SEP_STRING ".", "README");
+ test_path_search ("." ENV_SEP_STRING "$KPATHSEA", "README");
+
+ return 0;
+}
+
+#endif /* TEST */
+
+
+/*
+Local variables:
+test-compile-command: "gcc -posix -g -I. -I.. -DTEST pathsearch.c kpathsea.a"
+End:
+*/
diff --git a/Build/source/texk/kpathsea/pathsearch.h b/Build/source/texk/kpathsea/pathsearch.h
new file mode 100644
index 00000000000..927aa2dbd08
--- /dev/null
+++ b/Build/source/texk/kpathsea/pathsearch.h
@@ -0,0 +1,95 @@
+/* pathsearch.h: mostly-generic path searching.
+
+ Copyright 1999-2005 Olaf Weber.
+ Copyright 1993, 94, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_PATHSEARCH_H
+#define KPATHSEA_PATHSEARCH_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/str-llist.h>
+#include <kpathsea/types.h>
+
+/* If PATH is non-null, return its first element (as defined by
+ IS_ENV_SEP). If it's NULL, return the next element in the previous
+ path, a la strtok. Leading, trailing, or doubled colons result in
+ the empty string. When at the end of PATH, return NULL. In any
+ case, return a pointer to an area that may be overwritten on
+ subsequent calls. */
+extern KPSEDLL string kpse_path_element P1H(const_string path);
+
+/* Like `kpse_path_element', but for filename components (using
+ IS_DIR_SEP). Uses same area as `kpse_path_element'. */
+extern string kpse_filename_component P1H(const_string path);
+
+/*
+ This function may rewrite its argument to avoid bugs when calling
+ stat() or equivalent under Win32. Also, it returns the index after
+ which the program should start to look for expandable constructs. */
+extern unsigned kpse_normalize_path P1H(string elt);
+
+/* Given a path element ELT, return a pointer to a NULL-terminated list
+ of the corresponding (existing) directory or directories, with
+ trailing slashes, or NULL. If ELT is the empty string, check the
+ current working directory.
+
+ It's up to the caller to expand ELT. This is because this routine is
+ most likely only useful to be called from `kpse_path_search', which
+ has already assumed expansion has been done. */
+extern KPSEDLL str_llist_type *kpse_element_dirs P1H(string elt);
+
+
+/* Call `kpse_expand' on NAME. If the result is an absolute or
+ explicitly relative filename, check whether it is a readable
+ (regular) file.
+
+ Otherwise, look in each of the directories specified in PATH (also do
+ tilde and variable expansion on elements in PATH), using a prebuilt
+ db (see db.h) if it's relevant for a given path element.
+
+ If the prebuilt db doesn't exist, or if MUST_EXIST is true and NAME
+ isn't found in the prebuilt db, look on the filesystem. (I.e., if
+ MUST_EXIST is false, and NAME isn't found in the db, do *not* look on
+ the filesystem.)
+
+ The caller must expand PATH. This is because it makes more sense to
+ do this once, in advance, instead of for every search using it.
+
+ In any case, return the complete filename if found, otherwise NULL. */
+extern KPSEDLL string kpse_path_search P3H(const_string path,
+ const_string name,
+ boolean must_exist);
+
+/* Like kpse_path_search, except we're given a list of names. */
+extern KPSEDLL string kpse_path_search_list P3H(const_string path,
+ const_string* names,
+ boolean must_exist);
+
+/* Like `kpse_path_search' with MUST_EXIST true, but return a list of
+ all the filenames (or NULL if none), instead of taking the first. */
+extern KPSEDLL string *kpse_all_path_search P2H(const_string path,
+ const_string name);
+
+/* Like `kpse_path_search_list' with MUST_EXIST true, but return a list of
+ all the filenames (or NULL if none), instead of taking the first. */
+extern KPSEDLL string *kpse_all_path_search_list P2H(const_string path,
+ const_string* names);
+
+#endif /* not KPATHSEA_PATHSEARCH_H */
+
diff --git a/Build/source/texk/kpathsea/proginit.c b/Build/source/texk/kpathsea/proginit.c
new file mode 100644
index 00000000000..8cb9c70506d
--- /dev/null
+++ b/Build/source/texk/kpathsea/proginit.c
@@ -0,0 +1,79 @@
+/* proginit.c: useful initializations for DVI drivers.
+
+ Copyright 1997, 2005 Olaf Weber.
+ Copyright 1994, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/proginit.h>
+#include <kpathsea/tex-file.h>
+
+
+/* These initializations were common to all the drivers modified for
+ kpathsea, so a single routine seemed in order. Kind of a bollixed-up
+ mess, but still better than repeating the code. */
+
+void
+kpse_init_prog P4C(const_string, prefix, unsigned, dpi, const_string, mode,
+ const_string, fallback)
+{
+ string font_var = concat (prefix, "FONTS");
+ string header_var = concat (prefix, "HEADERS");
+ string makepk_var = concat (prefix, "MAKEPK");
+ string size_var = concat (prefix, "SIZES");
+
+ /* Do both `pk_format' and `any_glyph_format' for the sake of xdvi; in
+ general, mktexpk might apply to either, and the program will ask
+ for the one it wants. */
+
+ /* Might have a program-specific name for mktexpk itself. */
+ if (getenv (makepk_var)) {
+ /* If we did, we want to enable the program, I think. */
+ kpse_set_program_enabled (kpse_pk_format, 1, kpse_src_env);
+ kpse_set_program_enabled (kpse_any_glyph_format, 1, kpse_src_env);
+
+ kpse_format_info[kpse_pk_format].program
+ = kpse_format_info[kpse_any_glyph_format].program
+ = getenv (makepk_var);
+ }
+
+ /* A couple font paths have traditionally had application-specific
+ environment variables to override all else; namely, XDVIFONTS and
+ DVIPSHEADERS. So set those if we have them. */
+ kpse_format_info[kpse_pk_format].override_path
+ = kpse_format_info[kpse_gf_format].override_path
+ = kpse_format_info[kpse_any_glyph_format].override_path
+ = kpse_format_info[kpse_tfm_format].override_path
+ = getenv (font_var);
+
+ kpse_format_info[kpse_tex_ps_header_format].override_path
+ = getenv (header_var);
+
+ kpse_init_fallback_resolutions (size_var);
+ xputenv_int ("MAKETEX_BASE_DPI", dpi);
+ kpse_fallback_font = fallback;
+
+ /* Ugliness. See comments in kpse_make_tex in kpathsea/tex-make.c. */
+ xputenv ("MAKETEX_MODE", mode ? mode : DIR_SEP_STRING);
+
+ free (font_var);
+ free (header_var);
+ free (makepk_var);
+ free (size_var);
+}
diff --git a/Build/source/texk/kpathsea/proginit.h b/Build/source/texk/kpathsea/proginit.h
new file mode 100644
index 00000000000..ae73485bad2
--- /dev/null
+++ b/Build/source/texk/kpathsea/proginit.h
@@ -0,0 +1,37 @@
+/* proginit.h: declarations for DVI driver initializations.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1994, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_PROGINIT_H
+#define KPATHSEA_PROGINIT_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+
+/* Common initializations for DVI drivers -- check for `PREFIX'SIZES and
+ `PREFIX'FONTS environment variables, setenv MAKETEX_MODE to MODE,
+ etc., etc. See the source. */
+
+extern KPSEDLL void
+kpse_init_prog P4H(const_string prefix, unsigned dpi, const_string mode,
+ const_string fallback);
+
+#endif /* not KPATHSEA_PROGINIT_H */
diff --git a/Build/source/texk/kpathsea/progname.c b/Build/source/texk/kpathsea/progname.c
new file mode 100644
index 00000000000..0c40a5e11e7
--- /dev/null
+++ b/Build/source/texk/kpathsea/progname.c
@@ -0,0 +1,633 @@
+/* progname.c: the executable name we were invoked as; general initialization.
+
+ Copyright 1998-2005 Olaf Weber.
+ Copyright 1994, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/absolute.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/c-stat.h>
+#include <kpathsea/pathsearch.h>
+/* For kpse_reset_progname */
+#include <kpathsea/tex-file.h>
+
+#if defined (WIN32) || defined (DJGPP)
+#include <kpathsea/c-pathmx.h>
+#endif
+
+#if defined(__i386_pc_gnu__)
+#ifndef _S_ISUID
+#define _S_ISUID 04000 /* Set user ID on execution. */
+#endif
+#ifndef _S_ISGID
+#define _S_ISGID 02000 /* Set group ID on execution. */
+#endif
+#ifndef _S_ISVTX
+#define _S_ISVTX 01000 /* Save swapped text after use (sticky). */
+#endif
+#ifndef _S_IREAD
+#define _S_IREAD 0400 /* Read by owner. */
+#endif
+#ifndef _S_IWRITE
+#define _S_IWRITE 0200 /* Write by owner. */
+#endif
+#ifndef _S_IEXEC
+#define _S_IEXEC 0100 /* Execute by owner. */
+#endif
+#endif
+
+/* NeXT does not define the standard macros, but has the equivalent.
+ WIN32 doesn't define them either, and doesn't have them.
+ From: Gregor Hoffleit <flight@mathi.uni-heidelberg.de>. */
+#ifndef S_IXUSR
+#ifdef WIN32
+#define S_IXUSR 0
+#define S_IXGRP 0
+#define S_IXOTH 0
+#else /* not WIN32 */
+#define S_IXUSR 0100
+#endif /* not WIN32 */
+#endif /* not S_IXUSR */
+#ifndef S_IXGRP
+#define S_IXGRP 0010
+#endif
+#ifndef S_IXOTH
+#define S_IXOTH 0001
+#endif
+
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
+/* Don't redefine the variables if glibc already has. */
+string program_invocation_name = NULL;
+string program_invocation_short_name = NULL;
+#endif
+/* And the variable for the program we pretend to be. */
+string kpse_program_name = NULL;
+
+#ifndef WIN32
+/* From a standalone program `ll' to expand symlinks written by Kimbo Mundy.
+ Don't bother to compile if we don't have symlinks; thus we can assume
+ / as the separator. Also don't try to use basename, etc., or
+ handle arbitrary filename length. Mixed case function names because
+ that's what kimbo liked. */
+
+#ifdef S_ISLNK
+static int ll_verbose = 0;
+static int ll_loop = 0;
+
+#undef BSIZE
+#define BSIZE 2048 /* sorry */
+
+
+/* Read link FN into SYM. */
+
+static void
+ReadSymLink P2C(char *, fn, char *, sym)
+{
+ register int n = readlink (fn, sym, BSIZE);
+ if (n < 0) {
+ perror (fn);
+ exit (1);
+ }
+ sym[n] = 0;
+}
+
+
+/* Strip first component from S, and also return it in a static buffer. */
+
+static char *
+StripFirst P1C(register char *, s)
+{
+ static char buf[BSIZE];
+ register char *s1;
+
+ /* Find the end of the first path element */
+ for (s1 = s; *s1 && (*s1 != '/' || s1 == s); s1++)
+ ;
+
+ /* Copy it into buf and null-terminate it. */
+ strncpy (buf, s, s1 - s);
+ buf[s1 - s] = 0;
+
+ /* Skip over the leading / (if any) */
+ if (*s1 == '/')
+ ++s1;
+
+ /* Squeeze out the element */
+ while ((*s++ = *s1++) != 0)
+ ;
+
+ return buf;
+}
+
+
+/* Strip last component from S, and also return it in a static buffer. */
+
+static char *
+StripLast P1C(register char *, s)
+{
+ static char buf[BSIZE];
+ register char *s1;
+
+ for (s1 = s + strlen (s); s1 > s && *s1 != '/'; s1--)
+ ;
+ strcpy (buf, s1 + (*s1 == '/'));
+ *s1 = 0;
+
+ return buf;
+}
+
+
+/* Copy first path element from B to A, removing it from B. */
+
+static void
+CopyFirst P2C(register char *, a, char *, b)
+{
+ register int length = strlen (a);
+
+ if (length > 0 && a[length - 1] != '/') {
+ a[length] = '/';
+ a[length + 1] = 0;
+ }
+ strcat (a, StripFirst (b));
+}
+
+/* Returns NULL on error. Prints intermediate results if global
+ `ll_verbose' is nonzero. */
+
+#define EX(s) (strlen (s) && strcmp (s, "/") ? "/" : "")
+#define EXPOS EX(post)
+#define EXPRE EX(pre)
+
+static char *
+expand_symlinks P1C(char *, s)
+{
+ static char pre[BSIZE]; /* return value */
+ char post[BSIZE], sym[BSIZE], tmp[BSIZE], before[BSIZE];
+ char *cp;
+ char a;
+ struct stat st;
+ int done;
+
+ /* Check for symlink loops. It's difficult to check for all the
+ possibilities ourselves, so let the kernel do it. And make it
+ conditional so that people can see where the infinite loop is
+ being caused (see engtools#1536). */
+ if (!ll_loop) {
+ FILE *f = fopen (s, "r");
+ if (!f && errno == ELOOP) {
+ /* Not worried about other errors, we'll get to them in due course. */
+ perror (s);
+ return NULL;
+ }
+ if (f) fclose (f);
+ }
+
+ strcpy (post, s);
+ strcpy (pre, "");
+
+ while (strlen (post) != 0) {
+ CopyFirst (pre, post);
+
+ if (lstat (pre, &st) != 0) {
+ fprintf (stderr, "lstat(%s) failed ...\n", pre);
+ perror (pre);
+ return NULL;
+ }
+
+ if (S_ISLNK (st.st_mode)) {
+ ReadSymLink (pre, sym);
+
+ if (!strncmp (sym, "/", 1)) {
+ if (ll_verbose)
+ printf ("[%s]%s%s -> [%s]%s%s\n", pre, EXPOS, post, sym, EXPOS,post);
+ strcpy (pre, "");
+
+ } else {
+ a = pre[0]; /* handle links through the root */
+ strcpy (tmp, StripLast (pre));
+ if (!strlen (pre) && a == '/')
+ strcpy (pre, "/");
+
+ if (ll_verbose) {
+ sprintf (before, "%s%s[%s]%s%s", pre, EXPRE, tmp, EXPOS, post);
+ printf ("%s -> %s%s[%s]%s%s\n", before, pre, EXPRE, sym, EXPOS,post);
+ }
+
+ /* Strip "../" path elements from the front of sym; print
+ new result if there were any such elements. */
+ done = 0;
+ a = pre[0]; /* handle links through the root */
+ while (!strncmp (sym, "..", 2)
+ && (sym[2] == 0 || sym[2] == '/')
+ && strlen (pre) != 0
+ && strcmp (pre, ".")
+ && strcmp (pre, "..")
+ && (strlen (pre) < 3
+ || strcmp (pre + strlen (pre) - 3, "/.."))) {
+ done = 1;
+ StripFirst (sym);
+ StripLast (pre);
+ }
+
+ if (done && ll_verbose) {
+ for (cp = before; *cp;)
+ *cp++ = ' ';
+ if (strlen (sym))
+ printf ("%s == %s%s%s%s%s\n", before, pre, EXPRE, sym, EXPOS,post);
+ else
+ printf ("%s == %s%s%s\n", before, pre, EXPOS, post);
+ }
+ if (!strlen (pre) && a == '/')
+ strcpy (pre, "/");
+ }
+
+ if (strlen (post) != 0 && strlen (sym) != 0)
+ strcat (sym, "/");
+
+ strcat (sym, post);
+ strcpy (post, sym);
+ }
+ }
+
+ return pre;
+}
+#else /* not S_ISLNK */
+#define expand_symlinks(s) (s)
+#endif /* not S_ISLNK */
+
+/* Remove .'s and ..'s in DIR, to avoid problems with relative symlinks
+ as the program name, etc. This does not canonicalize symlinks. */
+
+static string
+remove_dots P1C(string, dir)
+{
+#ifdef AMIGA
+ return dir;
+#else
+ string c;
+ unsigned len;
+ string ret = (string) ""; /* We always reassign. */
+
+ for (c = kpse_filename_component (dir); c;
+ c = kpse_filename_component (NULL)) {
+ if (STREQ (c, ".")) {
+ /* If leading ., replace with cwd. Else ignore. */
+ if (*ret == 0) {
+ ret = xgetcwd ();
+ }
+
+ } else if (STREQ (c, "..")) {
+ /* If leading .., start with xdirname (cwd). Else remove last
+ component from ret, if any. */
+ if (*ret == 0) {
+ string dot = xgetcwd ();
+ ret = xdirname (dot);
+ free (dot);
+ } else {
+ unsigned last;
+ for (last = strlen (ret);
+ last > (NAME_BEGINS_WITH_DEVICE (ret) ? 2 : 0);
+ last--) {
+ if (IS_DIR_SEP (ret[last - 1])) {
+ /* If we have `/../', that's the same as `/'. */
+ if (last > 1) {
+ ret[last - 1] = 0;
+ }
+ break;
+ }
+ }
+ }
+
+ } else {
+ /* Not . or ..; just append. Include a directory separator unless
+ our string already ends with one. This also changes all directory
+ separators into the canonical DIR_SEP_STRING. */
+ string temp;
+ len = strlen (ret);
+ temp = concat3 (ret, ((len > 0 && ret[len - 1] == DIR_SEP)
+ || (NAME_BEGINS_WITH_DEVICE (c) && *ret == 0))
+ ? "" : DIR_SEP_STRING,
+ c);
+ if (*ret)
+ free (ret);
+ ret = temp;
+ }
+ }
+
+ /* Remove a trailing /, just in case it snuck in. */
+ len = strlen (ret);
+ if (len > 0 && ret[len - 1] == DIR_SEP) {
+ ret[len - 1] = 0;
+ }
+
+ return ret;
+#endif /* not AMIGA */
+}
+
+/* Return directory ARGV0 comes from. Check PATH if ARGV0 is not
+ absolute. */
+
+static string
+selfdir P1C(const_string, argv0)
+{
+ string ret = NULL;
+ string self = NULL;
+
+ if (kpse_absolute_p (argv0, true)) {
+ self = xstrdup (argv0);
+ } else {
+#ifdef AMIGA
+#include <dos.h>
+#include <proto/dos.h>
+#include <proto/exec.h>
+ BPTR lock;
+ struct DosLibrary *DOSBase
+ = (struct DosLibrary *) OpenLibrary ("dos.library", 0L);
+ assert (DOSBase);
+
+ self = xmalloc (BUFSIZ);
+ lock = findpath (argv0);
+ if (lock != ((BPTR) -1)) {
+ if (getpath (lock, self) == -1) {
+ *self = '\0';
+ } else {
+ strcat (self,DIR_SEP_STRING);
+ strcat (self,argv0);
+ }
+ UnLock (lock);
+ }
+ CloseLibrary((struct Library *) DOSBase);
+#else /* not AMIGA */
+ string elt;
+ struct stat s;
+
+ /* Have to check PATH. But don't call kpse_path_search since we don't
+ want to search any ls-R's or do anything special with //'s. */
+ for (elt = kpse_path_element (getenv ("PATH")); !self && elt;
+ elt = kpse_path_element (NULL)) {
+ string name;
+
+ /* UNIX tradition interprets the empty path element as "." */
+ if (*elt == 0) elt = ".";
+
+ name = concat3 (elt, DIR_SEP_STRING, argv0);
+
+ /* In order to do this perfectly, we'd have to check the owner bits only
+ if we are the file owner, and the group bits only if we belong
+ to the file group. That's a lot of work, though, and it's not
+ likely that kpathsea will ever be used with a program that's
+ only executable by some classes and not others. See the
+ `file_status' function in execute_cmd.c in bash for what's
+ necessary if we were to do it right. */
+ if (stat (name, &s) == 0 && s.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) {
+ /* Do not stop at directories. */
+ if (!S_ISDIR(s.st_mode))
+ self = name;
+ }
+ }
+#endif /* not AMIGA */
+ }
+
+ /* If argv0 is somehow dir/exename, `self' will still be NULL. */
+ if (!self)
+ self = concat3 (".", DIR_SEP_STRING, argv0);
+
+ ret = xdirname (remove_dots (expand_symlinks (self)));
+
+ free (self);
+
+ return ret;
+}
+#endif /* not WIN32 */
+
+void
+kpse_set_program_name P2C(const_string, argv0, const_string, progname)
+{
+ string ext, sdir, sdir_parent, sdir_grandparent;
+ string s = getenv ("KPATHSEA_DEBUG");
+#ifdef WIN32
+ string debug_output = getenv("KPATHSEA_DEBUG_OUTPUT");
+ string append_debug_output = getenv("KPATHSEA_DEBUG_APPEND");
+ int err, olderr;
+#endif
+
+ /* Set debugging stuff first, in case we end up doing debuggable stuff
+ during this initialization. */
+ if (s) {
+ kpathsea_debug |= atoi (s);
+ }
+
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
+#if defined(WIN32)
+ /* Set various info about user. Among many things,
+ ensure that HOME is set. If debug_paths is on,
+ turn on some message if $HOME is not found. */
+ if (KPSE_DEBUG_P(KPSE_DEBUG_PATHS)) {
+ set_home_warning();
+ }
+ init_user_info();
+
+ /* redirect stderr to debug_output. Easier to send logfiles. */
+ if (debug_output) {
+ int flags = _O_CREAT | _O_TRUNC | _O_RDWR;
+ err = -1;
+ if (_stricmp(debug_output, "con") == 0
+ || _stricmp(debug_output, "con:") == 0) {
+ err = _fileno(stdout);
+ } else {
+ if (append_debug_output) {
+ flags = _O_CREAT | _O_APPEND | _O_WRONLY;
+ } else {
+ flags = _O_CREAT | _O_TRUNC | _O_WRONLY;
+ xputenv("KPATHSEA_DEBUG_APPEND", "yes");
+ }
+ }
+
+ if ((err < 0)
+ && (err = _open(debug_output, flags, _S_IREAD | _S_IWRITE)) == -1)
+ {
+ WARNING1("Can't open %s for stderr redirection!\n", debug_output);
+ perror(debug_output);
+ } else if ((olderr = _dup(fileno(stderr))) == -1) {
+ WARNING("Can't dup() stderr!\n");
+ close(err);
+ } else if (_dup2(err, fileno(stderr)) == -1) {
+ WARNING1("Can't redirect stderr to %s!\n", debug_output);
+ close(olderr);
+ close(err);
+ } else {
+ close(err);
+ }
+ }
+ /* Win95 always gives the short filename for argv0, not the long one.
+ There is only this way to catch it. It makes all the selfdir stuff
+ useless for win32. */
+ {
+ char short_path[PATH_MAX], path[PATH_MAX], *fp;
+
+ /* SearchPath() always gives back an absolute directory */
+ if (SearchPath(NULL, argv0, ".exe", PATH_MAX, short_path, &fp) == 0)
+ FATAL1("Can't determine where the executable %s is.\n", argv0);
+ if (!win32_get_long_filename(short_path, path, sizeof(path))) {
+ FATAL1("This path points to an invalid file : %s\n", short_path);
+ }
+ /* slashify the dirname */
+ for (fp = path; fp && *fp; fp++)
+ if (IS_DIR_SEP(*fp)) *fp = DIR_SEP;
+ /* sdir will be the directory of the executable, ie: c:/TeX/bin */
+ sdir = xdirname(path);
+ program_invocation_name = xstrdup(xbasename(path));
+ }
+
+#elif defined(__DJGPP__)
+
+ /* DJGPP programs support long filenames on Windows 95, but ARGV0 there
+ is always made with the short 8+3 aliases of all the pathname elements.
+ If long names are supported, we need to convert that to a long name.
+
+ All we really need is to call `_truename', but most of the code
+ below is required to deal with the special case of networked drives. */
+ if (pathconf (argv0, _PC_NAME_MAX) > 12) {
+ char long_progname[PATH_MAX];
+
+ if (_truename (argv0, long_progname)) {
+ char *fp;
+
+ if (long_progname[1] != ':') {
+ /* A complication: `_truename' returns network-specific string at
+ the beginning of `long_progname' when the program resides on a
+ networked drive, and DOS calls cannot grok such pathnames. We
+ need to convert the filesystem name back to a drive letter. */
+ char rootname[PATH_MAX], rootdir[4];
+
+ if (argv0[0] && argv0[1] == ':')
+ rootdir[0] = argv0[0]; /* explicit drive in `argv0' */
+ else
+ rootdir[0] = getdisk () + 'A';
+ rootdir[1] = ':';
+ rootdir[2] = '\\';
+ rootdir[3] = '\0';
+ if (_truename (rootdir, rootname)) {
+ /* Find out where `rootname' ends in `long_progname' and replace
+ it with the drive letter. */
+ int root_len = strlen (rootname);
+
+ if (IS_DIR_SEP (rootname[root_len - 1]))
+ root_len--; /* keep the trailing slash */
+ long_progname[0] = rootdir[0];
+ long_progname[1] = ':';
+ memmove (long_progname + 2, long_progname + root_len,
+ strlen (long_progname + root_len) + 1);
+ }
+ }
+
+ /* Convert everything to canonical form. */
+ if (long_progname[0] >= 'A' && long_progname[0] <= 'Z')
+ long_progname[0] += 'a' - 'A'; /* make drive lower case, for beauty */
+ for (fp = long_progname; *fp; fp++)
+ if (IS_DIR_SEP (*fp))
+ *fp = DIR_SEP;
+
+ program_invocation_name = xstrdup (long_progname);
+ }
+ else
+ /* If `_truename' failed, God help them, because we won't... */
+ program_invocation_name = xstrdup (argv0);
+ }
+ else
+ program_invocation_name = xstrdup (argv0);
+
+#else /* !WIN32 && !__DJGPP__ */
+
+ program_invocation_name = xstrdup (argv0);
+
+#endif
+#endif /* not HAVE_PROGRAM_INVOCATION_NAME */
+
+ /* We need to find SELFAUTOLOC *before* removing the ".exe" suffix from
+ the program_name, otherwise the PATH search inside selfdir will fail,
+ since `prog' doesn't exists as a file, there's `prog.exe' instead. */
+#ifndef WIN32
+ sdir = selfdir (program_invocation_name);
+#endif
+ /* SELFAUTODIR is actually the parent of the invocation directory,
+ and SELFAUTOPARENT the grandparent. This is how teTeX did it. */
+ xputenv ("SELFAUTOLOC", sdir);
+ sdir_parent = xdirname (sdir);
+ xputenv ("SELFAUTODIR", sdir_parent);
+ sdir_grandparent = xdirname (sdir_parent);
+ xputenv ("SELFAUTOPARENT", sdir_grandparent);
+
+ free (sdir);
+ free (sdir_parent);
+ free (sdir_grandparent);
+
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
+ program_invocation_short_name = (string)xbasename (program_invocation_name);
+#endif
+
+ if (progname) {
+ kpse_program_name = xstrdup (progname);
+ } else {
+ /* If configured --enable-shared and running from the build directory
+ with the wrapper scripts (e.g., for make check), the binaries will
+ be named foo.exe instead of foo. Or possibly if we're running on a
+ DOSISH system. */
+ ext = find_suffix (program_invocation_short_name);
+ if (ext && FILESTRCASEEQ (ext, "exe")) {
+ kpse_program_name = remove_suffix (program_invocation_short_name);
+ } else {
+ kpse_program_name = xstrdup (program_invocation_short_name);
+ }
+ }
+
+ xputenv("progname", kpse_program_name);
+}
+
+/* This function is deprecated, because when we pretend to have a different
+ name it will look for _that_ name in the PATH if program_invocation_name
+ is not defined. */
+void
+kpse_set_progname P1C(const_string, argv0)
+{
+ kpse_set_program_name (argv0, NULL);
+}
+
+#ifdef TEST
+void
+main (int argc, char **argv)
+{
+ puts (remove_dots ("/w/kpathsea"));
+ puts (remove_dots ("/w//kpathsea"));
+ puts (remove_dots ("/w/./kpathsea"));
+ puts (remove_dots ("."));
+ puts (remove_dots ("./"));
+ puts (remove_dots ("./."));
+ puts (remove_dots ("../kpathsea"));
+ puts (remove_dots ("/kpathsea/../foo"));
+ puts (remove_dots ("/../w/kpathsea"));
+ puts (remove_dots ("/../w/kpathsea/."));
+ puts (remove_dots ("/te/share/texmf/../../../../bin/gnu"));
+}
+/*
+Local variables:
+standalone-compile-command: "gcc -g -I. -I.. -DTEST progname.c STATIC/libkpathsea.a"
+End:
+*/
+#endif /* TEST */
diff --git a/Build/source/texk/kpathsea/progname.h b/Build/source/texk/kpathsea/progname.h
new file mode 100644
index 00000000000..c7480e7c6eb
--- /dev/null
+++ b/Build/source/texk/kpathsea/progname.h
@@ -0,0 +1,55 @@
+/* progname.h: Declarations for argv[0] equivalents.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1994, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_PROGNAME_H
+#define KPATHSEA_PROGNAME_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+extern KPSEDLL string program_invocation_name;
+extern KPSEDLL string program_invocation_short_name;
+extern KPSEDLL string kpse_program_name;
+
+/* Set the first two variables above (if they're not predefined) to a copy
+ of ARGV0 and everything in ARGV0 after the last directory separator,
+ respectively. Set kpse_program_name to a copy of PROGNAME or the
+ or the value of program_invocation_short_name if PROGNAME is NULL.
+ This function also determines the AUTO* variables. */
+
+extern KPSEDLL void kpse_set_program_name P2H(const_string argv0,
+ const_string progname);
+
+/* See also `kpse_reset_program_name' which is defined in tex-file.c
+
+ That function is to be used to set kpse_program_name to a different
+ value. It clears the path searching information, to ensure that
+ the search paths are appropriate to the new name. */
+
+/* DEPRECATED
+ Set first two variables above (if they're not predefined) to a copy of
+ ARGV0 and everything in ARGV0 after the last directory separator,
+ respectively. kpse_program_name is _always_ set to a copy of everything
+ in ARGV0 after the last directory separator. */
+
+extern KPSEDLL void kpse_set_progname P1H(const_string argv0);
+
+#endif /* not KPATHSEA_PROGNAME_H */
diff --git a/Build/source/texk/kpathsea/putenv.c b/Build/source/texk/kpathsea/putenv.c
new file mode 100644
index 00000000000..e1b48513b19
--- /dev/null
+++ b/Build/source/texk/kpathsea/putenv.c
@@ -0,0 +1,110 @@
+/****************************************************************/
+/* */
+/* putenv(3) */
+/* */
+/* Change or add an environment entry */
+/* */
+/****************************************************************/
+/* origination 1987-Oct-7 T. Holm */
+/****************************************************************/
+
+/*
+Path: hoptoad!pacbell!ames!ll-xn!mit-eddie!uw-beaver!ssc-vax!uvicctr!tholm
+From: tholm@uvicctr.UUCP (Terrence W. Holm)
+Newsgroups: comp.os.minix
+Subject: putenv(3)
+Message-ID: <395@uvicctr.UUCP>
+Date: 5 May 88 06:40:52 GMT
+Organization: University of Victoria, Victoria B.C. Canada
+
+EFTH Minix report #2 - May 1988 - putenv(3)
+
+This is an implementation of putenv(3) that we
+wrote for Minix. Please consider this a public
+domain program.
+*/
+
+#define NULL 0
+#define PSIZE sizeof(char *)
+
+extern char **environ;
+
+char *strchr();
+char *malloc();
+
+/****************************************************************/
+/* */
+/* int */
+/* putenv( entry ) */
+/* */
+/* The "entry" should follow the form */
+/* "NAME=VALUE". This routine will search the */
+/* user environment for "NAME" and replace its */
+/* value with "VALUE". */
+/* */
+/* Note that "entry" is not copied, it is used */
+/* as the environment entry. This means that it */
+/* must not be unallocated or otherwise modifed */
+/* by the caller, unless it is replaced by a */
+/* subsequent putenv(). */
+/* */
+/* If the name is not found in the environment, */
+/* then a new vector of pointers is allocated, */
+/* "entry" is put at the end and the global */
+/* variable "environ" is updated. */
+/* */
+/* This function normally returns 0, but -1 */
+/* is returned if it can not allocate enough */
+/* space using malloc(3), or "entry" does not */
+/* contain a '='. */
+/* */
+/****************************************************************/
+
+
+int
+putenv( entry )
+ char *entry;
+{
+ unsigned length;
+ unsigned size;
+ char *temp;
+ char **p;
+ char **new_environ;
+
+ /* Find the length of the "NAME=" */
+
+ temp = strchr(entry,'=');
+ if ( temp == 0 )
+ return( -1 );
+
+ length = (unsigned) (temp - entry + 1);
+
+
+ /* Scan through the environment looking for "NAME=" */
+
+ for ( p=environ; *p != 0 ; p++ )
+ if ( strncmp( entry, *p, length ) == 0 )
+ {
+ *p = entry;
+ return( 0 );
+ }
+
+
+ /* The name was not found, build a bigger environment */
+
+ size = p - environ;
+
+ new_environ = (char **) malloc( (size+2)*PSIZE );
+
+ if ( new_environ == (char **) NULL )
+ return( -1 );
+
+ memcpy ((char *) new_environ, (char *) environ, size*PSIZE );
+
+ new_environ[size] = entry;
+ new_environ[size+1] = NULL;
+
+ environ = new_environ;
+
+ return(0);
+}
diff --git a/Build/source/texk/kpathsea/readable.c b/Build/source/texk/kpathsea/readable.c
new file mode 100644
index 00000000000..1f8d941f5f0
--- /dev/null
+++ b/Build/source/texk/kpathsea/readable.c
@@ -0,0 +1,108 @@
+/* readable.c: check if a filename is a readable non-directory file.
+
+ Copyright 1998, 99, 2000, 01, 05 Olaf Weber.
+ Copyright 1993, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-stat.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/readable.h>
+#include <kpathsea/tex-hush.h>
+#include <kpathsea/truncate.h>
+
+
+/* If access can read FN, run stat (assigning to stat buffer ST) and
+ check that fn is not a directory. Don't check for just being a
+ regular file, as it is potentially useful to read fifo's or some
+ kinds of devices. */
+
+#ifdef __DJGPP__
+/* `stat' is way too expensive for such a simple job. */
+#define READABLE(fn, st) \
+ (access (fn, R_OK) == 0 && access (fn, D_OK) == -1)
+#elif WIN32
+/* Warning: st must be an unsigned int under Win32 */
+static boolean
+READABLE(const_string fn, unsigned int st)
+{
+ if ((st = GetFileAttributes(fn)) != 0xFFFFFFFF) {
+ /* succeeded */
+ errno = 0;
+ } else {
+ switch(GetLastError()) {
+ case ERROR_BUFFER_OVERFLOW:
+ errno = ENAMETOOLONG;
+ break;
+ case ERROR_ACCESS_DENIED:
+ errno = EACCES;
+ break;
+ default :
+ errno = EIO; /* meaningless, will make ret=NULL later */
+ break;
+ }
+ }
+ return ((st != 0xFFFFFFFF) &&
+ !(st & FILE_ATTRIBUTE_DIRECTORY));
+}
+#else
+#define READABLE(fn, st) \
+ (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode))
+#endif
+
+/* POSIX invented the brain-damage of not necessarily truncating
+ filename components; the system's behavior is defined by the value of
+ the symbol _POSIX_NO_TRUNC, but you can't change it dynamically!
+
+ Generic const return warning. See extend-fname.c. */
+
+string
+kpse_readable_file P1C(const_string, name)
+{
+ string ret;
+
+#ifdef WIN32
+ unsigned int st = 0;
+#else /* ! WIN32 */
+ struct stat st;
+#endif
+
+ kpse_normalize_path((string)name);
+ if (READABLE (name, st)) {
+ ret = (string) name;
+#ifdef ENAMETOOLONG
+ } else if (errno == ENAMETOOLONG) {
+ ret = kpse_truncate_filename (name);
+
+ /* Perhaps some other error will occur with the truncated name, so
+ let's call access again. */
+ if (!READABLE (ret, st)) { /* Failed. */
+ if (ret != name) free (ret);
+ ret = NULL;
+ }
+#endif /* ENAMETOOLONG */
+ } else { /* Some other error. */
+ if (errno == EACCES) { /* Maybe warn them if permissions are bad. */
+ if (!kpse_tex_hush ("readable")) {
+ perror (name);
+ }
+ }
+ ret = NULL;
+ }
+ return ret;
+}
diff --git a/Build/source/texk/kpathsea/readable.h b/Build/source/texk/kpathsea/readable.h
new file mode 100644
index 00000000000..ce2d953f47f
--- /dev/null
+++ b/Build/source/texk/kpathsea/readable.h
@@ -0,0 +1,34 @@
+/* readable.h: Is a file readable?
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_READABLE_H
+#define KPATHSEA_READABLE_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+/* If NAME is readable and is a regular file, return it. If the error is
+ ENAMETOOLONG, truncate any too-long path components, and if the
+ result is a readable file, return that. Otherwise return NULL. */
+
+extern KPSEDLL string kpse_readable_file P1H(const_string name);
+
+#endif /* not KPATHSEA_READABLE_H */
diff --git a/Build/source/texk/kpathsea/readlink.c b/Build/source/texk/kpathsea/readlink.c
new file mode 100644
index 00000000000..2c88c9cc2ab
--- /dev/null
+++ b/Build/source/texk/kpathsea/readlink.c
@@ -0,0 +1,80 @@
+/* readlink -- obtain contents of symlink.
+
+ Copyright 1998, 1999, 2001, 2005 Olaf Weber.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <stdio.h>
+#include <kpathsea/config.h>
+#include <kpathsea/c-pathmx.h>
+#include <kpathsea/c-unistd.h>
+#include <kpathsea/c-stat.h>
+
+#ifdef WIN32
+#include <string.h>
+#endif
+
+/*
+ * readlink name
+ * Returns 0 if name exists and is a symlink, 1 otherwise. The contents
+ * of the link are printed on standard output.
+ */
+
+int
+main P2C(int, argc, char **, argv)
+{
+#ifdef S_ISLNK
+ int status;
+ char path[PATH_MAX];
+#endif
+
+ if (argc > 1 && strcmp (argv[1], "--help") == 0) {
+ printf("Usage: %s FILE\n\
+ If FILE exists and is a symlink, print the contents of the link and\n\
+ exit successfully. Otherwise print nothing and fail.\n\
+\n\
+--help display this help and exit\n\
+--version output version information and exit\n\n", argv[0]);
+ fputs ("Email bug reports to tex-k@mail.tug.org.\n", stdout);
+ exit(0);
+ } else if (argc > 1 && strcmp (argv[1], "--version") == 0) {
+ printf ("%s (%s)\n\
+Copyright (C) 1998 Olaf Weber.\n\
+There is NO warranty. You may redistribute this software\n\
+under the terms of the GNU General Public License\n\
+For more information about these matters, see the file named GPL.\n\
+Primary author of %s: Olaf Weber.\n",
+argv[0], KPSEVERSION, argv[0]);
+ exit (0);
+ }
+
+ /* insist on exactly one arg */
+ if (argc != 2) {
+ fprintf(stderr, "%s: Need exactly one argument.\n\
+Try `%s --help' for more information.\n", argv[0], argv[0]);
+ exit(1);
+ }
+
+#ifdef S_ISLNK
+ status = readlink(argv[1], path, PATH_MAX);
+ if (status != -1) {
+ printf("%.*s\n", status, path);
+ return 0;
+ }
+#endif
+ return 1;
+}
diff --git a/Build/source/texk/kpathsea/remote.c b/Build/source/texk/kpathsea/remote.c
new file mode 100644
index 00000000000..65a967e5680
--- /dev/null
+++ b/Build/source/texk/kpathsea/remote.c
@@ -0,0 +1,92 @@
+/*
+ Handling of remote files with kpathsea.
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/hash.h>
+#include <geturl.h>
+
+hash_table_type *remote_db;
+
+static char *log_buffer;
+int index;
+
+void __cdecl DoDownloadProgress(unsigned long partial, unsigned long total)
+{
+ sprintf(log_buffer+index," -> %8ld/%8ld\r", partial, total);
+ fputs(log_buffer, stdout);
+}
+
+void __cdecl DoDownloadLog(char *s, ...)
+{
+#if 0
+ va_list argList;
+ fputc('\n', stderr);
+ va_start (argList, s);
+ vfprintf(stderr, s, argList);
+ va_end (argList);
+#endif
+}
+
+string get_remote_file(const_string filename)
+{
+ string *lookup = NULL;
+ string localname = NULL;
+ boolean ret;
+
+ if ((remote_db = hash_exists_p(hashtable_remote)) == NULL) {
+ remote_db = hash_create (1007, hashtable_remote);
+ }
+
+ lookup = hash_lookup(remote_db, filename);
+ /* Either the file has already been downloaded */
+ if (lookup && *lookup) {
+ return *lookup;
+ }
+ /* Or it is a new one */
+ /* Get some local name */
+ localname =_tempnam(getenv("TMP"), "kpse");
+ if (localname == NULL) return localname;
+
+ index = strlen(filename);
+ log_buffer = xmalloc(index + 24);
+ strcpy(log_buffer, filename);
+
+ ret = (get_url_to_file(filename,
+ localname,
+ 0,
+ DoDownloadLog,
+ DoDownloadProgress,
+ NULL, /* AfxGetInstanceHandle() */
+ NetIOIE5, /*g_uiNetMethod */
+ NULL, /* _proxy_address */
+ 80 /* g_uiProxyPort */
+ ) == 0);
+
+ if (ret)
+ hash_insert(remote_db, filename, localname);
+ else
+ localname = NULL;
+
+ puts("\n");
+ free(log_buffer);
+ return localname;
+}
+
+void CDECL unlink_remote_file(const_string key, const_string value)
+{
+ int fa;
+ fa = GetFileAttributes(value);
+ if (fa != 0xFFFFFFFF && !(fa & FILE_ATTRIBUTE_DIRECTORY)) {
+ if (DeleteFile(value) == 0) {
+ fprintf(stderr, "%s: can't delete file %s (error %d)\n", kpse_program_name, value, GetLastError());
+ }
+ }
+}
+
+void cleanup_remote_files()
+{
+ hash_table_type *remote = hash_exists_p(hashtable_remote);
+ hash_iter(remote, unlink_remote_file);
+}
diff --git a/Build/source/texk/kpathsea/remote.h b/Build/source/texk/kpathsea/remote.h
new file mode 100644
index 00000000000..3938ac869a8
--- /dev/null
+++ b/Build/source/texk/kpathsea/remote.h
@@ -0,0 +1,29 @@
+/* remote.h: declarations for retrieving remote files
+
+Copyright (C) 1994, 95 Karl Berry.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef REMOTE_H
+#define REMOTE_H
+
+#ifdef HAVE_GETURL
+#include <wininet.h>
+
+extern KPSEDLL string get_remote_file(const_string);
+extern void cleanup_remote_files();
+#endif
+
+#endif /* REMOTE_H */
diff --git a/Build/source/texk/kpathsea/rm-suffix.c b/Build/source/texk/kpathsea/rm-suffix.c
new file mode 100644
index 00000000000..88739119fc1
--- /dev/null
+++ b/Build/source/texk/kpathsea/rm-suffix.c
@@ -0,0 +1,45 @@
+/* rm-suffix.c: remove any suffix.
+
+ Copyright (C) 1992, 93, 95 Free Software Foundation, Inc.
+ Modified for kpathsea by Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+
+/* Generic const warning -- see extend-fname.c. */
+
+string
+remove_suffix P1C(const_string, s)
+{
+ string ret;
+ const_string suffix = find_suffix (s);
+
+ if (suffix)
+ {
+ /* Back up to before the dot. */
+ suffix--;
+ ret = (string) xmalloc (suffix - s + 1);
+ strncpy (ret, s, suffix - s);
+ ret[suffix - s] = 0;
+ }
+ else
+ ret = (string) s;
+
+ return ret;
+}
diff --git a/Build/source/texk/kpathsea/stamp-auto.in b/Build/source/texk/kpathsea/stamp-auto.in
new file mode 100644
index 00000000000..f40664acad8
--- /dev/null
+++ b/Build/source/texk/kpathsea/stamp-auto.in
@@ -0,0 +1 @@
+Mo Aug 22 08:26:05 CEST 2005
diff --git a/Build/source/texk/kpathsea/str-list.c b/Build/source/texk/kpathsea/str-list.c
new file mode 100644
index 00000000000..66df7b791cc
--- /dev/null
+++ b/Build/source/texk/kpathsea/str-list.c
@@ -0,0 +1,120 @@
+/* str-list.c: define routines for string lists.
+
+ Copyright 2001, 2005 Olaf Weber
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/str-list.h>
+
+
+/* See the .h file for comments. */
+
+
+str_list_type
+str_list_init P1H(void)
+{
+ str_list_type ret;
+
+ STR_LIST_LENGTH (ret) = 0;
+ STR_LIST (ret) = NULL;
+
+ return ret;
+}
+
+
+void
+str_list_add P2C(str_list_type *, l, string, s)
+{
+ STR_LIST_LENGTH (*l)++;
+ XRETALLOC (STR_LIST (*l), STR_LIST_LENGTH (*l), string);
+ STR_LIST_LAST_ELT (*l) = s;
+}
+
+
+/* May as well save some reallocations and do everything in a chunk
+ instead of calling str_list_add on each element. */
+
+void
+str_list_concat P2C(str_list_type *, target, str_list_type, more)
+{
+ unsigned e;
+ unsigned prev_len = STR_LIST_LENGTH (*target);
+
+ STR_LIST_LENGTH (*target) += STR_LIST_LENGTH (more);
+ XRETALLOC (STR_LIST (*target), STR_LIST_LENGTH (*target), string);
+
+ for (e = 0; e < STR_LIST_LENGTH (more); e++)
+ STR_LIST_ELT (*target, prev_len + e) = STR_LIST_ELT (more, e);
+}
+
+
+/* Concatenate the elements of more to each element of target. This
+ _must_ be done with the first index varying fastest. */
+/* Note that we free the old elements of target as well. */
+
+void
+str_list_concat_elements P2C(str_list_type *, target, str_list_type, more)
+{
+ if (STR_LIST_LENGTH(more) == 0) {
+ return;
+ } else if (STR_LIST_LENGTH(*target) == 0) {
+ unsigned int i;
+ STR_LIST_LENGTH(*target) = STR_LIST_LENGTH(more);
+ STR_LIST(*target) =
+ (string*)xmalloc(STR_LIST_LENGTH(more)*sizeof(char*));
+ for (i=0;i!=STR_LIST_LENGTH(more);++i) {
+ STR_LIST_ELT(*target,i)=xstrdup(STR_LIST_ELT(more,i));
+ }
+ return;
+ } else {
+ unsigned new_len;
+ char ** new_list;
+ unsigned int i,j;
+ new_list = (string*)xmalloc(STR_LIST_LENGTH (*target)
+ * STR_LIST_LENGTH (more) * sizeof(char*));
+
+ new_len = 0;
+ for (j = 0; j != STR_LIST_LENGTH(more); ++j) {
+ for (i = 0; i != STR_LIST_LENGTH(*target); ++i) {
+ new_list[new_len] = concat(STR_LIST_ELT(*target,i),
+ STR_LIST_ELT(more,j));
+ ++new_len;
+ }
+ }
+ for (i = 0; i != STR_LIST_LENGTH(*target); ++i)
+ free(STR_LIST_ELT(*target, i));
+ free(STR_LIST(*target));
+ STR_LIST_LENGTH(*target) = new_len;
+ STR_LIST(*target) = new_list;
+ }
+}
+
+
+/* Free the list (but not the elements within it). */
+
+void
+str_list_free P1C(str_list_type *, l)
+{
+ if (STR_LIST (*l))
+ {
+ free (STR_LIST (*l));
+ STR_LIST (*l) = NULL;
+ }
+}
diff --git a/Build/source/texk/kpathsea/str-list.h b/Build/source/texk/kpathsea/str-list.h
new file mode 100644
index 00000000000..dcffd928424
--- /dev/null
+++ b/Build/source/texk/kpathsea/str-list.h
@@ -0,0 +1,60 @@
+/* str-list.h: Declarations for string lists.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1993, 94 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_STR_LIST_H
+#define KPATHSEA_STR_LIST_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+
+/* Lists of strings; used for, e.g., directory lists. */
+
+typedef struct
+{
+ unsigned length;
+ string *list;
+} str_list_type;
+
+#define STR_LIST_LENGTH(l) ((l).length)
+#define STR_LIST(l) ((l).list)
+#define STR_LIST_ELT(l, n) STR_LIST (l)[n]
+#define STR_LIST_LAST_ELT(l) STR_LIST_ELT (l, STR_LIST_LENGTH (l) - 1)
+
+/* Return a new, empty, list. */
+extern str_list_type str_list_init P1H(void);
+
+/* Append the string S to the list L. It's up to the caller to not
+ deallocate S; we don't copy it. Also up to the caller to terminate
+ the list with a null entry. */
+extern void str_list_add P2H(str_list_type *l, string s);
+
+/* Append all the elements from MORE to TARGET. */
+extern void str_list_concat P2H(str_list_type * target, str_list_type more);
+
+/* Free the space for the list elements (but not the list elements
+ themselves). */
+extern void str_list_free P1H(str_list_type *l);
+
+/* Append each element of more to each element of target. */
+extern void str_list_concat_elements P2H(str_list_type * target, str_list_type more);
+
+#endif /* not KPATHSEA_STR_LIST_H */
diff --git a/Build/source/texk/kpathsea/str-llist.c b/Build/source/texk/kpathsea/str-llist.c
new file mode 100644
index 00000000000..4006852f9b9
--- /dev/null
+++ b/Build/source/texk/kpathsea/str-llist.c
@@ -0,0 +1,96 @@
+/* str-llist.c: Implementation of a linked list of strings.
+
+ Copyright (C) 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/str-llist.h>
+
+
+/* Add the new string STR to the end of the list L. */
+
+void
+str_llist_add P2C(str_llist_type *, l, string, str)
+{
+ str_llist_elt_type *e;
+ str_llist_elt_type *new_elt = XTALLOC1 (str_llist_elt_type);
+
+ /* The new element will be at the end of the list. */
+ STR_LLIST (*new_elt) = str;
+ STR_LLIST_MOVED (*new_elt) = false;
+ STR_LLIST_NEXT (*new_elt) = NULL;
+
+ /* Find the current end of the list. */
+ for (e = *l; e && STR_LLIST_NEXT (*e); e = STR_LLIST_NEXT (*e))
+ ;
+
+ if (!e)
+ *l = new_elt;
+ else
+ STR_LLIST_NEXT (*e) = new_elt;
+}
+
+/* Move an element towards the top. The idea is that when a file is
+ found in a given directory, later files will likely be in that same
+ directory, and looking for the file in all the directories in between
+ is thus a waste. */
+
+void
+str_llist_float P2C(str_llist_type *, l, str_llist_elt_type *, mover)
+{
+ str_llist_elt_type *last_moved, *unmoved;
+
+ /* If we've already moved this element, never mind. */
+ if (STR_LLIST_MOVED (*mover))
+ return;
+
+ /* Find the first unmoved element (to insert before). We're
+ guaranteed this will terminate, since MOVER itself is currently
+ unmoved, and it must be in L (by hypothesis). */
+ for (last_moved = NULL, unmoved = *l; STR_LLIST_MOVED (*unmoved);
+ last_moved = unmoved, unmoved = STR_LLIST_NEXT (*unmoved))
+ ;
+
+ /* If we are the first unmoved element, nothing to relink. */
+ if (unmoved != mover)
+ { /* Remember `mover's current successor, so we can relink `mover's
+ predecessor to it. */
+ str_llist_elt_type *before_mover;
+ str_llist_elt_type *after_mover = STR_LLIST_NEXT (*mover);
+
+ /* Find `mover's predecessor. */
+ for (before_mover = unmoved; STR_LLIST_NEXT (*before_mover) != mover;
+ before_mover = STR_LLIST_NEXT (*before_mover))
+ ;
+
+ /* `before_mover' now links to `after_mover'. */
+ STR_LLIST_NEXT (*before_mover) = after_mover;
+
+ /* Insert `mover' before `unmoved' and after `last_moved' (or at
+ the head of the list). */
+ STR_LLIST_NEXT (*mover) = unmoved;
+ if (!last_moved)
+ *l = mover;
+ else
+ STR_LLIST_NEXT (*last_moved) = mover;
+ }
+
+ /* We've moved it. */
+ STR_LLIST_MOVED (*mover) = true;
+}
diff --git a/Build/source/texk/kpathsea/str-llist.h b/Build/source/texk/kpathsea/str-llist.h
new file mode 100644
index 00000000000..2d823d1795c
--- /dev/null
+++ b/Build/source/texk/kpathsea/str-llist.h
@@ -0,0 +1,58 @@
+/* str-llist.h: A linked list of strings,
+
+ It's pretty disgusting that both this and str-list exist; the reason is
+ that C cannot express iterators very well, and I don't want to change
+ all the for loops right now.
+
+ Copyright 1993, 94 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef STR_LLIST_H
+#define STR_LLIST_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+
+/* It's a little bizarre to be using the same type for the list and the
+ elements of the list, but no reason not to in this case, I think --
+ we never need a NULL string in the middle of the list, and an extra
+ NULL/NULL element always at the end is inconsequential. */
+
+struct str_llist_elt
+{
+ string str;
+ boolean moved;
+ struct str_llist_elt *next;
+};
+typedef struct str_llist_elt str_llist_elt_type;
+typedef struct str_llist_elt *str_llist_type;
+
+#define STR_LLIST(sl) ((sl).str)
+#define STR_LLIST_MOVED(sl) ((sl).moved)
+#define STR_LLIST_NEXT(sl) ((sl).next)
+
+
+/* Add the new string E to the end of the list L. */
+extern void str_llist_add P2H(str_llist_type *l, string e);
+
+/* Reorganize L so that E is below only other elements that have already
+ been moved. Set `moved' member for E. */
+extern void str_llist_float P2H(str_llist_type *l, str_llist_elt_type *e);
+
+#endif /* not STR_LLIST_H */
diff --git a/Build/source/texk/kpathsea/strcasecmp.c b/Build/source/texk/kpathsea/strcasecmp.c
new file mode 100644
index 00000000000..23c1638d9e6
--- /dev/null
+++ b/Build/source/texk/kpathsea/strcasecmp.c
@@ -0,0 +1,86 @@
+/* strcasecmp.c - case-insensitive strcmp
+
+ Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+ This file was part of the GNU C Library. Modified by kb@mail.tug.org to
+ avoid glibc-isms.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <ctype.h>
+
+/* Compare S1 and S2, ignoring case, returning less than, equal to or
+ greater than zero if S1 is lexiographically less than,
+ equal to or greater than S2. */
+int
+strcasecmp (s1, s2)
+ const char *s1;
+ const char *s2;
+{
+ register const unsigned char *p1 = (const unsigned char *) s1;
+ register const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+
+ if (p1 == p2)
+ return 0;
+
+ do
+ {
+ c1 = tolower (*p1++);
+ c2 = tolower (*p2++);
+ if (c1 == '\0')
+ break;
+ }
+ while (c1 == c2);
+
+ return c1 - c2;
+}
+
+int
+strncasecmp (s1, s2, n)
+ const char *s1;
+ const char *s2;
+ unsigned n;
+{
+ register const unsigned char *p1 = (const unsigned char *) s1;
+ register const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+
+ if (p1 == p2 || n == 0)
+ return 0;
+
+ do
+ {
+ c1 = tolower (*p1++);
+ c2 = tolower (*p2++);
+ if (c1 == '\0' || c1 != c2)
+ return c1 - c2;
+ } while (--n > 0);
+
+ return c1 - c2;
+}
diff --git a/Build/source/texk/kpathsea/strstr.c b/Build/source/texk/kpathsea/strstr.c
new file mode 100644
index 00000000000..5080a9e1e63
--- /dev/null
+++ b/Build/source/texk/kpathsea/strstr.c
@@ -0,0 +1,125 @@
+/* strstr.c - search for a substring in string.
+
+ Copyright (C) 1994, 95 Free Software Foundation, Inc.
+ This file was part of the GNU C Library. Modified by kb@mail.tug.org.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+/*
+ * My personal strstr() implementation that beats most other algorithms.
+ * Until someone tells me otherwise, I assume that this is the
+ * fastest implementation of strstr() in C.
+ * I deliberately chose not to comment it. You should have at least
+ * as much fun trying to understand it, as I had to write it :-).
+ *
+ * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+typedef unsigned chartype;
+
+char *
+strstr (phaystack, pneedle)
+ const char *phaystack;
+ const char *pneedle;
+{
+ register const unsigned char *haystack, *needle;
+ register chartype b, c;
+
+ haystack = (const unsigned char *) phaystack;
+ needle = (const unsigned char *) pneedle;
+
+ b = *needle;
+ if (b != '\0')
+ {
+ haystack--; /* possible ANSI violation */
+ do
+ {
+ c = *++haystack;
+ if (c == '\0')
+ goto ret0;
+ }
+ while (c != b);
+
+ c = *++needle;
+ if (c == '\0')
+ goto foundneedle;
+ ++needle;
+ goto jin;
+
+ for (;;)
+ {
+ register chartype a;
+ register const unsigned char *rhaystack, *rneedle;
+
+ do
+ {
+ a = *++haystack;
+ if (a == '\0')
+ goto ret0;
+ if (a == b)
+ break;
+ a = *++haystack;
+ if (a == '\0')
+ goto ret0;
+shloop: }
+ while (a != b);
+
+jin: a = *++haystack;
+ if (a == '\0')
+ goto ret0;
+
+ if (a != c)
+ goto shloop;
+
+ rhaystack = haystack-- + 1;
+ rneedle = needle;
+ a = *rneedle;
+
+ if (*rhaystack == a)
+ do
+ {
+ if (a == '\0')
+ goto foundneedle;
+ ++rhaystack;
+ a = *++needle;
+ if (*rhaystack != a)
+ break;
+ if (a == '\0')
+ goto foundneedle;
+ ++rhaystack;
+ a = *++needle;
+ }
+ while (*rhaystack == a);
+
+ needle = rneedle; /* took the register-poor aproach */
+
+ if (a == '\0')
+ break;
+ }
+ }
+foundneedle:
+ return (char*) haystack;
+ret0:
+ return 0;
+}
diff --git a/Build/source/texk/kpathsea/strtol.c b/Build/source/texk/kpathsea/strtol.c
new file mode 100644
index 00000000000..add9cb46885
--- /dev/null
+++ b/Build/source/texk/kpathsea/strtol.c
@@ -0,0 +1,297 @@
+/* strtol.c - convert a string to an unsigned long int.
+
+ Copyright 1997 Karl Berry.
+ Copyright 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+/* The original code in this file came from the GNU C Library,
+ with modifications to fit libkpathsea.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define USE_NUMBER_GROUPING
+# define STDC_HEADERS
+# define HAVE_LIMITS_H
+#endif
+
+#include <ctype.h>
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+#ifdef STDC_HEADERS
+# include <stddef.h>
+# include <stdlib.h>
+#else
+# ifndef NULL
+# define NULL 0
+# endif
+#endif
+
+#ifdef USE_NUMBER_GROUPING
+# include "../locale/localeinfo.h"
+#endif
+
+/* Nonzero if we are defining `strtoul' or `strtouq', operating on
+ unsigned integers. */
+#ifndef UNSIGNED
+# define UNSIGNED 0
+# define INT LONG int
+#else
+# define strtol strtoul
+# define INT unsigned LONG int
+#endif
+
+/* If QUAD is defined, we are defining `strtoq' or `strtouq',
+ operating on `long long int's. */
+#ifdef QUAD
+# if UNSIGNED
+# define strtoul strtouq
+# else
+# define strtol strtoq
+# endif
+# define LONG long long
+# undef LONG_MIN
+# define LONG_MIN LONG_LONG_MIN
+# undef LONG_MAX
+# define LONG_MAX LONG_LONG_MAX
+# undef ULONG_MAX
+# define ULONG_MAX ULONG_LONG_MAX
+# if __GNUC__ == 2 && __GNUC_MINOR__ < 7
+ /* Work around gcc bug with using this constant. */
+ static const unsigned long long int maxquad = ULONG_LONG_MAX;
+# undef ULONG_MAX
+# define ULONG_MAX maxquad
+# endif
+#else
+# define LONG long
+#endif
+
+#ifdef __STDC__
+# define INTERNAL(x) INTERNAL1(x)
+# define INTERNAL1(x) __##x##_internal
+#else
+# define INTERNAL(x) __/**/x/**/_internal
+#endif
+
+#ifdef USE_NUMBER_GROUPING
+/* This file defines a function to check for correct grouping. */
+# include "grouping.h"
+#endif
+
+
+/* Convert NPTR to an `unsigned long int' or `long int' in base BASE.
+ If BASE is 0 the base is determined by the presence of a leading
+ zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal.
+ If BASE is < 2 or > 36, it is reset to 10.
+ If ENDPTR is not NULL, a pointer to the character after the last
+ one converted is stored in *ENDPTR. */
+
+INT
+INTERNAL (strtol) (nptr, endptr, base, group)
+ const char *nptr;
+ char **endptr;
+ int base;
+ int group;
+{
+ int negative;
+ register unsigned LONG int cutoff;
+ register unsigned int cutlim;
+ register unsigned LONG int i;
+ register const char *s;
+ register unsigned char c;
+ const char *save, *end;
+ int overflow;
+
+#ifdef USE_NUMBER_GROUPING
+ /* The thousands character of the current locale. */
+ wchar_t thousands;
+ /* The numeric grouping specification of the current locale,
+ in the format described in <locale.h>. */
+ const char *grouping;
+
+ if (group)
+ {
+ grouping = _NL_CURRENT (LC_NUMERIC, GROUPING);
+ if (*grouping <= 0 || *grouping == CHAR_MAX)
+ grouping = NULL;
+ else
+ {
+ /* Figure out the thousands separator character. */
+ if (mbtowc (&thousands, _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP),
+ strlen (_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP))) <= 0)
+ thousands = (wchar_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP);
+ if (thousands == L'\0')
+ grouping = NULL;
+ }
+ }
+ else
+ grouping = NULL;
+#endif
+
+ if (base < 0 || base == 1 || base > 36)
+ base = 10;
+
+ s = nptr;
+
+ /* Skip white space. */
+ while (isspace (*s))
+ ++s;
+ if (*s == '\0')
+ goto noconv;
+
+ /* Check for a sign. */
+ if (*s == '-')
+ {
+ negative = 1;
+ ++s;
+ }
+ else if (*s == '+')
+ {
+ negative = 0;
+ ++s;
+ }
+ else
+ negative = 0;
+
+ if (base == 16 && s[0] == '0' && toupper (s[1]) == 'X')
+ s += 2;
+
+ /* If BASE is zero, figure it out ourselves. */
+ if (base == 0)
+ if (*s == '0')
+ {
+ if (toupper (s[1]) == 'X')
+ {
+ s += 2;
+ base = 16;
+ }
+ else
+ base = 8;
+ }
+ else
+ base = 10;
+
+ /* Save the pointer so we can check later if anything happened. */
+ save = s;
+
+#ifdef USE_NUMBER_GROUPING
+ if (group)
+ {
+ /* Find the end of the digit string and check its grouping. */
+ end = s;
+ for (c = *end; c != '\0'; c = *++end)
+ if (c != thousands && !isdigit (c) &&
+ (!isalpha (c) || toupper (c) - 'A' + 10 >= base))
+ break;
+ if (*s == thousands)
+ end = s;
+ else
+ end = correctly_grouped_prefix (s, end, thousands, grouping);
+ }
+ else
+#endif
+ end = NULL;
+
+ cutoff = ULONG_MAX / (unsigned LONG int) base;
+ cutlim = ULONG_MAX % (unsigned LONG int) base;
+
+ overflow = 0;
+ i = 0;
+ for (c = *s; c != '\0'; c = *++s)
+ {
+ if (s == end)
+ break;
+ if (isdigit (c))
+ c -= '0';
+ else if (isalpha (c))
+ c = toupper (c) - 'A' + 10;
+ else
+ break;
+ if (c >= base)
+ break;
+ /* Check for overflow. */
+ if (i > cutoff || (i == cutoff && c > cutlim))
+ overflow = 1;
+ else
+ {
+ i *= (unsigned LONG int) base;
+ i += c;
+ }
+ }
+
+ /* Check if anything actually happened. */
+ if (s == save)
+ goto noconv;
+
+ /* Store in ENDPTR the address of one character
+ past the last character we converted. */
+ if (endptr != NULL)
+ *endptr = (char *) s;
+
+#if !UNSIGNED
+ /* Check for a value that is within the range of
+ `unsigned LONG int', but outside the range of `LONG int'. */
+ if (i > (negative ?
+ -(unsigned LONG int) LONG_MIN : (unsigned LONG int) LONG_MAX))
+ overflow = 1;
+#endif
+
+ if (overflow)
+ {
+ errno = ERANGE;
+#if UNSIGNED
+ return ULONG_MAX;
+#else
+ return negative ? LONG_MIN : LONG_MAX;
+#endif
+ }
+
+ /* Return the result of the appropriate sign. */
+ return (negative ? -i : i);
+
+noconv:
+ /* There was no number to convert. */
+ if (endptr != NULL)
+ *endptr = (char *) nptr;
+ return 0L;
+}
+
+/* External user entry point. */
+
+#ifdef weak_symbol
+weak_symbol (strtol)
+#endif
+
+INT
+strtol (nptr, endptr, base)
+ const char *nptr;
+ char **endptr;
+ int base;
+{
+ return INTERNAL (strtol) (nptr, endptr, base, 0);
+}
diff --git a/Build/source/texk/kpathsea/systypes.h b/Build/source/texk/kpathsea/systypes.h
new file mode 100644
index 00000000000..c1af9402f8e
--- /dev/null
+++ b/Build/source/texk/kpathsea/systypes.h
@@ -0,0 +1,32 @@
+/* c-systypes.h: include <sys/types.h>. It's too bad we need this file,
+ but some systems don't protect <sys/types.h> from multiple
+ inclusions, and I'm not willing to put up with that.
+
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef C_SYSTYPES_H
+#define C_SYSTYPES_H
+
+#include <sys/types.h>
+
+/* This is the symbol that X uses to determine if <sys/types.h> has been
+ read, so we define it. */
+#define __TYPES__
+
+#endif /* not C_SYSTYPES_H */
diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c
new file mode 100644
index 00000000000..6fabb311b9d
--- /dev/null
+++ b/Build/source/texk/kpathsea/tex-file.c
@@ -0,0 +1,949 @@
+/* tex-file.c: high-level file searching by format.
+
+ Copyright 1998-2005 Olaf Weber.
+ Copyright 1993, 94, 95, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/c-vararg.h>
+#include <kpathsea/cnf.h>
+#include <kpathsea/concatn.h>
+#include <kpathsea/default.h>
+#include <kpathsea/expand.h>
+#include <kpathsea/fontmap.h>
+#include <kpathsea/paths.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/tex-file.h>
+#include <kpathsea/tex-make.h>
+#include <kpathsea/variable.h>
+
+
+/* See tex-file.h. */
+const_string kpse_fallback_font = NULL;
+const_string kpse_fallback_resolutions_string = NULL;
+unsigned *kpse_fallback_resolutions = NULL;
+kpse_format_info_type kpse_format_info[kpse_last_format];
+
+/* These are not in the structure
+ because it's annoying to initialize lists in C. */
+#define GF_ENVS "GFFONTS", GLYPH_ENVS
+#define PK_ENVS "PKFONTS", "TEXPKS", GLYPH_ENVS
+#define GLYPH_ENVS "GLYPHFONTS", "TEXFONTS"
+#define TFM_ENVS "TFMFONTS", "TEXFONTS"
+#define AFM_ENVS "AFMFONTS", "TEXFONTS"
+#define BASE_ENVS "MFBASES", "TEXMFINI"
+#define BIB_ENVS "BIBINPUTS", "TEXBIB"
+#define BST_ENVS "BSTINPUTS"
+#define CNF_ENVS "TEXMFCNF"
+#define DB_ENVS "TEXMFDBS"
+#define FMT_ENVS "TEXFORMATS", "TEXMFINI"
+#define FONTMAP_ENVS "TEXFONTMAPS", "TEXFONTS"
+#define MEM_ENVS "MPMEMS", "TEXMFINI"
+#define MF_ENVS "MFINPUTS"
+#define MFPOOL_ENVS "MFPOOL", "TEXMFINI"
+#define MFT_ENVS "MFTINPUTS"
+#define MP_ENVS "MPINPUTS"
+#define MPPOOL_ENVS "MPPOOL", "TEXMFINI"
+#define MPSUPPORT_ENVS "MPSUPPORT"
+#define OCP_ENVS "OCPINPUTS"
+#define OFM_ENVS "OFMFONTS", "TEXFONTS"
+#define OPL_ENVS "OPLFONTS", "TEXFONTS"
+#define OTP_ENVS "OTPINPUTS"
+#define OVF_ENVS "OVFFONTS", "TEXFONTS"
+#define OVP_ENVS "OVPFONTS", "TEXFONTS"
+#define PICT_ENVS "TEXPICTS", TEX_ENVS
+#define TEX_ENVS "TEXINPUTS"
+#define TEXDOC_ENVS "TEXDOCS"
+#define TEXPOOL_ENVS "TEXPOOL", "TEXMFINI"
+#define TEXSOURCE_ENVS "TEXSOURCES"
+#define TEX_PS_HEADER_ENVS "TEXPSHEADERS", "PSHEADERS"
+#define TROFF_FONT_ENVS "TRFONTS"
+#define TYPE1_ENVS "T1FONTS", "T1INPUTS", "TEXFONTS", TEX_PS_HEADER_ENVS
+#define VF_ENVS "VFFONTS", "TEXFONTS"
+#define DVIPS_CONFIG_ENVS "TEXCONFIG"
+#define IST_ENVS "TEXINDEXSTYLE", "INDEXSTYLE"
+#define TRUETYPE_ENVS "TTFONTS", "TEXFONTS"
+#define TYPE42_ENVS "T42FONTS", "TEXFONTS"
+#define WEB2C_ENVS "WEB2C"
+#define MISCFONTS_ENVS "MISCFONTS", "TEXFONTS"
+#define WEB_ENVS "WEBINPUTS"
+#define CWEB_ENVS "CWEBINPUTS"
+#define ENC_ENVS "ENCFONTS", "TEXFONTS"
+#define CMAP_ENVS "CMAPFONTS", "TEXFONTS"
+#define SFD_ENVS "SFDFONTS", "TEXFONTS"
+#define OPENTYPE_ENVS "OPENTYPEFONTS", "TEXFONTS"
+#define PDFTEXCONFIG_ENVS "PDFTEXCONFIG"
+#define LIG_ENVS "LIGFONTS", "TEXFONTS"
+#define TEXMFSCRIPTS_ENVS "TEXMFSCRIPTS"
+
+/* The compiled-in default list, DEFAULT_FONT_SIZES, is intended to be
+ set from the command line (presumably via the Makefile). */
+
+#ifndef DEFAULT_FONT_SIZES
+#define DEFAULT_FONT_SIZES ""
+#endif
+
+void
+kpse_init_fallback_resolutions P1C(string, envvar)
+{
+ string size;
+ const_string size_var = ENVVAR (envvar, "TEXSIZES");
+ string size_str = getenv (size_var);
+ unsigned *last_resort_sizes = NULL;
+ unsigned size_count = 0;
+ const_string default_sizes = kpse_fallback_resolutions_string
+ ? kpse_fallback_resolutions_string
+ : DEFAULT_FONT_SIZES;
+ string size_list = kpse_expand_default (size_str, default_sizes);
+
+ /* Initialize the list of last-resort sizes. */
+ for (size = kpse_path_element (size_list); size != NULL;
+ size = kpse_path_element (NULL))
+ {
+ unsigned s;
+ if (! *size) /* Skip empty elements. */
+ continue;
+
+ s = atoi (size);
+ if (size_count && s < last_resort_sizes[size_count - 1]) {
+ WARNING1 ("kpathsea: last resort size %s not in ascending order, ignored",
+ size);
+ } else {
+ size_count++;
+ XRETALLOC (last_resort_sizes, size_count, unsigned);
+ last_resort_sizes[size_count - 1] = atoi (size);
+ }
+ }
+
+ /* Add a zero to mark the end of the list. */
+ size_count++;
+ XRETALLOC (last_resort_sizes, size_count, unsigned);
+ last_resort_sizes[size_count - 1] = 0;
+
+ free (size_list);
+
+ kpse_fallback_resolutions = last_resort_sizes;
+}
+
+/* We should be able to set the program arguments in the same way. Not
+ to mention the path values themselves. */
+
+void
+kpse_set_program_enabled P3C(kpse_file_format_type, fmt, boolean, value,
+ kpse_src_type, level)
+{
+ kpse_format_info_type *f = &kpse_format_info[fmt];
+ if (level >= f->program_enable_level) {
+ f->program_enabled_p = value;
+ f->program_enable_level = level;
+ }
+}
+
+
+/* Web2c and kpsewhich have command-line options to set this stuff. May
+ as well have a common place. */
+
+void
+kpse_maketex_option P2C(const_string, fmtname, boolean, value)
+{
+ kpse_file_format_type fmt = kpse_last_format;
+
+ /* Trying to match up with the suffix lists unfortunately doesn't work
+ well, since that would require initializing the formats. */
+ /* FIXME: Currently the function silently ignores unrecognized arguments.*/
+ if (FILESTRCASEEQ (fmtname, "pk")) {
+ fmt = kpse_pk_format;
+ } else if (FILESTRCASEEQ (fmtname, "mf")) {
+ fmt = kpse_mf_format;
+ } else if (FILESTRCASEEQ (fmtname, "tex")) {
+ fmt = kpse_tex_format;
+ } else if (FILESTRCASEEQ (fmtname, "tfm")) {
+ fmt = kpse_tfm_format;
+ } else if (FILESTRCASEEQ (fmtname, "ofm")) {
+ fmt = kpse_ofm_format;
+ } else if (FILESTRCASEEQ (fmtname, "ocp")) {
+ fmt = kpse_ocp_format;
+ }
+ if (fmt != kpse_last_format) {
+ kpse_set_program_enabled (fmt, value, kpse_src_cmdline);
+ }
+}
+
+/* Macro subroutines for `init_path'. TRY_ENV checks if an envvar ENAME
+ is set and non-null, and sets var to ENAME if so. */
+#define TRY_ENV(ename) do { \
+ string evar = ename; \
+} while (0)
+
+/* And EXPAND_DEFAULT calls kpse_expand_default on try_path and the
+ present info->path. */
+#define EXPAND_DEFAULT(try_path, source_string) \
+ if (try_path) { \
+ info->raw_path = try_path; \
+ info->path = kpse_expand_default (try_path, info->path); \
+ info->path_source = source_string; \
+ }
+
+/* Find the final search path to use for the format entry INFO, given
+ the compile-time default (DEFAULT_PATH), and the environment
+ variables to check (the remaining arguments, terminated with NULL).
+ We set the `path' and `path_source' members of INFO. The
+ `client_path' member must already be set upon entry. */
+
+static void
+init_path PVAR2C(kpse_format_info_type *, info, const_string, default_path, ap)
+{
+ string env_name;
+ string env_value = NULL;
+ string var = NULL;
+
+ info->default_path = default_path;
+
+ /* First envvar that's set to a nonempty value will exit the loop. If
+ none are set, we want the first cnf entry that matches. Find the
+ cnf entries simultaneously, to avoid having to go through envvar
+ list twice -- because of the PVAR?C macro, that would mean having
+ to create a str_list and then use it twice. Yuck. */
+ while ((env_name = va_arg (ap, string)) != NULL) {
+ /* Since sh doesn't like envvar names with `.', check PATH_prog
+ as well as PATH.prog. */
+ if (!var) {
+ /* Try PATH.prog. */
+ string evar = concat3 (env_name, ".", kpse_program_name);
+ env_value = getenv (evar);
+ if (env_value && *env_value) {
+ var = evar;
+ } else {
+ free (evar);
+ /* Try PATH_prog. */
+ evar = concat3 (env_name, "_", kpse_program_name);
+ env_value = getenv (evar);
+ if (env_value && *env_value) {
+ var = evar;
+ } else {
+ free (evar);
+ /* Try simply PATH. */
+ env_value = getenv (env_name);
+ if (env_value && *env_value) {
+ var = env_name;
+ }
+ }
+ }
+ }
+
+ /* If we are initializing the cnf path, don't try to get any
+ values from the cnf files; that's infinite loop time. */
+ if (!info->cnf_path && info != &kpse_format_info[kpse_cnf_format])
+ info->cnf_path = kpse_cnf_get (env_name);
+
+ if (var && info->cnf_path)
+ break;
+ }
+ va_end (ap);
+
+ /* Expand any extra :'s. For each level, we replace an extra : with
+ the path at the next lower level. For example, an extra : in a
+ user-set envvar should be replaced with the path from the cnf file.
+ things are complicated because none of the levels above the very
+ bottom are guaranteed to exist. */
+
+ /* Assume we can reliably start with the compile-time default. */
+ info->path = info->raw_path = info->default_path;
+ info->path_source = "compile-time paths.h";
+
+ /* Translate ';' in the envvar into ':' if that's our ENV_SEP. */
+ if (IS_ENV_SEP(':') && env_value) {
+ string loc;
+ env_value = xstrdup(env_value); /* Freed below. */
+ for (loc = env_value; *loc; loc++) {
+ if (*loc == ';')
+ *loc = ':';
+ }
+ }
+
+ EXPAND_DEFAULT (info->cnf_path, "texmf.cnf");
+ EXPAND_DEFAULT (info->client_path, "program config file");
+ if (var)
+ EXPAND_DEFAULT (env_value, concat (var, " environment variable"));
+ EXPAND_DEFAULT (info->override_path, "application override variable");
+ info->path = kpse_brace_expand (info->path);
+
+ /* Free the copied env_value. */
+ if (IS_ENV_SEP(':') && env_value)
+ free(env_value);
+}}
+
+
+/* Some file types have more than one suffix. */
+/* Some times it is convenient to modify the list of searched suffixes.
+ *** Don't complain if this function goes away. ***
+ */
+void
+kpse_set_suffixes PVAR2C(kpse_file_format_type, format,
+ boolean, alternate, ap)
+{
+ const_string **list;
+ const_string s;
+ int count = 0;
+
+ if (alternate) {
+ list = &kpse_format_info[format].alt_suffix;
+ }
+ else {
+ list = &kpse_format_info[format].suffix;
+ }
+
+ while ((s = va_arg (ap, string)) != NULL) {
+ count++;
+ XRETALLOC (*list, count + 1, const_string);
+ (*list)[count - 1] = s;
+ }
+ va_end (ap);
+ (*list)[count] = NULL;
+
+}}
+
+/* The path spec we are defining, one element of the global array. */
+#define FMT_INFO kpse_format_info[format]
+/* Call kpse_set_add_suffixes. */
+#define SUFFIXES(args) kpse_set_suffixes(format, false, args, NULL)
+#define ALT_SUFFIXES(args) kpse_set_suffixes(format, true, args, NULL)
+
+/* Call `init_path', including appending the trailing NULL to the envvar
+ list. Also initialize the fields not needed in setting the path. */
+#define INIT_FORMAT(text, default_path, envs) \
+ FMT_INFO.type = text; \
+ init_path (&FMT_INFO, default_path, envs, NULL)
+
+
+/* A few file types allow for runtime generation by an external program.
+ kpse_init_prog may have already initialized it (the `program'
+ member). Here we allow people to turn it off or on in the config
+ file, by setting the variable whose name is the uppercasified program
+ name to 0 or 1. */
+
+static void
+init_maketex PVAR2C(kpse_file_format_type, fmt, const_string, dflt_prog, ap)
+{
+ kpse_format_info_type *f = &kpse_format_info[fmt];
+ const_string prog = f->program ? f->program : dflt_prog; /* mktexpk */
+ string PROG = uppercasify (prog); /* MKTEXPK */
+ string progval = kpse_var_value (PROG); /* ENV/cnf{"MKTEXPK"} */
+ const_string arg;
+
+ /* Doesn't hurt to always set this info. */
+ f->program = prog;
+
+ /* Set up the argument vector. */
+ f->argc = 0;
+ f->argv = XTALLOC(2, const_string);
+ f->argv[f->argc++] = dflt_prog;
+ while ((arg = va_arg (ap, string)) != NULL) {
+ f->argc++;
+ XRETALLOC (f->argv, f->argc + 1, const_string);
+ f->argv[f->argc - 1] = arg;
+ }
+ f->argv[f->argc] = NULL;
+
+ if (progval && *progval) {
+ /* This might actually be from an environment variable value, but in
+ that case, we'll have previously set it from kpse_init_prog. */
+ kpse_set_program_enabled (fmt, *progval == '1', kpse_src_client_cnf);
+ }
+
+ free (PROG);
+}}
+
+/* We need this twice, so ... */
+#define MKTEXPK_ARGS \
+ "--mfmode","$MAKETEX_MODE",\
+ "--bdpi","$MAKETEX_BASE_DPI",\
+ "--mag","$MAKETEX_MAG",\
+ "--dpi","$KPATHSEA_DPI",\
+ NULL
+
+static string
+remove_dbonly P1C(const_string, path)
+{
+ string ret = XTALLOC(strlen (path) + 1, char), q=ret;
+ const_string p=path;
+ boolean new_elt=true;
+
+ while (*p) {
+ if (new_elt && *p && *p == '!' && *(p+1) == '!')
+ p += 2;
+ else {
+ new_elt = (*p == ENV_SEP);
+ *q++ = *p++;
+ }
+ }
+ *q = '\0';
+ return(ret);
+}
+
+/* Initialize everything for FORMAT. */
+
+const_string
+kpse_init_format P1C(kpse_file_format_type, format)
+{
+ /* If we get called twice, don't redo all the work. */
+ if (FMT_INFO.path)
+ return FMT_INFO.path;
+
+ switch (format)
+ { /* We might be able to avoid repeating `gf' or whatever so many
+ times with token pasting, but it doesn't seem worth it. */
+ case kpse_gf_format:
+ INIT_FORMAT ("gf", DEFAULT_GFFONTS, GF_ENVS);
+ SUFFIXES ("gf");
+ FMT_INFO.suffix_search_only = true;
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_pk_format:
+ init_maketex (format, "mktexpk", MKTEXPK_ARGS);
+ INIT_FORMAT ("pk", DEFAULT_PKFONTS, PK_ENVS);
+ SUFFIXES ("pk");
+ FMT_INFO.suffix_search_only = true;
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_any_glyph_format:
+ init_maketex (format, "mktexpk", MKTEXPK_ARGS);
+ INIT_FORMAT ("bitmap font", DEFAULT_GLYPHFONTS, GLYPH_ENVS);
+ FMT_INFO.suffix_search_only = true;
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_tfm_format:
+ /* Must come before kpse_ofm_format. */
+ init_maketex (format, "mktextfm", NULL);
+ INIT_FORMAT ("tfm", DEFAULT_TFMFONTS, TFM_ENVS);
+ SUFFIXES (".tfm");
+ FMT_INFO.suffix_search_only = true;
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_afm_format:
+ INIT_FORMAT ("afm", DEFAULT_AFMFONTS, AFM_ENVS);
+ SUFFIXES (".afm");
+ break;
+ case kpse_base_format:
+ init_maketex (format, "mktexfmt", NULL);
+ INIT_FORMAT ("base", DEFAULT_MFBASES, BASE_ENVS);
+ SUFFIXES (".base");
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_bib_format:
+ INIT_FORMAT ("bib", DEFAULT_BIBINPUTS, BIB_ENVS);
+ SUFFIXES (".bib");
+ FMT_INFO.suffix_search_only = true;
+ break;
+ case kpse_bst_format:
+ INIT_FORMAT ("bst", DEFAULT_BSTINPUTS, BST_ENVS);
+ SUFFIXES (".bst");
+ break;
+ case kpse_cnf_format:
+ INIT_FORMAT ("cnf", DEFAULT_TEXMFCNF, CNF_ENVS);
+ SUFFIXES (".cnf");
+ break;
+ case kpse_db_format:
+ INIT_FORMAT ("ls-R", DEFAULT_TEXMFDBS, DB_ENVS);
+#define LSR_SUFFIXES "ls-R", "ls-r"
+ SUFFIXES (LSR_SUFFIXES);
+ FMT_INFO.path = remove_dbonly (FMT_INFO.path);
+ break;
+ case kpse_fmt_format:
+ init_maketex (format, "mktexfmt", NULL);
+ INIT_FORMAT ("fmt", DEFAULT_TEXFORMATS, FMT_ENVS);
+ SUFFIXES (".fmt");
+#define FMT_SUFFIXES ".efmt",".efm",".ofmt",".ofm",".oft",".eofmt",".eoft",".eof",".pfmt",".pfm",".epfmt",".epf",".xpfmt",".xpf",".afmt",".afm"
+ ALT_SUFFIXES (FMT_SUFFIXES);
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_fontmap_format:
+ INIT_FORMAT ("map", DEFAULT_TEXFONTMAPS, FONTMAP_ENVS);
+ SUFFIXES (".map");
+ break;
+ case kpse_mem_format:
+ init_maketex (format, "mktexfmt", NULL);
+ INIT_FORMAT ("mem", DEFAULT_MPMEMS, MEM_ENVS);
+ SUFFIXES (".mem");
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_mf_format:
+ init_maketex (format, "mktexmf", NULL);
+ INIT_FORMAT ("mf", DEFAULT_MFINPUTS, MF_ENVS);
+ SUFFIXES (".mf");
+ break;
+ case kpse_mft_format:
+ INIT_FORMAT ("mft", DEFAULT_MFTINPUTS, MFT_ENVS);
+ SUFFIXES (".mft");
+ break;
+ case kpse_mfpool_format:
+ INIT_FORMAT ("mfpool", DEFAULT_MFPOOL, MFPOOL_ENVS);
+ SUFFIXES (".pool");
+ break;
+ case kpse_mp_format:
+ INIT_FORMAT ("mp", DEFAULT_MPINPUTS, MP_ENVS);
+ SUFFIXES (".mp");
+ break;
+ case kpse_mppool_format:
+ INIT_FORMAT ("mppool", DEFAULT_MPPOOL, MPPOOL_ENVS);
+ SUFFIXES (".pool");
+ break;
+ case kpse_mpsupport_format:
+ INIT_FORMAT ("MetaPost support", DEFAULT_MPSUPPORT, MPSUPPORT_ENVS);
+ break;
+ case kpse_ocp_format:
+ init_maketex (format, "mkocp", NULL);
+ INIT_FORMAT ("ocp", DEFAULT_OCPINPUTS, OCP_ENVS);
+ SUFFIXES (".ocp");
+ FMT_INFO.suffix_search_only = true;
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_ofm_format:
+ init_maketex (format, "mkofm", NULL);
+ INIT_FORMAT ("ofm", DEFAULT_OFMFONTS, OFM_ENVS);
+#define OFM_SUFFIXES ".ofm", ".tfm"
+ SUFFIXES (OFM_SUFFIXES);
+ FMT_INFO.suffix_search_only = true;
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_opl_format:
+ INIT_FORMAT ("opl", DEFAULT_OPLFONTS, OPL_ENVS);
+ SUFFIXES (".opl");
+ FMT_INFO.suffix_search_only = true;
+ break;
+ case kpse_otp_format:
+ INIT_FORMAT ("otp", DEFAULT_OTPINPUTS, OTP_ENVS);
+ SUFFIXES (".otp");
+ FMT_INFO.suffix_search_only = true;
+ break;
+ case kpse_ovf_format:
+ INIT_FORMAT ("ovf", DEFAULT_OVFFONTS, OVF_ENVS);
+ SUFFIXES (".ovf");
+ FMT_INFO.suffix_search_only = true;
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_ovp_format:
+ INIT_FORMAT ("ovp", DEFAULT_OVPFONTS, OVP_ENVS);
+ SUFFIXES (".ovp");
+ FMT_INFO.suffix_search_only = true;
+ break;
+ case kpse_pict_format:
+ INIT_FORMAT ("graphic/figure", DEFAULT_TEXINPUTS, PICT_ENVS);
+#define PICT_SUFFIXES ".eps", ".epsi"
+ ALT_SUFFIXES (PICT_SUFFIXES);
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_tex_format:
+ init_maketex (format, "mktextex", NULL);
+ INIT_FORMAT ("tex", DEFAULT_TEXINPUTS, TEX_ENVS);
+ SUFFIXES (".tex");
+ /* We don't maintain a list of alternate TeX suffixes. Such a list
+ could never be complete. */
+ break;
+ case kpse_tex_ps_header_format:
+ INIT_FORMAT ("PostScript header", DEFAULT_TEXPSHEADERS,
+ TEX_PS_HEADER_ENVS);
+/* Unfortunately, dvipsk uses this format for type1 fonts. */
+#define TEXPSHEADER_SUFFIXES ".pro"
+ ALT_SUFFIXES (TEXPSHEADER_SUFFIXES);
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_texdoc_format:
+ INIT_FORMAT ("TeX system documentation", DEFAULT_TEXDOCS, TEXDOC_ENVS);
+ break;
+ case kpse_texpool_format:
+ INIT_FORMAT ("texpool", DEFAULT_TEXPOOL, TEXPOOL_ENVS);
+ SUFFIXES (".pool");
+ break;
+ case kpse_texsource_format:
+ INIT_FORMAT ("TeX system sources", DEFAULT_TEXSOURCES, TEXSOURCE_ENVS);
+ break;
+ case kpse_troff_font_format:
+ INIT_FORMAT ("Troff fonts", DEFAULT_TRFONTS, TROFF_FONT_ENVS);
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_type1_format:
+ INIT_FORMAT ("type1 fonts", DEFAULT_T1FONTS, TYPE1_ENVS);
+#define TYPE1_SUFFIXES ".pfa", ".pfb"
+ SUFFIXES (TYPE1_SUFFIXES);
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_vf_format:
+ INIT_FORMAT ("vf", DEFAULT_VFFONTS, VF_ENVS);
+ SUFFIXES (".vf");
+ FMT_INFO.suffix_search_only = true;
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_dvips_config_format:
+ INIT_FORMAT ("dvips config", DEFAULT_TEXCONFIG, DVIPS_CONFIG_ENVS);
+ break;
+ case kpse_ist_format:
+ INIT_FORMAT ("ist", DEFAULT_INDEXSTYLE, IST_ENVS);
+ SUFFIXES (".ist");
+ break;
+ case kpse_truetype_format:
+ INIT_FORMAT ("truetype fonts", DEFAULT_TTFONTS, TRUETYPE_ENVS);
+#define TRUETYPE_SUFFIXES ".ttf", ".ttc", ".TTF", ".TTC"
+ SUFFIXES (TRUETYPE_SUFFIXES);
+ FMT_INFO.suffix_search_only = false;
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_type42_format:
+ INIT_FORMAT ("type42 fonts", DEFAULT_T42FONTS, TYPE42_ENVS);
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_web2c_format:
+ INIT_FORMAT ("web2c files", DEFAULT_WEB2C, WEB2C_ENVS);
+ break;
+ case kpse_program_text_format:
+ INIT_FORMAT ("other text files",
+ concatn (".", ENV_SEP_STRING, "$TEXMF/",
+ kpse_program_name, "//", NULL),
+ concat (uppercasify (kpse_program_name), "INPUTS"));
+ break;
+ case kpse_program_binary_format:
+ INIT_FORMAT ("other binary files",
+ concatn (".", ENV_SEP_STRING, "$TEXMF/",
+ kpse_program_name, "//", NULL),
+ concat (uppercasify (kpse_program_name), "INPUTS"));
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_miscfonts_format:
+ INIT_FORMAT ("misc fonts", DEFAULT_MISCFONTS, MISCFONTS_ENVS);
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_web_format:
+ INIT_FORMAT ("web", DEFAULT_WEBINPUTS, WEB_ENVS);
+ SUFFIXES (".web");
+ ALT_SUFFIXES (".ch");
+ break;
+ case kpse_cweb_format:
+ INIT_FORMAT ("cweb", DEFAULT_CWEBINPUTS, CWEB_ENVS);
+#define CWEB_SUFFIXES ".w", ".web"
+ SUFFIXES (CWEB_SUFFIXES);
+ ALT_SUFFIXES (".ch");
+ break;
+ case kpse_enc_format:
+ INIT_FORMAT ("enc files", DEFAULT_ENCFONTS, ENC_ENVS);
+ SUFFIXES (".enc");
+ break;
+ case kpse_cmap_format:
+ INIT_FORMAT ("cmap files", DEFAULT_CMAPFONTS, CMAP_ENVS);
+ SUFFIXES (".cmap");
+ break;
+ case kpse_sfd_format:
+ INIT_FORMAT ("subfont definition files", DEFAULT_SFDFONTS, SFD_ENVS);
+ SUFFIXES (".sfd");
+ break;
+ case kpse_opentype_format:
+ INIT_FORMAT ("opentype fonts", DEFAULT_OPENTYPEFONTS, OPENTYPE_ENVS);
+ SUFFIXES (".otf");
+ FMT_INFO.binmode = true;
+ break;
+ case kpse_pdftex_config_format:
+ INIT_FORMAT ("pdftex config", DEFAULT_PDFTEXCONFIG, PDFTEXCONFIG_ENVS);
+ break;
+ case kpse_lig_format:
+ INIT_FORMAT ("lig files", DEFAULT_LIGFONTS, LIG_ENVS);
+ SUFFIXES (".lig");
+ break;
+ case kpse_texmfscripts_format:
+ INIT_FORMAT ("texmfscripts", DEFAULT_TEXMFSCRIPTS, TEXMFSCRIPTS_ENVS);
+ break;
+ default:
+ FATAL1 ("kpse_init_format: Unknown format %d", format);
+ }
+
+#ifdef KPSE_DEBUG
+#define MAYBE(member) (FMT_INFO.member ? FMT_INFO.member : "(none)")
+
+ /* Describe the monster we've created. */
+ if (KPSE_DEBUG_P (KPSE_DEBUG_PATHS))
+ {
+ DEBUGF2 ("Search path for %s files (from %s)\n",
+ FMT_INFO.type, FMT_INFO.path_source);
+ DEBUGF1 (" = %s\n", FMT_INFO.path);
+ DEBUGF1 (" before expansion = %s\n", FMT_INFO.raw_path);
+ DEBUGF1 (" application override path = %s\n", MAYBE (override_path));
+ DEBUGF1 (" application config file path = %s\n", MAYBE (client_path));
+ DEBUGF1 (" texmf.cnf path = %s\n", MAYBE (cnf_path));
+ DEBUGF1 (" compile-time path = %s\n", MAYBE (default_path));
+ DEBUGF (" default suffixes =");
+ if (FMT_INFO.suffix) {
+ const_string *ext;
+ for (ext = FMT_INFO.suffix; ext && *ext; ext++) {
+ fprintf (stderr, " %s", *ext);
+ }
+ putc ('\n', stderr);
+ } else {
+ fputs (" (none)\n", stderr);
+ }
+ DEBUGF (" other suffixes =");
+ if (FMT_INFO.alt_suffix) {
+ const_string *alt;
+ for (alt = FMT_INFO.alt_suffix; alt && *alt; alt++) {
+ fprintf (stderr, " %s", *alt);
+ }
+ putc ('\n', stderr);
+ } else {
+ fputs (" (none)\n", stderr);
+ }
+ DEBUGF1 (" search only with suffix = %d\n",FMT_INFO.suffix_search_only);
+ DEBUGF1 (" numeric format value = %d\n", format);
+ DEBUGF1 (" runtime generation program = %s\n", MAYBE (program));
+ DEBUGF (" runtime generation command =");
+ if (FMT_INFO.argv) {
+ const_string *arg;
+ for (arg = FMT_INFO.argv; *arg; arg++) {
+ fprintf (stderr, " %s", *arg);
+ }
+ putc ('\n', stderr);
+ } else {
+ fputs(" (none)\n", stderr);
+ }
+ DEBUGF1 (" program enabled = %d\n", FMT_INFO.program_enabled_p);
+ DEBUGF1 (" program enable level = %d\n", FMT_INFO.program_enable_level);
+ }
+#endif /* KPSE_DEBUG */
+
+ return FMT_INFO.path;
+}
+
+/* Look up a file NAME of type FORMAT, and the given MUST_EXIST. This
+ initializes the path spec for FORMAT if it's the first lookup of that
+ type. Return the filename found, or NULL. This is the most likely
+ thing for clients to call. */
+
+string
+kpse_find_file P3C(const_string, name, kpse_file_format_type, format,
+ boolean, must_exist)
+{
+ const_string *ext;
+ unsigned name_len = 0;
+ boolean name_has_suffix_already = false;
+ string mapped_name;
+ string *mapped_names;
+ const_string *target;
+ unsigned count;
+ boolean use_fontmaps = (format == kpse_tfm_format
+ || format == kpse_gf_format
+ || format == kpse_pk_format
+ || format == kpse_ofm_format);
+ string ret = NULL;
+
+ /* NAME being NULL is a programming bug somewhere. NAME can be empty,
+ though; this happens with constructs like `\input\relax'. */
+ assert (name);
+
+ if (FMT_INFO.path == NULL)
+ kpse_init_format (format);
+
+ if (KPSE_DEBUG_P(KPSE_DEBUG_SEARCH))
+ DEBUGF3 ("kpse_find_file: searching for %s of type %s (from %s)\n",
+ name, FMT_INFO.type, FMT_INFO.path_source);
+
+ /* Do variable and tilde expansion. */
+ name = kpse_expand(name);
+
+ /* Does NAME already end in a possible suffix? */
+ name_len = strlen (name);
+ if (FMT_INFO.suffix) {
+ for (ext = FMT_INFO.suffix; !name_has_suffix_already && *ext; ext++) {
+ unsigned suffix_len = strlen (*ext);
+ name_has_suffix_already = (name_len >= suffix_len
+ && FILESTRCASEEQ (*ext, name + name_len - suffix_len));
+ }
+ }
+ if (!name_has_suffix_already && FMT_INFO.alt_suffix) {
+ for (ext = FMT_INFO.alt_suffix; !name_has_suffix_already && *ext; ext++) {
+ unsigned suffix_len = strlen (*ext);
+ name_has_suffix_already = (name_len >= suffix_len
+ && FILESTRCASEEQ (*ext, name + name_len - suffix_len));
+ }
+ }
+
+ /* Set up target list. */
+ count = 0;
+ target = XTALLOC1 (const_string);
+ /* Case #1: NAME doesn't have a suffix which is equal to a "standard"
+ suffix. For example, foo.bar, but not foo.tex. We look for the
+ name with the standard suffixes appended. */
+ if (!name_has_suffix_already && FMT_INFO.suffix) {
+ for (ext = FMT_INFO.suffix; *ext; ext++) {
+ string name_with_suffix = concat (name, *ext);
+ target[count++] = name_with_suffix;
+ XRETALLOC(target, count+1, const_string);
+ if (use_fontmaps
+ && (mapped_names = kpse_fontmap_lookup (name_with_suffix)) != NULL)
+ {
+ /* FIXME: we leak mapped_names and its elements, some of the time */
+ while ((mapped_name = *mapped_names++) != NULL) {
+ target[count++] = xstrdup (mapped_name);
+ XRETALLOC(target, count+1, const_string);
+ }
+ }
+ }
+ }
+ /* Case #2: Just look for the name we've been given, provided non-suffix
+ searches are allowed or the name already includes a suffix. */
+ if (name_has_suffix_already || !FMT_INFO.suffix_search_only) {
+ target[count++] = xstrdup (name);
+ XRETALLOC(target, count+1, const_string);
+ if (use_fontmaps && (mapped_names = kpse_fontmap_lookup (name)) != NULL) {
+ /* FIXME: we leak mapped_names and its elements, some of the time */
+ while ((mapped_name = *mapped_names++) != NULL) {
+ target[count++] = xstrdup (mapped_name);
+ XRETALLOC(target, count+1, const_string);
+ }
+ }
+ }
+ /* Terminate list. */
+ target[count] = NULL;
+
+ /* Search. */
+#if 0
+ /* Simple version, just do the search for the list, and pound disk
+ * then and there if appropriate.
+ */
+ ret = kpse_path_search_list (FMT_INFO.path, target, must_exist);
+#elif 0
+ /* Variant where we delay disk-pounding. */
+ ret = kpse_path_search_list (FMT_INFO.path, target, false);
+ if (!ret && must_exist)
+ ret = kpse_path_search_list (FMT_INFO.path, target, true);
+#else
+ /* Variant that tries the match the original behaviour more closely.
+ * The distinction is that we pound the disk for a far shorter list
+ * of names.
+ *
+ * This is the fastest variant, because it does fewer disk accesses
+ * than the two variants above -- for example some 750 calls of
+ * access(2) compared to 1500.
+ */
+ ret = kpse_path_search_list (FMT_INFO.path, target, false);
+ /* Do we need to pound the disk? */
+ if (!ret && must_exist) {
+ for (count = 0; target[count]; count++)
+ free((void*)target[count]);
+ count = 0;
+ /* We look for a subset of the previous set of names, so the
+ * target array is large enough. In particular, we don't pound
+ * the disk for alternate names from the fontmaps. Perhaps we
+ * should?
+ */
+ if (!name_has_suffix_already && FMT_INFO.suffix_search_only) {
+ for (ext = FMT_INFO.suffix; !ret && *ext; ext++)
+ target[count++] = concat (name, *ext);
+ }
+ if (name_has_suffix_already || !FMT_INFO.suffix_search_only) {
+ target[count++] = xstrdup (name);
+ }
+ target[count] = NULL;
+ ret = kpse_path_search_list (FMT_INFO.path, target, true);
+ }
+#endif
+
+ /* Free the list we created. */
+ for (count = 0; target[count]; count++)
+ free((void*)target[count]);
+ free(target);
+
+ /* If nothing was found, call mktex* to create a missing file. */
+ if (!ret && must_exist) {
+ ret = kpse_make_tex (format, name);
+ }
+
+ free((void*)name);
+
+ return ret;
+}
+
+/* Open NAME along the search path for TYPE for reading and return the
+ resulting file, or exit with an error message. */
+
+FILE *
+kpse_open_file P2C(const_string, name, kpse_file_format_type, type)
+{
+ string fullname = kpse_find_file (name, type, true);
+ const_string mode = kpse_format_info[type].binmode
+ ? FOPEN_RBIN_MODE
+ : FOPEN_R_MODE;
+ FILE *f = fullname ? fopen (fullname, mode) : NULL;
+ if (!f) {
+ if (fullname) {
+ perror (fullname);
+ exit (1);
+ } else {
+ FATAL2 ("%s file `%s' not found", kpse_format_info[type].type, name);
+ }
+ }
+
+ return f;
+}
+
+/* When using the %&<format> construct, we'd like to use the paths for
+ that format, rather than those for the name we were called with.
+ Of course this happens after various initializations have been
+ performed, so we have this function to force the issue. Note that
+ the paths for kpse_cnf_format and kpse_db_format are not cleared.
+
+ This function is defined here, and not in progname.c, because it
+ need kpse_format_info, and would cause all of tex-file to be pulled
+ in by programs that do not need it. */
+void
+kpse_reset_program_name P1C(const_string, progname)
+{
+ int i;
+
+ /* It is a fatal error for either of these to be NULL. */
+ assert (progname && kpse_program_name);
+ /* Do nothing if the name is unchanged. */
+ if (STREQ(kpse_program_name, progname))
+ return;
+
+ free (kpse_program_name);
+ kpse_program_name = xstrdup (progname);
+ xputenv("progname", kpse_program_name);
+
+ /* Clear paths -- do we want the db path to be cleared? */
+ for (i = 0; i != kpse_last_format; ++i) {
+ /* Do not erase the cnf of db paths. This means that the filename
+ database is not rebuilt, nor are different configuration files
+ searched. The alternative is to tolerate a memory leak of up
+ to 100k if this function is called. */
+ if (i == kpse_cnf_format || i == kpse_db_format)
+ continue;
+ /* Wipe the path (it is tested) and the cnf_path and because their
+ values may differ with the new program name. */
+ if (kpse_format_info[i].path != NULL) {
+ free ((string)kpse_format_info[i].path);
+ kpse_format_info[i].path = NULL;
+ }
+ /* We cannot free the cnf_path: it points into the cnf hash, which
+ means all hell will break loose if we did. */
+ if (kpse_format_info[i].cnf_path != NULL) {
+ kpse_format_info[i].cnf_path = NULL;
+ }
+ /* We do not wipe the override_path at this point, though arguably
+ we should provide new values. It is not likely to matter for
+ the programs that call this function. */
+ }
+}
diff --git a/Build/source/texk/kpathsea/tex-file.h b/Build/source/texk/kpathsea/tex-file.h
new file mode 100644
index 00000000000..a2047f84c2d
--- /dev/null
+++ b/Build/source/texk/kpathsea/tex-file.h
@@ -0,0 +1,202 @@
+/* tex-file.h: find files in a particular format.
+
+ Copyright 1998-2005 Olaf Weber.
+ Copyright 1993, 94, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_TEX_FILE_H
+#define KPATHSEA_TEX_FILE_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/c-vararg.h>
+#include <kpathsea/types.h>
+
+
+/* If non-NULL, try looking for this if can't find the real font. */
+extern const_string kpse_fallback_font;
+
+
+/* If non-NULL, default list of fallback resolutions comes from this
+ instead of the compile-time value. Set by dvipsk for the R config
+ cmd. *SIZES environment variables override/use as default. */
+extern KPSEDLL const_string kpse_fallback_resolutions_string;
+
+/* If non-NULL, check these if can't find (within a few percent of) the
+ given resolution. List must end with a zero element. */
+extern unsigned *kpse_fallback_resolutions;
+
+/* This initializes the fallback resolution list. If ENVVAR
+ is set, it is used; otherwise, the envvar `TEXSIZES' is looked at; if
+ that's not set either, a compile-time default is used. */
+extern void kpse_init_fallback_resolutions P1H(string envvar);
+
+/* We put the glyphs first so we don't waste space in an array in
+ tex-glyph.c. Accompany a new format here with appropriate changes in
+ tex-file.c and kpsewhich.c (the suffix variable). */
+typedef enum
+{
+ kpse_gf_format,
+ kpse_pk_format,
+ kpse_any_glyph_format, /* ``any'' meaning gf or pk */
+ kpse_tfm_format,
+ kpse_afm_format,
+ kpse_base_format,
+ kpse_bib_format,
+ kpse_bst_format,
+ kpse_cnf_format,
+ kpse_db_format,
+ kpse_fmt_format,
+ kpse_fontmap_format,
+ kpse_mem_format,
+ kpse_mf_format,
+ kpse_mfpool_format,
+ kpse_mft_format,
+ kpse_mp_format,
+ kpse_mppool_format,
+ kpse_mpsupport_format,
+ kpse_ocp_format,
+ kpse_ofm_format,
+ kpse_opl_format,
+ kpse_otp_format,
+ kpse_ovf_format,
+ kpse_ovp_format,
+ kpse_pict_format,
+ kpse_tex_format,
+ kpse_texdoc_format,
+ kpse_texpool_format,
+ kpse_texsource_format,
+ kpse_tex_ps_header_format,
+ kpse_troff_font_format,
+ kpse_type1_format,
+ kpse_vf_format,
+ kpse_dvips_config_format,
+ kpse_ist_format,
+ kpse_truetype_format,
+ kpse_type42_format,
+ kpse_web2c_format,
+ kpse_program_text_format,
+ kpse_program_binary_format,
+ kpse_miscfonts_format,
+ kpse_web_format,
+ kpse_cweb_format,
+ kpse_enc_format,
+ kpse_cmap_format,
+ kpse_sfd_format,
+ kpse_opentype_format,
+ kpse_pdftex_config_format,
+ kpse_lig_format,
+ kpse_texmfscripts_format,
+ kpse_last_format /* one past last index */
+} kpse_file_format_type;
+
+
+/* Perhaps we could use this for path values themselves; for now, we use
+ it only for the program_enabled_p value. */
+typedef enum
+{
+ kpse_src_implicit, /* C initialization to zero */
+ kpse_src_compile, /* configure/compile-time default */
+ kpse_src_texmf_cnf, /* texmf.cnf, the kpathsea config file */
+ kpse_src_client_cnf, /* application config file, e.g., config.ps */
+ kpse_src_env, /* environment variable */
+ kpse_src_x, /* X Window System resource */
+ kpse_src_cmdline /* command-line option */
+} kpse_src_type;
+
+
+/* For each file format, we record the following information. The main
+ thing that is not part of this structure is the environment variable
+ lists. They are used directly in tex-file.c. We could incorporate
+ them here, but it would complicate the code a bit. We could also do
+ it via variable expansion, but not now, maybe not ever:
+ ${PKFONTS-${TEXFONTS-/usr/local/lib/texmf/fonts//}}. */
+
+typedef struct
+{
+ const_string type; /* Human-readable description. */
+ const_string path; /* The search path to use. */
+ const_string raw_path; /* Pre-$~ (but post-default) expansion. */
+ const_string path_source; /* Where the path started from. */
+ const_string override_path; /* From client environment variable. */
+ const_string client_path; /* E.g., from dvips's config.ps. */
+ const_string cnf_path; /* From texmf.cnf. */
+ const_string default_path; /* If all else fails. */
+ const_string *suffix; /* For kpse_find_file to check for/append. */
+ const_string *alt_suffix; /* More suffixes to check for. */
+ boolean suffix_search_only; /* Only search with a suffix? */
+ const_string program; /* ``mktexpk'', etc. */
+ int argc; /* Count of standard arguments. */
+ const_string *argv; /* Standard arguments to `program'. */
+ boolean program_enabled_p; /* Invoke `program'? */
+ kpse_src_type program_enable_level; /* Who said to invoke `program'. */
+ boolean binmode; /* The files must be opened in binary mode. */
+} kpse_format_info_type;
+
+/* The sole variable of that type, indexed by `kpse_file_format_type'.
+ Initialized by calls to `kpse_find_file' for `kpse_init_format'. */
+extern KPSEDLL kpse_format_info_type kpse_format_info[kpse_last_format];
+
+
+/* If LEVEL is higher than `program_enabled_level' for FMT, set
+ `program_enabled_p' to VALUE. */
+extern KPSEDLL void kpse_set_program_enabled P3H(kpse_file_format_type fmt,
+ boolean value, kpse_src_type level);
+/* Call kpse_set_program_enabled with VALUE and the format corresponding
+ to FMTNAME. */
+extern KPSEDLL void kpse_maketex_option P2H(const_string fmtname, boolean value);
+
+/* Change the list of searched suffixes (alternate suffixes if alternate is
+ true). */
+extern KPSEDLL void kpse_set_suffixes PVAR2H(kpse_file_format_type format,
+ boolean alternate);
+
+/* Initialize the info for the given format. This is called
+ automatically by `kpse_find_file', but the glyph searching (for
+ example) can't use that function, so make it available. */
+extern KPSEDLL const_string kpse_init_format P1H(kpse_file_format_type);
+
+/* If FORMAT has a non-null `suffix' member, append it to NAME "."
+ and call `kpse_path_search' with the result and the other arguments.
+ If that fails, try just NAME. */
+extern KPSEDLL string kpse_find_file P3H(const_string name,
+ kpse_file_format_type format, boolean must_exist);
+
+/* Here are some abbreviations. */
+#define kpse_find_mf(name) kpse_find_file (name, kpse_mf_format, true)
+#define kpse_find_mft(name) kpse_find_file (name, kpse_mft_format, true)
+#define kpse_find_pict(name) kpse_find_file (name, kpse_pict_format, true)
+#define kpse_find_tex(name) kpse_find_file (name, kpse_tex_format, true)
+#define kpse_find_tfm(name) kpse_find_file (name, kpse_tfm_format, true)
+#define kpse_find_ofm(name) kpse_find_file (name, kpse_ofm_format, true)
+
+/* The `false' is correct for DVI translators, which should clearly not
+ require vf files for every font (e.g., cmr10.vf). But it's wrong for
+ VF translators, such as vftovp. */
+#define kpse_find_vf(name) kpse_find_file (name, kpse_vf_format, false)
+#define kpse_find_ovf(name) kpse_find_file (name, kpse_ovf_format, false)
+
+/* Don't just look up the name, actually open the file. */
+extern KPSEDLL FILE *kpse_open_file P2H(const_string, kpse_file_format_type);
+
+/* This function is used to set kpse_program_name (from progname.c) to
+ a different value. It will clear the path searching information, to
+ ensure that the search paths are appropriate to the new name. */
+
+extern KPSEDLL void kpse_reset_program_name P1H(const_string progname);
+
+#endif /* not KPATHSEA_TEX_FILE_H */
diff --git a/Build/source/texk/kpathsea/tex-glyph.c b/Build/source/texk/kpathsea/tex-glyph.c
new file mode 100644
index 00000000000..d45b699911d
--- /dev/null
+++ b/Build/source/texk/kpathsea/tex-glyph.c
@@ -0,0 +1,392 @@
+/* tex-glyph.c: Search for GF/PK files.
+
+ Copyright 1997, 98, 99, 2005 Olaf Weber.
+ Copyright 1993, 94, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/absolute.h>
+#include <kpathsea/expand.h>
+#include <kpathsea/fontmap.h>
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/tex-glyph.h>
+#include <kpathsea/tex-make.h>
+#include <kpathsea/variable.h>
+
+/* Routines are in bottom-up order. */
+
+/* Support both cmr10.300pk and dpi300/cmr10.pk. (Use the latter
+ instead of dpi300\cmr10.pk since DOS supports /'s, but Unix doesn't
+ support \'s. */
+#define UNIX_BITMAP_SPEC "$KPATHSEA_NAME.$KPATHSEA_DPI$KPATHSEA_FORMAT"
+#define DPI_BITMAP_SPEC "dpi$KPATHSEA_DPI/$KPATHSEA_NAME.$KPATHSEA_FORMAT"
+
+/* Look up FONTNAME at resolution DPI in PATH, with filename suffix
+ EXTENSION. Return file found or NULL. */
+
+static string
+try_format P3C(const_string, fontname, unsigned, dpi,
+ kpse_file_format_type, format)
+{
+ static const_string bitmap_specs[]
+ = { UNIX_BITMAP_SPEC, DPI_BITMAP_SPEC, NULL };
+ const_string *spec;
+ boolean must_exist;
+ string ret = NULL;
+ const_string path = kpse_format_info[format].path;
+ const_string *sfx;
+ if (!path)
+ path = kpse_init_format (format);
+
+ /* Set the suffix on the name we'll be searching for. */
+ sfx = kpse_format_info[format].suffix;
+ if (sfx && *sfx)
+ xputenv ("KPATHSEA_FORMAT", *sfx);
+
+ /* OK, the limits on this for loop are a little hokey, but it saves
+ having to repeat the body. We want to do it once with `must_exist'
+ false to avoid looking on the disk for cmr10.600pk if
+ dpi600/cmr10.pk is in ls-R. (The time spent in the extra variable
+ expansions and db searches is negligible.) */
+ for (must_exist = false; !ret && must_exist <= true; must_exist++)
+ {
+ for (spec = bitmap_specs; !ret && *spec; spec++)
+ {
+ string name = kpse_var_expand (*spec);
+ ret = kpse_path_search (path, name, must_exist);
+ if (name != ret)
+ free (name);
+ }
+ }
+
+ return ret;
+}
+
+/* Look for FONTNAME at resolution DPI in format FORMAT. Search the
+ (entire) PK path first, then the GF path, if we're looking for both.
+ Return any filename found, and (if we succeeded) fill in GLYPH_FILE. */
+
+static string
+try_size P4C(const_string, fontname, unsigned, dpi,
+ kpse_file_format_type, format,
+ kpse_glyph_file_type *, glyph_file)
+{
+ kpse_file_format_type format_found;
+ string ret;
+ boolean try_gf = format == kpse_gf_format || format == kpse_any_glyph_format;
+ boolean try_pk = format == kpse_pk_format || format == kpse_any_glyph_format;
+
+ xputenv_int ("KPATHSEA_DPI", dpi);
+
+ /* Look for PK first (since it's more likely to be found), then GF. */
+ ret = try_pk ? try_format (fontname, dpi, kpse_pk_format) : NULL;
+
+ if (ret != NULL)
+ format_found = kpse_pk_format;
+ else
+ {
+ if (try_gf)
+ {
+ ret = try_format (fontname, dpi, kpse_gf_format);
+ format_found = kpse_gf_format;
+ }
+ }
+
+ if (ret != NULL && glyph_file)
+ { /* Success. Fill in the return info. Discard const. */
+ glyph_file->name = (string) fontname;
+ glyph_file->dpi = dpi;
+ glyph_file->format = format_found;
+ }
+
+ return ret;
+}
+
+/* Look for FONTNAME at resolution DPI, then at the resolutions within
+ KPSE_BITMAP_TOLERANCE of DPI. */
+
+static string
+try_resolution P4C(const_string, fontname, unsigned, dpi,
+ kpse_file_format_type, format,
+ kpse_glyph_file_type *, glyph_file)
+{
+ string ret = try_size (fontname, dpi, format, glyph_file);
+
+ if (!ret)
+ {
+ unsigned r;
+ unsigned tolerance = KPSE_BITMAP_TOLERANCE (dpi);
+ /* Cast to unsigned to shut up stupid compilers. */
+ unsigned lower_bound = (int) (dpi - tolerance) < 0 ? 0 : (unsigned)(dpi - tolerance);
+ unsigned upper_bound = (unsigned)(dpi + tolerance);
+
+ /* Prefer scaling up to scaling down, since scaling down can omit
+ character features (Tom did this in dvips). */
+ for (r = lower_bound; !ret && r <= upper_bound; r++)
+ if (r != dpi)
+ ret = try_size (fontname, r, format, glyph_file);
+ }
+
+ return ret;
+}
+
+/* Look up *FONTNAME_PTR in format FORMAT at DPI in the texfonts.map files
+ that we can find, returning the filename found and GLYPH_FILE. Also
+ set *FONTNAME_PTR to the real name corresponding to the alias found
+ or the first alias, if that is not an alias itself. (This allows
+ mktexpk to only deal with real names.) */
+
+static string
+try_fontmap P4C(string *, fontname_ptr, unsigned, dpi,
+ kpse_file_format_type, format,
+ kpse_glyph_file_type *, glyph_file)
+{
+ string *mapped_names;
+ string fontname = *fontname_ptr;
+ string ret = NULL;
+
+ mapped_names = kpse_fontmap_lookup (fontname);
+ if (mapped_names) {
+ string mapped_name;
+ string first_name = *mapped_names;
+ while (!ret && (mapped_name = *mapped_names++)) {
+ xputenv ("KPATHSEA_NAME", mapped_name);
+ ret = try_resolution (mapped_name, dpi, format, glyph_file);
+ }
+ if (ret) {
+ /* If some alias succeeeded, return that alias. */
+ *fontname_ptr = xstrdup (mapped_name);
+ /* Return first alias name, unless that itself is an alias,
+ in which case do nothing. */
+ } else if (!kpse_fontmap_lookup (first_name)) {
+ *fontname_ptr = xstrdup (first_name);
+ }
+ }
+
+ return ret;
+}
+
+/* Look for FONTNAME in `kpse_fallback_resolutions', omitting DPI if we
+ happen across it. Return NULL if nothing found. Pass GLYPH_FILE
+ along as usual. Assume `kpse_fallback_resolutions' is sorted. */
+
+static string
+try_fallback_resolutions P4C(const_string, fontname, unsigned, dpi,
+ kpse_file_format_type, format,
+ kpse_glyph_file_type *, glyph_file)
+{
+ unsigned s;
+ int loc, max_loc;
+ int lower_loc, upper_loc;
+ unsigned lower_diff, upper_diff;
+ unsigned closest_diff = UINT_MAX;
+ string ret = NULL; /* In case the only fallback resolution is DPI. */
+
+ /* First find the fallback size closest to DPI, even including DPI. */
+ for (s = 0; kpse_fallback_resolutions[s] != 0; s++)
+ {
+ unsigned this_diff = abs (kpse_fallback_resolutions[s] - dpi);
+ if (this_diff < closest_diff)
+ {
+ closest_diff = this_diff;
+ loc = s;
+ }
+ }
+ if (s == 0)
+ return ret; /* If nothing in list, quit now. */
+
+ max_loc = s;
+ lower_loc = loc - 1;
+ upper_loc = loc + 1;
+
+ for (;;)
+ {
+ unsigned fallback = kpse_fallback_resolutions[loc];
+ /* Don't bother to try DPI itself again. */
+ if (fallback != dpi)
+ {
+ ret = try_resolution (fontname, fallback, format, glyph_file);
+ if (ret)
+ break;
+ }
+
+ /* That didn't work. How far away are the locs above or below? */
+ lower_diff = lower_loc > -1
+ ? dpi - kpse_fallback_resolutions[lower_loc] : INT_MAX;
+ upper_diff = upper_loc < max_loc
+ ? kpse_fallback_resolutions[upper_loc] - dpi : INT_MAX;
+
+ /* But if we're at the end in both directions, quit. */
+ if (lower_diff == INT_MAX && upper_diff == INT_MAX)
+ break;
+
+ /* Go in whichever direction is closest. */
+ if (lower_diff < upper_diff)
+ {
+ loc = lower_loc;
+ lower_loc--;
+ }
+ else
+ {
+ loc = upper_loc;
+ upper_loc++;
+ }
+ }
+
+ return ret;
+}
+
+/* See the .h file for description. This is the entry point. */
+
+string
+kpse_find_glyph P4C(const_string, passed_fontname, unsigned, dpi,
+ kpse_file_format_type, format,
+ kpse_glyph_file_type *, glyph_file)
+{
+ string ret;
+ kpse_glyph_source_type source;
+ string fontname = (string) passed_fontname; /* discard const */
+
+ /* Start the search: try the name we're given. */
+ source = kpse_glyph_source_normal;
+ xputenv ("KPATHSEA_NAME", fontname);
+ ret = try_resolution (fontname, dpi, format, glyph_file);
+
+ /* Try all the various possibilities in order of preference. */
+ if (!ret) {
+ /* Maybe FONTNAME was an alias. */
+ source = kpse_glyph_source_alias;
+ ret = try_fontmap (&fontname, dpi, format, glyph_file);
+
+ /* If not an alias, try creating it on the fly with mktexpk,
+ unless FONTNAME is absolute or explicitly relative. */
+ if (!ret && !kpse_absolute_p (fontname, true)) {
+ source = kpse_glyph_source_maketex;
+ /* `try_resolution' leaves the envvar set randomly. */
+ xputenv_int ("KPATHSEA_DPI", dpi);
+ ret = kpse_make_tex (format, fontname);
+ }
+
+ /* If mktex... succeeded, set return struct. Doesn't make sense for
+ `kpse_make_tex' to set it, since it can only succeed or fail,
+ unlike the other routines. */
+ if (ret && glyph_file) {
+ KPSE_GLYPH_FILE_DPI (*glyph_file) = dpi;
+ KPSE_GLYPH_FILE_NAME (*glyph_file) = fontname;
+ }
+
+ /* If mktex... failed, try any fallback resolutions. */
+ else {
+ if (kpse_fallback_resolutions)
+ ret = try_fallback_resolutions (fontname, dpi, format, glyph_file);
+
+ /* We're down to the font of last resort. */
+ if (!ret && kpse_fallback_font) {
+ const_string name = kpse_fallback_font;
+ source = kpse_glyph_source_fallback;
+ xputenv ("KPATHSEA_NAME", name);
+
+ /* As before, first try it at the given size. */
+ ret = try_resolution (name, dpi, format, glyph_file);
+
+ /* The fallback font at the fallback resolutions. */
+ if (!ret && kpse_fallback_resolutions)
+ ret = try_fallback_resolutions (name, dpi, format, glyph_file);
+ }
+ }
+ }
+
+ /* If RET is null, then the caller is not supposed to look at GLYPH_FILE,
+ so it doesn't matter if we assign something incorrect. */
+ if (glyph_file)
+ KPSE_GLYPH_FILE_SOURCE (*glyph_file) = source;
+
+ /* FIXME: fontname may have been allocated, but (worse) it may also
+ have been assigned to struct that's passed out of this function.
+ if (fontname != passed_fontname)
+ free (fontname);
+ */
+
+ return ret;
+}
+
+/* The tolerances change whether we base things on DPI1 or DPI2. */
+
+boolean
+kpse_bitmap_tolerance P2C(double, dpi1, double, dpi2)
+{
+ unsigned tolerance = KPSE_BITMAP_TOLERANCE (dpi2);
+ unsigned lower_bound = (int) (dpi2 - tolerance) < 0 ? 0 : dpi2 - tolerance;
+ unsigned upper_bound = dpi2 + tolerance;
+
+ return lower_bound <= dpi1 && dpi1 <= upper_bound;
+}
+
+#ifdef TEST
+
+void
+test_find_glyph (const_string fontname, unsigned dpi)
+{
+ string answer;
+ kpse_glyph_file_type ret;
+
+ printf ("\nSearch for %s@%u:\n\t", fontname, dpi);
+
+ answer = kpse_find_glyph_format (fontname, dpi,
+ kpse_any_glyph_format, &ret);
+ if (answer)
+ {
+ string format = ret.format == kpse_pk_format ? "pk" : "gf";
+ if (!ret.name)
+ ret.name = "(nil)";
+ printf ("%s\n\t(%s@%u, %s)\n", answer, ret.name, ret.dpi, format);
+ }
+ else
+ puts ("(nil)");
+}
+
+
+int
+main ()
+{
+ test_find_glyph ("/usr/local/lib/tex/fonts/cm/cmr10", 300); /* absolute */
+ test_find_glyph ("cmr10", 300); /* normal */
+ test_find_glyph ("logo10", 300); /* find gf */
+ test_find_glyph ("cmr10", 299); /* find 300 */
+ test_find_glyph ("circle10", 300); /* in fontmap */
+ test_find_glyph ("none", 300); /* do not find */
+ kpse_fallback_font = "cmr10";
+ test_find_glyph ("fallback", 300); /* find fallback font cmr10 */
+ kpse_init_fallback_resolutions ("KPATHSEA_TEST_SIZES");
+ test_find_glyph ("fallbackdpi", 759); /* find fallback font cmr10@300 */
+
+ xputenv ("GFFONTS", ".");
+ test_find_glyph ("cmr10", 300); /* different GFFONTS/TEXFONTS */
+
+ return 0;
+}
+
+#endif /* TEST */
+
+
+/*
+Local variables:
+test-compile-command: "gcc -g -I. -I.. -DTEST tex-glyph.c kpathsea.a"
+End:
+*/
diff --git a/Build/source/texk/kpathsea/tex-glyph.h b/Build/source/texk/kpathsea/tex-glyph.h
new file mode 100644
index 00000000000..9dc42ee1bc6
--- /dev/null
+++ b/Build/source/texk/kpathsea/tex-glyph.h
@@ -0,0 +1,81 @@
+/* tex-glyph.h: look for a TeX glyph font (GF or PK).
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_TEX_GLYPH_H
+#define KPATHSEA_TEX_GLYPH_H
+
+#include <kpathsea/tex-file.h>
+
+
+/* This type describes the origination of a glyph font. */
+
+typedef enum
+{
+ kpse_glyph_source_normal, /* the searched-for font: already existed */
+ kpse_glyph_source_alias, /* : was an alias for an existing file */
+ kpse_glyph_source_maketex, /* : was created on the fly */
+ kpse_glyph_source_fallback /* : wasn't found, but the fallback font was */
+} kpse_glyph_source_type;
+
+
+typedef struct
+{
+ string name; /* font name found */
+ unsigned dpi; /* size found, for glyphs */
+ kpse_file_format_type format; /* glyph format found */
+ kpse_glyph_source_type source; /* where we found it */
+} kpse_glyph_file_type;
+
+#define KPSE_GLYPH_FILE_NAME(f) ((f).name)
+#define KPSE_GLYPH_FILE_DPI(f) ((f).dpi)
+#define KPSE_GLYPH_FILE_FORMAT(f) ((f).format)
+#define KPSE_GLYPH_FILE_SOURCE(f) ((f).source)
+
+
+/* Search first for the font named FONT_NAME at resolution DPI in the
+ glyph format FORMAT (see `try_size' for details of format searching).
+ Then try resolutions within KPSE_BITMAP_TOLERANCE of DPI. Then try
+ the resolutions in `kpse_fallback_sizes', then within the tolerance
+ of each of those. Then if FONT_NAME is an alias defined in a
+ texfonts.map do all the above for its real name. Then try the above
+ for kpse_fallback_name. Then fail. Return either the filename
+ found, or NULL. Also return information about the file found in
+ *GLYPH_FILE. */
+extern KPSEDLL string kpse_find_glyph P4H(const_string font_name, unsigned dpi,
+ kpse_file_format_type format,
+ kpse_glyph_file_type *glyph_file);
+
+/* Look for a specific format only. */
+#define kpse_find_pk(font_name, dpi, glyph_file) \
+ kpse_find_glyph (font_name, dpi, kpse_pk_format, glyph_file)
+#define kpse_find_gf(font_name, dpi, glyph_file) \
+ kpse_find_glyph (font_name, dpi, kpse_gf_format, glyph_file)
+
+
+/* Defines how far away a pixel file can be found from its stated size.
+ The DVI standard says any resolution within 0.2% of the stated size
+ is ok, but we are more forgiving. */
+#define KPSE_BITMAP_TOLERANCE(r) ((r) / 500.0 + 1)
+
+/* Check whether DPI1 is within KPSE_BITMAP_TOLERANCE of DPI2. */
+extern KPSEDLL boolean kpse_bitmap_tolerance P2H(double dpi1, double dpi2);
+
+#endif /* not KPATHSEA_TEX_GLYPH_H */
diff --git a/Build/source/texk/kpathsea/tex-hush.c b/Build/source/texk/kpathsea/tex-hush.c
new file mode 100644
index 00000000000..c037f957f4d
--- /dev/null
+++ b/Build/source/texk/kpathsea/tex-hush.c
@@ -0,0 +1,46 @@
+/* tex-hush.c: are we suppressing warnings?
+
+ Copyright 1998, 2000, 2005 Olaf Weber.
+ Copyright 1996 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/pathsearch.h>
+#include <kpathsea/tex-hush.h>
+#include <kpathsea/variable.h>
+
+boolean
+kpse_tex_hush P1C(const_string, what)
+{
+ string h;
+ string hush = kpse_var_value ("TEX_HUSH");
+ if (hush) {
+ if (STREQ (hush, "all"))
+ return true;
+ if (STREQ (hush, "none"))
+ return false;
+ for (h = kpse_path_element (hush); h; h = kpse_path_element (NULL)) {
+ /* Don't do anything special with empty elements. */
+ if (STREQ (h, what))
+ return true;
+ }
+ }
+
+ return false;
+}
diff --git a/Build/source/texk/kpathsea/tex-hush.h b/Build/source/texk/kpathsea/tex-hush.h
new file mode 100644
index 00000000000..d7277f97992
--- /dev/null
+++ b/Build/source/texk/kpathsea/tex-hush.h
@@ -0,0 +1,31 @@
+/* tex-hush.h: suppressing warnings?
+
+ Copyright 1996 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_TEX_HUSH_H
+#define KPATHSEA_TEX_HUSH_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+/* Return true if WHAT is included in the TEX_HUSH environment
+ variable/config value. */
+extern KPSEDLL boolean kpse_tex_hush P1H(const_string what);
+
+#endif /* not KPATHSEA_TEX_HUSH_H */
diff --git a/Build/source/texk/kpathsea/tex-make.c b/Build/source/texk/kpathsea/tex-make.c
new file mode 100644
index 00000000000..0c6f980fefc
--- /dev/null
+++ b/Build/source/texk/kpathsea/tex-make.c
@@ -0,0 +1,595 @@
+/* tex-make.c: Run external programs to make TeX-related files.
+
+ Copyright 1997, 98, 2001-05 Olaf Weber.
+ Copyright 1993, 94, 95, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/concatn.h>
+#include <kpathsea/db.h>
+#include <kpathsea/fn.h>
+#include <kpathsea/magstep.h>
+#include <kpathsea/readable.h>
+#include <kpathsea/tex-make.h>
+#include <kpathsea/variable.h>
+
+
+/* We never throw away stdout, since that is supposed to be the filename
+ found, if all is successful. This variable controls whether stderr
+ is thrown away. */
+boolean kpse_make_tex_discard_errors = false;
+
+/* We set the envvar MAKETEX_MAG, which is part of the default spec for
+ MakeTeXPK above, based on KPATHSEA_DPI and MAKETEX_BASE_DPI. */
+
+static void
+set_maketex_mag P1H(void)
+{
+ char q[MAX_INT_LENGTH * 3 + 3];
+ int m;
+ string dpi_str = getenv ("KPATHSEA_DPI");
+ string bdpi_str = getenv ("MAKETEX_BASE_DPI");
+ unsigned dpi = dpi_str ? atoi (dpi_str) : 0;
+ unsigned bdpi = bdpi_str ? atoi (bdpi_str) : 0;
+
+ /* If the environment variables aren't set, it's a bug. */
+ assert (dpi != 0 && bdpi != 0);
+
+ /* Fix up for roundoff error. Hopefully the driver has already fixed
+ up DPI, but may as well be safe, and also get the magstep number. */
+ (void) kpse_magstep_fix (dpi, bdpi, &m);
+
+ if (m == 0) {
+ if (bdpi <= 4000) {
+ sprintf(q, "%u+%u/%u", dpi / bdpi, dpi % bdpi, bdpi);
+ } else {
+ unsigned f = bdpi/4000;
+ unsigned r = bdpi%4000;
+
+ if (f > 1) {
+ if (r > 0) {
+ sprintf(q, "%u+%u/(%u*%u + %u)",
+ dpi/bdpi, dpi%bdpi, f, (bdpi - r)/f, r);
+ } else {
+ sprintf(q, "%u+%u/(%u*%u)", dpi/bdpi, dpi%bdpi, f, bdpi/f);
+ }
+ } else {
+ sprintf(q, "%u+%u/(4000 + %u)", dpi/bdpi, dpi%bdpi, bdpi, r);
+ }
+ }
+ } else {
+ /* m is encoded with LSB being a ``half'' bit (see magstep.h). Are
+ we making an assumption here about two's complement? Probably.
+ In any case, if m is negative, we have to put in the sign
+ explicitly, since m/2==0 if m==-1. */
+ const_string sign = "";
+ if (m < 0) {
+ m *= -1;
+ sign = "-";
+ }
+ sprintf(q, "magstep\\(%s%d.%d\\)", sign, m / 2, (m & 1) * 5);
+ }
+ xputenv ("MAKETEX_MAG", q);
+}
+
+/* This mktex... program was disabled, or the script failed. If this
+ was a font creation (according to FORMAT), append CMD
+ to a file missfont.log in the current directory. */
+
+static void
+misstex P2C(kpse_file_format_type, format, string *, args)
+{
+ static FILE *missfont = NULL;
+ string *s;
+
+ /* If we weren't trying to make a font, do nothing. Maybe should
+ allow people to specify what they want recorded? */
+ if (format != kpse_gf_format
+ && format != kpse_pk_format
+ && format != kpse_any_glyph_format
+ && format != kpse_tfm_format
+ && format != kpse_vf_format)
+ return;
+
+ /* If this is the first time, have to open the log file. But don't
+ bother logging anything if they were discarding errors. */
+ if (!missfont && !kpse_make_tex_discard_errors) {
+ const_string missfont_name = kpse_var_value ("MISSFONT_LOG");
+ if (!missfont_name || *missfont_name == '1') {
+ missfont_name = "missfont.log"; /* take default name */
+ } else if (missfont_name
+ && (*missfont_name == 0 || *missfont_name == '0')) {
+ missfont_name = NULL; /* user requested no missfont.log */
+ } /* else use user's name */
+
+ missfont = missfont_name ? fopen (missfont_name, FOPEN_A_MODE) : NULL;
+ if (!missfont && kpse_var_value ("TEXMFOUTPUT")) {
+ missfont_name = concat3 (kpse_var_value ("TEXMFOUTPUT"), DIR_SEP_STRING,
+ missfont_name);
+ missfont = fopen (missfont_name, FOPEN_A_MODE);
+ }
+
+ if (missfont)
+ fprintf (stderr, "kpathsea: Appending font creation commands to %s.\n",
+ missfont_name);
+ }
+
+ /* Write the command if we have a log file. */
+ if (missfont) {
+ fputs (args[0], missfont);
+ for (s = &args[1]; *s != NULL; s++) {
+ putc(' ', missfont);
+ fputs (*s, missfont);
+ }
+ putc ('\n', missfont);
+ }
+}
+
+
+/* Assume the script outputs the filename it creates (and nothing
+ else) on standard output; hence, we run the script with `popen'. */
+
+static string
+maketex P2C(kpse_file_format_type, format, string*, args)
+{
+ /* New implementation, use fork/exec pair instead of popen, since
+ * the latter is virtually impossible to make safe.
+ */
+ unsigned len;
+ string *s;
+ string ret;
+ string fn;
+
+ if (!kpse_make_tex_discard_errors) {
+ fprintf (stderr, "kpathsea: Running");
+ for (s = &args[0]; *s != NULL; s++)
+ fprintf (stderr, " %s", *s);
+ fputc('\n', stderr);
+ }
+
+#if defined (AMIGA)
+ /* Amiga has a different interface. */
+ {
+ string cmd;
+ string newcmd;
+ cmd = xstrdup(args[0]);
+ for (s = &args[1]; *s != NULL; s++) {
+ newcmd = concat(cmd, *s);
+ free (cmd);
+ cmd = newcmd;
+ }
+ ret = system(cmd) == 0 ? getenv ("LAST_FONT_CREATED"): NULL;
+ free (cmd);
+ }
+#elif defined (MSDOS) && !defined(DJGPP)
+#error Implement new MSDOS mktex call interface here
+#elif defined (WIN32)
+ /* We would vastly prefer to link directly with mktex.c here.
+ Unfortunately, it is not quite possible because kpathsea
+ is not reentrant. The progname is expected to be set in mktex.c
+ and various initialisations occur. So to be safe, we implement
+ a call sequence equivalent to the Unix one. */
+ {
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+
+ HANDLE child_in, child_out, child_err;
+ HANDLE father_in, father_out_dup;
+ HANDLE current_pid;
+ SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE};
+ string new_cmd = NULL, app_name = NULL;
+
+ char buf[1024+1];
+ int num;
+ extern char *quote_args(char **argv);
+
+ if (look_for_cmd(args[0], &app_name) == FALSE) {
+ ret = NULL;
+ goto error_exit;
+ }
+
+ /* Compute the command line */
+ new_cmd = quote_args(args);
+
+ /* We need this handle to duplicate other handles */
+ current_pid = GetCurrentProcess();
+
+ ZeroMemory( &si, sizeof(STARTUPINFO) );
+ si.cb = sizeof(STARTUPINFO);
+ si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW ;
+ si.wShowWindow = /* 0 */ SW_HIDE ;
+
+ /* Child stdin */
+ child_in = CreateFile("nul",
+ GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ &sa, /* non inheritable */
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+ si.hStdInput = child_in;
+
+ if (CreatePipe(&father_in, &child_out, NULL, 0) == FALSE) {
+ fprintf(stderr, "popen: error CreatePipe\n");
+ goto error_exit;
+ }
+ if (DuplicateHandle(current_pid, child_out,
+ current_pid, &father_out_dup,
+ 0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE) {
+ fprintf(stderr, "popen: error DuplicateHandle father_in\n");
+ CloseHandle(father_in);
+ CloseHandle(child_out);
+ goto error_exit;
+ }
+ CloseHandle(child_out);
+ si.hStdOutput = father_out_dup;
+
+ /* Child stderr */
+ if (kpse_make_tex_discard_errors) {
+ child_err = CreateFile("nul",
+ GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ &sa, /* non inheritable */
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+ }
+ else {
+ DuplicateHandle(current_pid, GetStdHandle(STD_ERROR_HANDLE),
+ current_pid, &child_err,
+ 0, TRUE,
+ DUPLICATE_SAME_ACCESS);
+ }
+ si.hStdError = child_err;
+
+ /* creating child process */
+ if (CreateProcess(app_name, /* pointer to name of executable module */
+ new_cmd, /* pointer to command line string */
+ NULL, /* pointer to process security attributes */
+ NULL, /* pointer to thread security attributes */
+ TRUE, /* handle inheritance flag */
+ 0, /* creation flags */
+ NULL, /* pointer to environment */
+ NULL, /* pointer to current directory */
+ &si, /* pointer to STARTUPINFO */
+ &pi /* pointer to PROCESS_INFORMATION */
+ ) == 0) {
+ FATAL2("kpathsea: CreateProcess() failed for `%s' (Error %x)\n", new_cmd, GetLastError());
+ }
+
+ CloseHandle(child_in);
+ CloseHandle(father_out_dup);
+ CloseHandle(child_err);
+
+ /* Only the process handle is needed */
+ CloseHandle(pi.hThread);
+
+ /* Get stdout of child from the pipe. */
+ fn = xstrdup("");
+ while (ReadFile(father_in,buf,sizeof(buf)-1, &num, NULL) != 0
+ && num > 0) {
+ if (num <= 0) {
+ if (GetLastError() != ERROR_BROKEN_PIPE) {
+ FATAL2("kpathsea: read() error code for `%s' (Error %d)", new_cmd, GetLastError());
+ break;
+ }
+ } else {
+ string newfn;
+ buf[num] = '\0';
+ newfn = concat(fn, buf);
+ free(fn);
+ fn = newfn;
+ }
+ }
+ /* End of file on pipe, child should have exited at this point. */
+ CloseHandle(father_in);
+
+ if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_OBJECT_0) {
+ WARNING2("kpathsea: failed to wait for process termination: %s (Error %d)\n",
+ new_cmd, GetLastError());
+ }
+
+ CloseHandle(pi.hProcess);
+
+ if (new_cmd) free(new_cmd);
+ if (app_name) free(app_name);
+
+ if (fn) {
+ len = strlen(fn);
+
+ /* Remove trailing newlines and returns. */
+ while (len && (fn[len - 1] == '\n' || fn[len - 1] == '\r')) {
+ fn[len - 1] = '\0';
+ len--;
+ }
+
+ ret = len == 0 ? NULL : kpse_readable_file (fn);
+ if (!ret && len > 1) {
+ WARNING2 ("kpathsea: %s output `%s' instead of a filename",
+ new_cmd, fn);
+ }
+
+ /* Free the name if we're not returning it. */
+ if (fn != ret)
+ free (fn);
+ }
+ error_exit:
+ ;
+ }
+#else
+ {
+ /* Standard input for the child. Set to /dev/null */
+ int childin;
+ /* Standard output for the child, what we're interested in. */
+ int childout[2];
+ /* Standard error for the child, same as parent or /dev/null */
+ int childerr;
+ /* Child pid. */
+ pid_t childpid;
+
+ /* Open the channels that the child will use. */
+ /* A fairly horrible uses of gotos for here for the error case. */
+ if ((childin = open("/dev/null", O_RDONLY)) < 0) {
+ perror("kpathsea: open(\"/dev/null\", O_RDONLY)");
+ goto error_childin;
+ }
+ if (pipe(childout) < 0) {
+ perror("kpathsea: pipe()");
+ goto error_childout;
+ }
+ if ((childerr = open("/dev/null", O_WRONLY)) < 0) {
+ perror("kpathsea: open(\"/dev/null\", O_WRONLY)");
+ goto error_childerr;
+ }
+ if ((childpid = fork()) < 0) {
+ perror("kpathsea: fork()");
+ close(childerr);
+ error_childerr:
+ close(childout[0]);
+ close(childout[1]);
+ error_childout:
+ close(childin);
+ error_childin:
+ fn = NULL;
+ } else if (childpid == 0) {
+ /* Child
+ *
+ * We can use vfork, provided we're careful about what we
+ * do here: do not return from this function, do not modify
+ * variables, call _exit if there is a problem.
+ *
+ * Complete setting up the file descriptors.
+ * We use dup(2) so the order in which we do this matters.
+ */
+ close(childout[0]);
+ /* stdin -- the child will not receive input from this */
+ if (childin != 0) {
+ close(0);
+ dup(childin);
+ close(childin);
+ }
+ /* stdout -- the output of the child's action */
+ if (childout[1] != 1) {
+ close(1);
+ dup(childout[1]);
+ close(childout[1]);
+ }
+ /* stderr -- use /dev/null if we discard errors */
+ if (childerr != 2) {
+ if (kpse_make_tex_discard_errors) {
+ close(2);
+ dup(childerr);
+ }
+ close(childerr);
+ }
+ /* FIXME: We could/should close all other file descriptors as well. */
+ /* exec -- on failure a call of _exit(2) it is the only option */
+ if (execvp(args[0], args))
+ perror(args[0]);
+ _exit(1);
+ } else {
+ /* Parent */
+ char buf[1024+1];
+ int num;
+ int status;
+
+ /* Clean up child file descriptors that we won't use anyway. */
+ close(childin);
+ close(childout[1]);
+ close(childerr);
+ /* Get stdout of child from the pipe. */
+ fn = xstrdup("");
+ while ((num = read(childout[0],buf,sizeof(buf)-1)) != 0) {
+ if (num == -1) {
+ if (errno != EINTR) {
+ perror("kpathsea: read()");
+ break;
+ }
+ } else {
+ string newfn;
+ buf[num] = '\0';
+ newfn = concat(fn, buf);
+ free(fn);
+ fn = newfn;
+ }
+ }
+ /* End of file on pipe, child should have exited at this point. */
+ close(childout[0]);
+ /* We don't really care about the exit status at this point. */
+ wait(NULL);
+ }
+
+ if (fn) {
+ len = strlen(fn);
+
+ /* Remove trailing newlines and returns. */
+ while (len && (fn[len - 1] == '\n' || fn[len - 1] == '\r')) {
+ fn[len - 1] = '\0';
+ len--;
+ }
+
+ ret = len == 0 ? NULL : kpse_readable_file (fn);
+ if (!ret && len > 1) {
+ WARNING2("kpathsea: %s output `%s' instead of a filename",
+ args[0], fn);
+ }
+
+ /* Free the name if we're not returning it. */
+ if (fn != ret)
+ free (fn);
+ } else {
+ ret = NULL;
+ }
+ }
+#endif
+
+ if (ret == NULL)
+ misstex (format, args);
+ else
+ kpse_db_insert (ret);
+
+ return ret;
+}
+
+
+/* Create BASE in FORMAT and return the generated filename, or
+ return NULL. */
+
+string
+kpse_make_tex P2C(kpse_file_format_type, format, const_string, base)
+{
+ kpse_format_info_type spec; /* some compilers lack struct initialization */
+ string ret = NULL;
+
+ spec = kpse_format_info[format];
+ if (!spec.type) { /* Not initialized yet? */
+ kpse_init_format (format);
+ spec = kpse_format_info[format];
+ }
+
+ if (spec.program && spec.program_enabled_p) {
+ /* See the documentation for the envvars we're dealing with here. */
+ /* Number of arguments is spec.argc + 1, plus the trailing NULL. */
+ string *args = XTALLOC (spec.argc + 2, string);
+ /* Helpers */
+ int argnum;
+ int i;
+
+ /* FIXME
+ * Check whether the name we were given is likely to be a problem.
+ * Right now we err on the side of strictness:
+ * - may not start with a hyphen (fixable in the scripts).
+ * - allowed are: alphanumeric, underscore, hyphen, period, plus
+ * ? also allowed DIRSEP, as we can be fed that when creating pk fonts
+ * No doubt some possibilities were overlooked.
+ */
+ if (base[0] == '-' /* || IS_DIR_SEP(base[0]) */) {
+ fprintf(stderr, "kpathsea: Illegal fontname `%s': starts with '%c'\n",
+ base, base[0]);
+ return NULL;
+ }
+ for (i = 0; base[i]; i++) {
+ if (!ISALNUM(base[i])
+ && base[i] != '-'
+ && base[i] != '+'
+ && base[i] != '_'
+ && base[i] != '.'
+ && !IS_DIR_SEP(base[i]))
+ {
+ fprintf(stderr, "kpathsea: Illegal fontname `%s': contains '%c'\n",
+ base, base[i]);
+ return NULL;
+ }
+ }
+
+ if (format == kpse_gf_format
+ || format == kpse_pk_format
+ || format == kpse_any_glyph_format)
+ set_maketex_mag ();
+
+ /* Here's an awful kludge: if the mode is `/', mktexpk recognizes
+ it as a special case. `kpse_prog_init' sets it to this in the
+ first place when no mode is otherwise specified; this is so
+ when the user defines a resolution, they don't also have to
+ specify a mode; instead, mktexpk's guesses will take over.
+ They use / for the value because then when it is expanded as
+ part of the PKFONTS et al. path values, we'll wind up searching
+ all the pk directories. We put $MAKETEX_MODE in the path
+ values in the first place so that sites with two different
+ devices with the same resolution can find the right fonts; but
+ such sites are uncommon, so they shouldn't make things harder
+ for everyone else. */
+ for (argnum = 0; argnum < spec.argc; argnum++) {
+ args[argnum] = kpse_var_expand (spec.argv[argnum]);
+ }
+ args[argnum++] = xstrdup(base);
+ args[argnum] = NULL;
+
+ ret = maketex (format, args);
+
+ for (argnum = 0; args[argnum] != NULL; argnum++)
+ free (args[argnum]);
+ free (args);
+ }
+
+ return ret;
+}
+
+#ifdef TEST
+
+void
+test_make_tex (kpse_file_format_type fmt, const_string base)
+{
+ string answer;
+
+ printf ("\nAttempting %s in format %d:\n", base, fmt);
+
+ answer = kpse_make_tex (fmt, base);
+ puts (answer ? answer : "(nil)");
+}
+
+
+int
+main ()
+{
+ xputenv ("KPATHSEA_DPI", "781"); /* call mktexpk */
+ xputenv ("MAKETEX_BASE_DPI", "300"); /* call mktexpk */
+ KPSE_MAKE_SPEC_ENABLED (kpse_make_specs[kpse_pk_format]) = true;
+ test_make_tex (kpse_pk_format, "cmr10");
+
+ /* Fail with mktextfm. */
+ KPSE_MAKE_SPEC_ENABLED (kpse_make_specs[kpse_tfm_format]) = true;
+ test_make_tex (kpse_tfm_format, "foozler99");
+
+ /* Call something disabled. */
+ test_make_tex (kpse_bst_format, "no-way");
+
+ return 0;
+}
+
+#endif /* TEST */
+
+
+/*
+Local variables:
+test-compile-command: "gcc -g -I. -I.. -DTEST tex-make.c kpathsea.a"
+End:
+*/
diff --git a/Build/source/texk/kpathsea/tex-make.h b/Build/source/texk/kpathsea/tex-make.h
new file mode 100644
index 00000000000..81767248e30
--- /dev/null
+++ b/Build/source/texk/kpathsea/tex-make.h
@@ -0,0 +1,42 @@
+/* tex-make.h: declarations for executing external scripts.
+
+ Copyright 1999, 2005 Olaf Weber.
+ Copyright 1993, 94 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_TEX_MAKE_H
+#define KPATHSEA_TEX_MAKE_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/tex-file.h>
+#include <kpathsea/types.h>
+
+
+/* If true, throw away standard error from the mktex... scripts.
+ (Standard output is the filename, so we never throw that away.) */
+extern KPSEDLL boolean kpse_make_tex_discard_errors;
+
+
+/* Run a program to create a file named by BASE_FILE in format FORMAT.
+ Return the full filename to it, or NULL. Any other information about
+ the file is passed through environment variables. See the mktexpk
+ stuff in `tex-make.c' for an example. */
+extern string kpse_make_tex P2H(kpse_file_format_type format,
+ const_string base_file);
+
+#endif /* not KPATHSEA_TEX_MAKE_H */
diff --git a/Build/source/texk/kpathsea/texmf.in b/Build/source/texk/kpathsea/texmf.in
new file mode 100644
index 00000000000..f9e7b3f9b44
--- /dev/null
+++ b/Build/source/texk/kpathsea/texmf.in
@@ -0,0 +1,559 @@
+% original texmf.cnf -- runtime path configuration file for kpathsea.
+% (If you change or delete `original' on the previous line, the
+% distribution won't install its version over yours.)
+% Public domain.
+%
+% What follows is a super-summary of what this .cnf file can
+% contain. Please read the Kpathsea manual for more information.
+%
+% texmf.cnf is generated from texmf.in, by replacing @var@ with the
+% value of the Make variable `var', via a sed file texmf.sed, generated
+% (once) by kpathsea/Makefile (itself generated from kpathsea/Makefile.in
+% by configure).
+%
+% Any identifier (sticking to A-Za-z_ for names is safest) can be assigned.
+% The `=' (and surrounding spaces) is optional.
+% No % or @ in texmf.in, for the sake of autogeneration.
+% (However, %'s and @'s can be edited into texmf.cnf or put in envvar values.)
+% $foo (or ${foo}) in a value expands to the envvar or cnf value of foo.
+%
+% Earlier entries (in the same or another file) override later ones, and
+% an environment variable foo overrides any texmf.cnf definition of foo.
+%
+% All definitions are read before anything is expanded, so you can use
+% variables before they are defined.
+%
+% If a variable assignment is qualified with `.PROGRAM', it is ignored
+% unless the current executable (last filename component of argv[0]) is
+% named PROGRAM. This foo.PROGRAM construct is not recognized on the
+% right-hand side. For environment variables, use FOO_PROGRAM.
+%
+% Which file formats use which paths for searches is described in the
+% various programs' and the kpathsea documentation.
+%
+% // means to search subdirectories (recursively).
+% A leading !! means to look only in the ls-R db, never on the disk.
+% A leading/trailing/doubled ; in the paths will be expanded into the
+% compile-time default. Probably not what you want.
+%
+% You can use brace notation, for example: /usr/local/{mytex:othertex}
+% expands to /usr/local/mytex:/usr/local/othertex. Instead of the path
+% separator you can use a comma: /usr/local/{mytex,othertex} also expands
+% to /usr/local/mytex:/usr/local/othertex. However, the use of the comma
+% instead of the path separator is deprecated.
+%
+% The text above assumes thet path separator is a colon (:). Non-UNIX
+% systems use different path separators, like the semicolon (;).
+
+% Part 1: Search paths and directories.
+
+% You can set an environment variable to override TEXMF if you're testing
+% a new TeX tree, without changing anything else.
+%
+% You may wish to use one of the $SELFAUTO... variables here so TeX will
+% find where to look dynamically. See the manual and the definition
+% below of TEXMFCNF.
+
+% The tree containing the runtime files closely related to the specific
+% program version used:
+TEXMFMAIN = @texmf@
+
+% The main distribution tree:
+TEXMFDIST = @texmf@-dist
+
+% A place for local additions to a "standard" texmf tree.
+% This tree is not used for local configuration maintained by
+% texconfig, it uses TEXMFCONFIG below.
+TEXMFLOCAL = @texmf@-local
+
+% TEXMFSYSVAR, where texconfig-sys stores variable runtime data.
+% With teTeX-3.0 or later, this must be set.
+% For sharing this tree with $TEXMFMAIN:
+% TEXMFSYSVAR = $TEXMFMAIN
+% For using a separate tree:
+% TEXMFSYSVAR = @texmf@-var
+TEXMFSYSVAR = @texmf@-var
+
+% TEXMFSYSCONFIG, where texconfig-sys stores configuration data.
+% With teTeX-3.0 or later, this must be set.
+% For sharing this tree with $TEXMFMAIN:
+% TEXMFSYSCONFIG = $TEXMFMAIN
+% For using a separate tree:
+% TEXMFSYSCONFIG = @texmf@-config
+TEXMFSYSCONFIG = @texmf@-config
+
+% User texmf trees can be catered for like this...
+% This used to be HOMETEXMF.
+TEXMFHOME = $HOME/texmf
+
+% TEXMFVAR, where texconfig stores variable runtime data.
+% With teTeX-3.0 or later, this must be set.
+% For sharing this tree with $TEXMFMAIN:
+% TEXMFVAR = $TEXMFMAIN
+% For using a separate tree:
+% TEXMFVAR = $HOME/.texmf-var
+TEXMFVAR = $HOME/.texmf-var
+
+% TEXMFCONFIG, where texconfig stores configuration data.
+% With teTeX-3.0 or later, this must be set.
+% For sharing this tree with $TEXMFMAIN:
+% TEXMFCONFIG = $TEXMFMAIN
+% For using a separate tree:
+% TEXMFCONFIG = $HOME/.texmf-config
+% For using a separate tree:
+% TEXMFCONFIG = @texmf@-config
+TEXMFCONFIG = $HOME/.texmf-config
+
+% Now, list all the texmf trees. If you have multiple trees you can
+% use shell brace notation, like this:
+% TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
+% The braces are necessary.
+%
+% For texconfig to work properly, TEXMFCONFIG and TEXMFVAR should be named
+% explicitly and before all other trees.
+TEXMF = {!!$TEXMFCONFIG,!!$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST}
+
+% The system trees. These are the trees that are shared by all the users.
+SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST
+
+% Where generated fonts may be written. This tree is used when the sources
+% were found in a system tree and either that tree wasn't writable, or the
+% varfonts feature was enabled in MT_FEATURES in mktex.cnf.
+VARTEXFONTS = @vartexfonts@
+
+% Where to look for ls-R files. There need not be an ls-R in the
+% directories in this path, but if there is one, Kpathsea will use it.
+%
+% Remove $VARTEXFONTS from TEXMFDBS if the VARTEXFONTS directory is below
+% one of the TEXMF directories (avoids overlapping ls-R files).
+TEXMFDBS = $TEXMF;$VARTEXFONTS
+
+% It may be convenient to define TEXMF like this:
+% TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN,$HOME}
+% which allows users to set up entire texmf trees, and tells TeX to
+% look in places like ~/tex and ~/bibtex. If you do this, define TEXMFDBS
+% like this:
+% TEXMFDBS = $TEXMFHOME;$TEXMFLOCAL;$TEXMFMAIN;$VARTEXFONTS
+% or mktexlsr will generate an ls-R file for $HOME when called, which is
+% rarely desirable. If you do this you'll want to define SYSTEXMF like
+% this:
+% SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST
+% so that fonts from a user's tree won't escape into the global trees.
+%
+% On some systems, there will be a system tree which contains all the font
+% files that may be created as well as the formats. For example
+% TEXMFVAR = /var/lib/texmf
+% is used on many Linux systems. In this case, set VARTEXFONTS like this
+% VARTEXFONTS = $TEXMFVAR/fonts
+% and do not mention it in TEXMFDBS (but _do_ mention TEXMFVAR).
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Usually you will not need to edit any of the other variables in part 1. %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% WEB2C is for Web2C specific files. The current directory may not be
+% a good place to look for them.
+WEB2C = $TEXMF/web2c
+
+% TEXINPUTS is for TeX input files -- i.e., anything to be found by \input
+% or \openin, including .sty, .eps, etc.
+
+% Plain TeX. Have the command tex check all directories as a last
+% resort, we may have plain-compatible stuff anywhere.
+TEXINPUTS.tex = .;$TEXMF/tex/{plain,generic,}//
+
+% Other plain-based formats.
+TEXINPUTS.amstex = .;$TEXMF/tex/{amstex,plain,generic,}//
+TEXINPUTS.csplain = .;$TEXMF/tex/{csplain,plain,generic,}//
+TEXINPUTS.eplain = .;$TEXMF/tex/{eplain,plain,generic,}//
+TEXINPUTS.ftex = .;$TEXMF/tex/{formate,plain,generic,}//
+TEXINPUTS.jadetex = .;$TEXMF/tex/{jadetex,plain,generic,}//
+TEXINPUTS.mex = .;$TEXMF/tex/{mex,plain,generic,}//
+TEXINPUTS.texinfo = .;$TEXMF/tex/{texinfo,plain,generic,}//
+
+% LaTeX 2e specific macros are stored in latex/, macros that can only be
+% used with 2.09 in latex209/. In addition, we look in the directory
+% latex209, useful for macros that were written for 2.09 and do not
+% mention 2e at all, but can be used with 2e.
+TEXINPUTS.cslatex = .;$TEXMF/tex/{cslatex,csplain,latex,generic,}//
+TEXINPUTS.platex = .;$TEXMF/tex/{platex,latex,generic,}//
+TEXINPUTS.latex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.olatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.latex209 = .;$TEXMF/tex/{latex209,generic,latex,}//
+
+% Fontinst needs to read afm files.
+TEXINPUTS.fontinst = .;$TEXMF/{tex,fonts/afm}//
+
+% MLTeX.
+TEXINPUTS.frlatex = .;$TEXMF/tex/{french,latex,generic,}//
+TEXINPUTS.frtex = .;$TEXMF/tex/{french,plain,generic,}//
+TEXINPUTS.mllatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.mltex = .;$TEXMF/tex/{plain,generic,}//
+
+% e-TeX. This form of the input paths is borrowed from teTeX. A certain
+% variant of TDS is assumed here, unaffected by the build variables.
+TEXINPUTS.elatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.etex = .;$TEXMF/tex/{plain,generic,}//
+
+% pdfTeX. This form of the input paths is borrowed from teTeX. A certain
+% variant of TDS is assumed here, unaffected by the build variables.
+TEXINPUTS.pdfcslatex = .;$TEXMF/tex/{cslatex,csplain,latex,generic,}//
+TEXINPUTS.pdfcsplain = .;$TEXMF/tex/{csplain,plain,generic,}//
+TEXINPUTS.pdfjadetex = .;$TEXMF/tex/{jadetex,plain,generic,}//
+TEXINPUTS.pdflatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.pdfmex = .;$TEXMF/tex/{mex,plain,generic,}//
+TEXINPUTS.utf8mex = .;$TEXMF/tex/{mex,plain,generic,}//
+TEXINPUTS.pdftex = .;$TEXMF/tex/{plain,generic,}//
+TEXINPUTS.pdftexinfo = .;$TEXMF/tex/{texinfo,plain,generic,}//
+TEXINPUTS.pdfamstex = .;$TEXMF/tex/{amstex,plain,generic,}//
+
+% pdfeTeX.
+TEXINPUTS.pdfelatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.pdfetex = .;$TEXMF/tex/{plain,generic,}//
+
+% pdfxTeX.
+TEXINPUTS.pdfxlatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.pdfxtex = .;$TEXMF/tex/{plain,generic,}//
+
+% XeTeX
+TEXINPUTS.xelatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.xetex = .;$TEXMF/tex/{plain,generic,}//
+
+% Omega / Aleph
+TEXINPUTS.lamed = .;$TEXMF/tex/{lamed,lambda,latex,generic,}//
+TEXINPUTS.lambda = .;$TEXMF/tex/{lambda,latex,generic,}//
+TEXINPUTS.omega = .;$TEXMF/tex/{plain,generic,}//
+TEXINPUTS.aleph = .;$TEXMF/tex/{plain,generic,}//
+
+% Context macros by Hans Hagen:
+TEXINPUTS.context = .;$TEXMF/tex/{context,plain,generic,}//
+
+% odd formats needing their own paths
+TEXINPUTS.lamstex = .;$TEXMF/tex/{lamstex,plain,generic,}//
+TEXINPUTS.lollipop = .;$TEXMF/tex/{lollipop,plain,generic,}//
+TEXINPUTS.platex-pl = .;$TEXMF/tex/{platex,latex,generic,}//
+TEXINPUTS.pdfplatex = .;$TEXMF/tex/{platex,latex,generic,}//
+
+% Earlier entries override later ones, so put this last.
+TEXINPUTS = .;$TEXMF/tex/{$progname,generic,}//
+
+% Metafont, MetaPost inputs.
+MFINPUTS = .;$TEXMF/metafont//;{$TEXMF/fonts,$VARTEXFONTS}/source//
+MPINPUTS = .;$TEXMF/metapost//
+
+% Dump files (fmt/base/mem) for vir{tex,mf,mp} to read (see web2c/INSTALL),
+% and string pools (.pool) for ini{tex,mf,mp}. It is silly that we have six
+% paths and directories here (they all resolve to a single place by default),
+% but historically ...
+TEXFORMATS = .;$TEXMF/web2c
+MFBASES = .;$TEXMF/web2c
+MPMEMS = .;$TEXMF/web2c
+TEXPOOL = .;$TEXMF/web2c
+MFPOOL = .;$TEXMF/web2c
+MPPOOL = .;$TEXMF/web2c
+
+% Device-independent font metric files.
+VFFONTS = .;$TEXMF/fonts/vf//
+TFMFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/tfm//
+
+% The $MAKETEX_MODE below means the drivers will not use a cx font when
+% the mode is ricoh. If no mode is explicitly specified, kpse_prog_init
+% sets MAKETEX_MODE to /, so all subdirectories are searched. See the manual.
+% The modeless part guarantees that bitmaps for PostScript fonts are found.
+PKFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/pk/{$MAKETEX_MODE,modeless}//
+
+% Similarly for the GF format, which only remains in existence because
+% Metafont outputs it (and MF isn't going to change).
+GFFONTS = .;$TEXMF/fonts/gf/$MAKETEX_MODE//
+
+% A backup for PKFONTS and GFFONTS. Not used for anything.
+GLYPHFONTS = .;$TEXMF/fonts
+
+% A place to puth everything that doesn't fit the other font categories.
+MISCFONTS = .;$TEXMF/fonts/misc//
+
+% font name map files.
+TEXFONTMAPS = .;$TEXMF/fonts/map//
+
+% support non"k"-xdvi:
+PKFONTS.XDvi = .:$TEXMF/%s:$VARTEXFONTS/pk/{%m,modeless}//
+VFFONTS.XDvi = .:$TEXMF/%s
+PSHEADERS.XDvi = .:$TEXMF/%q{dvips,fonts/type1}//
+TEXPICTS.XDvi = .:$TEXMF/%q{dvips,tex}//
+
+% BibTeX bibliographies and style files.
+BIBINPUTS = .;$TEXMF/bibtex/bib//
+BSTINPUTS = .;$TEXMF/bibtex/bst//
+
+% MFT style files.
+MFTINPUTS = .;$TEXMF/mft//
+
+% PostScript headers and prologues (.pro); unfortunately, some programs
+% also use this for acessing font files (enc, type1, truetype)
+TEXPSHEADERS = .;$TEXMF/{dvips,fonts/{enc,type1,type3}}//
+TEXPSHEADERS.gsftopk = .;$TEXMF/{dvips,fonts/{enc,type1,type3,truetype}}//
+
+% PostScript Type 1 outline fonts.
+T1FONTS = .;$TEXMF/fonts/type1//
+
+% PostScript AFM metric files.
+AFMFONTS = .;$TEXMF/fonts/afm//
+
+% TrueType outline fonts.
+TTFONTS = .;$TEXMF/fonts/truetype//
+
+% Type 42 outline fonts.
+T42FONTS = .;$TEXMF/fonts/type42//
+
+% Ligature definition files.
+LIGFONTS = .;$TEXMF/fonts/lig//
+
+% Dvips' config.* files (this name should not start with `TEX'!).
+TEXCONFIG = $TEXMF/dvips//
+
+% Makeindex style (.ist) files.
+INDEXSTYLE = .;$TEXMF/makeindex//
+
+% Font encoding files (.enc).
+ENCFONTS = .;$TEXMF/fonts/enc//
+
+% CMap files.
+CMAPFONTS = .;$TEXMF/fonts/cmap//
+
+% Subfont definition files.
+SFDFONTS = .;$TEXMF/fonts/sfd//
+
+% Opentype outline fonts.
+OPENTYPEFONTS = .;$TEXMF/fonts/opentype//
+
+% pdftex config files:
+PDFTEXCONFIG = .;$TEXMF/pdftex/{$progname,}//
+
+% Used by DMP (ditroff-to-mpx), called by makempx -troff.
+% The path given is correct for GROFF on Linux installed under /usr.
+% Originally: TRFONTS = /usr/lib/font/devpost
+TRFONTS = /usr/share/groff/current/font/devps
+MPSUPPORT = .;$TEXMF/metapost/support
+
+% For xdvi to find mime.types and .mailcap, if they do not exist in
+% $HOME. These are single directories, not paths.
+% (But the default mime.types, at least, may well suffice.)
+MIMELIBDIR = @prefix@/etc
+MAILCAPLIBDIR = @prefix@/etc
+
+% TeX documentation and source files, for use with kpsewhich.
+TEXDOCS = .;$TEXMF/doc//
+TEXSOURCES = .;$TEXMF/source//
+
+% Web and CWeb input paths.
+WEBINPUTS = .;$TEXMF/web//
+CWEBINPUTS = .;$TEXMF/cweb//
+
+% Omega-related fonts and other files. The odd construction for OFMFONTS
+% makes it behave in the face of a definition of TFMFONTS. Unfortunately
+% no default substitution would take place for TFMFONTS, so an explicit
+% path is retained.
+OFMFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/{ofm,tfm}//;$TFMFONTS
+OPLFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/opl//
+OVFFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/ovf//
+OVPFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/ovp//
+OTPINPUTS = .;$TEXMF/omega/otp//
+OCPINPUTS = .;$TEXMF/omega/ocp//
+
+% Some additional input variables for several programs. If you add
+% a program that uses the 'other text files' or 'other binary files'
+% search formats, you'll want to add their variables here as well.
+T4HTINPUTS = .;$TEXMF/tex4ht//
+
+% Architecture independent executables
+TEXMFSCRIPTS = $TEXMF/scripts//
+
+%% The mktex* scripts rely on KPSE_DOT. Do not set it in the environment.
+% KPSE_DOT = .
+
+% This definition isn't used from this .cnf file itself (that would be
+% paradoxical), but the compile-time default in paths.h is built from it.
+% The SELFAUTO* variables are set automatically from the location of
+% argv[0], in kpse_set_progname.
+%
+% The TETEXDIR stuff isn't likely to relevant unless you're using teTeX,
+% but it doesn't hurt.
+%
+% For security reasons, it is better not to have . part of the path.
+%
+TEXMFCNF = {$SELFAUTOLOC,$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/web2c};$TETEXDIR;$TEXMF/web2c;@web2c@
+
+# $progname: kpathsea v. 3.5.3 or later overwrites this at runtime. To
+# avoid empty expansions from binaries linked against an earlier
+# version of the library, we set $progname and $engine to something
+# non-empty:
+progname = unset
+engine = unset
+
+
+% Part 2: Non-path options.
+
+% Write .log/.dvi/etc. files here, if the current directory is unwritable.
+% TEXMFOUTPUT = /tmp
+
+% If a dynamic file creation fails, log the command to this file, in
+% either the current directory or TEXMFOUTPUT. Set to the
+% empty string or 0 to avoid logging.
+MISSFONT_LOG = missfont.log
+
+% Set to a colon-separated list of words specifying warnings to suppress.
+% To suppress everything, use TEX_HUSH = all; this is currently equivalent to
+% TEX_HUSH = checksum:lostchar:readable:special
+% To suppress nothing, use TEX_HUSH = none or do not set the variable at all.
+TEX_HUSH = none
+
+% Enable system commands via \write18{...}?
+shell_escape = f
+
+% Allow TeX \openin, \openout, or \input on filenames starting with `.'
+% (e.g., .rhosts) or outside the current tree (e.g., /etc/passwd)?
+% a (any) : any file can be opened.
+% r (restricted) : disallow opening "dotfiles".
+% p (paranoid) : as 'r' and disallow going to parent directories, and
+% restrict absolute paths to be under $TEXMFOUTPUT.
+openout_any = p
+openin_any = a
+
+% Allow TeX, MF, and MP to parse the first line of an input file for
+% the %&format construct.
+parse_first_line = f
+
+% Enable file:line:error style messages.
+file_line_error_style = f
+
+% Enable the mktex... scripts by default? These must be set to 0 or 1.
+% Particular programs can and do override these settings, for example
+% dvips's -M option. Your first chance to specify whether the scripts
+% are invoked by default is at configure time.
+%
+% These values are ignored if the script names are changed; e.g., if you
+% set DVIPSMAKEPK to `foo', what counts is the value of the environment
+% variable/config value `FOO', not the `MKTEXPK' value.
+%
+% MKTEXTEX = 0
+% MKTEXPK = 0
+% MKTEXMF = 0
+% MKTEXTFM = 0
+% MKTEXFMT = 0
+% MKOCP = 0
+% MKOFM = 0
+
+% What MetaPost runs to make MPX files. This is passed an option -troff
+% if MP is in troff mode. Set to `0' to disable this feature.
+MPXCOMMAND = makempx
+
+
+% Part 3: Array and other sizes for TeX (and Metafont and MetaPost).
+%
+% If you want to change some of these sizes only for a certain TeX
+% variant, the usual dot notation works, e.g.,
+% main_memory.hugetex = 20000000
+%
+% If a change here appears to be ignored, try redumping the format file.
+
+% Memory. Must be less than 8,000,000 total.
+%
+% main_memory is relevant only to initex, extra_mem_* only to non-ini.
+% Thus, have to redump the .fmt file after changing main_memory; to add
+% to existing fmt files, increase extra_mem_*. (To get an idea of how
+% much, try \tracingstats=2 in your TeX source file;
+% web2c/tests/memtest.tex might also be interesting.)
+%
+% To increase space for boxes (as might be needed by, e.g., PiCTeX),
+% increase extra_mem_bot.
+%
+% For some xy-pic samples, you may need as much as 700000 words of memory.
+% For the vast majority of documents, 60000 or less will do.
+%
+main_memory = 1000000 % words of inimemory available; also applies to inimf&mp
+extra_mem_top = 0 % extra high memory for chars, tokens, etc.
+extra_mem_bot = 0 % extra low memory for boxes, glue, breakpoints, etc.
+
+% ConTeXt is a memory hog...
+extra_mem_top.context = 2000000
+extra_mem_bot.context = 4000000
+main_memory.context = 1500000
+main_memory.mpost = 1500000
+
+% Words of font info for TeX (total size of all TFM files, approximately).
+font_mem_size = 500000
+
+% Total number of fonts. Must be >= 50 and <= 2000 (without tex.ch changes).
+font_max = 2000
+
+% Extra space for the hash table of control sequences (which allows 10K
+% names as distributed).
+hash_extra = 50000
+
+% Max number of characters in all strings, including all error messages,
+% help texts, font names, control sequences. These values apply to TeX and MP.
+pool_size = 1250000
+% Minimum pool space after TeX/MP's own strings; must be at least
+% 25000 less than pool_size, but doesn't need to be nearly that large.
+string_vacancies = 90000
+% Maximum number of strings.
+max_strings = 100000
+% min pool space left after loading .fmt
+pool_free = 47500
+
+% Hyphenation trie. As distributed, the maximum is 65535; this should
+% work unless `unsigned short' is not supported or is smaller than 16
+% bits. This value should suffice for UK English, US English, French,
+% and German (for example). To increase, you must change
+% `ssup_trie_opcode' and `ssup_trie_size' in tex.ch (and rebuild TeX);
+% the trie will then consume four bytes per entry, instead of two.
+%
+% US English, German, and Portuguese: 30000.
+% German: 14000.
+% US English: 10000.
+%
+trie_size = 300000
+
+% Buffer size. TeX uses the buffer to contain input lines, but macro
+% expansion works by writing material into the buffer and reparsing the
+% line. As a consequence, certain constructs require the buffer to be
+% very large. As distributed, the size is 50000; most documents can be
+% handled within a tenth of this size.
+buf_size = 200000
+
+hyph_size = 8191 % prime number of hyphenation exceptions, >610, <32767.
+ % http://primes.utm.edu/curios/page.php/8191.html
+nest_size = 500 % simultaneous semantic levels (e.g., groups)
+max_in_open = 15 % simultaneous input files and error insertions
+param_size = 5000 % simultaneous macro parameters
+save_size = 5000 % for saving values outside current group
+stack_size = 1500 % simultaneous input sources
+
+% These are Omega-specific.
+ocp_buf_size = 20000 % character buffers for ocp filters.
+ocp_stack_size = 10000 % stacks for ocp computations.
+ocp_list_size = 1000 % control for multiple ocps.
+
+% Parameter specific to MetaPost.
+% Maximum number of knots between breakpoints of a path.
+% Set to 2000 by default.
+% path_size.mpost = 10000
+
+% These are pdftex-specific.
+obj_tab_size = 300000 % PDF objects
+dest_names_size = 300000 % destinations
+
+% These work best if they are the same as the I/O buffer size, but it
+% doesn't matter much. Must be a multiple of 8.
+dvi_buf_size = 16384 % TeX
+gf_buf_size = 16384 % MF
+
+% It's probably inadvisable to change these. At any rate, we must have:
+% 45 < error_line < 255;
+% 30 < half_error_line < error_line - 15;
+% 60 <= max_print_line;
+% These apply to Metafont and MetaPost as well.
+error_line = 79
+half_error_line = 50
+max_print_line = 79
diff --git a/Build/source/texk/kpathsea/texmf.in-teTeX b/Build/source/texk/kpathsea/texmf.in-teTeX
new file mode 100644
index 00000000000..53b9d5c11f4
--- /dev/null
+++ b/Build/source/texk/kpathsea/texmf.in-teTeX
@@ -0,0 +1,559 @@
+% original texmf.cnf -- runtime path configuration file for kpathsea.
+% (If you change or delete `original' on the previous line, the
+% distribution won't install its version over yours.)
+% Public domain.
+%
+% What follows is a super-summary of what this .cnf file can
+% contain. Please read the Kpathsea manual for more information.
+%
+% texmf.cnf is generated from texmf.in, by replacing @var@ with the
+% value of the Make variable `var', via a sed file texmf.sed, generated
+% (once) by kpathsea/Makefile (itself generated from kpathsea/Makefile.in
+% by configure).
+%
+% Any identifier (sticking to A-Za-z_ for names is safest) can be assigned.
+% The `=' (and surrounding spaces) is optional.
+% No % or @ in texmf.in, for the sake of autogeneration.
+% (However, %'s and @'s can be edited into texmf.cnf or put in envvar values.)
+% $foo (or ${foo}) in a value expands to the envvar or cnf value of foo.
+%
+% Earlier entries (in the same or another file) override later ones, and
+% an environment variable foo overrides any texmf.cnf definition of foo.
+%
+% All definitions are read before anything is expanded, so you can use
+% variables before they are defined.
+%
+% If a variable assignment is qualified with `.PROGRAM', it is ignored
+% unless the current executable (last filename component of argv[0]) is
+% named PROGRAM. This foo.PROGRAM construct is not recognized on the
+% right-hand side. For environment variables, use FOO_PROGRAM.
+%
+% Which file formats use which paths for searches is described in the
+% various programs' and the kpathsea documentation.
+%
+% // means to search subdirectories (recursively).
+% A leading !! means to look only in the ls-R db, never on the disk.
+% A leading/trailing/doubled ; in the paths will be expanded into the
+% compile-time default. Probably not what you want.
+%
+% You can use brace notation, for example: /usr/local/{mytex:othertex}
+% expands to /usr/local/mytex:/usr/local/othertex. Instead of the path
+% separator you can use a comma: /usr/local/{mytex,othertex} also expands
+% to /usr/local/mytex:/usr/local/othertex. However, the use of the comma
+% instead of the path separator is deprecated.
+%
+% The text above assumes thet path separator is a colon (:). Non-UNIX
+% systems use different path separators, like the semicolon (;).
+
+% Part 1: Search paths and directories.
+
+% You can set an environment variable to override TEXMF if you're testing
+% a new TeX tree, without changing anything else.
+%
+% You may wish to use one of the $SELFAUTO... variables here so TeX will
+% find where to look dynamically. See the manual and the definition
+% below of TEXMFCNF.
+
+% The tree containing the runtime files closely related to the specific
+% program version used:
+TEXMFMAIN = @texmf@
+
+% The main distribution tree:
+TEXMFDIST = @texmf@-dist
+
+% A place for local additions to a "standard" texmf tree.
+% This tree is not used for local configuration maintained by
+% texconfig, it uses TEXMFCONFIG below.
+TEXMFLOCAL = @texmf@-local
+
+% TEXMFSYSVAR, where texconfig-sys stores variable runtime data.
+% With teTeX-3.0 or later, this must be set.
+% For sharing this tree with $TEXMFMAIN:
+% TEXMFSYSVAR = $TEXMFMAIN
+% For using a separate tree:
+% TEXMFSYSVAR = @texmf@-var
+TEXMFSYSVAR = @texmf@-var
+
+% TEXMFSYSCONFIG, where texconfig-sys stores configuration data.
+% With teTeX-3.0 or later, this must be set.
+% For sharing this tree with $TEXMFMAIN:
+% TEXMFSYSCONFIG = $TEXMFMAIN
+% For using a separate tree:
+% TEXMFSYSCONFIG = @texmf@-config
+TEXMFSYSCONFIG = @texmf@-config
+
+% User texmf trees can be catered for like this...
+% This used to be HOMETEXMF.
+TEXMFHOME = $HOME/texmf
+
+% TEXMFVAR, where texconfig stores variable runtime data.
+% With teTeX-3.0 or later, this must be set.
+% For sharing this tree with $TEXMFMAIN:
+% TEXMFVAR = $TEXMFMAIN
+% For using a separate tree:
+% TEXMFVAR = $HOME/.tetex3.1/texmf-var
+TEXMFVAR = $HOME/.tetex3.1/texmf-var
+
+% TEXMFCONFIG, where texconfig stores configuration data.
+% With teTeX-3.0 or later, this must be set.
+% For sharing this tree with $TEXMFMAIN:
+% TEXMFCONFIG = $TEXMFMAIN
+% For using a separate tree:
+% TEXMFCONFIG = $HOME/.tetex3.1/texmf-config
+% For using a separate tree:
+% TEXMFCONFIG = @texmf@-config
+TEXMFCONFIG = $HOME/.tetex3.1/texmf-config
+
+% Now, list all the texmf trees. If you have multiple trees you can
+% use shell brace notation, like this:
+% TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
+% The braces are necessary.
+%
+% For texconfig to work properly, TEXMFCONFIG and TEXMFVAR should be named
+% explicitly and before all other trees.
+TEXMF = {!!$TEXMFCONFIG,!!$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST}
+
+% The system trees. These are the trees that are shared by all the users.
+SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST
+
+% Where generated fonts may be written. This tree is used when the sources
+% were found in a system tree and either that tree wasn't writable, or the
+% varfonts feature was enabled in MT_FEATURES in mktex.cnf.
+VARTEXFONTS = @vartexfonts@
+
+% Where to look for ls-R files. There need not be an ls-R in the
+% directories in this path, but if there is one, Kpathsea will use it.
+%
+% Remove $VARTEXFONTS from TEXMFDBS if the VARTEXFONTS directory is below
+% one of the TEXMF directories (avoids overlapping ls-R files).
+TEXMFDBS = $TEXMF;$VARTEXFONTS
+
+% It may be convenient to define TEXMF like this:
+% TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN,$HOME}
+% which allows users to set up entire texmf trees, and tells TeX to
+% look in places like ~/tex and ~/bibtex. If you do this, define TEXMFDBS
+% like this:
+% TEXMFDBS = $TEXMFHOME;$TEXMFLOCAL;$TEXMFMAIN;$VARTEXFONTS
+% or mktexlsr will generate an ls-R file for $HOME when called, which is
+% rarely desirable. If you do this you'll want to define SYSTEXMF like
+% this:
+% SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST
+% so that fonts from a user's tree won't escape into the global trees.
+%
+% On some systems, there will be a system tree which contains all the font
+% files that may be created as well as the formats. For example
+% TEXMFVAR = /var/lib/texmf
+% is used on many Linux systems. In this case, set VARTEXFONTS like this
+% VARTEXFONTS = $TEXMFVAR/fonts
+% and do not mention it in TEXMFDBS (but _do_ mention TEXMFVAR).
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Usually you will not need to edit any of the other variables in part 1. %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% WEB2C is for Web2C specific files. The current directory may not be
+% a good place to look for them.
+WEB2C = $TEXMF/web2c
+
+% TEXINPUTS is for TeX input files -- i.e., anything to be found by \input
+% or \openin, including .sty, .eps, etc.
+
+% Plain TeX. Have the command tex check all directories as a last
+% resort, we may have plain-compatible stuff anywhere.
+TEXINPUTS.tex = .;$TEXMF/tex/{plain,generic,}//
+
+% Other plain-based formats.
+TEXINPUTS.amstex = .;$TEXMF/tex/{amstex,plain,generic,}//
+TEXINPUTS.csplain = .;$TEXMF/tex/{csplain,plain,generic,}//
+TEXINPUTS.eplain = .;$TEXMF/tex/{eplain,plain,generic,}//
+TEXINPUTS.ftex = .;$TEXMF/tex/{formate,plain,generic,}//
+TEXINPUTS.jadetex = .;$TEXMF/tex/{jadetex,plain,generic,}//
+TEXINPUTS.mex = .;$TEXMF/tex/{mex,plain,generic,}//
+TEXINPUTS.texinfo = .;$TEXMF/tex/{texinfo,plain,generic,}//
+
+% LaTeX 2e specific macros are stored in latex/, macros that can only be
+% used with 2.09 in latex209/. In addition, we look in the directory
+% latex209, useful for macros that were written for 2.09 and do not
+% mention 2e at all, but can be used with 2e.
+TEXINPUTS.cslatex = .;$TEXMF/tex/{cslatex,csplain,latex,generic,}//
+TEXINPUTS.platex = .;$TEXMF/tex/{platex,latex,generic,}//
+TEXINPUTS.latex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.olatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.latex209 = .;$TEXMF/tex/{latex209,generic,latex,}//
+
+% Fontinst needs to read afm files.
+TEXINPUTS.fontinst = .;$TEXMF/{tex,fonts/afm}//
+
+% MLTeX.
+TEXINPUTS.frlatex = .;$TEXMF/tex/{french,latex,generic,}//
+TEXINPUTS.frtex = .;$TEXMF/tex/{french,plain,generic,}//
+TEXINPUTS.mllatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.mltex = .;$TEXMF/tex/{plain,generic,}//
+
+% e-TeX. This form of the input paths is borrowed from teTeX. A certain
+% variant of TDS is assumed here, unaffected by the build variables.
+TEXINPUTS.elatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.etex = .;$TEXMF/tex/{plain,generic,}//
+
+% pdfTeX. This form of the input paths is borrowed from teTeX. A certain
+% variant of TDS is assumed here, unaffected by the build variables.
+TEXINPUTS.pdfcslatex = .;$TEXMF/tex/{cslatex,csplain,latex,generic,}//
+TEXINPUTS.pdfcsplain = .;$TEXMF/tex/{csplain,plain,generic,}//
+TEXINPUTS.pdfjadetex = .;$TEXMF/tex/{jadetex,plain,generic,}//
+TEXINPUTS.pdflatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.pdfmex = .;$TEXMF/tex/{mex,plain,generic,}//
+TEXINPUTS.utf8mex = .;$TEXMF/tex/{mex,plain,generic,}//
+TEXINPUTS.pdftex = .;$TEXMF/tex/{plain,generic,}//
+TEXINPUTS.pdftexinfo = .;$TEXMF/tex/{texinfo,plain,generic,}//
+TEXINPUTS.pdfamstex = .;$TEXMF/tex/{amstex,plain,generic,}//
+
+% pdfeTeX.
+TEXINPUTS.pdfelatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.pdfetex = .;$TEXMF/tex/{plain,generic,}//
+
+% pdfxTeX.
+TEXINPUTS.pdfxlatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.pdfxtex = .;$TEXMF/tex/{plain,generic,}//
+
+% XeTeX
+TEXINPUTS.xelatex = .;$TEXMF/tex/{latex,generic,}//
+TEXINPUTS.xetex = .;$TEXMF/tex/{plain,generic,}//
+
+% Omega / Aleph
+TEXINPUTS.lamed = .;$TEXMF/tex/{lamed,lambda,latex,generic,}//
+TEXINPUTS.lambda = .;$TEXMF/tex/{lambda,latex,generic,}//
+TEXINPUTS.omega = .;$TEXMF/tex/{plain,generic,}//
+TEXINPUTS.aleph = .;$TEXMF/tex/{plain,generic,}//
+
+% Context macros by Hans Hagen:
+TEXINPUTS.context = .;$TEXMF/tex/{context,plain,generic,}//
+
+% odd formats needing their own paths
+TEXINPUTS.lamstex = .;$TEXMF/tex/{lamstex,plain,generic,}//
+TEXINPUTS.lollipop = .;$TEXMF/tex/{lollipop,plain,generic,}//
+TEXINPUTS.platex-pl = .;$TEXMF/tex/{platex,latex,generic,}//
+TEXINPUTS.pdfplatex = .;$TEXMF/tex/{platex,latex,generic,}//
+
+% Earlier entries override later ones, so put this last.
+TEXINPUTS = .;$TEXMF/tex/{$progname,generic,}//
+
+% Metafont, MetaPost inputs.
+MFINPUTS = .;$TEXMF/metafont//;{$TEXMF/fonts,$VARTEXFONTS}/source//
+MPINPUTS = .;$TEXMF/metapost//
+
+% Dump files (fmt/base/mem) for vir{tex,mf,mp} to read (see web2c/INSTALL),
+% and string pools (.pool) for ini{tex,mf,mp}. It is silly that we have six
+% paths and directories here (they all resolve to a single place by default),
+% but historically ...
+TEXFORMATS = .;$TEXMF/web2c
+MFBASES = .;$TEXMF/web2c
+MPMEMS = .;$TEXMF/web2c
+TEXPOOL = .;$TEXMF/web2c
+MFPOOL = .;$TEXMF/web2c
+MPPOOL = .;$TEXMF/web2c
+
+% Device-independent font metric files.
+VFFONTS = .;$TEXMF/fonts/vf//
+TFMFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/tfm//
+
+% The $MAKETEX_MODE below means the drivers will not use a cx font when
+% the mode is ricoh. If no mode is explicitly specified, kpse_prog_init
+% sets MAKETEX_MODE to /, so all subdirectories are searched. See the manual.
+% The modeless part guarantees that bitmaps for PostScript fonts are found.
+PKFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/pk/{$MAKETEX_MODE,modeless}//
+
+% Similarly for the GF format, which only remains in existence because
+% Metafont outputs it (and MF isn't going to change).
+GFFONTS = .;$TEXMF/fonts/gf/$MAKETEX_MODE//
+
+% A backup for PKFONTS and GFFONTS. Not used for anything.
+GLYPHFONTS = .;$TEXMF/fonts
+
+% A place to puth everything that doesn't fit the other font categories.
+MISCFONTS = .;$TEXMF/fonts/misc//
+
+% font name map files.
+TEXFONTMAPS = .;$TEXMF/fonts/map//
+
+% support non"k"-xdvi:
+PKFONTS.XDvi = .:$TEXMF/%s:$VARTEXFONTS/pk/{%m,modeless}//
+VFFONTS.XDvi = .:$TEXMF/%s
+PSHEADERS.XDvi = .:$TEXMF/%q{dvips,fonts/type1}//
+TEXPICTS.XDvi = .:$TEXMF/%q{dvips,tex}//
+
+% BibTeX bibliographies and style files.
+BIBINPUTS = .;$TEXMF/bibtex/bib//
+BSTINPUTS = .;$TEXMF/bibtex/bst//
+
+% MFT style files.
+MFTINPUTS = .;$TEXMF/mft//
+
+% PostScript headers and prologues (.pro); unfortunately, some programs
+% also use this for acessing font files (enc, type1, truetype)
+TEXPSHEADERS = .;$TEXMF/{dvips,fonts/{enc,type1,type3}}//
+TEXPSHEADERS.gsftopk = .;$TEXMF/{dvips,fonts/{enc,type1,type3,truetype}}//
+
+% PostScript Type 1 outline fonts.
+T1FONTS = .;$TEXMF/fonts/type1//
+
+% PostScript AFM metric files.
+AFMFONTS = .;$TEXMF/fonts/afm//
+
+% TrueType outline fonts.
+TTFONTS = .;$TEXMF/fonts/truetype//
+
+% Type 42 outline fonts.
+T42FONTS = .;$TEXMF/fonts/type42//
+
+% Ligature definition files.
+LIGFONTS = .;$TEXMF/fonts/lig//
+
+% Dvips' config.* files (this name should not start with `TEX'!).
+TEXCONFIG = $TEXMF/dvips//
+
+% Makeindex style (.ist) files.
+INDEXSTYLE = .;$TEXMF/makeindex//
+
+% Font encoding files (.enc).
+ENCFONTS = .;$TEXMF/fonts/enc//
+
+% CMap files.
+CMAPFONTS = .;$TEXMF/fonts/cmap//
+
+% Subfont definition files.
+SFDFONTS = .;$TEXMF/fonts/sfd//
+
+% Opentype outline fonts.
+OPENTYPEFONTS = .;$TEXMF/fonts/opentype//
+
+% pdftex config files:
+PDFTEXCONFIG = .;$TEXMF/pdftex/{$progname,}//
+
+% Used by DMP (ditroff-to-mpx), called by makempx -troff.
+% The path given is correct for GROFF on Linux installed under /usr.
+% Originally: TRFONTS = /usr/lib/font/devpost
+TRFONTS = /usr/share/groff/current/font/devps
+MPSUPPORT = .;$TEXMF/metapost/support
+
+% For xdvi to find mime.types and .mailcap, if they do not exist in
+% $HOME. These are single directories, not paths.
+% (But the default mime.types, at least, may well suffice.)
+MIMELIBDIR = @prefix@/etc
+MAILCAPLIBDIR = @prefix@/etc
+
+% TeX documentation and source files, for use with kpsewhich.
+TEXDOCS = .;$TEXMF/doc//
+TEXSOURCES = .;$TEXMF/source//
+
+% Web and CWeb input paths.
+WEBINPUTS = .;$TEXMF/web//
+CWEBINPUTS = .;$TEXMF/cweb//
+
+% Omega-related fonts and other files. The odd construction for OFMFONTS
+% makes it behave in the face of a definition of TFMFONTS. Unfortunately
+% no default substitution would take place for TFMFONTS, so an explicit
+% path is retained.
+OFMFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/{ofm,tfm}//;$TFMFONTS
+OPLFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/opl//
+OVFFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/ovf//
+OVPFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/ovp//
+OTPINPUTS = .;$TEXMF/omega/otp//
+OCPINPUTS = .;$TEXMF/omega/ocp//
+
+% Some additional input variables for several programs. If you add
+% a program that uses the 'other text files' or 'other binary files'
+% search formats, you'll want to add their variables here as well.
+T4HTINPUTS = .;$TEXMF/tex4ht//
+
+% Architecture independent executables
+TEXMFSCRIPTS = $TEXMF/scripts//
+
+%% The mktex* scripts rely on KPSE_DOT. Do not set it in the environment.
+% KPSE_DOT = .
+
+% This definition isn't used from this .cnf file itself (that would be
+% paradoxical), but the compile-time default in paths.h is built from it.
+% The SELFAUTO* variables are set automatically from the location of
+% argv[0], in kpse_set_progname.
+%
+% The TETEXDIR stuff isn't likely to relevant unless you're using teTeX,
+% but it doesn't hurt.
+%
+% For security reasons, it is better not to have . part of the path.
+%
+TEXMFCNF = {$SELFAUTOLOC,$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/web2c};$TETEXDIR;$TEXMF/web2c;@web2c@
+
+# $progname: kpathsea v. 3.5.3 or later overwrites this at runtime. To
+# avoid empty expansions from binaries linked against an earlier
+# version of the library, we set $progname and $engine to something
+# non-empty:
+progname = unset
+engine = unset
+
+
+% Part 2: Non-path options.
+
+% Write .log/.dvi/etc. files here, if the current directory is unwritable.
+% TEXMFOUTPUT = /tmp
+
+% If a dynamic file creation fails, log the command to this file, in
+% either the current directory or TEXMFOUTPUT. Set to the
+% empty string or 0 to avoid logging.
+MISSFONT_LOG = missfont.log
+
+% Set to a colon-separated list of words specifying warnings to suppress.
+% To suppress everything, use TEX_HUSH = all; this is currently equivalent to
+% TEX_HUSH = checksum:lostchar:readable:special
+% To suppress nothing, use TEX_HUSH = none or do not set the variable at all.
+TEX_HUSH = none
+
+% Enable system commands via \write18{...}?
+shell_escape = f
+
+% Allow TeX \openin, \openout, or \input on filenames starting with `.'
+% (e.g., .rhosts) or outside the current tree (e.g., /etc/passwd)?
+% a (any) : any file can be opened.
+% r (restricted) : disallow opening "dotfiles".
+% p (paranoid) : as 'r' and disallow going to parent directories, and
+% restrict absolute paths to be under $TEXMFOUTPUT.
+openout_any = p
+openin_any = a
+
+% Allow TeX, MF, and MP to parse the first line of an input file for
+% the %&format construct.
+parse_first_line = f
+
+% Enable file:line:error style messages.
+file_line_error_style = f
+
+% Enable the mktex... scripts by default? These must be set to 0 or 1.
+% Particular programs can and do override these settings, for example
+% dvips's -M option. Your first chance to specify whether the scripts
+% are invoked by default is at configure time.
+%
+% These values are ignored if the script names are changed; e.g., if you
+% set DVIPSMAKEPK to `foo', what counts is the value of the environment
+% variable/config value `FOO', not the `MKTEXPK' value.
+%
+% MKTEXTEX = 0
+% MKTEXPK = 0
+% MKTEXMF = 0
+% MKTEXTFM = 0
+% MKTEXFMT = 0
+% MKOCP = 0
+% MKOFM = 0
+
+% What MetaPost runs to make MPX files. This is passed an option -troff
+% if MP is in troff mode. Set to `0' to disable this feature.
+MPXCOMMAND = makempx
+
+
+% Part 3: Array and other sizes for TeX (and Metafont and MetaPost).
+%
+% If you want to change some of these sizes only for a certain TeX
+% variant, the usual dot notation works, e.g.,
+% main_memory.hugetex = 20000000
+%
+% If a change here appears to be ignored, try redumping the format file.
+
+% Memory. Must be less than 8,000,000 total.
+%
+% main_memory is relevant only to initex, extra_mem_* only to non-ini.
+% Thus, have to redump the .fmt file after changing main_memory; to add
+% to existing fmt files, increase extra_mem_*. (To get an idea of how
+% much, try \tracingstats=2 in your TeX source file;
+% web2c/tests/memtest.tex might also be interesting.)
+%
+% To increase space for boxes (as might be needed by, e.g., PiCTeX),
+% increase extra_mem_bot.
+%
+% For some xy-pic samples, you may need as much as 700000 words of memory.
+% For the vast majority of documents, 60000 or less will do.
+%
+main_memory = 1000000 % words of inimemory available; also applies to inimf&mp
+extra_mem_top = 0 % extra high memory for chars, tokens, etc.
+extra_mem_bot = 0 % extra low memory for boxes, glue, breakpoints, etc.
+
+% ConTeXt is a memory hog...
+extra_mem_top.context = 2000000
+extra_mem_bot.context = 4000000
+main_memory.context = 1500000
+main_memory.mpost = 1500000
+
+% Words of font info for TeX (total size of all TFM files, approximately).
+font_mem_size = 500000
+
+% Total number of fonts. Must be >= 50 and <= 2000 (without tex.ch changes).
+font_max = 2000
+
+% Extra space for the hash table of control sequences (which allows 10K
+% names as distributed).
+hash_extra = 50000
+
+% Max number of characters in all strings, including all error messages,
+% help texts, font names, control sequences. These values apply to TeX and MP.
+pool_size = 1250000
+% Minimum pool space after TeX/MP's own strings; must be at least
+% 25000 less than pool_size, but doesn't need to be nearly that large.
+string_vacancies = 90000
+% Maximum number of strings.
+max_strings = 100000
+% min pool space left after loading .fmt
+pool_free = 47500
+
+% Hyphenation trie. As distributed, the maximum is 65535; this should
+% work unless `unsigned short' is not supported or is smaller than 16
+% bits. This value should suffice for UK English, US English, French,
+% and German (for example). To increase, you must change
+% `ssup_trie_opcode' and `ssup_trie_size' in tex.ch (and rebuild TeX);
+% the trie will then consume four bytes per entry, instead of two.
+%
+% US English, German, and Portuguese: 30000.
+% German: 14000.
+% US English: 10000.
+%
+trie_size = 300000
+
+% Buffer size. TeX uses the buffer to contain input lines, but macro
+% expansion works by writing material into the buffer and reparsing the
+% line. As a consequence, certain constructs require the buffer to be
+% very large. As distributed, the size is 50000; most documents can be
+% handled within a tenth of this size.
+buf_size = 200000
+
+hyph_size = 8191 % prime number of hyphenation exceptions, >610, <32767.
+ % http://primes.utm.edu/curios/page.php/8191.html
+nest_size = 500 % simultaneous semantic levels (e.g., groups)
+max_in_open = 15 % simultaneous input files and error insertions
+param_size = 5000 % simultaneous macro parameters
+save_size = 5000 % for saving values outside current group
+stack_size = 1500 % simultaneous input sources
+
+% These are Omega-specific.
+ocp_buf_size = 20000 % character buffers for ocp filters.
+ocp_stack_size = 10000 % stacks for ocp computations.
+ocp_list_size = 1000 % control for multiple ocps.
+
+% Parameter specific to MetaPost.
+% Maximum number of knots between breakpoints of a path.
+% Set to 2000 by default.
+% path_size.mpost = 10000
+
+% These are pdftex-specific.
+obj_tab_size = 300000 % PDF objects
+dest_names_size = 300000 % destinations
+
+% These work best if they are the same as the I/O buffer size, but it
+% doesn't matter much. Must be a multiple of 8.
+dvi_buf_size = 16384 % TeX
+gf_buf_size = 16384 % MF
+
+% It's probably inadvisable to change these. At any rate, we must have:
+% 45 < error_line < 255;
+% 30 < half_error_line < error_line - 15;
+% 60 <= max_print_line;
+% These apply to Metafont and MetaPost as well.
+error_line = 79
+half_error_line = 50
+max_print_line = 79
diff --git a/Build/source/texk/kpathsea/tilde.c b/Build/source/texk/kpathsea/tilde.c
new file mode 100644
index 00000000000..b92bfe12e38
--- /dev/null
+++ b/Build/source/texk/kpathsea/tilde.c
@@ -0,0 +1,167 @@
+/* tilde.c: Expand user's home directories.
+
+ Copyright 1997, 98, 2005, Olaf Weber.
+ Copyright 1993, 95, 96, 97 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/tilde.h>
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+
+/* If NAME has a leading ~ or ~user, Unix-style, expand it to the user's
+ home directory, and return a new malloced string. If no ~, or no
+ <pwd.h>, just return NAME. */
+
+string
+kpse_tilde_expand P1C(const_string, name)
+{
+ const_string expansion;
+ const_string home;
+ const_string prefix;
+
+ assert (name);
+
+ /* If there is a leading "!!", set prefix to "!!", otherwise use
+ the empty string. After this, we can test whether a prefix was
+ found by checking *prefix, and it is safe to unconditionally
+ prepend it. */
+ if (name[0] == '!' && name[1] == '!') {
+ name += 2;
+ prefix = "!!";
+ } else {
+ prefix = "";
+ }
+
+ /* If no leading tilde, do nothing, and return the original string. */
+ if (*name != '~') {
+ if (*prefix)
+ name -= 2;
+ expansion = name;
+
+ /* If a bare tilde, return the home directory or `.'. (Very unlikely
+ that the directory name will do anyone any good, but ... */
+ } else if (name[1] == 0) {
+ home = getenv ("HOME");
+ if (!home) {
+ home = ".";
+ }
+ expansion = concat (prefix, home);
+
+ /* If `~/', remove any trailing / or replace leading // in $HOME.
+ Should really check for doubled intermediate slashes, too. */
+ } else if (IS_DIR_SEP (name[1])) {
+ unsigned c = 1;
+ home = getenv ("HOME");
+ if (!home) {
+ home = ".";
+ }
+ if (IS_DIR_SEP (*home) && IS_DIR_SEP (home[1])) { /* handle leading // */
+ home++;
+ }
+ if (IS_DIR_SEP (home[strlen (home) - 1])) { /* omit / after ~ */
+ c++;
+ }
+ expansion = concat3 (prefix, home, name + c);
+
+ /* If `~user' or `~user/', look up user in the passwd database (but
+ OS/2 doesn't have this concept. */
+ } else {
+#ifdef HAVE_PWD_H
+ struct passwd *p;
+ string user;
+ unsigned c = 2;
+ while (!IS_DIR_SEP (name[c]) && name[c] != 0) /* find user name */
+ c++;
+
+ user = (string) xmalloc (c);
+ strncpy (user, name + 1, c - 1);
+ user[c - 1] = 0;
+
+ /* We only need the cast here for (deficient) systems
+ which do not declare `getpwnam' in <pwd.h>. */
+ p = (struct passwd *) getpwnam (user);
+ free (user);
+
+ /* If no such user, just use `.'. */
+ home = p ? p->pw_dir : ".";
+ if (IS_DIR_SEP (*home) && IS_DIR_SEP (home[1])) { /* handle leading // */
+ home++;
+ }
+ if (IS_DIR_SEP (home[strlen (home) - 1]) && name[c] != 0)
+ c++; /* If HOME ends in /, omit the / after ~user. */
+
+ expansion = concat3 (prefix, home, name + c);
+#else /* not HAVE_PWD_H */
+ /* Since we don't know how to look up a user name, just return the
+ original string. */
+ if (*prefix)
+ name -= 2;
+ expansion = name;
+#endif /* not HAVE_PWD_H */
+ }
+ /* We may return the same thing as the original, and then we might not
+ be returning a malloc-ed string. Callers beware. Sorry. */
+ return (string) expansion;
+}
+
+#ifdef TEST
+
+void
+test_expand_tilde (const_string filename)
+{
+ string answer;
+
+ printf ("Tilde expansion of `%s':\t", filename ? filename : "(nil)");
+ answer = kpse_tilde_expand (filename);
+ puts (answer);
+}
+
+int
+main ()
+{
+ string tilde_path = "tilde";
+
+ test_expand_tilde ("");
+ test_expand_tilde ("none");
+ test_expand_tilde ("~root");
+ test_expand_tilde ("~");
+ test_expand_tilde ("foo~bar");
+
+ test_expand_tilde ("!!");
+ test_expand_tilde ("!!none");
+ test_expand_tilde ("!!~root");
+ test_expand_tilde ("!!~");
+ test_expand_tilde ("!!foo~bar");
+
+ return 0;
+}
+
+#endif /* TEST */
+
+
+/*
+Local variables:
+standalone-compile-command: "gcc -g -I. -I.. -DTEST tilde.c kpathsea.a"
+End:
+*/
diff --git a/Build/source/texk/kpathsea/tilde.h b/Build/source/texk/kpathsea/tilde.h
new file mode 100644
index 00000000000..81550e72ca3
--- /dev/null
+++ b/Build/source/texk/kpathsea/tilde.h
@@ -0,0 +1,33 @@
+/* tilde.h: Declare tilde expander.
+
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_TILDE_H
+#define KPATHSEA_TILDE_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+
+/* Replace a leading ~ or ~name in FILENAME with getenv ("HOME") or
+ name's home directory, respectively. FILENAME may not be null. */
+
+extern string kpse_tilde_expand P1H(const_string filename);
+
+#endif /* not KPATHSEA_TILDE_H */
diff --git a/Build/source/texk/kpathsea/truncate.c b/Build/source/texk/kpathsea/truncate.c
new file mode 100644
index 00000000000..2e764864c1c
--- /dev/null
+++ b/Build/source/texk/kpathsea/truncate.c
@@ -0,0 +1,59 @@
+/* truncate.c: truncate too-long components in a filename.
+
+ Copyright 1993, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-namemx.h>
+#include <kpathsea/c-pathch.h>
+#include <kpathsea/c-pathmx.h>
+#include <kpathsea/truncate.h>
+
+
+/* Truncate any too-long components in NAME, returning the result. It's
+ too bad this is necessary. See comments in readable.c for why. */
+
+string
+kpse_truncate_filename P1C(const_string, name)
+{
+ unsigned c_len = 0; /* Length of current component. */
+ unsigned ret_len = 0; /* Length of constructed result. */
+
+ /* Allocate enough space. */
+ string ret = (string) xmalloc (strlen (name) + 1);
+
+ for (; *name; name++)
+ {
+ if (IS_DIR_SEP (*name) || IS_DEVICE_SEP (*name))
+ { /* At a directory delimiter, reset component length. */
+ c_len = 0;
+ }
+ else if (c_len > NAME_MAX)
+ { /* If past the max for a component, ignore this character. */
+ continue;
+ }
+
+ /* Copy this character. */
+ ret[ret_len++] = *name;
+ c_len++;
+ }
+ ret[ret_len] = 0;
+
+ return ret;
+}
diff --git a/Build/source/texk/kpathsea/truncate.h b/Build/source/texk/kpathsea/truncate.h
new file mode 100644
index 00000000000..7af9ae858ce
--- /dev/null
+++ b/Build/source/texk/kpathsea/truncate.h
@@ -0,0 +1,32 @@
+/* truncate.h: truncate too-long components in a filename.
+
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_TRUNCATE_H
+#define KPATHSEA_TRUNCATE_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+/* Truncate any component in NAME longer than the system NAME_MAX, and
+ return the result as a malloced string. If none, return a copy of
+ NAME. */
+extern string kpse_truncate_filename P1H(const_string name);
+
+#endif /* not KPATHSEA_TRUNCATE_H */
diff --git a/Build/source/texk/kpathsea/types.h b/Build/source/texk/kpathsea/types.h
new file mode 100644
index 00000000000..09c020f9412
--- /dev/null
+++ b/Build/source/texk/kpathsea/types.h
@@ -0,0 +1,55 @@
+/* types.h: general types.
+
+ Copyright (C) 1993, 1995, 96, 2005 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_TYPES_H
+#define KPATHSEA_TYPES_H
+
+/* Booleans. */
+/* NeXT wants to define their own boolean type. */
+#ifndef HAVE_BOOLEAN
+#define HAVE_BOOLEAN
+typedef int boolean;
+/* `true' and `false' are reserved words in C++. */
+#ifndef __cplusplus
+#ifndef true
+#define true 1
+#define false 0
+#endif /* not true */
+#endif /* not __cplusplus */
+#endif /* not HAVE_BOOLEAN */
+
+/* The X library (among other things) defines `FALSE' and `TRUE', and so
+ we only want to define them if necessary, for use by application code. */
+#ifndef FALSE
+#define FALSE false
+#define TRUE true
+#endif /* FALSE */
+
+/* The usual null-terminated string. */
+typedef char *string;
+
+/* A pointer to constant data. (ANSI says `const string' is
+ `char * const', which is a constant pointer to non-constant data.) */
+typedef const char *const_string;
+
+/* A generic pointer. */
+typedef void *address;
+
+#endif /* not KPATHSEA_TYPES_H */
diff --git a/Build/source/texk/kpathsea/unixtex.ftp b/Build/source/texk/kpathsea/unixtex.ftp
new file mode 100644
index 00000000000..d0c6322141c
--- /dev/null
+++ b/Build/source/texk/kpathsea/unixtex.ftp
@@ -0,0 +1,151 @@
+`unixtex.ftp': Obtaining TeX
+============================
+
+This is `ftp://ftp.tug.org/tex/unixtex.ftp', last updated 26 December
+2003. Also available as `http://www.tug.org/unixtex.ftp'. The IP
+address is currently `[130.225.2.178]'. It is also in Kpathsea source
+distributions as `etc/unixtex.ftp' (although the network version is
+usually newer). Mail <tex-k@mail.tug.org> with comments or questions.
+
+ Following are general instructions for Unix or other sites who wish to
+acquire the Web2c distribution, (plain) TeX, LaTeX (2e), BibTeX,
+Metafont, MetaPost, DVI processors for the X window system, PostScript,
+the PCL language in the HP LaserJet, and related programs. They are
+oriented towards building from the original sources, though some
+information on alternative packages is included in the last section.
+See also `http://www.tug.org/web2c/', the Web2c and Kpathsea home page.
+
+ Please note that the Web2c distribution is a bare-bones distribution
+in source form, and building a complete installation from it is a
+non-trivial matter. For most uses, it is a better idea to install a
+distribution with pre-packaged binaries for your platform. The
+principal example of such a distribution is TeX Live
+(`http://www.tug.org/texlive/'), which is based on the Web2c sources.
+
+ Please consider joining the TeX Users Group (TUG) or another user
+group of your choice to help support the maintenance and development of
+the programs you retrieve. See `http://www.tug.org/join.html' for
+information and the membership registration form, and
+`http://www.tug.org/usergroups.html' for a listing of all user groups.
+
+ For actual installation instructions after obtaining the necessary
+sources, see *Note Installation::. A copy is in the distribution file
+`kpathsea/INSTALL'.
+
+Electronic distribution
+-----------------------
+
+In many places we refer to CTAN:. This is _both_ a host name and a
+directory name. Here are the primary locations:
+
+ `ftp://ctan.tug.org/tex-archive/' (Vermont, USA)
+ `ftp://ftp.dante.de/tex-archive/' (Germany)
+ `ftp://ftp.tex.ac.uk/tex-archive/' (England)
+
+CTAN has many mirrors worldwide; see the top-level file
+`README.mirrors' from one of the sites above or see
+`http://www.tug.org/CTAN.sites'.
+
+ You can also access CTAN via the World Wide Web, electronic mail, or
+NFS. The same `README.mirrors' file explains how.
+
+ You will need to retrieve some or all of the following archives,
+depending on your needs (don't forget to set binary mode for file
+transfers):
+
+`CTAN:/systems/web2c/web.tar.gz'
+ The original WEB source files, written primarily by Don Knuth.
+ Required unless you already have this `web' version. (The WEB
+ sources change irregularly with respect to Web2c itself.) Unpacks
+ into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/web2c.tar.gz'
+ The Web2c system. Required. Also unpacks into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/web2c-etex.tar.gz'
+ Additions to the Web2c system for building e-TeX. Optional.
+ Unpacks into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/etexlib.tar.gz'
+ Additions to the texmf tree needed to build e-TeX. Optional.
+ Unpacks into `texmf/'.
+
+`CTAN:/systems/web2c/etexdoc.tar.gz'
+ Documentation for e-TeX as an addition to the texmf tree.
+ Optional. Unpacks into `texmf/'.
+
+`CTAN:/systems/web2c/web2c-omega.tar.gz'
+ Additions to the Web2c system for building Omega. Optional.
+ Unpacks into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/omegalib.tar.gz'
+ Additions to the texmf tree needed to build Omega. Optional.
+ Unpacks into `texmf/'.
+
+`CTAN:/systems/web2c/omegadoc.tar.gz'
+ Documentation for Omega as an addition to the texmf tree.
+ Optional. Unpacks into `texmf/'.
+
+`CTAN:/systems/web2c/web2c-pdftex.tar.gz'
+ Additions to the Web2c system for building pdfTeX. Optional.
+ Unpacks into `web2c-VERSION'.
+
+`CTAN:/systems/web2c/pdftexlib.tar.gz'
+ Additions to the texmf tree needed to build pdfTeX. Optional.
+ Unpacks into `texmf/'.
+
+`CTAN:/dviware/xdvik/xdvik.tar.gz'
+ X window system DVI previewer. Unpacks into `xdvik-VERSION'.
+ Optional.
+
+ Additional drivers, macro files, and other support are needed to build
+a working system. These are available in teTeX.
+
+ All that said, the originating host for the software above is
+`ftp.tug.org'. You can retrieve these distributions (but not much
+else) from the `tex/' directory on that host.
+
+CD-ROM distribution
+-------------------
+
+Numerous organizations distribute various TeX CD-ROM's (and DVD's):
+
+ * Virtually all the TeX user groups collaborate to produce the `TeX
+ Live' distribution once a year; see `http://www.tug.org/texlive/'
+ for more information.
+
+ * The Free Software Foundation's `Source Code CD-ROM' contains the
+ minimal TeX source distribution described in the previous section
+ (i.e., enough to print GNU documentation); email <gnu@gnu.org>.
+
+ * Most Linux distributions include some TeX package based on Web2c;
+ see the Linux documentation file `Distribution-HOWTO' for a
+ comparison of Linux distributions, available (for example) via
+ `http://www.linux.org'.
+
+ If you know of additional TeX distributions to add to this list,
+please inform <tex-k@mail.tug.org>.
+
+Other TeX packages
+------------------
+
+Many other TeX implementations are available in `CTAN:/systems',
+including ready-to-run distributions for Unix, Amiga, Acorn, VMS,
+Macintosh, DOS, and Windows (in various forms). Although Web2c has
+support in the source code for many operating systems, and in fact some
+of the other distributions are based on it, it's unlikely to work as
+distributed on anything but Unix. (Please contribute improvements!)
+
+ The principal user-oriented Unix distribution based on Web2c is the
+teTeX distribution. It includes complete sources, and runs on all
+modern Unix variants, including Linux. It contains many TeX-related
+programs besides those in the core Web2c.
+
+ The host labrea.stanford.edu is the original source for the files for
+which Donald Knuth is directly responsible: `tex.web', `plain.tex',
+etc. However, unless you want to build your TeX library tree ab initio,
+it is more reliable and less work to retrieve these files as part of
+the above packages. In any case, labrea is not the canonical source for
+anything except what was created by Stanford TeX project, so do not
+rely on all the files available at that ftp site being up-to-date.
+
diff --git a/Build/source/texk/kpathsea/unixtex.texi b/Build/source/texk/kpathsea/unixtex.texi
new file mode 100644
index 00000000000..19cf159f465
--- /dev/null
+++ b/Build/source/texk/kpathsea/unixtex.texi
@@ -0,0 +1,286 @@
+@ifclear version
+@defcodeindex fl
+@defcodeindex op
+@end ifclear
+
+@node unixtex.ftp
+@section @file{unixtex.ftp}: Obtaining @TeX{}
+
+@cindex obtaining @TeX{}
+@cindex retrieving @TeX{}
+
+@flindex unixtex.ftp
+@flindex tug.org
+@flindex www.tug.org
+@flindex ftp.tug.org
+This
+@iftex
+chapter
+@end iftex
+is @uref{ftp://ftp.tug.org/tex/unixtex.ftp}, last updated 26 December
+2003. Also available as @uref{http://www.tug.org/unixtex.ftp}. The
+IP address is currently @code{[130.225.2.178]}. It is also in
+Kpathsea source distributions as @file{etc/unixtex.ftp} (although the
+network version is usually newer). Mail @email{tex-k@@mail.tug.org}
+with comments or questions.
+
+Following are general instructions for Unix or other sites who wish to
+acquire the Web2c distribution, (plain) @TeX{}, La@TeX{} (2e),
+Bib@TeX{}, Metafont, MetaPost, DVI processors for the X window system,
+PostScript, the PCL language in the HP LaserJet, and related programs.
+They are oriented towards building from the original sources, though
+some information on alternative packages is included in the last
+section. See also @uref{http://www.tug.org/web2c/}, the Web2c and
+Kpathsea home page.
+
+Please note that the Web2c distribution is a bare-bones distribution
+in source form, and building a complete installation from it is a
+non-trivial matter. For most uses, it is a better idea to install a
+distribution with pre-packaged binaries for your platform. The
+principal example of such a distribution is @TeX{} Live
+(@uref{http://www.tug.org/texlive/}), which is based on the
+Web2c sources.
+
+Please consider joining the @TeX{} Users Group (TUG) or another user
+group of your choice to help support the maintenance and development
+of the programs you retrieve. See @uref{http://www.tug.org/join.html}
+for information and the membership registration form, and
+@uref{http://www.tug.org/usergroups.html} for a listing of all user groups.
+
+For actual installation instructions after obtaining the necessary
+sources, see @ref{Installation}. A copy is in the distribution file
+@file{kpathsea/INSTALL}.
+
+@menu
+* Electronic distribution:: CTAN and so forth.
+* CD-ROM distribution::
+* Other TeX packages::
+@end menu
+
+@c * Tape distribution::
+@c used to be in this menu.
+
+@node Electronic distribution
+@subsection Electronic distribution
+
+@cindex ftp retrieval
+@cindex obtaining Web2c by ftp
+@cindex distributions, via ftp
+
+@cindex CTAN, defined
+@cindex backbone of CTAN
+In many places we refer to @var{CTAN:}. This is @emph{both} a host name
+and a directory name. Here are the primary locations:
+
+@example
+@uref{ftp://ctan.tug.org/tex-archive/} @r{(Vermont, USA)}
+@uref{ftp://ftp.dante.de/tex-archive/} @r{(Germany)}
+@uref{ftp://ftp.tex.ac.uk/tex-archive/} @r{(England)}
+@end example
+
+@noindent
+@flindex README.mirrors
+@flindex CTAN.sites
+@cindex mirrors, FTP
+CTAN has many mirrors worldwide; see the top-level file
+@file{README.mirrors} from one of the sites above or see
+@uref{http://www.tug.org/CTAN.sites}.
+
+@cindex World Wide Web CTAN access
+@cindex email CTAN access
+@cindex NFS CTAN access
+You can also access CTAN via the World Wide Web, electronic
+mail, or NFS. The same @file{README.mirrors} file explains how.
+
+@cindex binary mode, for file transfers
+You will need to retrieve some or all of the following archives,
+depending on your needs (don't forget to set binary mode for file
+transfers):
+
+@table @asis
+@item @file{@var{CTAN:}/systems/web2c/web.tar.gz}
+@cindex Knuth, Donald E., original author
+The original WEB source files, written primarily by Don Knuth. Required
+unless you already have this @file{web} version. (The WEB sources
+change irregularly with respect to Web2c itself.) Unpacks into
+@file{web2c-@var{version}}.
+
+@item @file{@var{CTAN:}/systems/web2c/web2c.tar.gz}
+The Web2c system. Required. Also unpacks into
+@file{web2c-@var{version}}.
+
+@item @file{@var{CTAN:}/systems/web2c/web2c-etex.tar.gz}
+Additions to the Web2c system for building e-@TeX{}. Optional. Unpacks
+into @file{web2c-@var{version}}.
+
+@item @file{@var{CTAN:}/systems/web2c/etexlib.tar.gz}
+Additions to the texmf tree needed to build e-@TeX{}. Optional.
+Unpacks into @file{texmf/}.
+
+@item @file{@var{CTAN:}/systems/web2c/etexdoc.tar.gz}
+Documentation for e-@TeX{} as an addition to the texmf tree. Optional.
+Unpacks into @file{texmf/}.
+
+@item @file{@var{CTAN:}/systems/web2c/web2c-omega.tar.gz}
+Additions to the Web2c system for building Omega. Optional. Unpacks
+into @file{web2c-@var{version}}.
+
+@item @file{@var{CTAN:}/systems/web2c/omegalib.tar.gz}
+Additions to the texmf tree needed to build Omega. Optional. Unpacks
+into @file{texmf/}.
+
+@item @file{@var{CTAN:}/systems/web2c/omegadoc.tar.gz}
+Documentation for Omega as an addition to the texmf tree. Optional.
+Unpacks into @file{texmf/}.
+
+@item @file{@var{CTAN:}/systems/web2c/web2c-pdftex.tar.gz}
+Additions to the Web2c system for building pdf@TeX{}. Optional.
+Unpacks into @file{web2c-@var{version}}.
+
+@item @file{@var{CTAN:}/systems/web2c/pdftexlib.tar.gz}
+Additions to the texmf tree needed to build pdf@TeX{}. Optional.
+Unpacks into @file{texmf/}.
+
+@item @file{@var{CTAN:}/dviware/xdvik/xdvik.tar.gz}
+X window system DVI previewer. Unpacks into @file{xdvik-@var{version}}.
+Optional.
+@end table
+
+Additional drivers, macro files, and other support are needed to build
+a working system. These are available in te@TeX{}.
+
+All that said, the originating host for the software above is
+@file{ftp.tug.org}. You can retrieve these distributions (but not much
+else) from the @file{tex/} directory on that host.
+
+
+@node CD-ROM distribution
+@subsection CD-ROM distribution
+
+@cindex CD-ROM distributions
+@cindex obtaining Web2c on CD-ROM
+@cindex distributions, on CD-ROM
+
+Numerous organizations distribute various @TeX{} CD-ROM's (and DVD's):
+
+@itemize @bullet
+@item
+@cindex @TeX{} Live CD-ROM
+Virtually all the @TeX{} user groups collaborate to produce the
+@cite{@TeX{} Live} distribution once a year; see
+@uref{http://www.tug.org/texlive/} for more information.
+
+@item
+@cindex Free Software Foundation
+@cindex FSF Source Code CD-ROM
+The Free Software Foundation's @cite{Source Code CD-ROM} contains the
+minimal @TeX{} source distribution described in the previous section
+(i.e., enough to print GNU documentation); email
+@email{gnu@@gnu.org}.
+
+@c Commented out: the information is outdated in way or another.
+
+@c @item
+@c The Gateway@! CD-ROM set contains a runnable NetBSD/Amiga distribution
+@c and sources; see @url{http://www.netbsd.org/Sites/cdroms.html}.
+
+@c @item
+@c The InfoMagic CD-ROM is a copy of CTAN (see previous section); see
+@c @url{http://www.infomagic.com}.
+
+@c @item
+@c @cindex 4all@TeX{} Live CD-ROM
+@c @cindex NTG
+@c NTG (Dutch-speaking @TeX{} user group) produced the 4all@TeX{} CD-ROM;
+@c email @email{ntg@@nic.surfnet.nl}, or see
+@c @url{http://www.ntg.nl/4allcd/}. This is a runnable system.
+
+@c @item
+@c @cindex Prime Time @TeX{}cetera CD-ROM
+@c The Prime Time @TeX{}cetera CD-ROM is also a copy of CTAN; email
+@c @email{ptf@@ctcl.com} or see @url{http://www.ptf.com/ptf/}.
+
+@c @item
+@c @cindex Walnut Creek @TeX{} CD-ROM
+@c Walnut Creek's @TeX{} CD-ROM is also a copy of CTAN; email
+@c @email{info@@cdrom.com} or see
+@c @url{http://www.cdrom.com:/titles/tex.html}.
+
+@item
+@cindex Linux, using Web2c
+Most Linux distributions include some @TeX{} package based on
+Web2c; see the Linux documentation file @samp{Distribution-HOWTO} for a
+comparison of Linux distributions, available (for example) via
+@uref{http://www.linux.org}.
+@end itemize
+
+If you know of additional @TeX{} distributions to add to this
+list, please inform @email{tex-k@@mail.tug.org}.
+
+@ignore
+
+@node Tape distribution
+@subsection Tape distribution
+
+@cindex tape distribution
+@cindex obtaining @TeX{} on tape
+@cindex distributions, on tape
+
+@cindex Northwest Computing Support Center
+@flindex unixtex@@u.washington.edu
+@cindex support organization
+You can obtain a complete @TeX{} distribution, including Web2c, on tape.
+Contact:
+@display
+Pierre MacKay / Denny Hall, Mail Stop DH-10 / Department of Classics
+University of Washington / Seattle, WA 98195 / USA
+phone: 206-543-2268; email: @email{unixtex@@u.washington.edu}
+@end display
+
+At this writing, the distribution is available in @code{tar} format on
+4@dmn{mm} DAT cartridges, and the
+cost is US$210. Make checks payable to the University of Washington,
+drawn on a U.S. bank. Purchase orders are acceptable, but they carry an
+extra charge of $10 to pay for invoice processing. Overseas sites,
+please add $20 for shipment via air parcel post, or $30 for shipment via
+courier.
+
+@end ignore
+
+@node Other TeX packages
+@subsection Other @TeX{} packages
+
+@cindex other @TeX{} distributions
+@cindex @TeX{} distributions besides Web2c
+
+@cindex Amiga @TeX{} implementations
+@cindex Acorn @TeX{} implementations
+@cindex VMS @TeX{} implementations
+@cindex Macintosh @TeX{} implementations
+@cindex DOS @TeX{} implementations
+@cindex Windows @TeX{} implementations
+Many other @TeX{} implementations are available in
+@file{@var{CTAN:}/systems}, including ready-to-run distributions for
+Unix, Amiga, Acorn, VMS, Macintosh, DOS, and Windows (in various forms).
+Although Web2c has support in the source code for many operating
+systems, and in fact some of the other distributions are based on it,
+it's unlikely to work as distributed on anything but Unix. (Please
+contribute improvements!)
+
+@cindex te@TeX{}
+@cindex precompiled Unix binaries
+The principal user-oriented Unix distribution based on Web2c is the
+te@TeX{} distribution. It includes complete sources, and runs on
+all modern Unix variants, including Linux. It contains many
+@TeX{}-related programs besides those in the core Web2c.
+
+@flindex labrea.stanford.edu
+@cindex Knuth, Donald E., archive of programs by
+The host @t{labrea.stanford.edu} is the original source for the files
+for which Donald Knuth is directly responsible: @file{tex.web},
+@file{plain.tex}, etc. However, unless you want to build your @TeX{}
+library tree ab initio, it is more reliable and less work to retrieve
+these files as part of the above packages. In any case, @t{labrea} is
+not the canonical source for anything except what was created by
+Stanford @TeX{} project, so do not rely on all the files available at
+that ftp site being up-to-date.
diff --git a/Build/source/texk/kpathsea/uppercasify.c b/Build/source/texk/kpathsea/uppercasify.c
new file mode 100644
index 00000000000..77445da5fe3
--- /dev/null
+++ b/Build/source/texk/kpathsea/uppercasify.c
@@ -0,0 +1,38 @@
+/* uppercasify.c: change all lowercase letters to uppercase.
+
+ Copyright 1993 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-ctype.h>
+
+
+string
+uppercasify P1C(const_string, s)
+{
+ string target;
+ string ret = xstrdup (s);
+
+ for (target = ret; *target; target++)
+ {
+ *target = TOUPPER (*target);
+ }
+
+ return ret;
+}
diff --git a/Build/source/texk/kpathsea/variable.c b/Build/source/texk/kpathsea/variable.c
new file mode 100644
index 00000000000..079850386a7
--- /dev/null
+++ b/Build/source/texk/kpathsea/variable.c
@@ -0,0 +1,273 @@
+/* variable.c: variable expansion.
+
+ Copyright 1997, 99, 2001, 02, 05 Olaf Weber.
+ Copyright 1993, 94, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/cnf.h>
+#include <kpathsea/fn.h>
+#include <kpathsea/variable.h>
+
+
+/* Here's the simple one, when a program just wants a value. */
+
+string
+kpse_var_value P1C(const_string, var)
+{
+ string vtry, ret;
+
+ assert(kpse_program_name);
+
+ /* First look for VAR.progname. */
+ vtry = concat3(var, ".", kpse_program_name);
+ ret = getenv (vtry);
+ free (vtry);
+
+ if (!ret || !*ret) {
+ /* Now look for VAR_progname. */
+ vtry = concat3(var, "_", kpse_program_name);
+ ret = getenv (vtry);
+ free (vtry);
+ }
+
+ if (!ret || !*ret)
+ ret = getenv (var);
+
+ if (!ret || !*ret)
+ ret = kpse_cnf_get (var);
+
+ if (ret)
+ ret = kpse_var_expand (ret);
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_VARS))
+ DEBUGF2("variable: %s = %s\n", var, ret ? ret : "(nil)");
+#endif
+
+ return ret;
+}
+
+/* We have to keep track of variables being expanded, otherwise
+ constructs like TEXINPUTS = $TEXINPUTS result in an infinite loop.
+ (Or indirectly recursive variables, etc.) Our simple solution is to
+ add to a list each time an expansion is started, and check the list
+ before expanding. */
+
+typedef struct {
+ const_string var;
+ boolean expanding;
+} expansion_type;
+static expansion_type *expansions; /* The sole variable of this type. */
+static unsigned expansion_len = 0;
+
+static void
+expanding P2C(const_string, var, boolean, xp)
+{
+ unsigned e;
+ for (e = 0; e < expansion_len; e++) {
+ if (STREQ (expansions[e].var, var)) {
+ expansions[e].expanding = xp;
+ return;
+ }
+ }
+
+ /* New variable, add it to the list. */
+ expansion_len++;
+ XRETALLOC (expansions, expansion_len, expansion_type);
+ expansions[expansion_len - 1].var = xstrdup (var);
+ expansions[expansion_len - 1].expanding = xp;
+}
+
+
+/* Return whether VAR is currently being expanding. */
+
+static boolean
+expanding_p P1C(const_string, var)
+{
+ unsigned e;
+ for (e = 0; e < expansion_len; e++) {
+ if (STREQ (expansions[e].var, var))
+ return expansions[e].expanding;
+ }
+
+ return false;
+}
+
+/* Append the result of value of `var' to EXPANSION, where `var' begins
+ at START and ends at END. If `var' is not set, do not complain.
+ This is a subroutine for the more complicated expansion function. */
+
+static void
+expand P3C(fn_type *, expansion, const_string, start, const_string, end)
+{
+ string value;
+ unsigned len = end - start + 1;
+ string var = (string)xmalloc (len + 1);
+ strncpy (var, start, len);
+ var[len] = 0;
+
+ if (expanding_p (var)) {
+ WARNING1 ("kpathsea: variable `%s' references itself (eventually)", var);
+ } else {
+ string vtry = concat3 (var, "_", kpse_program_name);
+ /* Check for an environment variable. */
+ value = getenv (vtry);
+ free (vtry);
+
+ if (!value || !*value)
+ value = getenv (var);
+
+ /* If no envvar, check the config files. */
+ if (!value || !*value)
+ value = kpse_cnf_get (var);
+
+ if (value) {
+ expanding (var, true);
+ value = kpse_var_expand (value);
+ expanding (var, false);
+ fn_grow (expansion, value, strlen (value));
+ free (value);
+ }
+
+ free (var);
+ }
+}
+
+/* Can't think of when it would be useful to change these (and the
+ diagnostic messages assume them), but ... */
+#ifndef IS_VAR_START /* starts all variable references */
+#define IS_VAR_START(c) ((c) == '$')
+#endif
+#ifndef IS_VAR_CHAR /* variable name constituent */
+#define IS_VAR_CHAR(c) (ISALNUM (c) || (c) == '_')
+#endif
+#ifndef IS_VAR_BEGIN_DELIMITER /* start delimited variable name (after $) */
+#define IS_VAR_BEGIN_DELIMITER(c) ((c) == '{')
+#endif
+#ifndef IS_VAR_END_DELIMITER
+#define IS_VAR_END_DELIMITER(c) ((c) == '}')
+#endif
+
+
+/* Maybe we should support some or all of the various shell ${...}
+ constructs, especially ${var-value}. */
+
+string
+kpse_var_expand P1C(const_string, src)
+{
+ const_string s;
+ string ret;
+ fn_type expansion;
+ expansion = fn_init ();
+
+ /* Copy everything but variable constructs. */
+ for (s = src; *s; s++) {
+ if (IS_VAR_START (*s)) {
+ s++;
+
+ /* Three cases: `$VAR', `${VAR}', `$<anything-else>'. */
+ if (IS_VAR_CHAR (*s)) {
+ /* $V: collect name constituents, then expand. */
+ const_string var_end = s;
+
+ do {
+ var_end++;
+ } while (IS_VAR_CHAR (*var_end));
+
+ var_end--; /* had to go one past */
+ expand (&expansion, s, var_end);
+ s = var_end;
+
+ } else if (IS_VAR_BEGIN_DELIMITER (*s)) {
+ /* ${: scan ahead for matching delimiter, then expand. */
+ const_string var_end = ++s;
+
+ while (*var_end && !IS_VAR_END_DELIMITER (*var_end))
+ var_end++;
+
+ if (! *var_end) {
+ WARNING1 ("%s: No matching } for ${", src);
+ s = var_end - 1; /* will incr to null at top of loop */
+ } else {
+ expand (&expansion, s, var_end - 1);
+ s = var_end; /* will incr past } at top of loop*/
+ }
+
+ } else {
+ /* $<something-else>: error. */
+ WARNING2 ("%s: Unrecognized variable construct `$%c'", src, *s);
+ /* Just ignore those chars and keep going. */
+ }
+ } else
+ fn_1grow (&expansion, *s);
+ }
+ fn_1grow (&expansion, 0);
+
+ ret = FN_STRING (expansion);
+ return ret;
+}
+
+#ifdef TEST
+
+static void
+test_var (string test, string right_answer)
+{
+ string result = kpse_var_expand (test);
+
+ printf ("expansion of `%s'\t=> %s", test, result);
+ if (!STREQ (result, right_answer))
+ printf (" [should be `%s']", right_answer);
+ putchar ('\n');
+}
+
+
+int
+main ()
+{
+ test_var ("a", "a");
+ test_var ("$foo", "");
+ test_var ("a$foo", "a");
+ test_var ("$foo a", " a");
+ test_var ("a$foo b", "a b");
+
+ xputenv ("FOO", "foo value");
+ test_var ("a$FOO", "afoo value");
+
+ xputenv ("Dollar", "$");
+ test_var ("$Dollar a", "$ a");
+
+ test_var ("a${FOO}b", "afoo valueb");
+ test_var ("a${}b", "ab");
+
+ test_var ("$$", ""); /* and error */
+ test_var ("a${oops", "a"); /* and error */
+
+ return 0;
+}
+
+#endif /* TEST */
+
+
+/*
+Local variables:
+standalone-compile-command: "gcc -g -I. -I.. -DTEST variable.c kpathsea.a"
+End:
+*/
diff --git a/Build/source/texk/kpathsea/variable.h b/Build/source/texk/kpathsea/variable.h
new file mode 100644
index 00000000000..07d549852c6
--- /dev/null
+++ b/Build/source/texk/kpathsea/variable.h
@@ -0,0 +1,44 @@
+/* variable.h: Declare variable expander.
+
+ Copyright (C) 1993, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_VARIABLE_H
+#define KPATHSEA_VARIABLE_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+
+/* Return the (variable-expanded) environment variable value or config
+ file value, or NULL. */
+extern KPSEDLL string kpse_var_value P1H(const_string var);
+
+/* Expand $VAR and ${VAR} references in SRC, returning the (always newly
+ dynamically-allocated) result. An unterminated ${ or any other
+ character following $ produce error messages, and that part of SRC is
+ ignored. In the $VAR form, the variable name consists of consecutive
+ letters, digits, and underscores. In the ${VAR} form, the variable
+ name consists of whatever is between the braces.
+
+ In any case, ``expansion'' means calling `getenv'; if the variable is not
+ set, look in texmf.cnf files for a definition. If not set there, either,
+ the expansion is the empty string (no error). */
+extern KPSEDLL string kpse_var_expand P1H(const_string src);
+
+#endif /* not KPATHSEA_VARIABLE_H */
diff --git a/Build/source/texk/kpathsea/version.c b/Build/source/texk/kpathsea/version.c
new file mode 100644
index 00000000000..df54fd9f669
--- /dev/null
+++ b/Build/source/texk/kpathsea/version.c
@@ -0,0 +1,36 @@
+/* version.c: version number for libkpathsea.
+
+ Copyright 1997, 99, 2005 Olaf Weber.
+ Copyright 1993, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include "c-auto.h"
+#include <kpathsea/c-proto.h>
+
+KPSEDLL char *kpathsea_version_string = (char *) KPSEVERSION;
+
+/* If you are redistributing a modified version of my original
+ distribution, please change this address.
+
+ Also change the address in makempx.in, mpto.c, and newer.c in
+ web2c/mpware/, and in dvilj/dvihp.
+
+ Thanks. --kb@cs.umb.edu */
+
+KPSEDLL char *kpse_bug_address = (char *)
+ "Email bug reports to tex-k@mail.tug.org.\n";
diff --git a/Build/source/texk/kpathsea/win32.mak b/Build/source/texk/kpathsea/win32.mak
new file mode 100644
index 00000000000..cd9fe7a6a4d
--- /dev/null
+++ b/Build/source/texk/kpathsea/win32.mak
@@ -0,0 +1,359 @@
+################################################################################
+#
+# Makefile : Web2C / Kpathsea
+# Author : Fabrice Popineau <Fabrice.Popineau@supelec.fr>
+# Platform : Win32, Microsoft VC++ 6.0, depends upon fpTeX 0.5 sources
+# Time-stamp: <03/06/22 01:11:48 popineau>
+#
+################################################################################
+root_srcdir=..\..
+!ifdef DEVELOPMENT
+INCLUDE=$(INCLUDE);$(root_srcdir)\texk.development
+!else
+INCLUDE=$(INCLUDE);$(root_srcdir)\texk
+!endif
+
+# Add -DNO_DEBUG to disable debugging, for vanishingly better performance.
+
+USE_KPATHSEA = 1
+USE_GNUW32 = 1
+MAKE_KPATHSEA = 1
+USE_GETURL = 1
+USE_REGEX = 1
+USE_GSW32 = 1
+USE_INET = 1
+#USE_NETWORK = 1
+#USE_NETWORK2 = 1
+# USE_MKTEX = 1
+
+!include <msvc/common.mak>
+
+kpathseadir=.
+
+{$(root_srcdir)/libs/libgnuw32}.c{$(objdir)}.obj:
+ $(compile) $<
+
+{$(root_srcdir)/libs/regex}.c{$(objdir)}.obj:
+ $(compile) $<
+
+DEFS = $(DEFS) -DHAVE_CONFIG_H -DHAVE_GETURL \
+ -DNO_MULTIPLE_EXTENSIONS -UNORMALIZED \
+ -DHASH_SHARED -DHASH_MAPPING_NAME=\"$(library_prefix)_hash_mapping\"
+
+# Put $(objdir)\tex-file.obj first, because it's what depends on the paths, and may
+# reduce frustration if the paths are wrong by doing it first.
+
+objects = $(objdir)\tex-file.obj \
+ $(objdir)\absolute.obj \
+ $(objdir)\atou.obj \
+ $(objdir)\cnf.obj \
+ $(objdir)\concat.obj \
+ $(objdir)\concat3.obj \
+ $(objdir)\concatn.obj \
+ $(objdir)\db.obj \
+ $(objdir)\debug.obj \
+ $(objdir)\dir.obj \
+ $(objdir)\elt-dirs.obj \
+ $(objdir)\expand.obj \
+ $(objdir)\extend-fname.obj \
+ $(objdir)\find-suffix.obj \
+ $(objdir)\fn.obj \
+ $(objdir)\fontmap.obj \
+ $(objdir)\getopt.obj \
+ $(objdir)\getopt1.obj \
+ $(objdir)\hash.obj \
+ $(objdir)\win32hash.obj \
+ $(objdir)\kdefault.obj \
+ $(objdir)\line.obj \
+ $(objdir)\magstep.obj \
+ $(objdir)\make-suffix.obj \
+ $(objdir)\path-elt.obj \
+ $(objdir)\pathsearch.obj \
+ $(objdir)\proginit.obj \
+ $(objdir)\progname.obj \
+ $(objdir)\readable.obj \
+ $(objdir)\remote.obj \
+ $(objdir)\rm-suffix.obj \
+ $(objdir)\str-list.obj \
+ $(objdir)\str-llist.obj \
+ $(objdir)\tex-glyph.obj \
+ $(objdir)\tex-hush.obj \
+ $(objdir)\tex-make.obj \
+ $(objdir)\tilde.obj \
+ $(objdir)\truncate.obj \
+ $(objdir)\uppercasify.obj \
+ $(objdir)\variable.obj \
+ $(objdir)\version.obj \
+ $(objdir)\xbasename.obj \
+ $(objdir)\xcalloc.obj \
+ $(objdir)\xdirname.obj \
+ $(objdir)\xfopen.obj \
+ $(objdir)\xfseek.obj \
+ $(objdir)\xftell.obj \
+ $(objdir)\xgetcwd.obj \
+ $(objdir)\xmalloc.obj \
+ $(objdir)\xputenv.obj \
+ $(objdir)\xrealloc.obj \
+ $(objdir)\xstrdup.obj \
+ $(liblobjs) \
+ $(malloc)
+
+liblobjs = \
+ $(objdir)\error.obj \
+ $(objdir)\lookcmd.obj \
+ $(objdir)\stat.obj \
+ $(objdir)\system.obj \
+ $(objdir)\popen.obj \
+# $(objdir)\dirent.obj \
+ $(objdir)\user.obj \
+ $(objdir)\time.obj \
+ $(objdir)\volume.obj \
+ $(objdir)\filename.obj \
+ $(objdir)\home.obj
+
+programs = \
+ $(objdir)\kpsewhich.exe \
+ $(objdir)\kpsecheck.exe \
+ $(objdir)\kpsestat.exe \
+ $(objdir)\access.exe
+
+default: all
+
+all: $(objdir) $(kpathsea) $(programs) info man
+
+lib: $(objdir) $(kpathsealib)
+
+!ifdef KPSE_DLL
+DEFS = $(DEFS) -DMAKE_KPSE_DLL
+
+$(kpathsealib): $(objects)
+ $(archive) /DEF $(objects)
+
+$(kpathseadll): $(objects) $(objdir)\kpathsea.res $(geturllib) # $(mktexlib)
+ $(link_dll) $(**) $(kpathsealib:.lib=.exp) $(conlibs)
+!else
+$(kpathsealib): $(objects) $(geturllib) # $(mktexlib)
+ $(archive) $(**)
+!endif
+
+$(objdir)\kpsewhich.exe: $(objdir)\kpsewhich.obj $(objdir)\kpsewhich.res $(kpathsealib)
+ $(link) $(**) $(conlibs)
+
+$(objdir)\kpsecheck.exe: $(objdir)\kpsecheck.obj $(objdir)\fnmatch.obj $(gsw32lib) $(kpathsealib)
+ $(link) $(**) $(conlibs)
+
+$(objdir)\kpsestat.exe: $(objdir)\kpsestat.obj $(gnuw32lib)
+ $(link) $(**) $(conlibs)
+
+$(objdir)\access.exe: $(objdir)\access.obj
+ $(link) $(objdir)\access.obj $(conlibs)
+
+$(objdir)\kpsewhich.obj: kpsewhich.c
+ $(compile) -UMAKE_KPSE_DLL kpsewhich.c
+
+$(objdir)\kpsecheck.obj: kpsecheck.c
+ $(compile) -UMAKE_KPSE_DLL kpsecheck.c
+
+$(objdir)\kpsestat.obj: kpsestat.c
+ $(compile) -UMAKE_KPSE_DLL -UKPSE_DLL kpsestat.c
+
+$(objdir)\access.obj: access.c
+ $(compile) access.c
+
+
+# Make variable substitutions for paths.h.
+texmf.cnf: texmf.in texmf.sed
+ $(sed) -e "/^[^%]/s/:/;/g" texmf.in \
+ | $(sed) -e "/^TEXMFMAIN/s/@texmf@/$$SELFAUTOPARENT\/texmf/" \
+ | $(sed) -e "/^TEXMFCNF/s/\(.*\);[^;]*;\([^;]*\);@web2c@/\1;\2;@web2c@/" \
+ | $(sed) -f texmf.sed \
+# Better to ensure c:/TeX is choosen, instead of e:/...
+# | $(sed) -e "s%$(prefix:\=/)%c:/TeX%g" \
+ >$@
+
+# makevars.mk -- the directory names we pass.
+# It's important that none of these values contain [ @%], for the sake
+# of kpathsea/texmf.sed.
+makevars = prefix=$(prefix) exec_prefix=$(exec_prefix) \
+ bindir=$(bindir) scriptdir=$(scriptdir) libdir=$(libdir) \
+ datadir=$(datadir) infodir=$(infodir) includedir=$(includedir) \
+ manext=$(manext) mandir=$(mandir) \
+ texmf=$(texmf) web2cdir=$(web2cdir) vartexfonts=$(vartexfonts)\
+ texinputdir=$(texinputdir) mfinputdir=$(mfinputdir) mpinputdir=$(mpinputdir)\
+ fontdir=$(fontdir) fmtdir=$(fmtdir) basedir=$(basedir) memdir=$(memdir) \
+ texpooldir=$(texpooldir) mfpooldir=$(mfpooldir) mppooldir=$(mppooldir) \
+ dvips_plain_macrodir=$(dvips_plain_macrodir) \
+ dvilj_latex2e_macrodir=$(dvilj_latex2e_macrodir) \
+ dvipsdir=$(dvipsdir) psheaderdir=$(psheaderdir) \
+ default_texsizes="$(default_texsizes)"
+# End of makevars.mk.
+
+# The idea is to turn each var=value into s%@var@%value%g. Seems simpler
+# to put the substitutions in a file than to play shell quoting games.
+texmf.sed: $(win32makedir)/paths.mak
+ -@$(del) texmf.sed
+ @echo <<makevars.txt
+$(makevars)
+<<KEEP
+ type makevars.txt \
+ | $(sed) -e "s%$(prefix:\=/)%$$PREFIX%g" \
+ | $(sed) -e "s/ [ ]*/ /g" -e "s@\\@/@g" \
+ | $(tr) " " "\012" \
+ | $(sed) -e "s%$$PREFIX%$(prefix:\=/)%g" \
+ | $(sed) -f $(win32seddir)/texmfsed.sed \
+# | $(sed) -e "s/^/s%@/" -e "s/=/@%/" -e "s/$$/%/" -e "s/$$/g/" \
+ > $@
+# Insert $TEXMF in as many of the hardwired paths as possible. We could
+# use the slightly different rule 's%$(texmf)/%\$$TEXMF/%g' and avoid
+# the need for the corrections below. But if texmf.in is edited
+# the heuristic may no longer work.
+ echo s%$(texmf:\=/)%$$TEXMF%g>>$@
+# Now we repair the damage this may have caused. Don't replace the rhs of
+# the TEXMFMAIN assignment itself, then we'd end up with TEXMFMAIN = $TEXMF
+# and TEXMF = $TEXMFMAIN. The (commented) assignment of TEXMFLOCAL is
+# likely to have been mangled as well.
+ echo /^ *TEXMFMAIN[ =]/s%\$$TEXMF%$(texmf:\=/)%>>$@
+ echo /^[% ]*TEXMFLOCAL[ =]/s%\$$TEXMF%$(texmf:\=/)%>>$@
+# echo /^[% ]*TEXMF_CNF[ =]/s%\$$TEXMF%$(texmf:\=/)%>>$@
+# echo /^[% ]*TEXMFCNF[ =]/s%\$$TEXMF%$(texmf:\=/)%>>$@
+# And fill in the last clause of TEXMFCNF with an absolute path.
+ echo /^ *TEXMFCNF[ =]/s%@web2c@%$(web2cdir:\=/)%>>$@
+ -@$(del) makevars.txt
+
+# First null out comments and leading/trailing whitespace, then remove
+# lines that define invalid C identifiers, then remove blank lines and
+# lines that define lowercase values (those are never path values). Each
+# line remaining looks like
+# <name> = <value>
+# (but = and surrounding spaces are optional, hence can't remove all spaces).
+# Change this to #ifndef DEFAULT_name@#define DEFAULT_name "value"@#endif,
+# then change the @'s to newlines (sed isn't good at multiline replacements).
+#
+# No backslash-newline escapes in the long sed replacement because that
+# will turn into a space in the output.
+#
+# Without the $TEXMF/prefix/etc. substitutions, if the cnf file was
+# not found, the compile-time paths would be of little use, since TEXMF
+# (etc.) wouldn't be defined. Alternatively, we could have a way to
+# specify compile-time default values for variables in general, but I
+# think it's better to keep the last-resort paths as simple as possible.
+#
+# The definition of DEFAULT_TEXMF (and other variables)
+# that winds up in the final paths.h will not be used.
+#
+# We don't want to rewrite paths.h when we have only changed comments
+# in texmf.in that have no effect on paths.h, since that would cause
+# almost everything to be rebuilt.
+#
+# We also replace all semicolons with colons in the paths. Ultimately
+# the path-splitting code should be changed to understand both.
+$(kpathseadir)/paths.h: stamp-paths
+stamp-paths: texmf.cnf
+ echo /* paths.h: Generated from texmf.cnf. */ > paths.tmp
+ $(sed) -e "s/%.*//" -e "s/^[ ]*//" -e "s/[ ]*$$//" texmf.cnf \
+ | $(grep) "^[ ]*[A-Z0-9_]*[ =]" \
+ | $(sed) "/^$$/d" \
+ | $(sed) "s/^\([^ =]*\)[ ]*=*[ ]*\(.*\)/#ifndef DEFAULT_\1@#define DEFAULT_\1 \"\2\"@#endif/" \
+ | $(tr) @ "\012" \
+ | $(sed) -e "s@\$$TEXMFMAIN@$(texmf:\=/)@g" \
+ -e "s@\$$TEXMF@$(texmf:\=/)@g" \
+ -e "s@\$$VARTEXFONTS@c:/tex/fonts@g" \
+ -e "s@\$$web2cdir@$(web2cdir:\=/)@g" \
+ -e "s@\$$prefix@$(prefix:\=/)@g" \
+# Better to ensure c:/Program Files/TeXLive is choosen, instead of e:/...
+ -e "s@$(prefix:\=/)@c:/Program Files/TeXLive@g" \
+# | $(sed) -e "s%;%:%g" \
+ >>paths.tmp
+# fc paths.h paths.tmp > nul
+# if %ERRORLEVEL% NEQ 0 \
+# echo copying paths.tmp paths.h\
+# & $(CP) paths.tmp paths.h
+# $(del) paths.tmp
+ $(copy) paths.tmp paths.h & $(del) paths.tmp
+ date /t > stamp-paths
+ time /t >> stamp-paths
+
+!include <msvc/config.mak>
+
+# Need an extra definition for this. Dependencies included below.
+$(objdir)\tex-file.obj:
+ $(compile) -DDEFAULT_FONT_SIZES=\"$(default_texsizes)\" tex-file.c
+
+check: $(objdir)\kpsewhich.exe
+ .\$(objdir)\kpsewhich -expand-var $$TEXMF
+
+install:: all install-exec install-data
+
+install-exec::
+ -@$(mkdir) $(bindir) $(libdir) $(web2cdir) 2>nul
+ -@echo $(verbose) & for %i in ($(kpathseadll) $(programs)) do \
+ $(copy) %i $(bindir) $(redir_stdout)
+
+install-data:: install-info install-doc install-man kpathsea.h
+# Should we install the headers? They are not just system-dependent,
+# which is bad enough, but even compiler-dependent.
+ -@$(mkdir) $(includedir)\kpathsea 2>nul
+ -@echo $(verbose) & for %f in (*.h) do \
+ $(copy) %f $(includedir)\kpathsea $(redir_stdout)
+ -@$(del) $(includedir)\kpathsea\acconfig.h
+
+# I don't use this, but other programmers want it. acconfig.h is an
+# autoheader input file, not an includable C header. Bad name.
+kpathsea.h: always
+ -@$(del) $@
+ @echo off <<$@
+#include <kpathsea/config.h>
+<<KEEP
+ dir /b *.h | grep -v "\(acconfig\|config\|kpathsea\|win32lib\|c-auto\)\.h" \
+ | $(sed) -e "s,^,#include <kpathsea/," -e s",$$,>," >>$@
+# touch -r `ls -1t *.h | tail +2 | head -1` $@
+always:
+.PHONY: always
+
+# The manual pages
+manfiles = access.1 kpsestat.1 kpsewhich.1 \
+ mktexlsr.1 mktexmf.1 mktextfm.1 mktexpk.1
+
+infofiles = kpathsea.info
+docsubdir = kpathsea
+pdfdocfiles = kpathsea.pdf
+htmldocfiles = kpathsea.html
+
+!include <msvc/install.mak>
+
+info: kpathsea.info
+dvi: kpathsea.dvi
+ps: kpathsea.ps
+
+kpathsea.info: kpathsea.texi bugs.texi hier.texi install.texi unixtex.texi
+ -$(makeinfo) $(makeinfo_flags) kpathsea.texi -o $@
+
+!IFDEF MAINT
+INSTALL.txt: install.texi
+ $(makefinfo) $(one_info) $(MAKEINFO_FLAGS) install.texi -o $@
+ $(perl) $(win32perldir)\add-info-toc.pl $@
+ $(copy) $@ $(@:.txt=) $(redir_stderr)
+BUGS: bugs.texi
+ $(makefinfo) $(one_info) $(MAKEINFO_FLAGS) bugs.texi -o $@
+ $(perl) $(win32perldir)\add-info-toc.pl $@
+HIER: hier.texi
+ $(makefinfo) $(one_info) $(MAKEINFO_FLAGS) hier.texi -o $@
+unixtex.ftp: unixtex.texi
+ $(makefinfo) $(one_info) $(MAKEINFO_FLAGS) unixtex.texi -o $@
+doc: info dvi ps HIER BUGS INSTALL unixtex.ftp
+!endif
+
+!include <msvc/clean.mak>
+
+extraclean::
+ -@echo $(verbose) & ($(del) kpathsea*.html kpathsea*.pdf) 2>nul
+
+distclean::
+ -@$(del) paths.h texmf.cnf texmf.sed
+
+!include <msvc/rdepend.mak>
+!include "./depend.mak"
+
+# Local Variables:
+# mode: Makefile
+# End:
diff --git a/Build/source/texk/kpathsea/win32hash.c b/Build/source/texk/kpathsea/win32hash.c
new file mode 100644
index 00000000000..1c1252b3797
--- /dev/null
+++ b/Build/source/texk/kpathsea/win32hash.c
@@ -0,0 +1,760 @@
+/* hash.c: hash table operations.
+
+Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 Karl Berry & Olaf Weber.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-ctype.h>
+
+#include <kpathsea/hash.h>
+#include <kpathsea/str-list.h>
+
+#ifdef HAVE_GETURL
+#include <kpathsea/remote.h>
+#endif
+
+/* The hash function. We go for simplicity here. */
+
+/* All our hash tables are related to filenames. */
+#ifdef MONOCASE_FILENAMES
+#if defined(WIN32) && !defined(__i386_pc_gnu__)
+/* This is way faster under Win32. */
+#define TRANSFORM(x) ((unsigned)CharLower((LPTSTR)(BYTE)(x)))
+#else
+#define TRANSFORM(x) (tolower(x))
+#endif
+#else
+#define TRANSFORM(x) (x)
+#endif
+
+#define MAX_HASH_TABLES 64
+
+#define HASH_NULL(ptr) (ptr == hash_memory)
+#define HASH_PTR(ptr) ((char *)hash_memory + (unsigned long)(ptr))
+#define HASH_REL(rel) ((unsigned long)((char *)(rel) - (char *)hash_memory))
+#define HASH_BUCKETS(table, n) (*((hash_element_type **)((char *)hash_memory + (unsigned long)table->buckets + (n) * sizeof(hash_element_type *))))
+/* #define HASH_BUCKETS(table, n) *((hash_element_type **)(HASH_PTR((unsigned long) ((hash_element_type **)HASH_PTR(table->buckets))[n]))) */
+HANDLE hash_handle = 0;
+void *hash_memory = NULL;
+static unsigned long hash_memory_allocated = 0;
+unsigned long hash_memory_size = 8L*1024L*1024L;
+
+typedef struct _hash_memory_description {
+ unsigned long sig;
+ unsigned long memory_size;
+ unsigned long first_free_address;
+ unsigned long hash_offsets[MAX_HASH_TABLES];
+ unsigned long db_dir_list_len;
+ unsigned long db_dir_list;
+} hash_memory_description;
+
+hash_memory_description *hash_bloc;
+
+/* We need to protect initialisation and insert / lookup */
+static HANDLE hash_mutex;
+static boolean hash_init_done = false;
+
+extern str_list_type db_dir_list;
+
+void hash_restore_str_list(unsigned long ptr, unsigned len, str_list_type *l);
+void hash_save_str_list(str_list_type l);
+
+#if 0
+extern unsigned hash P2H(hash_table_type *table, const_string key);
+#ifdef NORMALIZED
+extern unsigned hash_normalized P2H(hash_table_type *table, const_string key);
+#endif
+#else
+static unsigned
+hash P2C(hash_table_type *, table, const_string, key)
+{
+ unsigned n = 0;
+
+ // fprintf(stderr, "Hashing %s to ", key);
+
+ /* Our keys aren't often anagrams of each other, so no point in
+ weighting the characters. */
+ while (*key != 0)
+ n = (n + n + TRANSFORM (*key++)) % table->size;
+
+ // fprintf(stderr, "%d\n", n);
+
+ return n;
+}
+
+#ifdef NORMALIZED
+/* Identical has function as above, but does not normalize keys. */
+static unsigned
+hash_normalized P2C(hash_table_type *, table, const_string, key)
+{
+ unsigned n = 0;
+
+ // fprintf(stderr, "Hashing (normalized) %s to ", key);
+
+ /* Our keys aren't often anagrams of each other, so no point in
+ weighting the characters. */
+ while (*key != 0)
+ n = (n + n + (*key++)) % table->size;
+
+ // fprintf(stderr, "%d\n", n);
+
+ return n;
+}
+#endif
+#endif
+
+/*
+ This function will be registered by atexit() to be called upon
+ program termination. It will free resources allocated for
+ hash-tables. It has to be registered only once, when the very first
+ hash-table is allocated.
+*/
+void CDECL
+hash_cleanup (void)
+{
+#ifdef HAVE_GETURL
+ cleanup_remote_files();
+#endif
+
+ if (hash_memory != NULL) {
+ if (UnmapViewOfFile(hash_memory) == 0) {
+ /* Report an error */
+ WARNING2("Can't UnMapViewOfFile(%x) (Error %d)!\n", hash_memory, GetLastError());
+ }
+ hash_memory = NULL;
+ }
+
+ if (hash_handle) {
+ if (CloseHandle(hash_handle) == 0) {
+ /* Report an error */
+ WARNING2("Can't CloseHandle(%x) (Error %d)!\n", hash_handle, GetLastError());
+ }
+ hash_handle = NULL;
+ }
+
+ if (hash_mutex) {
+ if (CloseHandle(hash_mutex) == 0) {
+ /* Report an error */
+ WARNING2("Can't CloseHandle(%x) (Error %d)!\n", hash_mutex, GetLastError());
+ }
+ hash_mutex = NULL;
+ }
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SHM))
+ DEBUGF1("Cleaned up shared hash tables, %ld memory was allocated.\n", hash_memory_allocated);
+#endif
+}
+
+KPSEDLL boolean hash_init_needed = false;
+
+boolean
+hash_lock(boolean force)
+{
+ int dwWaitResult;
+
+ if (!force && !hash_init_done)
+ return true;
+
+ /* Request ownership of mutex. */
+ dwWaitResult = WaitForSingleObject(hash_mutex, 25000L);
+
+ switch (dwWaitResult) {
+ /* The thread got mutex ownership. */
+ case WAIT_OBJECT_0:
+ return true;
+
+ /* Cannot get mutex ownership due to time-out. */
+ case WAIT_TIMEOUT:
+ WARNING("Timeout waiting to lock shared memory access!\n");
+ return false;
+
+ /* Got ownership of the abandoned mutex object. */
+ case WAIT_ABANDONED:
+ WARNING("Waiting to lock shared memory access abandoned!\n");
+ return false;
+ }
+
+ return false;
+}
+
+void
+hash_unlock(void)
+{
+ if (! hash_init_done)
+ return;
+
+ if (ReleaseMutex(hash_mutex) == 0) {
+ FATAL2("%s: Can't ReleaseMutex() access to shared memory databases (Error %d)!\n", kpse_program_name, GetLastError());
+ }
+}
+
+static void
+hash_start_init()
+{
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SHM))
+ DEBUGF1("%s: Start of shared hash tables initialisation.\n", kpse_program_name);
+#endif
+ hash_lock(true);
+}
+
+void
+hash_end_init()
+{
+ hash_init_done = true;
+ hash_unlock();
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SHM))
+ DEBUGF1("%s: End of shared hash tables initialisation.\n", kpse_program_name);
+#endif
+}
+
+void
+hash_init (void)
+{
+ SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
+
+ hash_init_done = false;
+ if ((hash_mutex = CreateMutex(NULL, FALSE, "kpse_initialization")) == 0) {
+ FATAL1("Can't CreateMutex() for shared memory locking (Error %d)!\n", GetLastError());
+ }
+
+ if ((hash_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, TRUE, HASH_MAPPING_NAME)) == 0) {
+
+ hash_start_init();
+
+ /* First call, need to allocate memory. */
+ if ((hash_handle = CreateFileMapping(INVALID_HANDLE_VALUE, &sa, PAGE_READWRITE,
+ 0, hash_memory_size, HASH_MAPPING_NAME)) == 0) {
+ /* Report an error. */
+ FATAL2("Can't CreateFileMapping() of size %ul (Error %d)!\n", hash_memory_size, GetLastError());
+ };
+ atexit(hash_cleanup);
+ hash_init_needed = true;
+ }
+
+ if ((hash_memory = MapViewOfFile(hash_handle, FILE_MAP_ALL_ACCESS, 0, 0, 0)) == NULL) {
+ /* Report an error. */
+ FATAL2("Can't MapViewOfFile(%x) (Error %d)!\n", hash_handle, GetLastError());
+ }
+
+ hash_bloc = (hash_memory_description *)hash_memory;
+ if (hash_init_needed) {
+ /* Is it more efficient to zero the whole block first ? */
+ ZeroMemory(hash_memory, sizeof(hash_bloc));
+ hash_bloc->sig = sizeof(hash_memory_description);
+ hash_bloc->memory_size = hash_memory_size;
+ hash_bloc->first_free_address = sizeof(hash_memory_description);
+ }
+ else {
+ extern boolean first_search;
+
+ hash_start_init();
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SHM))
+ DEBUGF1("Reusing shared hash tables at %x.\n", hash_memory);
+#endif
+
+ assert(hash_bloc->sig == sizeof(hash_memory_description));
+ /*
+ We could be a little bit cleaner here, just
+ relying on the hashtable_instances enumeration.
+ */
+ cnf_hash = (hash_table_type *)hash_exists_p(hashtable_cnf);
+ db = (hash_table_type *)hash_exists_p(hashtable_db);
+ alias_db = (hash_table_type *)hash_exists_p(hashtable_alias);
+ map = (hash_table_type *)hash_exists_p(hashtable_map);
+ link_table = (hash_table_type *)hash_exists_p(hashtable_links);
+ remote_db = (hash_table_type *)hash_exists_p(hashtable_remote);
+
+ db_dir_list = str_list_init();
+ /* Awful kludge ! */
+ first_search = false;
+ hash_restore_str_list(hash_bloc->db_dir_list, hash_bloc->db_dir_list_len, &db_dir_list);
+
+ }
+}
+
+void
+hash_reinit()
+{
+ if (!hash_init_needed) {
+ fprintf(stderr, "%s: your `ls-R' database files have been modified\n", kpse_program_name);
+ fprintf(stderr, "while kpathsea Dll was loaded by other programs.\n");
+ fprintf(stderr, "It is recommended that you terminate all of them.\n");
+ fprintf(stderr, "in order to reinitialize the shared databases.\n");
+ }
+}
+
+boolean
+hash_extend_memory ()
+{
+ /* We need to allocate a new memory bloc twice the size
+ of the previous one, copy everything and free the previous block.
+ */
+ SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
+ HANDLE new_hash_handle = 0;
+ void *new_hash_memory = NULL;
+ unsigned long new_hash_memory_size = 2 * hash_memory_size;
+
+ assert(hash_memory != NULL);
+
+ /* First, create some private unnamed bloc */
+ if ((new_hash_handle = CreateFileMapping(INVALID_HANDLE_VALUE, &sa, PAGE_READWRITE,
+ 0, new_hash_memory_size, NULL)) == 0) {
+ /* Report an error. */
+ FATAL2("Can't CreateFileMapping() of size %ul (Error %d)!\n", new_hash_memory_size, GetLastError());
+ };
+
+ if ((new_hash_memory = MapViewOfFile(new_hash_handle, FILE_MAP_ALL_ACCESS, 0, 0, 0)) == NULL) {
+ /* Report an error. */
+ FATAL2("Can't MapViewOfFile(%x) (Error %d)!\n", new_hash_handle, GetLastError());
+ }
+ /* Copy the data */
+ CopyMemory(new_hash_memory, hash_memory, hash_memory_size);
+ /* Cleanup handles */
+ hash_cleanup();
+ /* make the values point to the new bloc */
+ hash_memory_size = new_hash_memory_size;
+ hash_memory = new_hash_memory;
+ hash_handle = new_hash_handle;
+
+ /* Now, create the actual named, shareable bloc */
+ if ((new_hash_handle = CreateFileMapping(INVALID_HANDLE_VALUE, &sa, PAGE_READWRITE,
+ 0, hash_memory_size, HASH_MAPPING_NAME)) == 0) {
+ /* Report an error. */
+ FATAL2("Can't CreateFileMapping() of size %ul (Error %d)!\n", new_hash_memory_size, GetLastError());
+ };
+
+ if ((new_hash_memory = MapViewOfFile(new_hash_handle, FILE_MAP_ALL_ACCESS, 0, 0, 0)) == NULL) {
+ /* Report an error. */
+ FATAL2("Can't MapViewOfFile(%x) (Error %d)!\n", new_hash_handle, GetLastError());
+ }
+ /* Copy the data */
+ CopyMemory(new_hash_memory, hash_memory, hash_memory_size);
+ /* Cleanup the handles */
+ hash_cleanup();
+
+ hash_memory = new_hash_memory;
+ hash_handle = new_hash_handle;
+ hash_bloc = (hash_memory_description *)hash_memory;
+
+ return true;
+}
+
+unsigned long
+hash_malloc P1C(unsigned, size)
+{
+ unsigned long ret = hash_bloc->first_free_address;
+ hash_bloc->first_free_address += size;
+
+ if ((unsigned long)hash_bloc->first_free_address > (unsigned long)hash_bloc->memory_size) {
+ if (! hash_extend_memory()) {
+ fprintf(stderr, "Memory exhausted: base = %x, first_free_address = %x, size = %x\n",
+ hash_memory, hash_bloc->first_free_address, hash_bloc->memory_size);
+ }
+ }
+ assert((unsigned long)hash_bloc->first_free_address < (unsigned long)hash_bloc->memory_size);
+
+ hash_memory_allocated += size;
+
+ return ret;
+}
+
+unsigned long
+hash_strdup P1C(const_string, p)
+{
+ unsigned long q = hash_malloc(strlen(p)+1);
+ memcpy(HASH_PTR(q), p, strlen(p)+1);
+ return q;
+}
+
+void
+hash_free P1C(void *, address)
+{
+ /* Don't want to play with this for the moment.
+ Hash-Tables just grow up, no need to remove
+ anything from them. The `hash_remove' function
+ is only called from contrib/variables.c .
+ */
+}
+
+void
+hash_save_str_list(str_list_type l)
+{
+ unsigned int i;
+ unsigned long *q;
+ assert(hash_bloc != NULL);
+ hash_bloc->db_dir_list_len = STR_LIST_LENGTH(l);
+
+ if (hash_bloc->db_dir_list_len == 0) return;
+
+ hash_bloc->db_dir_list = hash_malloc(hash_bloc->db_dir_list_len * sizeof(unsigned long));
+ for (i = 0, q = (unsigned long *)HASH_PTR(hash_bloc->db_dir_list);
+ i < hash_bloc->db_dir_list_len;
+ i++, q++) {
+ *q = hash_strdup(STR_LIST_ELT(l, i));
+ }
+}
+
+void
+hash_restore_str_list(unsigned long ptr, unsigned len, str_list_type *l)
+{
+ int i;
+ unsigned long *q;
+ for (i = 0, q = (unsigned long *)HASH_PTR(ptr);
+ i < len;
+ i++, q++) {
+ str_list_add (l, HASH_PTR(*q));
+ }
+#if 0
+ fprintf(stderr, "Restored db_dir_list :\n");
+ for (i = 0; i < STR_LIST_LENGTH(*l); i++) {
+ fprintf(stderr, "\t%s\n", STR_LIST_ELT(*l, i));
+ }
+#endif
+}
+
+hash_table_type *
+hash_exists_p P1C(hashtable_instances, hash_number)
+{
+ unsigned long rel;
+
+ assert(hash_memory != NULL);
+ assert(hash_bloc != NULL);
+
+#if 0
+ fprintf(stderr, "Looking up for table %d ... ", hash_number);
+#endif
+ if (hash_bloc) {
+ if (rel = hash_bloc->hash_offsets[hash_number]) {
+#if 0
+ fprintf(stderr, "found (%x) for %d\n", (char *)hash_memory + rel, hash_number);
+#endif
+ return (hash_table_type *)((char *)hash_memory + rel);
+ }
+ }
+#if 0
+ fprintf(stderr, "found (null) for %d\n", hash_number);
+#endif
+ return NULL;
+}
+
+hash_table_type *
+hash_create P2C(unsigned, size, hashtable_instances, hash_number)
+{
+ /* hash_table_type ret; changed into "static ..." to work around gcc
+ optimizer bug for Alpha. */
+ static hash_table_type *ret;
+ unsigned b;
+
+ if (hash_memory == NULL) {
+ hash_init();
+ }
+
+ if (ret = hash_exists_p(hash_number)) {
+ assert(size == ret->size);
+ return ret;
+ }
+
+ hash_lock(false);
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SHM))
+ DEBUGF2("Hash: creating shared hash table %u of size %u\n", hash_number, size);
+#endif
+
+ hash_bloc->hash_offsets[hash_number] = hash_malloc(sizeof(hash_table_type));
+ ret = (hash_table_type *)HASH_PTR(hash_bloc->hash_offsets[hash_number]);
+
+ ret->buckets = (hash_element_type **)hash_malloc(size * sizeof(hash_element_type *));
+ ret->size = size;
+
+ /* calloc's zeroes aren't necessarily NULL, so be safe. */
+ for (b = 0; b <ret->size; b++)
+ HASH_BUCKETS(ret, b) = NULL;
+
+ hash_unlock();
+
+ return ret;
+}
+
+#if 0
+/* Not really usable. */
+hash_table_type *
+hash_reset P1C(hashtable_instances, hash_number)
+{
+ /* hash_table_type ret; changed into "static ..." to work around gcc
+ optimizer bug for Alpha. */
+ static hash_table_type *ret;
+ unsigned b;
+
+ if (hash_memory == NULL
+ || (ret = hash_exists_p(hash_number)) == NULL) {
+ return NULL;
+ }
+
+ hash_lock(false);
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_SHM))
+ DEBUGF1("Hash: resetting shared hash table %u\n", hash_number);
+#endif
+
+ /* calloc's zeroes aren't necessarily NULL, so be safe. */
+ for (b = 0; b <ret->size; b++)
+ HASH_BUCKETS(ret, b) = NULL;
+
+ hash_unlock();
+
+ return ret;
+}
+
+#endif
+/* WARNING: the comment below is frightening !
+ However, it does not seem to be the case that the strings
+ are changed after being inserted in the map.
+ IHMO, this should be strictly forbidden.
+*/
+/* Whether or not KEY is already in MAP, insert it and VALUE. Do not
+ duplicate the strings, in case they're being purposefully shared. */
+
+void
+hash_insert P3C(hash_table_type *, table, const_string, key,
+ const_string, value)
+{
+
+ unsigned n = hash (table, key);
+ unsigned long new_elt;
+
+ hash_lock(false);
+
+ new_elt = hash_malloc(sizeof(hash_element_type));
+
+ ((hash_element_type *)(HASH_PTR(new_elt)))->key = (const_string)hash_strdup(key);
+ ((hash_element_type *)(HASH_PTR(new_elt)))->value = (const_string)hash_strdup(value);
+ ((hash_element_type *)(HASH_PTR(new_elt)))->next = NULL;
+
+ /* Insert the new element at the end of the list. */
+ if (! HASH_BUCKETS(table, n))
+ /* first element in bucket is a special case. */
+ HASH_BUCKETS(table, n) = (hash_element_type *)new_elt;
+ else
+ {
+ hash_element_type *loc = (hash_element_type *)HASH_PTR(HASH_BUCKETS(table, n));
+ while (loc->next) /* Find the last element. */
+ loc = (hash_element_type *)HASH_PTR(loc->next);
+ loc->next = (hash_element_type *)new_elt; /* Insert the new one after. */
+ }
+
+ hash_unlock();
+}
+
+#ifdef NORMALIZED
+/* Same as above, for normalized keys. */
+void
+hash_insert_normalized P3C(hash_table_type *, table,
+ const_string, key,
+ const_string, value)
+{
+ unsigned n = hash_normalized (table, key);
+ unsigned long new_elt;
+
+ hash_lock(false);
+
+ new_elt = hash_malloc(sizeof(hash_element_type));
+
+ ((hash_element_type *)(HASH_PTR(new_elt)))->key = (const_string)hash_strdup(key);
+ ((hash_element_type *)(HASH_PTR(new_elt)))->value = (const_string)hash_strdup(value);
+ ((hash_element_type *)(HASH_PTR(new_elt)))->next = NULL;
+
+ /* Insert the new element at the end of the list. */
+ if (! HASH_BUCKETS(table, n))
+ /* first element in bucket is a special case. */
+ HASH_BUCKETS(table, n) = (hash_element_type *)new_elt;
+ else
+ {
+ hash_element_type *loc = (hash_element_type *)HASH_PTR(HASH_BUCKETS(table, n));
+ while (loc->next) /* Find the last element. */
+ loc = (hash_element_type *)HASH_PTR(loc->next);
+ loc->next = (hash_element_type *)new_elt; /* Insert the new one after. */
+ }
+
+ hash_unlock();
+}
+#endif /* WIN32*/
+
+/* Remove a (KEY, VALUE) pair. */
+
+void
+hash_remove P3C(hash_table_type *, table, const_string, key,
+ const_string, value)
+{
+ hash_element_type *p;
+ hash_element_type *q;
+ unsigned n = hash (table, key);
+
+ hash_lock(false);
+
+ /* Find pair. */
+ for (q = NULL, p = (hash_element_type *)HASH_PTR(HASH_BUCKETS(table, n)); ! HASH_NULL(p); q = p, p = (hash_element_type *)HASH_PTR(p->next))
+ if (FILESTRCASEEQ (key, HASH_PTR(p->key)) && STREQ (value, HASH_PTR(p->value)))
+ break;
+ if (p) {
+ /* We found something, remove it from the chain. */
+ if (q) q->next = p->next; else HASH_BUCKETS(table, n) = p->next;
+ /* We cannot dispose of the contents. */
+ hash_free ((void *)HASH_REL(p));
+ }
+
+ hash_unlock();
+}
+
+/* Look up STR in MAP. Return a (dynamically-allocated) list of the
+ corresponding strings or NULL if no match. */
+
+#ifdef KPSE_DEBUG
+/* Print the hash values as integers if this is nonzero. */
+boolean kpse_debug_hash_lookup_int = false;
+#endif
+
+string *
+hash_lookup P2C(hash_table_type *, table, const_string, key)
+{
+ hash_element_type *p;
+ str_list_type ret;
+ unsigned n = hash (table, key);
+
+ ret = str_list_init ();
+
+ hash_lock(false);
+
+ /* Look at everything in this bucket. */
+ for (p = (hash_element_type *)HASH_PTR(HASH_BUCKETS(table, n)); ! HASH_NULL(p); p = (hash_element_type *)HASH_PTR(p->next))
+ if (FILESTRCASEEQ (key, HASH_PTR(p->key)))
+ /* Cast because the general str_list_type shouldn't force const data. */
+ str_list_add (&ret, (string) xstrdup((string)HASH_PTR(p->value)));
+
+ /* If we found anything, mark end of list with null. */
+ if (STR_LIST (ret))
+ str_list_add (&ret, NULL);
+
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_HASH))
+ {
+ DEBUGF1 ("hash_shared_lookup(%s) =>", key);
+ if (!STR_LIST (ret))
+ fputs (" (nil)\n", stderr);
+ else
+ {
+ string *r;
+ for (r = STR_LIST (ret); *r; r++)
+ {
+ putc (' ', stderr);
+ if (kpse_debug_hash_lookup_int)
+ fprintf (stderr, "%ld", (long) *r);
+ else
+ fputs (*r, stderr);
+ }
+ putc ('\n', stderr);
+ }
+ fflush (stderr);
+ }
+#endif
+
+ hash_unlock();
+
+ return STR_LIST (ret);
+}
+
+/* We only print nonempty buckets, to decrease output volume. */
+
+void
+hash_print P2C(hash_table_type *, table, boolean, summary_only)
+{
+ unsigned b;
+ unsigned total_elements = 0, total_buckets = 0;
+
+ if (table == NULL) return;
+
+ hash_lock(false);
+
+ for (b = 0; b < table->size; b++) {
+ hash_element_type *bucket = (hash_element_type *)HASH_PTR(HASH_BUCKETS(table, b));
+
+ if (! HASH_NULL(bucket)) {
+ unsigned len = 1;
+ hash_element_type *tb;
+
+ total_buckets++;
+ if (!summary_only) fprintf (stderr, "%4d ", b);
+
+ for (tb = (hash_element_type *)HASH_PTR(bucket->next); ! HASH_NULL(tb); tb = (hash_element_type *)HASH_PTR(tb->next))
+ len++;
+ if (!summary_only) fprintf (stderr, ":%-5d", len);
+ total_elements += len;
+
+ if (!summary_only) {
+ for (tb = bucket; ! HASH_NULL(tb); tb = (hash_element_type *)HASH_PTR(tb->next))
+ fprintf (stderr, " %s=>%s", HASH_PTR(tb->key), HASH_PTR(tb->value));
+ putc ('\n', stderr);
+ }
+ }
+ }
+
+ hash_unlock();
+
+ fprintf (stderr,
+ "%u buckets, %u nonempty (%u%%); %u entries, average chain %.1f.\n",
+ table->size,
+ total_buckets,
+ 100 * total_buckets / table->size,
+ total_elements,
+ total_buckets ? total_elements / (double) total_buckets : 0.0);
+}
+
+/* Simple iterator over hash-table elements */
+void
+hash_iter P2C(hash_table_type *, table, hash_iter_fn, fn)
+{
+ unsigned b;
+
+ if (! table) return;
+
+ hash_lock(false);
+
+ for (b = 0; b < table->size; b++) {
+ hash_element_type *bucket = (hash_element_type *)HASH_PTR(HASH_BUCKETS(table, b));
+ if (! HASH_NULL(bucket)) {
+ unsigned len = 1;
+ hash_element_type *tb;
+ for (tb = bucket; ! HASH_NULL(tb); tb = (hash_element_type *)HASH_PTR(tb->next)) {
+#ifdef KPSE_DEBUG
+ if (KPSE_DEBUG_P (KPSE_DEBUG_HASH))
+ {
+ DEBUGF2("applying (shared) fn to %s%s\n", HASH_PTR(tb->value), HASH_PTR(tb->key));
+ }
+#endif
+ (*fn)(HASH_PTR(tb->key), HASH_PTR(tb->value));
+ }
+ }
+ }
+
+ hash_unlock();
+}
diff --git a/Build/source/texk/kpathsea/withenable.ac b/Build/source/texk/kpathsea/withenable.ac
new file mode 100644
index 00000000000..b0010cd7a3b
--- /dev/null
+++ b/Build/source/texk/kpathsea/withenable.ac
@@ -0,0 +1,103 @@
+dnl withenable.ac: --with and --enable options.
+
+dnl --enable-maintainer-mode as implemented in automake.
+AM_MAINTAINER_MODE
+
+dnl These are standard among *NIX systems, but not when cross-compiling
+AC_DEFUN([CF_SUBST],
+[AC_MSG_CHECKING(for $1 (symbol $2))
+AC_CACHE_VAL(cf_cv_subst_$2,[
+test -z "[$]$2" && $2=$3
+cf_cv_subst_$2=[$]$2])
+$2=${cf_cv_subst_$2}
+AC_MSG_RESULT([$]$2)
+AC_SUBST($2)
+])dnl
+CF_SUBST(loader,LD,ld)
+CF_SUBST(archiver,AR,ar)
+CF_SUBST(archiver options,ARFLAGS,rc)
+
+AC_ARG_WITH([mktexmf-default],
+[ --without-mktexmf-default do not run mktexmf if MF source missing],
+ , [with_mktexmf_default=yes])
+AC_ARG_WITH([mktexpk-default],
+[ --without-mktexpk-default do not run mktexpk if PK font missing],
+ , [with_mktexpk_default=yes])
+AC_ARG_WITH([mktextfm-default],
+[ --without-mktextfm-default do not run mktextfm if TFM file missing],
+ , [with_mktextfm_default=yes])
+AC_ARG_WITH([mkocp-default],
+[ --without-mkocp-default do not run mkocp if OCP file missing],
+ , [with_mkocp_default=yes])
+AC_ARG_WITH([mkofm-default],
+[ --without-mkofm-default do not run mkofm if OFM file missing],
+ , [with_mkofm_default=yes])
+AC_ARG_WITH([mktexfmt-default],
+[ --with-mktexfmt-default run mktexfmt if format file missing])
+AC_ARG_WITH([mktextex-default],
+[ --with-mktextex-default run mktextex if TeX source missing],
+ [with_mktextex_default=yes], [with_mktextex_default=no])
+
+dnl Check whether we can find a texmf tree. Look at the most common spots.
+dnl Not a switch, but something that must be included everywhere, even at
+dnl at the top level, so putting it in common.ac is not enough.
+AC_MSG_CHECKING(where the main texmf tree is located)
+case $prefix in
+ */) prefix=`echo "$prefix" | sed 's@/*$@@'`;;
+esac
+texmfmain=
+if test "x$datadir" != 'x${prefix}/share'; then
+ # First case, datadir is defined...
+ eval p=\"$datadir\"
+ # Unconditionally set the directory, but...
+ texmfmain=`echo "$p/texmf" | sed 's,//*,/,g'`
+ # ... do complain if it wasn't found.
+ if test -d "$texmfmain"; then
+ AC_MSG_RESULT("$texmfmain")
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_WARN([No texmf tree found at $texmfmain.
+ *****************************************************************
+ * Error: The main texmf tree was not found. *
+ * If you do not have the files, you should be able to them from *
+ * the same place you got these sources from, or from one of the *
+ * CTAN hosts. *
+ *****************************************************************
+ Winging it.])
+ fi
+else
+ # Second case, datadir is default...
+ if test "x$prefix" = "xNONE"; then
+ p="$ac_default_prefix"
+ else
+ eval p=\"$prefix\"
+ fi
+ for e in share/texmf lib/texmf texmf; do
+ if test -d "$p/$e"; then
+ texmfmain='${prefix}'/"$e"
+ break
+ fi
+ done
+ if test -z "$texmfmain" && test "x$prefix" = "xNONE"; then
+ # Still no texmfmain found, no prefix set, perhaps kpsewhich is
+ # installed and can help us out.
+ texmfmain=`kpsewhich --expand-path='$TEXMFMAIN'` 2>/dev/null
+ fi
+ texmfmain=`echo "$texmfmain" | sed 's,//*,/,g'`
+ if test -n "$texmfmain"; then
+ AC_MSG_RESULT("$texmfmain")
+ else
+ eval texmfmain="$datadir/texmf"
+ AC_MSG_RESULT([not found])
+ AC_MSG_WARN([The main texmf tree was not found at $texmfmain.
+ *****************************************************************
+ * Error: The main texmf tree was not found. *
+ * Use the --datadir option to specify its parent directory. *
+ * If you do not have the files, you should be able to them from *
+ * the same place you got these sources from, or from one of the *
+ * CTAN hosts. *
+ *****************************************************************
+ Winging it by pretending $texmfmain is correct.])
+ fi
+fi
+AC_SUBST(texmfmain)
diff --git a/Build/source/texk/kpathsea/xbasename.c b/Build/source/texk/kpathsea/xbasename.c
new file mode 100644
index 00000000000..748865e0777
--- /dev/null
+++ b/Build/source/texk/kpathsea/xbasename.c
@@ -0,0 +1,48 @@
+/* basename.c: return the last element in a path.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 94, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+/* Have to include this first to get c-auto.h. */
+#include <kpathsea/config.h>
+
+#include <kpathsea/c-pathch.h>
+
+/* Return NAME with any leading path stripped off. This returns a
+ pointer into NAME. For example, `basename ("/foo/bar.baz")'
+ returns "bar.baz". */
+
+const_string
+xbasename P1C(const_string, name)
+{
+ const_string base = NULL;
+ unsigned len;
+
+ for (len = strlen(name); len > 0; len--) {
+ if (IS_DIR_SEP(name[len - 1]) || IS_DEVICE_SEP(name[len - 1])) {
+ base = name + len;
+ break;
+ }
+ }
+
+ if (!base)
+ base = name;
+
+ return base;
+}
diff --git a/Build/source/texk/kpathsea/xcalloc.c b/Build/source/texk/kpathsea/xcalloc.c
new file mode 100644
index 00000000000..f5ae20fdd2d
--- /dev/null
+++ b/Build/source/texk/kpathsea/xcalloc.c
@@ -0,0 +1,38 @@
+/* xcalloc.c: calloc with error checking.
+
+ Copyright 2005 Olaf Weber
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+
+void *
+xcalloc P2C(unsigned, nelem, unsigned, elsize)
+{
+ void *new_mem = (void*)calloc(nelem, elsize);
+
+ if (new_mem == NULL) {
+ fprintf(stderr,
+ "xcalloc: request for %u elements of size %u failed.\n",
+ nelem, elsize);
+ exit(EXIT_FAILURE);
+ }
+
+ return new_mem;
+}
diff --git a/Build/source/texk/kpathsea/xdirname.c b/Build/source/texk/kpathsea/xdirname.c
new file mode 100644
index 00000000000..4a9e0a9808d
--- /dev/null
+++ b/Build/source/texk/kpathsea/xdirname.c
@@ -0,0 +1,121 @@
+/* xdirname.c: return the directory part of a path.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1999 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+/* Return directory for NAME. This is "." if NAME contains no directory
+ separators (should never happen for selfdir), else whatever precedes
+ the final directory separator, but with multiple separators stripped.
+ For example, `xdirname ("/foo//bar.baz")' returns "/foo". Always
+ return a new string. */
+
+#include <kpathsea/config.h>
+#include <kpathsea/c-pathch.h>
+
+string
+xdirname P1C(const_string, name)
+{
+ string ret;
+ unsigned limit = 0, loc;
+
+ /* Ignore a NULL name. */
+ if (!name)
+ return NULL;
+
+ if (NAME_BEGINS_WITH_DEVICE(name)) {
+ limit = 2;
+#if defined(WIN32) || defined(__CYGWIN__)
+ } else if (IS_UNC_NAME(name)) {
+ for (limit = 2; name[limit] && !IS_DIR_SEP(name[limit]); limit++)
+ ;
+ if (name[limit]) {
+ for (limit++ ; name[limit] && !IS_DIR_SEP(name[limit]); limit++)
+ ;
+ limit--;
+ } else {
+ /* malformed UNC name, backup */
+ limit = 2;
+ }
+#endif
+ }
+
+ for (loc = strlen (name); loc > limit && !IS_DIR_SEP (name[loc-1]); loc--)
+ ;
+
+ if (loc == limit && limit > 0) {
+ if (limit == 2) {
+ ret = (string)xmalloc(limit + 2);
+ ret[0] = name[0];
+ ret[1] = name[1];
+ ret[2] = '.';
+ ret[3] = '\0';
+ } else {
+ ret = (string)xmalloc(limit + 2);
+ strcpy(ret, name);
+ }
+ } else {
+ /* If have ///a, must return /, so don't strip off everything. */
+ while (loc > limit+1 && IS_DIR_SEP (name[loc-1])) {
+ loc--;
+ }
+ ret = (string)xmalloc(loc+1);
+ strncpy(ret, name, loc);
+ ret[loc] = '\0';
+ }
+
+ return ret;
+}
+
+#ifdef TEST
+
+char *tab[] = {
+ "\\\\neuromancer\\fptex\\bin\\win32\\kpsewhich.exe",
+ "\\\\neuromancer\\fptex\\win32\\kpsewhich.exe",
+ "\\\\neuromancer\\fptex\\kpsewhich.exe",
+ "\\\\neuromancer\\kpsewhich.exe",
+ "p:\\bin\\win32\\kpsewhich.exe",
+ "p:\\win32\\kpsewhich.exe",
+ "p:\\kpsewhich.exe",
+ "p:bin\\win32\\kpsewhich.exe",
+ "p:win32\\kpsewhich.exe",
+ "p:kpsewhich.exe",
+ "p:///kpsewhich.exe",
+ "/usr/bin/win32/kpsewhich.exe",
+ "/usr/bin/kpsewhich.exe",
+ "/usr/kpsewhich.exe",
+ "///usr/kpsewhich.exe",
+ "///kpsewhich.exe",
+ NULL
+};
+
+int main()
+{
+ char **p;
+ for (p = tab; *p; p++)
+ printf("name %s, dirname %s\n", *p, xdirname(*p));
+ return 0;
+}
+#endif /* TEST */
+
+
+/*
+Local variables:
+standalone-compile-command: "gcc -g -I. -I.. -DTEST variable.c kpathsea.a"
+End:
+*/
+
diff --git a/Build/source/texk/kpathsea/xfopen.c b/Build/source/texk/kpathsea/xfopen.c
new file mode 100644
index 00000000000..14c8cbc17b3
--- /dev/null
+++ b/Build/source/texk/kpathsea/xfopen.c
@@ -0,0 +1,50 @@
+/* xfopen.c: fopen and fclose with error checking.
+
+ Copyright 2005 Olaf Weber
+ Copyright 1992, 93, 95 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+
+/* These routines just check the return status from standard library
+ routines and abort if an error happens. */
+
+FILE *
+xfopen P2C(const_string, filename, const_string, mode)
+{
+ FILE *f;
+
+ assert(filename && mode);
+
+ f = fopen(filename, mode);
+ if (f == NULL)
+ FATAL_PERROR(filename);
+
+ return f;
+}
+
+
+void
+xfclose P2C(FILE *, f, const_string, filename)
+{
+ assert(f);
+
+ if (fclose(f) == EOF)
+ FATAL_PERROR(filename);
+}
diff --git a/Build/source/texk/kpathsea/xfseek.c b/Build/source/texk/kpathsea/xfseek.c
new file mode 100644
index 00000000000..22ba8978c4a
--- /dev/null
+++ b/Build/source/texk/kpathsea/xfseek.c
@@ -0,0 +1,30 @@
+/* xfseek.c: fseek with error checking.
+
+ Copyright 2005 Olaf Weber
+ Copyright 1992, 95 Karl Berry
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+
+void
+xfseek P4C(FILE *, f, long, offset, int, wherefrom, string, filename)
+{
+ if (fseek(f, offset, wherefrom) < 0)
+ FATAL_PERROR(filename);
+}
diff --git a/Build/source/texk/kpathsea/xftell.c b/Build/source/texk/kpathsea/xftell.c
new file mode 100644
index 00000000000..0548e1abd94
--- /dev/null
+++ b/Build/source/texk/kpathsea/xftell.c
@@ -0,0 +1,33 @@
+/* xftell.c: ftell with error checking.
+
+ Copyright 2005 Olaf Weber
+ Copyright 1992, 93, 95 Karl Berry
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include <kpathsea/config.h>
+
+
+unsigned long
+xftell P2C(FILE *, f, string, filename)
+{
+ long where = ftell (f);
+
+ if (where < 0)
+ FATAL_PERROR(filename);
+
+ return where;
+}
diff --git a/Build/source/texk/kpathsea/xgetcwd.c b/Build/source/texk/kpathsea/xgetcwd.c
new file mode 100644
index 00000000000..8c97c6a8bd8
--- /dev/null
+++ b/Build/source/texk/kpathsea/xgetcwd.c
@@ -0,0 +1,150 @@
+/* xgetcwd.c: a from-scratch version of getwd. Ideas from the tcsh 5.20
+ source, apparently uncopyrighted.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 94, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include <kpathsea/config.h>
+
+#if defined (HAVE_GETCWD) || defined (HAVE_GETWD)
+#include <kpathsea/c-pathmx.h>
+#else /* not HAVE_GETCWD && not HAVE_GETWD*/
+#include <kpathsea/c-dir.h>
+#include <kpathsea/xopendir.h>
+#include <kpathsea/xstat.h>
+
+
+static void
+xchdir P1C(string, dirname)
+{
+ if (chdir(dirname) != 0)
+ FATAL_PERROR(dirname);
+}
+
+#endif /* not HAVE_GETCWD && not HAVE_GETWD */
+
+
+/* Return the pathname of the current directory, or give a fatal error. */
+
+string
+xgetcwd P1H(void)
+{
+ /* If the system provides getcwd, use it. If not, use getwd if
+ available. But provide a way not to use getcwd: on some systems
+ getcwd forks, which is expensive and may in fact be impossible for
+ large programs like tex. If your system needs this define and it
+ is not detected by configure, let me know.
+ -- Olaf Weber <infovore@xs4all.nl */
+#if defined (HAVE_GETCWD) && !defined (GETCWD_FORKS)
+ string path = (string)xmalloc(PATH_MAX + 1);
+
+ if (getcwd (path, PATH_MAX + 1) == 0) {
+ fprintf(stderr, "getcwd: %s", path);
+ exit(EXIT_FAILURE);
+ }
+
+ return path;
+#elif defined (HAVE_GETWD)
+ string path = (string)xmalloc(PATH_MAX + 1);
+
+ if (getwd (path) == 0) {
+ fprintf(stderr, "getwd: %s", path);
+ exit(EXIT_FAILURE);
+ }
+
+ return path;
+#else /* not HAVE_GETCWD && not HAVE_GETWD */
+ struct stat root_stat, cwd_stat;
+ string cwd_path = (string)xmalloc(2); /* In case we assign "/" below. */
+
+ *cwd_path = 0;
+
+ /* Find the inodes of the root and current directories. */
+ root_stat = xstat("/");
+ cwd_stat = xstat(".");
+
+ /* Go up the directory hierarchy until we get to root, prepending each
+ directory we pass through to `cwd_path'. */
+ while (!SAME_FILE_P(root_stat, cwd_stat)) {
+ struct dirent *e;
+ DIR *parent_dir;
+ boolean found = false;
+
+ xchdir("..");
+ parent_dir = xopendir(".");
+
+ /* Look through the parent directory for the entry with the same
+ inode, so we can get its name. */
+ while ((e = readdir (parent_dir)) != NULL && !found) {
+ struct stat test_stat;
+ test_stat = xlstat(e->d_name);
+
+ if (SAME_FILE_P(test_stat, cwd_stat)) {
+ /* We've found it. Prepend the pathname. */
+ string temp = cwd_path;
+ cwd_path = concat3("/", e->d_name, cwd_path);
+ free(temp);
+
+ /* Set up to test the next parent. */
+ cwd_stat = xstat(".");
+
+ /* Stop reading this directory. */
+ found = true;
+ }
+ }
+ if (!found)
+ FATAL2("No inode %d/device %d in parent directory",
+ cwd_stat.st_ino, cwd_stat.st_dev);
+
+ xclosedir(parent_dir);
+ }
+
+ /* If the current directory is the root, cwd_path will be the empty
+ string, and we will have not gone through the loop. */
+ if (*cwd_path == 0)
+ strcpy(cwd_path, "/");
+ else
+ /* Go back to where we were. */
+ xchdir(cwd_path);
+
+#ifdef DOSISH
+ /* Prepend the drive letter to CWD_PATH, since this technique
+ never tells us what the drive is.
+
+ Note that on MS-DOS/MS-Windows, the branch that works around
+ missing `getwd' will probably only work for DJGPP (which does
+ have `getwd'), because only DJGPP reports meaningful
+ st_ino numbers. But someday, somebody might need this... */
+ {
+ char drive[3];
+ string temp = cwd_path;
+
+ /* Make the drive letter lower-case, unless it is beyond Z: (yes,
+ there ARE such drives, in case of Novell Netware on MS-DOS). */
+ drive[0] = root_stat.st_dev + (root_stat.st_dev < 26 ? 'a' : 'A');
+ drive[1] = ':';
+ drive[2] = '\0';
+
+ cwd_path = concat(drive, cwd_path);
+ free(temp);
+ }
+#endif
+
+ return cwd_path;
+#endif /* not HAVE_GETCWD && not HAVE_GETWD */
+}
diff --git a/Build/source/texk/kpathsea/xmalloc.c b/Build/source/texk/kpathsea/xmalloc.c
new file mode 100644
index 00000000000..33057a63913
--- /dev/null
+++ b/Build/source/texk/kpathsea/xmalloc.c
@@ -0,0 +1,37 @@
+/* xmalloc.c: malloc with error checking.
+
+ Copyright 2005 Olaf Weber
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+
+void *
+xmalloc P1C(unsigned, size)
+{
+ void *new_mem = (void *)malloc(size ? size : 1);
+
+ if (new_mem == NULL) {
+ fprintf(stderr, "fatal: memory exhausted (xmalloc of %u bytes).\n",
+ size);
+ exit(EXIT_FAILURE);
+ }
+
+ return new_mem;
+}
diff --git a/Build/source/texk/kpathsea/xopendir.c b/Build/source/texk/kpathsea/xopendir.c
new file mode 100644
index 00000000000..e755b463dc3
--- /dev/null
+++ b/Build/source/texk/kpathsea/xopendir.c
@@ -0,0 +1,51 @@
+/* xopendir.c: opendir and closedir with error checking.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 93, 94, 95, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+#include <kpathsea/xopendir.h>
+
+
+#ifndef WIN32
+DIR *
+xopendir P1C(string, dirname)
+{
+ DIR *d = opendir(dirname);
+
+ if (d == NULL)
+ FATAL_PERROR(dirname);
+
+ return d;
+}
+#endif /* not WIN32 */
+
+void
+xclosedir P1C(DIR *, d)
+{
+#ifdef CLOSEDIR_VOID
+ closedir (d);
+#else
+ int ret = closedir(d);
+
+ if (ret != 0)
+ FATAL("closedir failed");
+#endif
+}
+
diff --git a/Build/source/texk/kpathsea/xopendir.h b/Build/source/texk/kpathsea/xopendir.h
new file mode 100644
index 00000000000..1ef91c6ce80
--- /dev/null
+++ b/Build/source/texk/kpathsea/xopendir.h
@@ -0,0 +1,32 @@
+/* xopendir.h: Checked directory operations.
+
+ Copyright (C) 1994, 96 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#if !defined (KPATHSEA_XOPENDIR_H) && !defined (WIN32)
+#define KPATHSEA_XOPENDIR_H
+
+#include <kpathsea/c-dir.h>
+#include <kpathsea/c-proto.h>
+#include <kpathsea/types.h>
+
+/* Like opendir and closedir, but abort on error. */
+extern DIR *xopendir P1H(string dirname);
+extern void xclosedir P1H(DIR *);
+
+#endif /* not (KPATHSEA_XOPENDIR_H or WIN32) */
diff --git a/Build/source/texk/kpathsea/xputenv.c b/Build/source/texk/kpathsea/xputenv.c
new file mode 100644
index 00000000000..34d0e1d0730
--- /dev/null
+++ b/Build/source/texk/kpathsea/xputenv.c
@@ -0,0 +1,120 @@
+/* xputenv.c: set an environment variable without return.
+
+/*
+ * Copyright 2003-05 Olaf Weber.
+ * Copyright 1993-98 Karl Berry.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <kpathsea/config.h>
+
+#ifdef WIN32
+#include <stdlib.h>
+#else
+/* Avoid implicit declaration warning. But since some systems do
+ declare it, don't use a prototype, for fear of conflicts. */
+extern int putenv ();
+#endif /* not WIN32 */
+
+/* These record the strings we've set and have to keep around.
+ * This function can be called many times during a run, and this
+ * allows us to reclaim memory we allocated.
+ */
+static const char **saved_env;
+static int saved_count;
+
+/*
+ * We have different arguments from the "standard" function. A separate
+ * var and value tends to be much more practical.
+ *
+ * The standards for putenv are clear: put the passed string into the
+ * environment, and if you alter that string, the environment changes.
+ * Of course various implementations are broken in a number of ways,
+ * which include making copies of the passed string, and more.
+ */
+void
+xputenv(const char *var, const char *value)
+{
+ char *cur_item;
+ char *old_item;
+ char *new_item;
+ size_t var_lim;
+ int cur_loc;
+
+ /* kpse_debug2(KPSE_DEBUG_VARS, "kpse_putenv($%s,%s)", var, value); */
+
+ old_item = NULL;
+ cur_item = concat3(var, "=", value);
+ /* Include '=' in length. */
+ var_lim = strlen(var) + 1;
+
+ /* Have we stored something for this value already? */
+ for (cur_loc = 0; cur_loc != saved_count; ++cur_loc) {
+ if (strncmp(saved_env[cur_loc], cur_item, var_lim) == 0) {
+ /* Get the old value. We need this is case another part
+ * of the program didn't use us to change the environment.
+ */
+ old_item = getenv(var);
+ break;
+ }
+ }
+
+ if (old_item && strcmp(old_item, cur_item+var_lim) == 0) {
+ /* Set same value as is in environment, don't bother to set. */
+ free(cur_item);
+ return;
+ } else {
+ /* We set a different value. */
+ if (putenv(cur_item) < 0)
+ FATAL1("putenv(%s)", cur_item);
+ /* Get the new string. */
+ new_item = getenv(var);
+ if (new_item != cur_item+var_lim) {
+ /* Our new string isn't used, don't keep it around. */
+ free(cur_item);
+ return;
+ }
+ }
+
+ /* If we get here, it means getenv() returned a reference to cur_item.
+ * So we save cur_item, and free the old string we also owned.
+ */
+ if (cur_loc == saved_count) {
+ /* No old string. */
+ saved_count++;
+ saved_env = XRETALLOC(saved_env, saved_count, const char *);
+ } else {
+ /* We owned the old string. */
+ free(saved_env[cur_loc]);
+ }
+ saved_env[cur_loc] = cur_item;
+
+ return;
+}
+
+/* A special case for setting a variable to a numeric value
+ (specifically, KPATHSEA_DPI). We don't need to dynamically allocate
+ and free the string for the number, since it's saved as part of the
+ environment value. */
+
+void
+xputenv_int P2C(const_string, var_name, int, num)
+{
+ char str[MAX_INT_LENGTH];
+ sprintf (str, "%d", num);
+
+ xputenv (var_name, str);
+}
diff --git a/Build/source/texk/kpathsea/xrealloc.c b/Build/source/texk/kpathsea/xrealloc.c
new file mode 100644
index 00000000000..81a0cab8136
--- /dev/null
+++ b/Build/source/texk/kpathsea/xrealloc.c
@@ -0,0 +1,47 @@
+/* xrealloc.c: realloc with error checking.
+
+ Copyright 2005 Olaf Weber
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include <kpathsea/config.h>
+
+extern void *xmalloc P1H(unsigned);
+
+void *
+xrealloc P2C(void *, old_ptr, unsigned, size)
+{
+ void *new_mem;
+
+ if (old_ptr == NULL) {
+ new_mem = xmalloc(size);
+ } else {
+ new_mem = (void *)realloc(old_ptr, size);
+ if (new_mem == NULL) {
+ /* We used to print OLD_PTR here using %x, and casting its
+ value to unsigned, but that lost on the Alpha, where
+ pointers and unsigned had different sizes. Since the info
+ is of little or no value anyway, just don't print it. */
+ fprintf(stderr,
+ "fatal: memory exhausted (realloc of %u bytes).\n",
+ size);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ return new_mem;
+}
diff --git a/Build/source/texk/kpathsea/xstat.c b/Build/source/texk/kpathsea/xstat.c
new file mode 100644
index 00000000000..b495480db3e
--- /dev/null
+++ b/Build/source/texk/kpathsea/xstat.c
@@ -0,0 +1,58 @@
+/* xstat.c: stat and (maybe) lstat with error checking.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+#include <kpathsea/xstat.h>
+
+
+struct stat
+xstat P1C(const_string, path)
+{
+ struct stat s;
+
+ if (stat(path, &s) != 0)
+ FATAL_PERROR(path);
+
+ return s;
+}
+
+
+/* If we don't have symbolic links, lstat is the same as stat, and
+ a #define is made in the include file. */
+
+#ifdef S_ISLNK
+/*
+// We declared lstat to prevent a warning during development. This
+// turns out to be more trouble than it is worth.
+// extern int lstat ();
+*/
+struct stat
+xlstat P1C(const_string, path)
+{
+ struct stat s;
+
+ if (lstat(path, &s) != 0)
+ FATAL_PERROR(path);
+
+ return s;
+}
+#endif
diff --git a/Build/source/texk/kpathsea/xstat.h b/Build/source/texk/kpathsea/xstat.h
new file mode 100644
index 00000000000..c1ddec3bea9
--- /dev/null
+++ b/Build/source/texk/kpathsea/xstat.h
@@ -0,0 +1,44 @@
+/* xstat.h: stat with error checking.
+
+ Copyright 1992, 93, 94 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#ifndef KPATHSEA_XSTAT_H
+#define KPATHSEA_XSTAT_H
+
+#include <kpathsea/c-proto.h>
+#include <kpathsea/c-stat.h>
+#include <kpathsea/types.h>
+
+/* Two files are indistinguishable if they are on the same device
+ and have the same inode. This checks two stat buffers for that. Cf.
+ the `same_file_p' routine in file-p.c, declared in kpathlib.h. */
+#define SAME_FILE_P(s1, s2) \
+ ((s1).st_ino == (s2).st_ino && (s1).st_dev == (s2).st_dev)
+
+/* Does stat(2) on PATH, and aborts if the stat fails. */
+extern struct stat xstat P1H(const_string path);
+
+/* Ditto, for lstat(2) (except that lstat might not exist). */
+#ifdef S_ISLNK
+extern struct stat xlstat P1H(const_string path);
+#else
+#define xlstat xstat
+#endif
+
+#endif /* not KPATHSEA_XSTAT_H */
diff --git a/Build/source/texk/kpathsea/xstrdup.c b/Build/source/texk/kpathsea/xstrdup.c
new file mode 100644
index 00000000000..ef870dfbf16
--- /dev/null
+++ b/Build/source/texk/kpathsea/xstrdup.c
@@ -0,0 +1,32 @@
+/* xstrdup.c: strdup with error checking.
+
+ Copyright 2005 Olaf Weber.
+ Copyright 1992, 93 Karl Berry.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <kpathsea/config.h>
+
+
+/* Return a copy of S in new storage. */
+
+string
+xstrdup P1C(const_string, s)
+{
+ string new_string = (string)xmalloc(strlen (s) + 1);
+ return strcpy(new_string, s);
+}
diff --git a/Build/source/texk/kpathsea/xt.ac b/Build/source/texk/kpathsea/xt.ac
new file mode 100644
index 00000000000..c1f8217ee17
--- /dev/null
+++ b/Build/source/texk/kpathsea/xt.ac
@@ -0,0 +1,13 @@
+dnl Included by web2c and xdvik to handle the obsolete --with-x-toolkit option.
+
+AC_ARG_WITH([x-toolkit],
+[ --with-x-toolkit=KIT OBSOLETE: use --with-mf-x-toolkit and/or
+ --with-xdvi-x-toolkit instead.],
+[
+ AC_MSG_WARN(dnl
+[the --with-x-toolkit option is obsolete; please use --with-mf-x-toolkit
+and/or --with-xdvi-x-toolkit instead. (Assuming default toolkit.)])
+ with_xdvi_x_toolkit=yes
+ with_mf_x_toolkit=yes
+])
+dnl Included by web2c and xdvik to handle --with-x-toolkit.